/* Admin Dashboard Styling - Premium Look */
.tncet-dashboard-wrap {
    max-width: 1100px;
    margin: 30px 20px 30px 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tncet-dashboard-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 24px;
    padding: 35px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.header-main h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.header-main p {
    margin: 8px 0 0;
    font-size: 16px;
    opacity: 0.8;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
}

/* Tabs Navigation */
.tncet-tabs-nav {
    display: flex;
    background: #e2e8f0;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 30px;
    width: fit-content;
}

.tncet-tab-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tncet-tab-btn.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Tab Content Visibility */
.tncet-tab-pane {
    display: none !important;
}

.tncet-tab-pane.active {
    display: block !important;
    animation: tncetFadeIn 0.3s ease-out;
}

@keyframes tncetFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.tncet-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.tncet-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.tncet-form-group label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
    display: block;
}

.tncet-form-group input, 
.tncet-form-group select {
    width: 100%;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
}

/* History Table Styling restored */
.tncet-table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.tncet-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.tncet-history-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.tncet-history-table td {
    background: #f8fafc;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.tncet-history-table td:first-child { border-radius: 12px 0 0 12px; }
.tncet-history-table td:last-child { border-radius: 0 12px 12px 0; }

.tr-amt { font-weight: 700; color: #2563eb; }
.tr-name { font-weight: 700; }

/* Receipt Styles - OPTIMIZED FOR PRINT */
.receipt-container {
    width: 210mm;
    height: 148mm;
    background: #fff;
    padding: 8mm 12mm;
    position: relative;
    font-family: Arial, sans-serif;
    color: #000 !important;
    overflow: visible;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

.watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 450px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watermark-bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.receipt-header {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
    gap: 20px;
    text-align: center;
}

.school-logo {
    width: 85px;
    flex: none;
    margin: 0;
}

.school-logo img {
    height: 85px;
    width: auto;
    display: block;
}

.school-info {
    flex: none;
    max-width: 500px;
}

.school-info h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #000;
    line-height: 1.1;
    text-align: center;
}

.school-info p {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 700;
    color: #000;
    text-align: center;
}

.receipt-title-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 6px 0 8px;
    position: relative;
    z-index: 1;
}

.title-main {
    font-size: 18px;
    font-weight: 900;
    border-bottom: 1.5px solid #000;
    display: inline-block;
    padding: 0 6px;
    text-align: center;
}


.receipt-body {
    margin: 6px 0 12px;
    position: relative;
    z-index: 1;
}

.body-line, .body-line-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 9px;
    width: 100%;
    font-size: 13px;
}

