/* ==========================================================================
   Fee Collection & Student Wallet Recharge Module Stylesheet
   Theme: Light Institutional Workspace Theme (Exact Same as Academic & Staff Modules)
   Colors: Canvas #F8FAFC, Card Surface #FFFFFF, Border #E2E8F0, Navy #1E3A8A, Blue #2563EB
   ========================================================================== */

:root {
    --fee-canvas: #f8fafc;
    --fee-surface: #ffffff;
    --fee-surface-elevated: #ffffff;
    --fee-surface-input: #ffffff;
    --fee-border: #e2e8f0;
    --fee-border-light: #cbd5e1;
    --fee-navy: #1e3a8a;
    --fee-navy-hover: #172554;
    --fee-navy-glow: rgba(30, 58, 138, 0.22);
    --fee-blue: #2563eb;
    --fee-blue-subtle: #eff6ff;
    --fee-amber: #f59e0b;
    --fee-amber-hover: #d97706;
    --fee-amber-subtle: #fffbeb;
    --fee-amber-border: #fde68a;
    --fee-emerald: #10b981;
    --fee-emerald-hover: #059669;
    --fee-emerald-subtle: #ecfdf5;
    --fee-emerald-border: #a7f3d0;
    --fee-rose: #ef4444;
    --fee-rose-subtle: #fef2f2;
    --fee-rose-border: #fecaca;
    --fee-text-main: #0f172a;
    --fee-text-muted: #64748b;
    --fee-text-subtle: #94a3b8;
    --fee-radius: 14px;
    --fee-radius-sm: 8px;
    --fee-radius-lg: 16px;
    --fee-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    --fee-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}

/* Module Container (matches .academic-module-wrap) */
.fee-module-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 24px !important;
    color: var(--fee-text-main) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

#fee-collect-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Page Header (matches .academic-page-header) */
.fee-header-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent !important;
}

.fee-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2px;
    background: transparent !important;
}

.fee-top-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fee-top-title .fee-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(30, 58, 138, 0.08) !important;
    border: 1px solid rgba(30, 58, 138, 0.15) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e3a8a !important;
    font-size: 20px;
    flex-shrink: 0;
}

.fee-top-title h1 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 4px 0 !important;
    letter-spacing: -0.02em !important;
}

.fee-top-title p {
    font-size: 14px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.fee-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Navigation Sub-Tabs Strip (matches .academic-subnav-strip-wrap) */
.fee-nav-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 6px 10px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    margin-bottom: 6px !important;
}

.fee-nav-tabs::-webkit-scrollbar {
    display: none !important;
}

.fee-tab-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: all 0.15s ease !important;
    touch-action: manipulation !important;
    background: transparent !important;
    border: none !important;
}

.fee-tab-link:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

.fee-tab-link.active {
    color: #ffffff !important;
    background: #1e3a8a !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.22) !important;
}

.fee-tab-badge {
    font-size: 11px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: #e2e8f0 !important;
    color: #475569 !important;
    font-weight: 700 !important;
}

.fee-tab-link.active .fee-tab-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* Student Search & Quick Lookup Bar (matches .academic-filter-bar) */
.fee-lookup-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

.fee-cascade-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fee-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fee-search-box-wrap {
    flex: 1 1 320px;
    position: relative;
}

.fee-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.fee-search-input {
    width: 100%;
    height: 42px;
    padding: 8px 36px 8px 40px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #0f172a !important;
    font-size: 13.5px !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-sizing: border-box;
}

.fee-search-input:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.fee-search-input::placeholder {
    color: #94a3b8 !important;
}

.fee-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    display: none;
}

.fee-search-clear.visible {
    display: block;
}

/* Autocomplete Dropdown */
.fee-autocomplete-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15) !important;
    z-index: 100;
    max-height: 340px;
    overflow-y: auto;
    display: none;
}

.fee-autocomplete-results.active {
    display: block;
}

.fee-result-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.fee-result-item:hover, .fee-result-item.highlighted {
    background: #f1f5f9 !important;
}

.fee-result-student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fee-result-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1e3a8a;
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.fee-result-meta b {
    display: block;
    font-size: 14px;
    color: #0f172a;
}

.fee-result-meta small {
    font-size: 12px;
    color: #64748b;
}

.fee-result-badges {
    text-align: right;
}

.fee-result-due {
    font-size: 13px;
    font-weight: 700;
    color: #dc2626;
}

.fee-result-wallet {
    font-size: 11px;
    color: #059669;
    font-weight: 600;
}

/* Quick Class Filter Chips (matches .segmented-control) */
.fee-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.fee-filter-chip {
    padding: 5px 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
}

.fee-filter-chip:hover {
    color: #0f172a !important;
    background: #e2e8f0 !important;
}

