:root {
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1e23;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    /* Card Colors */
    --blue-light: #eff4ff;
    --blue-dark: #3b82f6;
    --green-light: #f0fdf4;
    --green-dark: #22c55e;
    --orange-light: #fff7ed;
    --orange-dark: #f97316;
    --yellow-light: #fefce8;
    --yellow-dark: #eab308;
    --purple-light: #faf5ff;
    --purple-dark: #a855f7;
    --teal-light: #f0fdfa;
    --teal-dark: #14b8a6;
    --pink-light: #eff4ff;
    --pink-dark: #1e3a8a;
    --navy-dark: #1e3a8a;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --madrasa-admin-offset: 0px;
}

body.admin-bar {
    --madrasa-admin-offset: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --madrasa-admin-offset: 46px;
    }
}

html:has(#madrasa-fee-root),
body:has(#madrasa-fee-root) {
    height: 100%;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

html.madrasa-app-active,
body.madrasa-app-active {
    height: 100%;
    max-width: 100vw;
    overflow: hidden;
}

#madrasa-fee-root {
    height: calc(100dvh - var(--madrasa-admin-offset, 0px));
    max-width: 100vw;
    overflow: hidden;
}

#madrasa-fee-root table {
    max-width: 100%;
    min-width: 0 !important;
}

#madrasa-fee-root th,
#madrasa-fee-root td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.dashboard-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(10px, 1.5vw, 16px);
    background-color: white;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    width: 100%;
    overflow-x: hidden;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #e8f5e9; /* Light green background */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-left h1 {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: clamp(12px, 1.5vw, 14px);
    font-weight: 500;
    white-space: nowrap;
}

.date-display .material-symbols-outlined {
    font-size: 20px;
}