.lbl {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.field-underlined {
    border-bottom: 1px solid #000;
    flex: 1;
    margin-left: 6px;
    padding: 1px 4px;
    font-weight: 900;
    font-size: 13px;
    min-height: 17px;
    color: #000;
    text-transform: uppercase;
    word-break: break-word;
}

.val-class.field-underlined {
    flex: none;
    width: 4ch;
    max-width: 4ch;
    min-width: 4ch;
    display: inline-block;
    text-align: center;
}

.line-part.line-part-std {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.line-part.line-part-appno {
    flex: 1.2;
}

.lbl-std {
    margin-left: 4px;
}

.body-line-row {
    display: flex;
    gap: 20px;
}

.line-part {
    display: flex;
    align-items: baseline;
    flex: 1;
    font-size: 13px;
}

.receipt-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 2px;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amount-box {
    border: 2px solid #000;
    padding: 5px 12px;
    font-size: 17px;
    font-weight: 900;
    display: inline-block;
    background: #fff;
}

.balance-info {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.balance-info span {
    color: #ef4444;
    font-weight: 900;
}

.footer-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.school-sign-text {
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 28px;
    line-height: 1.2;
}

.sign-space {
    height: 22px;
}

.sign-name {
    font-size: 11px;
    font-weight: 900;
}

.copy-text {
    font-size: 10px;
    font-weight: 900;
    margin-top: 2px;
}

.disclaimer-row {
    border-top: 1px solid #000;
    padding-top: 3px;
    font-size: 9px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-align: center;
}

.dis-text {
    margin: 0;
}

/* History Table Action Icons */
.tncet-actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tncet-btn-icon {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.tncet-btn-icon:hover {
    background: #e2e8f0;
    color: #2563eb;
    transform: scale(1.1);
}

#receipt-preview-container {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    visibility: hidden !important;
    display: block !important;
}

/* ========== PRINT STYLESHEET ========== */
@media print {
    @page {
        size: A5 landscape !important;
        margin: 0 !important;
    }

    @supports (aspect-ratio: 16 / 9) {
        @page {
            size: 210mm 148mm !important;
        }
    }

    /* Hide page content except the receipt preview */
    body > * {
        display: none !important;
    }

    /* Show only receipt elements */
    #receipt-preview-container {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 210mm !important;
        height: 148mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        border: none !important;
    }

    #receipt-preview-container * {
        visibility: visible !important;
    }

    .receipt-outer {
        display: block !important;
        width: 210mm !important;
        height: 148mm !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .receipt-container {
        width: 210mm !important;
        height: 148mm !important;
        padding: 8mm 12mm !important;
        margin: 0 !important;
        background: white !important;
        box-sizing: border-box !important;
        display: block !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .receipt-container * {
        visibility: visible !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .receipt-header,
    .receipt-title-row,
    .receipt-body,
    .receipt-footer,
    .body-line,
    .body-line-row,
    .footer-left,
    .footer-right,
    .line-part {
        display: flex !important;
    }

    /* Ensure all receipt elements are visible */
    .watermark-bg,
    .receipt-header,
    .receipt-title-row,
    .receipt-body,
    .receipt-footer,
    .disclaimer-row,
    .body-line,
    .body-line-row,
    .footer-left,
    .footer-right,
    .school-logo,
    .school-logo img,
    .school-info,
    .amount-box,
    .balance-info,
    .school-sign-text,
    .sign-space,
    .sign-name,
    .copy-text,
    .dis-text,
    .lbl,
    .field-underlined,
    .line-part {
        display: block !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: auto 0 !important;
    }

    html {
        width: 210mm !important;
        height: 148mm !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        width: 210mm !important;
        height: 148mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
}

/* ========== FRONT-END RECEIPT GENERATOR STYLING ========== */

/* Page Background & Variables */
.tncet-receipt-wrap {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --accent: #f43f5e;
    --bg-shade: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tncet-receipt-wrap {
    padding: 40px 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--text-main) !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
}

/* Frontend Header */
.tncet-frontend-header {
    text-align: center;
    margin-bottom: 40px;
}

.tncet-frontend-header h1 {
    font-size: 42px !important;
    font-weight: 900 !important;
    margin: 0 !important;
    color: #0f172a !important;
    letter-spacing: -1.5px !important;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.tncet-frontend-header p {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 8px;
}

/* Tab Navigation - Segmented Control Style */
.tncet-receipt-wrap .tncet-tabs-nav {
    display: flex !important;
    background: #e2e8f0 !important;
    padding: 6px !important;
    border-radius: 18px !important;
    margin: 0 auto 40px !important;
    width: fit-content !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
}

.tncet-receipt-wrap .tncet-tab-btn {
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tncet-receipt-wrap .tncet-tab-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tncet-receipt-wrap .tncet-tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* Tab Pane Visibility */
.tncet-tab-pane {
    display: none !important;
}

.tncet-tab-pane.active {
    display: block !important;
    animation: tncetFadeIn 0.4s ease-out;
}

@keyframes tncetFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Card Styling */
.tncet-receipt-wrap .tncet-card {
    background: white !important;
    border-radius: 30px !important;
    padding: 50px !important;
    box-shadow: var(--card-shadow) !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
    position: relative !important;
    overflow: hidden !important;
}

.tncet-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 6px !important;
    background: linear-gradient(90deg, #3b82f6, #2563eb) !important;
}

.tncet-form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-bottom: 30px !important;
}

/* History Card Specifics */
.history-card {
    padding: 40px !important;
}

.history-header {
    margin-bottom: 30px;
}

.history-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}

.history-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* History Table Styling */
.tncet-table-responsive {
    overflow-x: auto;
    border-radius: 16px;
}

.tncet-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.tncet-history-table th {
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: left;
}

.tncet-history-table td {
    background: #f8fafc;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

.tncet-history-table tr:hover td {
    background: #f1f5f9;
}

.tncet-history-table td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid transparent; }
.tncet-history-table td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid transparent; }

.tr-amt { font-weight: 700; color: var(--primary); }
.tr-name { font-weight: 700; color: #0f172a; }

/* Form Layout */
#tncet-receipt-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.tncet-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Form Group & Inputs */
.tncet-form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.tncet-form-group label {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.8px !important;
    margin-left: 4px !important;
    transition: color 0.3s ease !important;
    display: block !important;
}

.tncet-form-group:focus-within label {
    color: var(--primary);
}

.tncet-form-group input,
.tncet-form-group select {
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
}

.tncet-form-group input:hover,
.tncet-form-group select:hover {
    border-color: #cbd5e1;
}

.tncet-form-group input:focus,
.tncet-form-group select:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* Readonly Styling */
.tncet-form-group input[readonly] {
    background: #f1f5f9;
    border-color: #e2e8f0;
    cursor: not-allowed;
    color: #64748b;
}

.tncet-form-group input[readonly]:focus {
    transform: none;
    box-shadow: none;
}

/* Select Dropdown Styling */
.tncet-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

/* Button Styling - Premium Gradient */
.tncet-receipt-wrap button[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tncet-receipt-wrap button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.tncet-receipt-wrap button[type="submit"]:active {
    transform: translateY(-1px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tncet-receipt-wrap {
        padding: 20px 10px !important;
    }
    
    .tncet-receipt-wrap .tncet-card {
        padding: 20px 15px !important;
        border-radius: 20px !important;
    }

    .tncet-frontend-header {
        margin-bottom: 20px !important;
    }

    .tncet-frontend-header h1 {
        font-size: 26px !important;
    }

    #tncet-receipt-form {
        gap: 12px !important;
    }

    .tncet-form-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 0 !important;
    }

    .tncet-form-group {
        display: block !important;
        width: 100% !important;
        gap: 2px !important;
        margin-bottom: 12px !important;
    }

    .tncet-form-group label {
        font-size: 11px !important;
        letter-spacing: 0.3px !important;
        margin-bottom: 2px !important;
    }

    .tncet-form-group input,
    .tncet-form-group select {
        padding: 10px 14px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }

    .tncet-receipt-wrap button[type="submit"] {
        padding: 16px 20px !important;
        font-size: 13px !important;
        width: 100% !important;
        margin-top: 10px !important;
        white-space: nowrap !important;
        letter-spacing: 0.5px !important;
    }

    .tncet-tabs-nav {
        width: 100% !important;
        max-width: 760px !important;
        border-radius: 12px !important;
        gap: 6px !important;
        margin-bottom: 25px !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 6px 8px !important;
    }

    .tncet-receipt-wrap .tncet-tab-btn {
        padding: 10px 14px !important;
        font-size: 12px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        justify-content: center !important;
    }
}

/* Loading Animation */
@keyframes tncetSpin {
    to { transform: rotate(360deg); }
}

.tncet-receipt-wrap button[type="submit"]:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    background: #64748b;
}

.tncet-receipt-wrap button.is-printing::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: tncetSpin 0.8s linear infinite;
}

/* Bulk Delete Styles */
.tncet-history-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.tncet-btn-danger {
    background: #ef4444 !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    border: none !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.tncet-btn-danger:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
}

.tncet-btn-danger .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}