.fee-filter-chip.active {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2) !important;
}

/* Student Profile Lead Card */
.fee-student-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 20px 24px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}

.fee-student-lead {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fee-student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff !important;
    flex-shrink: 0;
    overflow: hidden;
}

.fee-student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fee-student-details h2 {
    font-size: 20px !important;
    font-weight: 800 !important;
    margin: 0 0 4px 0 !important;
    color: #0f172a !important;
}

.fee-student-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    color: #64748b !important;
}

.fee-student-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    color: #1e3a8a !important;
}

.fee-student-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 6-Metric KPI Grid */
.fee-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.fee-kpi-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.fee-kpi-card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06) !important;
}

.fee-kpi-card.highlight-amber {
    border-color: #fde68a !important;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%) !important;
}

.fee-kpi-card.highlight-emerald {
    border-color: #a7f3d0 !important;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%) !important;
}

.fee-kpi-card.highlight-rose {
    border-color: #fecaca !important;
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%) !important;
}

.fee-kpi-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #64748b !important;
}

.fee-kpi-value {
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
}

.fee-kpi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px !important;
    color: #64748b !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 6px;
    margin-top: 4px;
}

/* Status Badges */
.fee-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.fee-badge.badge-paid, .fee-badge.badge-valid {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

.fee-badge.badge-partial {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.fee-badge.badge-unpaid, .fee-badge.badge-void {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

.fee-badge.badge-reversed {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Standard Section Cards (.fee-card matches .academic-table-card) */
.fee-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 22px !important;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.fee-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 14px;
}

.fee-card-header h3 {
    font-size: 17px !important;
    font-weight: 800 !important;
    margin: 0;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables (matches .academic-table) */
.fee-table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 !important;
}

.fee-table {
    width: 100% !important;
    min-width: 580px;
    border-collapse: collapse !important;
    text-align: left !important;
    background: #ffffff !important;
    margin: 0 !important;
}

.fee-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    white-space: nowrap !important;
}

.fee-table td {
    padding: 13px 16px !important;
    font-size: 13.5px !important;
    color: #334155 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.fee-table tbody tr {
    background: #ffffff !important;
    transition: background 0.12s ease !important;
}

.fee-table tbody tr:hover td {
    background: #f8fafc !important;
}

.fee-table tr:last-child td {
    border-bottom: none !important;
}

/* Action Buttons (matches .btn-amber-primary and workspace buttons) */
.fee-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 9px 18px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
    touch-action: manipulation !important;
}

/* Primary Collection Action (Navy workspace standard) */
.fee-btn-amber {
    background: #1e3a8a !important;
    color: #ffffff !important;
    border-color: #1e3a8a !important;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.22) !important;
}

.fee-btn-amber:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3) !important;
}