.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Typography Helpers */
.section-title {
    font-size: clamp(12px, 1.5vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
}

/* Common Card Styles */
.info-card, .collection-card, .overview-box {
    display: flex;
    align-items: center;
    padding: clamp(10px, 1.4vw, 14px);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: var(--bg-card);
    gap: clamp(8px, 1.1vw, 12px);
    min-width: 0;
    min-height: 92px;
    overflow: hidden;
}

.info-card:hover, .collection-card:hover, .overview-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-box {
    width: clamp(40px, 3.2vw, 50px);
    height: clamp(40px, 3.2vw, 50px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box .material-symbols-outlined {
    font-size: clamp(21px, 1.8vw, 26px);
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.info-text .label {
    font-size: clamp(10px, 1.2vw, 12px);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: normal;
    line-height: 1.2;
}

.info-text .value {
    font-size: clamp(16px, 2vw, 21px);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Top Info Grid */
.top-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.info-blue { background-color: var(--blue-light); border-color: rgba(59, 130, 246, 0.2); }
.info-blue .icon-box { background-color: rgba(59, 130, 246, 0.15); color: var(--blue-dark); }
.info-blue .value { color: var(--text-primary); }

.info-green { background-color: var(--green-light); border-color: rgba(34, 197, 94, 0.2); }
.info-green .icon-box { background-color: rgba(34, 197, 94, 0.15); color: var(--green-dark); }
.info-green .value { color: var(--text-primary); }

.info-orange { background-color: var(--orange-light); border-color: rgba(249, 115, 22, 0.2); }
.info-orange .icon-box { background-color: rgba(249, 115, 22, 0.15); color: var(--orange-dark); }
.info-orange .value { color: var(--text-primary); }

/* Collection Grid */
.collection-section {
    margin-bottom: 24px;
}

.dashboard-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.dashboard-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(110px, 0.65fr);
    gap: 12px;
    align-items: end;
}

.dashboard-filter-group label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.dashboard-filter-group select {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #aebbb4;
    border-radius: 6px;
    outline: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-filter-group select:focus {
    border-color: var(--navy-dark);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}

.dashboard-year-filter {
    min-width: 0;
}

.top-info-grid .info-text .value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.col-blue { background-color: var(--blue-light); border-color: rgba(59, 130, 246, 0.2); }
.col-blue .icon-box { background-color: var(--blue-dark); color: white; }
.col-blue .value { color: var(--blue-dark); }

.col-green { background-color: var(--green-light); border-color: rgba(34, 197, 94, 0.2); }
.col-green .icon-box { background-color: rgba(34, 197, 94, 0.15); color: var(--green-dark); }
.col-green .value { color: var(--green-dark); }

.col-yellow { background-color: var(--yellow-light); border-color: rgba(234, 179, 8, 0.2); }
.col-yellow .icon-box { background-color: rgba(234, 179, 8, 0.15); color: var(--yellow-dark); }
.col-yellow .value { color: var(--yellow-dark); }

.col-purple { background-color: var(--purple-light); border-color: rgba(168, 85, 247, 0.2); }
.col-purple .icon-box { background-color: rgba(168, 85, 247, 0.15); color: var(--purple-dark); }
.col-purple .value { color: var(--purple-dark); }

.col-teal { background-color: var(--teal-light); border-color: rgba(20, 184, 166, 0.2); }
.col-teal .icon-box { background-color: rgba(20, 184, 166, 0.15); color: var(--teal-dark); }
.col-teal .value { color: var(--teal-dark); }

.col-pink { background-color: var(--pink-light); border-color: rgba(30, 58, 138, 0.2); }
.col-pink .icon-box { background-color: rgba(30, 58, 138, 0.14); color: var(--pink-dark); }
.col-pink .value { color: var(--pink-dark); }

/* Custom Date Filter */
.custom-date-filter {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 20px;
    background-color: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon .material-symbols-outlined {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 18px;
}

.input-with-icon input {
    padding: 10px 10px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    background-color: white;
    outline: none;
}

.input-with-icon input:focus {
    border-color: var(--navy-dark);
}

.btn-primary {
    padding: 10px 24px;
    background-color: var(--navy-dark);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    height: 40px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: #152c6e;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

.student-overview-card {
    padding-right: 0;
}

.overview-boxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bg-blue { background-color: var(--blue-light); border-color: rgba(59, 130, 246, 0.2); }
.bg-blue .icon-box { background-color: var(--blue-dark); color: white; }
.bg-blue .value { color: var(--blue-dark); }

.bg-green { background-color: var(--green-light); border-color: rgba(34, 197, 94, 0.2); }
.bg-green .icon-box { background-color: var(--green-dark); color: white; }
.bg-green .value { color: var(--green-dark); }

.chart-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: clamp(10px, 1.4vw, 14px);
    background-color: white;
    overflow: hidden;
    width: 100%;
}

.chart-container {
    height: 220px;
    width: 100%;
}

.fee-status-table {
    table-layout: fixed;
    width: 100%;
}

.fee-status-table th,
.fee-status-table td {
    padding: 10px 7px !important;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
}

.fee-status-table th {
    font-size: 10px !important;
    letter-spacing: 0 !important;
}

.fee-status-table td {
    font-size: 12px !important;
}

.fee-status-table button {
    max-width: 100%;
    justify-content: center;
}

.mfs-row-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
}

.mfs-row-icon-button {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--navy-dark);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    width: 32px;
}

.mfs-row-icon-button:hover,
.mfs-row-icon-button:focus-visible {
    background: #f4f8f6;
    border-color: var(--navy-dark);
    outline: none;
}

.mfs-row-icon-button:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.45;
}

.mfs-row-icon-danger {
    color: #b91c1c;
}

.mfs-row-icon-button .material-symbols-outlined {
    font-size: 18px;
}

.student-see-more-link {
    background: transparent;
    border: 0;
    color: var(--navy-dark);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.student-see-more-link:hover,
.student-see-more-link:focus-visible {
    color: #0f2e1f;
    outline: none;
}

.student-fee-schedule-scroll {
    max-width: 100%;
    overflow-x: hidden !important;
}

.student-fee-schedule-scroll table,
.student-fee-schedule-scroll thead,
.student-fee-schedule-scroll tbody {
    display: block;
    width: 100% !important;
}

.student-fee-schedule-scroll tr {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.student-fee-schedule-scroll thead {
    margin-bottom: 8px;
}

.student-fee-schedule-scroll th,
.student-fee-schedule-scroll td {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 74px;
    padding: 8px !important;
    text-align: center !important;
}

.student-fee-schedule-scroll th {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
}

.student-fee-schedule-scroll td {
    font-size: 12px;
}

.student-schedule-modal-overlay {
    align-items: center;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 18px;
    position: fixed;
    z-index: 1500;
}

.student-schedule-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.24);
    max-height: 92vh;
    max-width: 1100px;
    overflow-y: auto;
    padding: 18px;
    width: min(100%, 1100px);
}

.student-schedule-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.student-schedule-modal-header h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin: 0 0 4px;
}

.student-schedule-modal-header p {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 0;
}

.student-schedule-modal-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.student-schedule-profile {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 9px 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 14px;
    padding: 12px;
}

.student-schedule-profile div {
    color: var(--text-primary);
    font-size: 13px;
}

.student-schedule-fixed-grid,
.student-schedule-month-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
}

.student-schedule-fixed-card,
.student-schedule-month-card {
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 86px;
    padding: 10px;
    text-align: center;
}

.student-schedule-card-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 7px;
}

