* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f5f9;
    margin: 0;
    color: #2b2d3a;
}
.navbar {
    background: #20406b;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.navbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 16px;
    font-size: 14px;
}
.navbar a:hover { text-decoration: underline; }
.navbar .brand { font-weight: 600; font-size: 18px; }
.container { max-width: 1300px; margin: 24px auto; padding: 0 16px; }
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
h2 { margin-top: 0; }
h3 { margin-bottom: 6px; color: #20406b; }
.btn {
    display: inline-block;
    background: #20406b;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}
.btn:hover { background: #162d4c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-red { background: #c0392b; }
.btn-red:hover { background: #962a1f; }
.btn-green { background: #1e8e5a; }
.btn-green:hover { background: #156a43; }
.btn-gray { background: #888; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #eaeaf0; }
th { /* background: #f0f1f7; */ font-weight: 600; }
tr:hover { background: #fafbff; }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-active { background: #d8f3e6; color: #157347; }
.badge-inactive { background: #f0f1f7; color: #555; }
.badge-left { background: #fde2e1; color: #b02a25; }
input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d6d8e3;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
}
label { font-size: 13px; font-weight: 600; color: #555; display: block; margin-top: 12px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 200px; }
.stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-box {
    flex: 1; min-width: 160px;
    background: #fff; border-radius: 10px; padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stat-box .num { font-size: 26px; font-weight: 700; }
.stat-box .label { color: #777; font-size: 13px; }
.login-box { max-width: 360px; margin: 100px auto; }
.error { color: #c0392b; font-size: 14px; margin-top: 10px; }
.success { color: #157347; font-size: 14px; margin-top: 10px; }
.search-bar { margin-bottom: 16px; }
.small-text { color: #888; font-size: 12px; }
.tag { display: inline-block; background: #eef1fa; padding: 2px 8px; border-radius: 10px; font-size: 12px; margin: 2px; }
.sibling-row { border: 1px dashed #d6d8e3; padding: 12px; border-radius: 8px; margin-top: 10px; position: relative; }
.remove-row { position: absolute; top: 8px; right: 8px; cursor: pointer; color: #c0392b; font-size: 12px; }

.navbar {
    background: rgba(24, 42, 71, 0.96);
    padding: 14px 28px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 14px 30px rgba(17, 28, 48, 0.16);
    backdrop-filter: blur(12px);
}
.navbar a {
    color: rgba(255,255,255,0.86);
    margin-left: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.navbar a:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; transform: translateY(-1px); }
.navbar .brand {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0;
    color: #fff;
    text-decoration: none;
    margin-left: 0;
    padding: 0;
}
.navbar .brand:hover { background: transparent; transform: none; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.nav-toggle { display: none; }
.nav-toggle-btn {
    display: none;
    width: 42px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    margin: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle-btn span {
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-item { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid rgba(30, 61, 99, 0.1);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 20px 42px rgba(17, 28, 48, 0.18);
    z-index: 30;
    animation: riseIn .2s ease both;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: grid; gap: 2px; }
.navbar .dropdown-menu a {
    color: #26384f;
    margin-left: 0;
    display: block;
    padding: 9px 10px;
}
.navbar .dropdown-menu a:hover {
    background: #f3f7fb;
    color: #17375c;
    transform: none;
}

.dashboard-page {
    background:
        radial-gradient(circle at top left, rgba(35, 109, 181, 0.18), transparent 34%),
        linear-gradient(180deg, #eef4fb 0%, #f6f8fb 44%, #f8fafc 100%);
}
.dashboard-hero {
    min-height: 230px;
    border-radius: 8px;
    padding: 34px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(20, 42, 73, 0.96), rgba(31, 94, 126, 0.88));
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    overflow: hidden;
    position: relative;
    animation: riseIn .55s ease both;
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -45% 44%;
    height: 240px;
    background: linear-gradient(90deg, rgba(127, 219, 191, 0.24), rgba(255, 255, 255, 0.12));
    transform: rotate(-8deg);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.eyebrow {
    display: inline-flex;
    color: #cdebdc;
    background: rgba(255,255,255,0.12);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.dashboard-hero h1 {
    margin: 14px 0 8px;
    font-size: 38px;
    line-height: 1.12;
    letter-spacing: 0;
}
.dashboard-hero p { max-width: 620px; margin: 0; color: rgba(255,255,255,0.8); font-size: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-light { background: #fff; color: #17375c; }
.btn-light:hover { background: #eef6ff; color: #17375c; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.metric-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(30, 61, 99, 0.08);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 16px 36px rgba(38, 61, 90, 0.08);
    animation: riseIn .55s ease both;
    transition: transform .22s ease, box-shadow .22s ease;
}
.metric-card:nth-child(2) { animation-delay: .06s; }
.metric-card:nth-child(3) { animation-delay: .12s; }
.metric-card:nth-child(4) { animation-delay: .18s; }
.metric-card:hover { transform: translateY(-4px); box-shadow: 0 22px 42px rgba(38, 61, 90, 0.13); }
.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
}
.accent-blue .metric-icon { background: #236db5; }
.accent-green .metric-icon { background: #16845f; }
.accent-amber .metric-icon { background: #bf7a16; }
.accent-red .metric-icon { background: #b4444d; }
.metric-value { font-size: 25px; font-weight: 800; color: #172033; line-height: 1.1; }
.metric-label { color: #647084; font-weight: 700; font-size: 13px; margin-top: 5px; }
.metric-note { color: #8a94a6; font-size: 12px; margin-top: 8px; }
.progress-track {
    height: 8px;
    background: #e8edf4;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}
.progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #bf7a16, #e0a232);
    border-radius: inherit;
    animation: fillBar .8s ease both;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.45fr .8fr;
    gap: 16px;
    margin-bottom: 18px;
}
.dashboard-grid > * { min-width: 0; }
.panel {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(30, 61, 99, 0.08);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 16px 36px rgba(38, 61, 90, 0.08);
    animation: riseIn .55s ease both;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.panel-header h2 { margin: 0; font-size: 19px; color: #172033; }
.panel-header p { margin: 4px 0 0; color: #7b8595; font-size: 13px; }
.pill {
    background: #e8f3ef;
    color: #16845f;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.bar-list { display: grid; gap: 13px; }
.bar-row {
    display: grid;
    grid-template-columns: 96px 1fr 42px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.bar-row span { color: #465469; font-weight: 700; }
.bar-row strong { text-align: right; color: #172033; }
.bar-track { height: 10px; border-radius: 999px; background: #e8edf4; overflow: hidden; }
.bar-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #236db5, #24a186);
    animation: fillBar .8s ease both;
}
.split-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #edf0f5;
}
.split-stat:last-child { border-bottom: 0; }
.split-stat span { color: #657187; }
.split-stat strong { font-size: 20px; color: #172033; }
.activity-list { display: grid; gap: 10px; }
.activity-item {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    border-radius: 8px;
    transition: background .2s ease, transform .2s ease;
}
.activity-item:hover { background: #f3f7fb; transform: translateX(3px); }
.activity-item strong { display: block; color: #172033; }
.activity-item small { display: block; color: #7b8595; margin-top: 3px; }
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e9f1fb;
    color: #236db5;
    font-weight: 800;
    flex: 0 0 auto;
}
.avatar.money { background: #e8f3ef; color: #16845f; font-size: 12px; }
.text-link { color: #236db5; font-size: 13px; font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.data-card { border-radius: 8px; box-shadow: 0 16px 36px rgba(38, 61, 90, 0.08); }
.dashboard-filter {
    padding: 14px;
    border: 1px solid #edf0f5;
    border-radius: 8px;
    background: #f8fafc;
}
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table { min-width: 1060px; }
.transfer-hero {
    background: linear-gradient(135deg, rgba(29, 51, 84, 0.97), rgba(35, 109, 181, 0.86));
}
.transfer-grid {
    grid-template-columns: 1.45fr .75fr;
    align-items: flex-start;
}
.transfer-actions {
    position: sticky;
    top: 92px;
}
.transfer-actions h3 { margin-top: 0; }
.action-btn {
    width: 100%;
    text-align: center;
    margin-top: 16px;
}
.transfer-divider {
    height: 1px;
    background: #edf0f5;
    margin: 22px 0;
}
.select-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #465469;
    white-space: nowrap;
}
.select-all input,
.student-check {
    width: auto;
    margin: 0;
}

.finance-page {
    background:
        radial-gradient(circle at 14% 0%, rgba(36, 161, 134, 0.18), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(191, 122, 22, 0.12), transparent 24%),
        linear-gradient(180deg, #eef5f2 0%, #f7f9fb 48%, #f8fafc 100%);
}
.finance-hero {
    background: linear-gradient(135deg, rgba(18, 48, 59, 0.97), rgba(32, 88, 80, 0.9));
}
.finance-hero::after {
    background: linear-gradient(90deg, rgba(224, 162, 50, 0.22), rgba(255, 255, 255, 0.12));
}
.session-picker {
    min-width: 170px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.18);
}
.session-picker label {
    color: rgba(255,255,255,0.72);
    margin: 0 0 4px;
    font-size: 11px;
    text-transform: uppercase;
}
.session-picker select {
    margin: 0;
    border: 0;
    background: #fff;
    color: #17375c;
    font-weight: 700;
}
.finance-metrics .metric-card {
    min-height: 132px;
}
.finance-overview {
    grid-template-columns: 1.25fr .75fr;
}
.finance-progress {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
    align-items: center;
}
.progress-ring {
    --value: 0;
    width: 176px;
    height: 176px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle closest-side, #fff 72%, transparent 73%),
        conic-gradient(#16845f calc(var(--value) * 1%), #e8edf4 0);
    box-shadow: inset 0 0 0 1px rgba(30, 61, 99, 0.06);
    animation: riseIn .55s ease both;
}
.progress-ring span {
    color: #172033;
    font-size: 30px;
    font-weight: 800;
}
.finance-breakdown {
    display: grid;
    gap: 16px;
}
.finance-breakdown span {
    display: block;
    color: #647084;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}
.finance-breakdown strong {
    display: block;
    color: #172033;
    font-size: 22px;
    margin-bottom: 8px;
}
.progress-track.danger span { background: linear-gradient(90deg, #b4444d, #dc6670); }
.progress-track.muted span { background: linear-gradient(90deg, #647084, #9aa5b5); }
.finance-table-wrap table { min-width: 760px; }
.finance-table td:first-child strong {
    display: block;
    margin-bottom: 7px;
}
.mini-bar {
    height: 6px;
    width: 120px;
    max-width: 100%;
    border-radius: 999px;
    background: #e8edf4;
    overflow: hidden;
}
.mini-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16845f, #24a186);
    animation: fillBar .8s ease both;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fillBar {
    from { transform: scaleX(0); transform-origin: left; }
    to { transform: scaleX(1); transform-origin: left; }
}

@media (max-width: 1000px) {
    .metric-grid, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
    .hero-actions { justify-content: flex-start; }
    .finance-overview { grid-template-columns: 1fr; }
    .transfer-grid { grid-template-columns: 1fr; }
    .transfer-actions { position: static; }
}

@media (max-width: 680px) {
    .container { margin: 16px auto; }
    .navbar {
        padding: 12px 16px;
        align-items: center;
    }
    .nav-toggle-btn { display: flex; }
    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.12);
        animation: riseIn .2s ease both;
    }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-toggle:checked + .nav-toggle-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked + .nav-toggle-btn span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked + .nav-toggle-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .navbar a {
        margin-left: 0;
        width: 100%;
        padding: 10px 12px;
    }
    .navbar .brand {
        width: auto;
        padding: 0;
    }
    .nav-item { width: 100%; }
    .dropdown-menu {
        position: static;
        margin-top: 4px;
        width: 100%;
        box-shadow: none;
        border-color: rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.08);
    }
    .navbar .dropdown-menu a {
        color: rgba(255,255,255,0.88);
        padding-left: 22px;
    }
    .navbar .dropdown-menu a:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }
    .dashboard-hero { padding: 24px; min-height: 0; }
    .dashboard-hero h1 { font-size: 29px; }
    .metric-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .bar-row { grid-template-columns: 76px 1fr 34px; }
    .session-picker { width: 100%; }
    .finance-progress { grid-template-columns: 1fr; }
    .progress-ring { width: 150px; height: 150px; }
}