.fee-btn-outline {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

.fee-btn-outline:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.fee-btn-emerald {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

.fee-btn-emerald:hover {
    background: #047857 !important;
    color: #ffffff !important;
}

.fee-btn-danger {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.fee-btn-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.fee-btn-sm {
    padding: 6px 13px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
}

/* POS Terminal Layout */
.fee-pos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fee-pos-main-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.fee-payment-settlement-card {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.fee-calculation-box {
    background: #f8fafc;
    border: 1px solid var(--fee-border);
    border-radius: var(--fee-radius-sm);
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.fee-calculation-box > div {
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 993px) {
    .fee-payment-settlement-card {
        position: sticky;
        top: 16px;
    }

    .fee-sticky-summary {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .fee-pos-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .fee-sticky-summary {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        border: 1px solid #cbd5e1 !important;
        border-bottom: none !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(12px) !important;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.12) !important;
        padding: 10px 16px !important;
        z-index: 105 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    .fee-sticky-summary .fee-summary-total {
        flex: 1;
        min-width: 0;
    }

    .fee-sticky-summary .fee-summary-total small {
        font-size: 11px;
        text-transform: uppercase;
        color: #64748b;
        font-weight: 700;
        display: block;
        line-height: 1.2;
    }

    .fee-sticky-summary .fee-summary-total b {
        font-size: 20px;
        font-weight: 900;
        color: #1e3a8a;
        line-height: 1.2;
    }

    .fee-sticky-summary .fee-summary-actions {
        flex-shrink: 0;
    }

    .fee-sticky-summary .fee-summary-actions .fee-btn {
        padding: 9px 16px !important;
        font-size: 13.5px !important;
        white-space: nowrap !important;
        min-height: 42px !important;
    }

    .fee-module-wrap {
        padding-bottom: 120px !important;
    }
}

/* Preset Recharge Chips */
.fee-preset-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.fee-preset-chip {
    padding: 11px 10px;
    border-radius: 10px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e3a8a !important;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.fee-preset-chip:hover {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    transform: translateY(-1px);
}

.fee-preset-chip.active {
    background: #1e3a8a !important;
    color: #ffffff !important;
    border-color: #1e3a8a !important;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* Payment Method Radio Selector */
.fee-method-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.fee-method-option {
    position: relative;
}

.fee-method-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.fee-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.fee-method-card i {
    font-size: 18px;
    color: #64748b;
}

.fee-method-card span {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.fee-method-option input:checked + .fee-method-card {
    border-color: #1e3a8a !important;
    background: #eff6ff !important;
}

.fee-method-option input:checked + .fee-method-card i {
    color: #1e3a8a !important;
}

.fee-method-option input:checked + .fee-method-card span {
    color: #1e3a8a !important;
    font-weight: 700;
}

/* Large Target Number Input */
.fee-large-input-wrap {
    position: relative;
}

.fee-currency-symbol {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 800;
    color: #1e3a8a;
}

.fee-large-input {
    width: 100%;
    height: 58px;
    padding: 8px 20px 8px 46px;
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 10px;
    color: #0f172a !important;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.fee-large-input:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Sticky Action Footer (Mobile Ergonomics) */
.fee-sticky-summary {
    position: sticky;
    bottom: 20px;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--fee-radius);
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1) !important;
    z-index: 90;
}

.fee-summary-total small {
    display: block;
    font-size: 11.5px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.fee-summary-total b {
    font-size: 24px;
    font-weight: 900;
    color: #1e3a8a;
}

.fee-summary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal Styling */
.fee-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.fee-modal {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--fee-radius);
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #0f172a !important;
}

.fee-modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fee-modal-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.fee-modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fee-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid #f1f5f9 !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   Receipt & Print Layouts (Screen + Print)
   ========================================================================== */
.receipt-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.receipt-screen-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fee-receipt-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 13.5px;
}

@media (max-width: 640px) {
    .fee-receipt-meta-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .fee-receipt-meta-grid > div:last-child {
        text-align: left !important;
        border-top: 1px dashed var(--fee-border);
        padding-top: 12px;
    }
    .receipt-screen-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    .receipt-screen-actions .fee-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* 80mm POS Thermal Slip Format */
.receipt-thermal {
    width: 80mm;
    max-width: 100%;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.35;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.receipt-thermal-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-thermal-header h2 {
    font-size: 15px;
    font-weight: bold;
    margin: 0 0 4px 0;
    color: #000;
}

.receipt-thermal-meta {
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.receipt-line.bold {
    font-weight: bold;
}

.receipt-thermal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.receipt-thermal-table th, .receipt-thermal-table td {
    padding: 3px 0;
    text-align: left;
    font-size: 11.5px;
}

.receipt-thermal-table th:last-child, .receipt-thermal-table td:last-child {
    text-align: right;
}

.receipt-thermal-total {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 8px 0;
    margin-bottom: 12px;
}

.receipt-thermal-footer {
    text-align: center;
    font-size: 10.5px;
    margin-top: 12px;
}

.receipt-qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 12px 0 6px 0;
}

/* Standard A4 Duplex Layout */
.receipt-duplex {
    width: 100%;
    max-width: 900px;
    background: #ffffff !important;
    color: #111827 !important;
    padding: 32px;
    border-radius: var(--fee-radius);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.duplex-slips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    position: relative;
}

.duplex-slips-grid::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    border-left: 1px dashed #cbd5e1;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .duplex-slips-grid {
        grid-template-columns: 1fr;
    }
    .duplex-slips-grid::after {
        display: none;
    }
}

.duplex-slip {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.duplex-slip-badge {
    align-self: flex-end;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

/* Invoice & Universal Fee Filter Card & Controls */
.fee-invoice-filter-card,
.fee-filter-card {
    padding: 14px 18px !important;
    margin-bottom: 20px;
}

.fee-invoice-filter-form,
.fee-filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.fee-invoice-search-box,
.fee-filter-search {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.fee-invoice-search-box i,
.fee-filter-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fee-text-subtle, #94A3B8);
    font-size: 13.5px;
    pointer-events: none;
    z-index: 2;
}

.fee-invoice-search-box input,
.fee-filter-search input,
.fee-filter-search-input {
    width: 100%;
    height: 40px !important;
    padding-left: 42px !important;
    padding-right: 14px !important;
    border-radius: 8px !important;
    border: 1px solid #CBD5E1 !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.fee-invoice-search-box input:focus,
.fee-filter-search input:focus,
.fee-filter-search-input:focus {
    border-color: #F59E0B !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

.fee-invoice-filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fee-invoice-filter-controls select,
.fee-filter-select {
    height: 40px !important;
    min-width: 140px;
    padding: 0 12px !important;
    border-radius: 8px !important;
    border: 1px solid #CBD5E1 !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.fee-filter-select:focus,
.fee-invoice-filter-controls select:focus {
    border-color: #F59E0B !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

.fee-filter-date {
    height: 40px !important;
    min-width: 140px;
    padding: 0 12px !important;
    border-radius: 8px !important;
    border: 1px solid #CBD5E1 !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.fee-invoice-filter-btns,
.fee-filter-btns {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fee-invoice-filter-btns .fee-btn,
.fee-filter-btns .fee-btn {
    height: 40px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px !important;
    font-weight: 700;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .fee-invoice-filter-card,
    .fee-filter-card {
        padding: 12px 14px !important;
        border-radius: 12px !important;
    }

    .fee-invoice-filter-form {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .fee-filter-form {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .fee-invoice-search-box,
    .fee-filter-search,
    .fee-search-box {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .fee-filter-select-wrap {
        width: 100% !important;
        min-width: 0 !important;
    }

    .fee-filter-select-wrap:nth-child(4) {
        grid-column: span 2 !important;
    }

    .fee-invoice-search-box input,
    .fee-filter-search input,
    .fee-filter-search-input,
    .fee-search-box input {
        width: 100% !important;
        height: 40px !important;
    }

    .fee-filter-select,
    .fee-filter-date,
    .fee-invoice-filter-controls select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 40px !important;
        font-size: 13px !important;
        padding: 0 10px !important;
        text-overflow: ellipsis !important;
    }

    .fee-filter-select:nth-child(4):last-of-type,
    .fee-filter-group-full {
        grid-column: span 2 !important;
    }

    .fee-invoice-filter-controls {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .fee-invoice-filter-btns,
    .fee-filter-btns {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .fee-invoice-filter-btns button:only-child,
    .fee-filter-btns button:only-child,
    .fee-filter-btns .fee-btn:only-child {
        grid-column: 1 / -1 !important;
    }

    .fee-invoice-filter-btns .fee-btn,
    .fee-filter-btns .fee-btn {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        justify-content: center !important;
        font-size: 13px !important;
    }

    .fee-top-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .fee-top-actions {
        width: 100% !important;
    }

    .fee-top-actions .fee-btn,
    .fee-top-actions a {
        width: 100% !important;
        justify-content: center !important;
    }

    .fee-student-card {
        padding: 16px 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .fee-student-lead {
        gap: 12px !important;
    }

    .fee-student-avatar {
        width: 48px !important;
        height: 48px !important;
        font-size: 18px !important;
    }

    .fee-student-details h2 {
        font-size: 17px !important;
    }

    .fee-student-actions {
        width: 100% !important;
    }

    .fee-student-actions .fee-btn,
    .fee-student-actions a {
        width: 100% !important;
        justify-content: center !important;
    }

    .fee-modal-overlay {
        padding: 10px !important;
        z-index: 1000 !important;
    }

    .fee-modal {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 36px) !important;
    }

    .fee-modal-body {
        padding: 16px 14px !important;
        max-height: calc(100dvh - 160px) !important;
        overflow-y: auto !important;
    }

    .fee-modal-footer {
        padding: 12px 14px !important;
        flex-direction: column-reverse !important;
    }

    .fee-modal-footer .fee-btn,
    .fee-modal-footer button {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 640px) {
    .fee-cascade-row {
        grid-template-columns: 1fr !important;
    }

    .fee-search-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .fee-search-box-wrap {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .fee-card {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .fee-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .fee-method-selector {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .fee-method-card {
        padding: 8px 4px !important;
        font-size: 11.5px !important;
    }

    .fee-method-card i {
        font-size: 15px !important;
    }

    .fee-payment-settlement-card .fee-btn {
        width: 100% !important;
        white-space: normal !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .fee-preset-chips {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .fee-large-input {
        font-size: 20px !important;
        height: 50px !important;
    }

    .fee-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .fee-sticky-summary {
        padding: 8px 12px !important;
    }

    .fee-sticky-summary .fee-summary-total b {
        font-size: 17px !important;
    }

    .fee-sticky-summary .fee-summary-actions .fee-btn {
        padding: 8px 12px !important;
        font-size: 12.5px !important;
    }
}

/* Print CSS */

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    header, aside, .sidebar, .workspace-header, .mobile-bottom-nav, .page-footer, .no-print, .receipt-screen-actions, .skip-link {
        display: none !important;
    }

    .workspace, .workspace-body, .workspace-main {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .receipt-thermal {
        width: 80mm !important;
        margin: 0 auto !important;
        padding: 4mm !important;
        box-shadow: none !important;
        border: none !important;
        page-break-after: avoid;
    }

    .receipt-duplex {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 10mm !important;
    }
}