.student-schedule-section-title {
    color: var(--text-primary);
    font-size: 15px;
    margin: 18px 0 10px;
}

.student-schedule-status {
    font-size: 13px;
    font-weight: 800;
}

.student-schedule-month-card.is-paid .student-schedule-status {
    color: #1b5e20;
}

.student-schedule-month-card.is-unpaid .student-schedule-status {
    color: #b71c1c;
}

.student-schedule-month-card.is-na .student-schedule-status {
    background: #e1e3e1;
    border-radius: 4px;
    color: #727973;
    font-size: 11px;
    padding: 2px 7px;
}

/* Footer */
.dashboard-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS (Fallbacks)
   ============================================ */

/* Large screens/Tablets (below 1200px) */
@media (max-width: 1200px) {
    .top-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile/Small Tablets (below 768px) */
@media (max-width: 768px) {
    #madrasa-fee-root {
        height: 100dvh;
        max-width: 100%;
        width: 100%;
    }

    #madrasa-fee-root h1,
    #madrasa-fee-root h2,
    #madrasa-fee-root h3 {
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    #madrasa-fee-root h2 {
        font-size: 24px !important;
    }

    .dashboard-container {
        border-radius: 8px;
        padding: 10px;
    }

    .top-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 18px;
    }

    .collection-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .info-card,
    .collection-card,
    .overview-box {
        min-height: 82px;
        padding: 11px;
    }

    .icon-box {
        height: 42px;
        width: 42px;
    }

    .info-text .value {
        font-size: 18px;
        white-space: normal;
    }

    .dashboard-filter-bar {
        grid-template-columns: 1fr;
    }

    #madrasa-fee-root div[style*="grid-template-columns: 1fr 1fr"],
    #madrasa-fee-root div[style*="gridTemplateColumns:'1fr 1fr'"] {
        grid-template-columns: 1fr !important;
    }

    #madrasa-fee-root div[style*="display: flex"] {
        max-width: 100%;
    }

    #madrasa-fee-root button {
        max-width: 100%;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) {
        display: block;
        width: 100% !important;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) thead,
    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) colgroup {
        display: none !important;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) tbody,
    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) tr,
    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) td {
        display: block;
        width: 100% !important;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) tr {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) td {
        border: 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
        font-size: 12px !important;
        min-height: 0;
        padding: 9px 10px !important;
        text-align: left !important;
    }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) td:last-child {
        border-bottom: 0 !important;
    }

    .fee-status-table td:nth-child(1)::before { content: "#: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(2)::before { content: "Student: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(3)::before { content: "Parent / Contact: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(4)::before { content: "Department: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(5)::before { content: "Fee / Period: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(6)::before { content: "Due Date: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(7)::before { content: "Due: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(8)::before { content: "Discount: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(9)::before { content: "Paid: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(10)::before { content: "Remaining: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(11)::before { content: "Status: "; font-weight: 800; color: var(--text-secondary); }
    .fee-status-table td:nth-child(12)::before { content: "Action: "; font-weight: 800; color: var(--text-secondary); }

    #madrasa-fee-root table:not(.student-fee-schedule-scroll table) td[colspan]::before {
        content: "" !important;
    }

    .students-list-table td:nth-child(1)::before { content: "Select: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(2)::before { content: "Sr.: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(3)::before { content: "Reg No: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(4)::before { content: "Name: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(5)::before { content: "Father: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(6)::before { content: "Department: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(7)::before { content: "Section: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(8)::before { content: "Status: "; font-weight: 800; color: var(--text-secondary); }
    .students-list-table td:nth-child(9)::before { content: "Actions: "; font-weight: 800; color: var(--text-secondary); }

    .classes-list-table td:nth-child(1)::before { content: "Department: "; font-weight: 800; color: var(--text-secondary); }
    .classes-list-table td:nth-child(2)::before { content: "Section: "; font-weight: 800; color: var(--text-secondary); }
    .classes-list-table td:nth-child(3)::before { content: "Calendar: "; font-weight: 800; color: var(--text-secondary); }
    .classes-list-table td:nth-child(4)::before { content: "Students: "; font-weight: 800; color: var(--text-secondary); }
    .classes-list-table td:nth-child(5)::before { content: "Actions: "; font-weight: 800; color: var(--text-secondary); }

    .due-rules-table td:nth-child(1)::before { content: "Fee Type: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(2)::before { content: "Applies To: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(3)::before { content: "Date System: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(4)::before { content: "Schedule: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(5)::before { content: "Period / Event: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(6)::before { content: "Status: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(7)::before { content: "Remarks: "; font-weight: 800; color: var(--text-secondary); }
    .due-rules-table td:nth-child(8)::before { content: "Actions: "; font-weight: 800; color: var(--text-secondary); }

    .reports-ledger-table td:nth-child(1)::before { content: "Select: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(2)::before { content: "Receipt: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(3)::before { content: "Date: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(4)::before { content: "Student: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(5)::before { content: "Fee Type: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(6)::before { content: "Period: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(7)::before { content: "Amount: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(8)::before { content: "Discount: "; font-weight: 800; color: var(--text-secondary); }
    .reports-ledger-table td:nth-child(9)::before { content: "Actions: "; font-weight: 800; color: var(--text-secondary); }

    .student-statement-table td:nth-child(1)::before { content: "Fee Type: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(2)::before { content: "Period: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(3)::before { content: "Due Date: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(4)::before { content: "Due: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(5)::before { content: "Discount: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(6)::before { content: "Payable: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(7)::before { content: "Paid: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(8)::before { content: "Remaining: "; font-weight: 800; color: var(--text-secondary); }
    .student-statement-table td:nth-child(9)::before { content: "Status: "; font-weight: 800; color: var(--text-secondary); }

    .student-payment-history-table td:nth-child(1)::before { content: "Receipt: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(2)::before { content: "Date: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(3)::before { content: "Fee Type: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(4)::before { content: "Period: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(5)::before { content: "Paid: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(6)::before { content: "Discount: "; font-weight: 800; color: var(--text-secondary); }
    .student-payment-history-table td:nth-child(7)::before { content: "Remarks: "; font-weight: 800; color: var(--text-secondary); }

    .student-fee-schedule-scroll tr {
        grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    }

    .student-fee-schedule-scroll th,
    .student-fee-schedule-scroll td {
        min-height: 64px;
        padding: 7px !important;
    }

    .fee-status-table th,
    .fee-status-table td {
        padding: 7px 4px !important;
        font-size: 9px !important;
    }

    .fee-status-table .material-symbols-outlined {
        display: none;
    }

    .mfs-row-actions {
        justify-content: flex-start;
    }

    .student-schedule-modal-overlay {
        align-items: flex-start;
        padding: 10px;
    }

    .student-schedule-modal {
        max-height: 94vh;
        padding: 12px;
    }

    .student-schedule-modal-header {
        flex-direction: column;
    }

    .student-schedule-modal-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .student-schedule-fixed-grid,
    .student-schedule-month-grid {
        grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    }

    .student-schedule-fixed-card,
    .student-schedule-month-card {
        min-height: 76px;
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .dashboard-filter-bar {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    .custom-date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-primary {
        width: 100%;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
    --bg-main: #12181b;
    --bg-card: #1e262b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    
    --blue-light: rgba(59, 130, 246, 0.15);
    --green-light: rgba(34, 197, 94, 0.15);
    --orange-light: rgba(249, 115, 22, 0.15);
    --yellow-light: rgba(234, 179, 8, 0.15);
    --purple-light: rgba(168, 85, 247, 0.15);
    --teal-light: rgba(20, 184, 166, 0.15);
    --pink-light: rgba(59, 130, 246, 0.15);
    --navy-dark: #3b82f6;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.4);
}

body.dark-mode .dashboard-container {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .chart-card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .custom-date-filter {
    background-color: var(--bg-main);
    border-color: var(--border-color);
}

body.dark-mode .input-with-icon input {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}
