:root {
    --primary: #0f4c81;
    --primary-2: #1769aa;
    --primary-soft: #e8f2fb;
    --ink: #142033;
    --muted: #66758a;
    --line: #dce5ef;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --danger: #b42318;
    --ok: #157347;
    --shadow: 0 18px 48px rgba(15, 76, 129, .12);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #e8f2fb 0, transparent 34%), var(--bg);
    color: var(--ink);
    font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.muted, small { color: var(--muted); }

.loading {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(3px);
}
.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dbeafe;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(232,242,251,.88), rgba(249,251,253,.94)), url('login-background.jpeg') center/cover no-repeat fixed;
}
.login-card {
    width: min(430px, 100%);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(220,229,239,.9);
    border-radius: 24px;
    padding: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.login-logos { display: flex; justify-content: center; gap: 16px; }
.login-logos img { width: 66px; height: 66px; object-fit: contain; border-radius: 14px; }
.login-card h1 { text-align: center; margin: 18px 0 5px; color: var(--primary); font-size: 32px; }
.login-card p { text-align: center; color: var(--muted); margin: 0 0 24px; }
.login-card p.login-subtitle { margin-bottom: 14px; }
.login-school-info {
    display: grid;
    gap: 3px;
    margin: 0 0 20px;
    padding: 11px 13px;
    border: 1px solid #dbe8f3;
    border-radius: 13px;
    background: rgba(240,247,253,.76);
    text-align: center;
}
.login-school-info strong { color: #173f63; font-size: 13px; }
.login-school-info span { color: var(--muted); font-size: 11px; }
.login-contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin: -9px 0 18px;
}
.login-contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #d6e4ef;
    border-radius: 10px;
    background: #f8fbfe;
    color: #315a7d;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.login-contact-links a:hover {
    color: var(--primary);
    border-color: #9fc4df;
    background: #edf7ff;
    transform: translateY(-1px);
}
.login-contact-links svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-contact-links .contact-icon-dot,
#loginYoutube svg path:last-child { fill: currentColor; stroke: none; }
.login-card label, .settings label {
    display: block;
    margin: 13px 0;
    font-weight: 700;
}
input, select, textarea {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 4px rgba(23,105,170,.12);
}
.login-card input, .settings input, .toolbar input, .toolbar select { width: 100%; margin-top: 6px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 11px;
    padding: 10px 15px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 18px rgba(15,76,129,.20); }
.btn.secondary { background: #edf3f9; color: #24415f; }
.btn.danger { background: #fee4e2; color: #991b1b; }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.login-card .btn { width: 100%; margin-top: 12px; }
.error { min-height: 20px; color: var(--danger); margin-top: 12px; font-size: 13px; }

.app { min-height: 100vh; display: flex; }
.sidebar {
    width: 270px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    color: #dceaf6;
    background: linear-gradient(180deg, #0c2f50, #102a43);
    box-shadow: 10px 0 35px rgba(16,42,67,.08);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; }
.brand small, .user-box small { display: block; color: #9fb6c9; font-size: 11px; margin-top: 3px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    font-size: 20px;
}
.brand-mark img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 10px;
}
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#nav {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.20) transparent;
}
#nav button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 12px;
    background: transparent;
    color: #cbdbea;
    text-align: left;
}
#nav button:hover, #nav button.active, .nav-group.open > .nav-group-toggle {
    background: rgba(255,255,255,.12);
    color: #fff;
}
#nav button:focus-visible { outline: 2px solid rgba(147,197,253,.8); outline-offset: 2px; }
.nav-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .92;
}
.nav-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-group { display: grid; gap: 3px; }
.nav-group-toggle { font-weight: 750; }
.nav-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
    opacity: .65;
}
.nav-group.open .nav-chevron { transform: rotate(90deg); }
.nav-submenu {
    display: grid;
    gap: 3px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .25s ease, opacity .18s ease, transform .18s ease;
}
.nav-group.open .nav-submenu {
    max-height: 420px;
    opacity: 1;
    transform: none;
}
.nav-submenu .nav-item {
    min-height: 40px;
    margin-left: 12px;
    padding: 9px 11px 9px 17px;
    border-left: 1px solid rgba(255,255,255,.14);
    border-radius: 0 11px 11px 0;
    font-size: 13px;
}
.nav-submenu .nav-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}
.nav-submenu .nav-item.active {
    border-left-color: #7dd3fc;
    background: linear-gradient(90deg, rgba(56,189,248,.18), rgba(255,255,255,.09));
}
.nav-profile {
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px solid rgba(255,255,255,.10);
}
.side-footer { margin-top: auto; padding: 18px 8px 0; color: #8ca5ba; font-size: 11px; }

.main { flex: 1; min-width: 0; }
.topbar {
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 28px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.topbar-school {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    gap: 11px;
}
.topbar-school > img {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    padding: 3px;
}
.topbar-school > div { min-width: 0; }
.topbar-school small {
    display: flex;
    min-width: 0;
    gap: 7px;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
}
.topbar-school small strong,
.topbar-school small span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-school small span::before { content: "·"; margin-right: 7px; }
.menu-toggle {
    display: none;
    min-width: 42px;
    min-height: 42px;
    border-radius: 12px;
    background: #edf3f9;
}
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar, .profile-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.content {
    width: min(1600px, 100%);
    padding: 28px;
}
.welcome {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #eef7ff);
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15,76,129,.07);
}
.welcome h2 { margin: 0 0 4px; font-size: 26px; }
.welcome p { margin: 0; color: var(--muted); }
.dashboard-mode-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 8px;
    border: 1px solid #dbe7f2;
    border-radius: 16px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 10px 30px rgba(15,76,129,.07);
}
.dashboard-mode-tab {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 12px;
    background: transparent;
    color: #456178;
    font-weight: 850;
}
.dashboard-mode-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 8px 18px rgba(15,76,129,.18);
}
#dashboardClassFilter {
    margin-left: auto;
    min-width: 190px;
}
.stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}
.stat, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 26px rgba(15,76,129,.06);
}
.stat { padding: 18px; }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat strong { display: block; margin-top: 8px; color: var(--primary); font-size: 30px; letter-spacing: -.03em; }
.panel { padding: 20px; }
.dashboard-attendance-panel { margin-bottom: 22px; }
.attendance-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.attendance-summary-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-left: 4px solid #7b8da1;
    border-radius: 13px;
    background: #f9fbfd;
}
.attendance-summary-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.attendance-summary-card strong { display: block; margin-top: 5px; color: var(--ink); font-size: 25px; }
.attendance-summary-card.status-present { border-left-color: #157347; }
.attendance-summary-card.status-permit { border-left-color: #2563eb; }
.attendance-summary-card.status-sick { border-left-color: #d97706; }
.attendance-summary-card.status-absent { border-left-color: #b42318; }
.attendance-summary-card.status-total { border-left-color: var(--primary); }
.dashboard-subheading { margin: 0 0 10px; font-size: 15px; }
.dashboard-absence-table { min-width: 760px; }
.dashboard-monitoring { display: grid; gap: 14px; }
.monitoring-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.monitoring-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 120px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}
.monitoring-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    font-size: 24px;
    font-weight: 950;
}
.monitoring-card span, .monitoring-mini-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.monitoring-card strong { display: block; margin-top: 4px; font-size: 30px; line-height: 1; letter-spacing: -.03em; }
.monitoring-card small { display: block; margin-top: 7px; color: var(--muted); }
.monitoring-card.tone-green .monitoring-card-icon { background: linear-gradient(135deg, #059669, #22c55e); }
.monitoring-card.tone-purple .monitoring-card-icon { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.monitoring-card.tone-orange .monitoring-card-icon { background: linear-gradient(135deg, #f97316, #f59e0b); }
.monitoring-card.tone-cyan .monitoring-card-icon { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.monitoring-grid {
    display: grid;
    grid-template-columns: 1.1fr .85fr .95fr;
    gap: 14px;
    align-items: stretch;
}
.monitoring-grid-bottom { grid-template-columns: .8fr 1fr 1fr; }
.monitoring-service-table { min-width: 660px; }
.monitoring-donut-wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
    min-height: 230px;
}
.monitoring-donut {
    --present: 0;
    display: grid;
    place-items: center;
    align-content: center;
    width: 174px;
    height: 174px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #fff 0 54%, transparent 55%), conic-gradient(#22c55e calc(var(--present) * 1%), #fbbf24 0 96%, #3b82f6 0 99%, #ef4444 0);
    box-shadow: inset 0 0 0 1px #e5eef6, 0 15px 30px rgba(34,197,94,.14);
}
.monitoring-donut strong { color: #173f63; font-size: 32px; line-height: 1; }
.monitoring-donut span { color: var(--muted); font-weight: 800; }
.monitoring-legend { display: grid; gap: 10px; }
.monitoring-legend-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: center; }
.monitoring-legend-item i { width: 11px; height: 11px; border-radius: 50%; background: #22c55e; }
.monitoring-legend-item i.permit { background: #fbbf24; }
.monitoring-legend-item i.sick { background: #3b82f6; }
.monitoring-legend-item i.absent { background: #ef4444; }
.monitoring-legend-item span { color: #53687d; }
.monitoring-legend-item strong { color: #0f2740; font-size: 12px; }
.monitoring-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 18px;
}
.monitoring-mini-card {
    padding: 12px;
    border: 1px solid #dbe7f2;
    border-radius: 13px;
    background: #f8fbff;
}
.monitoring-mini-card strong { display: block; margin-top: 4px; font-size: 24px; color: var(--primary); }
.monitoring-mini-card.tone-green strong { color: #047857; }
.monitoring-mini-card.tone-red strong { color: #dc2626; }
.monitoring-mini-card.tone-purple strong { color: #7c3aed; }
.monitoring-bars { display: grid; gap: 12px; }
.monitoring-bar-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #465f76; font-size: 12px; font-weight: 850; }
.monitoring-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #edf3f9; }
.monitoring-bar-track i { display: block; height: 100%; min-width: 4px; border-radius: inherit; }
.monitoring-list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}
.monitoring-list-item strong { display: block; color: #0f2740; }
.monitoring-list-item small { display: block; margin-top: 3px; }
.monitoring-list-item span { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 750; }
.monitoring-inline-progress {
    position: relative;
    min-width: 120px;
    height: 24px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf3f9;
}
.monitoring-inline-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(135deg, #16a34a, #22c55e); }
.monitoring-inline-progress span { position: absolute; inset: 0; display: grid; place-items: center; color: #0f2740; font-size: 12px; font-weight: 900; }
.panel-head {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 19px; }
.panel-subtitle { margin: 4px 0 0; }
.toolbar { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; margin: 0; }
.table-wrap { overflow: auto; border-radius: 12px; }
.data-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table th, .data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9eff6;
    text-align: left;
    vertical-align: top;
}
.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7fafc;
    color: #526579;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.data-table tbody tr:hover { background: #f9fcff; }
.actions { white-space: nowrap; }
.select-search-input {
    margin-bottom: 6px !important;
    background: #f8fbfe;
}
.form-grid .select-search-input + select {
    margin-top: 0;
}
.attendance-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #eaf1f7;
}
.attendance-tab {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 9px;
    background: transparent;
    color: #536b80;
    font-weight: 800;
}
.attendance-tab.active { background: #fff; color: var(--primary); box-shadow: 0 4px 12px rgba(15,76,129,.1); }
.attendance-toolbar {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(160px, .8fr) minmax(240px, 1.5fr) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}
.attendance-toolbar label { display: grid; gap: 5px; color: #526579; font-size: 12px; font-weight: 800; }
.attendance-toolbar input, .attendance-toolbar select { width: 100%; }
.attendance-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.attendance-summary span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    min-height: 31px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fbfe;
    color: #536b80;
    font-size: 12px;
}
.attendance-summary strong { color: var(--ink); }
.attendance-status-hadir { --attendance-color: #187548; --attendance-bg: #e8f8ef; }
.attendance-status-izin { --attendance-color: #8a5a00; --attendance-bg: #fff6d8; }
.attendance-status-sakit { --attendance-color: #9a3412; --attendance-bg: #ffedd5; }
.attendance-status-alpha { --attendance-color: #a31d1d; --attendance-bg: #fee8e8; }
.attendance-summary .attendance-status-hadir,
.attendance-summary .attendance-status-izin,
.attendance-summary .attendance-status-sakit,
.attendance-summary .attendance-status-alpha { color: var(--attendance-color); background: var(--attendance-bg); border-color: transparent; }
.attendance-table { min-width: 930px; }
.attendance-table th:nth-child(1) { width: 90px; }
.attendance-table th:nth-child(2), .attendance-table th:nth-child(3) { width: 130px; }
.attendance-table th:nth-child(5) { width: 145px; }
.attendance-table th:nth-child(6) { width: 32%; }
.attendance-table select, .attendance-table input { width: 100%; min-width: 125px; }
.attendance-table td small { display: block; margin-top: 2px; }
.attendance-table tr[class*="attendance-status-"] td:first-child { box-shadow: inset 4px 0 0 var(--attendance-color); }
.attendance-report-wrap { max-height: 68vh; }
.attendance-report-table { min-width: 1700px; font-size: 12px; }
.attendance-report-table th, .attendance-report-table td { padding: 8px 7px; text-align: center; white-space: nowrap; }
.attendance-report-table th:nth-child(4), .attendance-report-table td:nth-child(4),
.attendance-report-table th:last-child, .attendance-report-table td:last-child { text-align: left; }
.attendance-report-table td[class*="attendance-status-"] { color: var(--attendance-color); background: var(--attendance-bg); font-weight: 900; }
.attendance-report-table th:nth-child(1), .attendance-report-table td:nth-child(1) { position: sticky; left: 0; z-index: 2; background: #fff; }
.attendance-report-table th:nth-child(2), .attendance-report-table td:nth-child(2) { position: sticky; left: 46px; z-index: 2; background: #fff; }
.attendance-report-table th:nth-child(3), .attendance-report-table td:nth-child(3) { position: sticky; left: 146px; z-index: 2; background: #fff; }
.attendance-report-table th:nth-child(4), .attendance-report-table td:nth-child(4) { position: sticky; left: 256px; z-index: 2; min-width: 220px; background: #fff; box-shadow: 6px 0 12px rgba(20,32,51,.05); }
.attendance-report-table thead th { z-index: 3; background: #f7fafc; }
.attendance-report-table thead th:nth-child(-n+4) { z-index: 4; background: #f7fafc; }
.activity-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eef2f6; }
.activity-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: #3b82b6; box-shadow: 0 0 0 4px #dbeafe; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.report-summary { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.report-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.report-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #fff, #f7fbff);
}
.report-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.report-card strong {
    display: block;
    margin-top: 5px;
    color: var(--primary);
    font-size: 22px;
}
.settings { display: grid; grid-template-columns: 90px 1fr; gap: 24px; max-width: 580px; }
.settings small { display: block; margin: 6px 0 14px; }
.school-profile-form {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: 24px;
}
.school-logo-grid { display: grid; align-content: start; gap: 14px; }
.school-logo-card {
    display: grid;
    gap: 9px;
    padding: 16px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #f8fbfe;
    font-weight: 800;
}
.school-logo-card img {
    width: 96px;
    height: 96px;
    justify-self: center;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid #d7e3ee;
    background: #fff;
    padding: 6px;
}
.school-logo-card input { width: 100%; padding: 9px; background: #fff; }
.school-logo-card small { font-weight: 500; }
.school-logo-card .school-logo-reset {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.school-logo-card .school-logo-reset input { width: 17px; height: 17px; padding: 0; accent-color: var(--primary); }
.school-profile-fields { align-content: start; }
.school-profile-actions {
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}
.access-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #b8d7ee;
    border-radius: 12px;
    background: #edf7ff;
    color: #254f72;
}
.role-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf3f9;
    color: #24415f;
    font-size: 12px;
    font-weight: 800;
}
.status-badge.active { background: #dcfce7; color: #166534; }
.status-badge.inactive { background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.subscription-alert { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 14px 17px; border: 1px solid #f6d88c; border-left: 5px solid #d99816; border-radius: 13px; background: #fff9e8; color: #7a5307; }
.subscription-alert strong, .subscription-alert span { display: block; }
.subscription-alert strong { flex: 0 0 auto; }
.subscription-alert.urgent { border-color: #fdba74; border-left-color: #ea580c; background: #fff7ed; color: #9a3412; }
.subscription-alert.danger { border-color: #fca5a5; border-left-color: #dc2626; background: #fff1f2; color: #991b1b; }
.billing-grid { display: grid; grid-template-columns: minmax(380px, .85fr) minmax(440px, 1.15fr); gap: 20px; align-items: start; }
.subscription-card { background: linear-gradient(145deg, #fff, #edf7ff); }
.subscription-head, .subscription-period, .invoice-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.subscription-head h2 { margin: 3px 0 18px; color: var(--primary); }
.subscription-period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 17px; border-top: 1px solid var(--line); }
.subscription-period div { display: grid; gap: 4px; }
.subscription-period strong { font-size: 17px; }
.subscription-deposit-card { padding: 0; overflow: hidden; }
.deposit-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px; }
.deposit-summary > div { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.deposit-summary small { color: var(--muted); }
.deposit-summary strong { color: #274862; font-size: 17px; }
.deposit-summary .balance { border-color: #a7e0c2; background: #effbf4; }
.deposit-summary .balance strong { color: #187548; }
.billing-subscription-form { padding: 0 0 18px; }
.billing-subscription-form .form-grid, .billing-subscription-form .school-profile-actions { padding-left: 18px; padding-right: 18px; }
.billing-price-preview { margin: 2px 18px 16px; padding: 12px 14px; border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: #eef7fc; color: var(--primary); font-weight: 800; }
.bank-list, .billing-invoices { display: grid; gap: 12px; margin-top: 14px; }
.billing-bank-panel { overflow: hidden; }
.billing-bank-heading { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.billing-bank-heading h2 { margin-top: 4px; }
.section-kicker {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.bank-list { margin-top: 0; }
.bank-card, .invoice-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.bank-card {
    padding: 0;
    overflow: hidden;
    border-color: #cfddea;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 55, 86, .07);
}
.bank-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 18px;
    background: linear-gradient(135deg, #f8fbfe 0%, #eef6fc 100%);
    border-bottom: 1px solid #dce8f1;
}
.bank-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.bank-brand > div { display: grid; gap: 1px; min-width: 0; }
.bank-brand small, .bank-account-label {
    color: #688096;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.bank-brand h3 { margin: 0; color: #173a5b; font-size: 18px; }
.bank-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: 0 6px 14px rgba(11, 78, 126, .2);
}
.bank-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e6f8ee;
    color: #187548;
    font-size: 11px;
    font-weight: 800;
}
.bank-active > span { width: 7px; height: 7px; border-radius: 50%; background: #20a565; }
.bank-account-box {
    display: grid;
    gap: 8px;
    margin: 18px;
    padding: 16px;
    border: 1px solid #d8e4ee;
    border-radius: 14px;
    background: #fff;
}
.bank-account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bank-account-number {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--primary);
    font-size: clamp(24px, 2vw, 29px);
    line-height: 1.15;
    letter-spacing: .055em;
    font-variant-numeric: tabular-nums;
}
.bank-holder { color: #647d94; font-size: 13px; }
.bank-holder strong { color: #2b4a66; }
.bank-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 37px;
    padding: 7px 11px;
    border: 1px solid #bcd2e3;
    border-radius: 10px;
    background: #f1f7fb;
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .18s ease;
}
.bank-copy-button:hover { border-color: var(--primary); background: #e6f2fa; transform: translateY(-1px); }
.bank-copy-button.copied { border-color: #65bc8f; background: #e6f8ee; color: #187548; }
.bank-copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bank-instructions { padding: 0 18px 18px; }
.bank-instructions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    color: #264a68;
}
.bank-instructions-title svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 1.9; }
.bank-instructions-title h4 { margin: 0; font-size: 14px; }
.bank-instruction-list { display: grid; gap: 9px; }
.bank-instruction-list p { margin: 0; color: #526c83; font-size: 13px; line-height: 1.55; }
.bank-instruction-intro {
    padding: 10px 12px;
    border-left: 3px solid #7bb9e2;
    border-radius: 0 9px 9px 0;
    background: #f3f8fc;
}
.bank-instruction-step {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}
.bank-step-number {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    background: #e4f1fa;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}
.bank-instruction-step p { padding-top: 3px; }
.bank-instruction-note {
    padding-top: 9px;
    border-top: 1px dashed #d7e3ec;
}
.invoice-card small { color: var(--muted); }
.invoice-main > div:first-child { display: grid; gap: 4px; }
.invoice-amount { display: grid; justify-items: end; gap: 7px; font-weight: 800; white-space: nowrap; }
.payment-history { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.payment-history small { flex-basis: 100%; color: var(--danger); }
.invoice-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.billing-payment-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.permission-table { min-width: 760px; }
.permission-table th:not(:first-child), .permission-table td:not(:first-child) { width: 92px; text-align: center; }
.permission-cell input {
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
    cursor: pointer;
}
.permission-cell input:disabled { cursor: not-allowed; opacity: .45; }
.user-table { min-width: 1050px; }
#savePermissionsBtn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.srs-cell-mark { display: block; margin-top: 4px; color: #b45309; font-size: 10px; font-weight: 800; letter-spacing: .04em; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15,32,51,.52);
    backdrop-filter: blur(4px);
}
.modal {
    width: min(820px, 100%);
    max-height: min(90vh, 920px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(15,32,51,.28);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.modal-head h2 { margin: 0; }
.close { min-width: 40px; min-height: 40px; border-radius: 12px; background: #f2f5f8; color: var(--muted); font-size: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 15px; }
.form-grid label { display: block; margin: 10px 0; font-weight: 700; }
.form-grid label.full { grid-column: 1 / -1; }
.form-section-title {
    grid-column: 1 / -1;
    margin: 18px 0 2px;
    padding: 11px 13px;
    border-left: 4px solid var(--primary);
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
}
.form-section-title:first-child { margin-top: 2px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; margin-top: 6px; }
.form-grid textarea { min-height: 92px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast {
    position: fixed;
    right: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 90;
    max-width: min(420px, calc(100vw - 32px));
    padding: 13px 16px;
    border-radius: 13px;
    background: #102a43;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

.help-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 26px 28px;
    overflow: hidden;
    border: 1px solid #cfe2ef;
    border-radius: 20px;
    background:
        radial-gradient(circle at 92% 15%, rgba(74,164,220,.24), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #eff8fd 100%);
    box-shadow: var(--shadow);
}
.help-hero h2 { margin: 4px 0 7px; color: #123d5c; font-size: clamp(24px, 3vw, 34px); }
.help-hero p { max-width: 720px; margin: 0; color: var(--muted); }
.help-role-card {
    display: grid;
    flex: 0 0 min(290px, 34%);
    gap: 4px;
    padding: 17px 19px;
    border: 1px solid #c8dfed;
    border-radius: 16px;
    background: rgba(255,255,255,.9);
}
.help-role-card small, .help-role-card span { color: var(--muted); }
.help-role-card strong { color: var(--primary); font-size: 20px; }
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 100px; display: grid; gap: 6px; padding: 15px; }
.help-toc > strong { padding: 5px 9px 10px; color: #2b4a66; }
.help-toc-button {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #526c83;
    font: inherit;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}
.help-toc-button:hover, .help-toc-button.active { background: var(--primary-soft); color: var(--primary); }
.help-content { min-width: 0; }
.help-panel { padding: 0; overflow: hidden; }
.help-panel > :not(.panel-head) { margin-left: 20px; margin-right: 20px; }
.help-step-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 20px 0; }
.help-step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.help-step > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 16px;
    font-weight: 900;
}
.help-step h3, .help-guide-card h3, .help-role-detail h3 { margin: 0; color: #213f59; font-size: 15px; }
.help-step p, .help-guide-card p, .help-role-detail p { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }
.help-note {
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid #bfe2d0;
    border-left: 5px solid var(--ok);
    border-radius: 14px;
    background: #f0fbf5;
    color: #315d48;
}
.help-note p { margin: 4px 0 0; }
.help-search-head input { width: min(300px, 100%); }
.help-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px 0; }
.help-guide-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}
.help-guide-title { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; }
.help-guide-title .nav-icon {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
}
.help-permission-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.help-permission-badges span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8f7ef;
    color: #187548;
    font-size: 11px;
    font-weight: 800;
}
.help-guide-card ol { flex: 1; margin: 15px 0 17px; padding-left: 20px; color: #526c83; }
.help-guide-card li { margin: 6px 0; padding-left: 3px; line-height: 1.5; }
.help-guide-card .btn { align-self: flex-start; }
.help-role-grid { display: grid; gap: 11px; padding: 20px 0; }
.help-role-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.help-role-detail.current { border-color: #85bee1; background: #f2f9fd; }
.help-role-detail > div { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; }
.help-role-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.help-role-detail h3 small { margin-left: 6px; color: var(--primary); font-size: 10px; text-transform: uppercase; }
.help-legend { display: flex; flex-wrap: wrap; gap: 15px; padding: 15px 0; color: var(--muted); font-size: 12px; }
.help-legend span { display: inline-flex; align-items: center; gap: 6px; }
.help-legend span:last-child { margin-left: auto; }
.help-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.help-dot.allowed { background: var(--ok); }
.help-dot.denied { background: #c9d4de; }
.help-matrix { min-width: 720px; }
.help-matrix td:first-child small { display: block; margin-top: 3px; color: var(--muted); }
.help-matrix th:not(:first-child), .help-matrix-cell { width: 82px; text-align: center; }
.matrix-mark { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 12px; font-weight: 900; }
.matrix-mark.allowed { background: #e2f7eb; color: #187548; }
.matrix-mark.denied { background: #edf1f4; color: #8292a0; }
.matrix-na { color: #b8c3cc; }
.help-faq-list { display: grid; gap: 10px; padding: 20px 0; }
.help-faq-list details { border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.help-faq-list summary { padding: 14px 16px; color: #294a65; font-weight: 800; cursor: pointer; }
.help-faq-list p { margin: 0; padding: 0 16px 16px; color: var(--muted); line-height: 1.6; }
.help-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 20px 0 0; }
.help-support-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 16px;
    border: 1px solid #bfe5d0;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff, #f0fbf5);
}
.help-support-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #dcfce7; color: #15803d; font-size: 21px; font-weight: 900; }
.help-support-card small, .help-support-card strong, .help-support-card span { display: block; }
.help-support-card small { color: var(--muted); font-weight: 700; }
.help-support-card strong { margin-top: 2px; color: #214b39; font-size: 16px; }
.help-support-card span { margin-top: 2px; color: #49705f; }
.help-whatsapp-button { white-space: nowrap; background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }

.subscription-document-panel { margin-top: 20px; }
.subscription-document-layout { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr); gap: 22px; align-items: start; }
.subscription-document-form { padding: 18px; border: 1px solid #dbe7f2; border-radius: 16px; background: linear-gradient(145deg, #f8fbff, #fff); }
.subscription-document-form textarea { min-height: 84px; }
.document-policy-note { margin-top: 14px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; color: #1e3a5f; background: #eff6ff; font-size: 12px; line-height: 1.55; }
.document-workflow { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding: 12px; border-radius: 14px; background: #f1f5f9; }
.document-workflow span { display: flex; align-items: center; gap: 7px; min-width: max-content; color: #334155; font-size: 12px; font-weight: 700; }
.document-workflow strong { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: #0f4c81; }
.document-workflow i { color: #94a3b8; font-style: normal; }
.billing-documents { display: grid; gap: 12px; }
.billing-document-card { padding: 16px; border: 1px solid #dbe4ee; border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(15, 76, 129, .06); }
.billing-document-main { display: flex; justify-content: space-between; gap: 18px; }
.billing-document-main > div:first-child, .billing-document-status { display: grid; gap: 5px; }
.billing-document-main strong { color: #0f2740; }
.billing-document-main small, .signed-file-name { color: #64748b; }
.document-type { width: max-content; padding: 4px 8px; border-radius: 999px; color: #075985; background: #e0f2fe; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.billing-document-status { justify-items: end; min-width: 130px; }
.document-rejection { margin-top: 12px; padding: 10px 12px; border-radius: 10px; color: #991b1b; background: #fef2f2; font-size: 12px; }
.document-lock { display: block; margin-top: 12px; color: #166534; font-size: 12px; font-weight: 700; }
.billing-document-upload { margin-top: 14px; padding: 16px; border: 1px dashed #60a5fa; border-radius: 14px; background: #eff6ff; }
.billing-document-upload label { display: grid; gap: 8px; font-weight: 700; }
.billing-document-upload small { color: #64748b; font-weight: 400; }

@media (max-width: 1200px) {
    .subscription-document-layout { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .monitoring-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .monitoring-grid, .monitoring-grid-bottom { grid-template-columns: 1fr; }
    .attendance-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        z-index: 50;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: none; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .topbar { padding: 0 15px; }
    .content { padding: 16px; }
    .panel-head { align-items: flex-start; flex-direction: column; }
    .toolbar { width: 100%; margin-left: 0; }
    .toolbar input, .toolbar select, .toolbar .btn { flex: 1 1 150px; }
    .dashboard-mode-switch { align-items: stretch; flex-wrap: wrap; }
    #dashboardClassFilter { flex: 1 1 100%; margin-left: 0; }
    .monitoring-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
    .monitoring-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-search { grid-column: 1 / -1; }
    .settings { grid-template-columns: 1fr; }
    .school-profile-form { grid-template-columns: 1fr; }
    .school-logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-profile-actions { grid-column: 1; }
    .profile-avatar { margin: auto; }
    .report-cards { grid-template-columns: 1fr; }
    .billing-grid { grid-template-columns: 1fr; }
    .deposit-summary { grid-template-columns: 1fr; }
    .subscription-alert { align-items: flex-start; flex-direction: column; }
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; display: flex; overflow-x: auto; }
    .help-toc > strong { display: none; }
    .help-toc-button { flex: 0 0 auto; width: auto; white-space: nowrap; }
}
@media (max-width: 640px) {
    body { font-size: 13px; }
    .login-screen { padding: 14px; }
    .login-card { padding: 24px; border-radius: 20px; }
    .app { display: block; }
    .topbar { min-height: 64px; }
    .topbar h1 { font-size: 18px; }
    .topbar-school { gap: 7px; }
    .topbar-school > img { width: 34px; height: 34px; flex-basis: 34px; }
    .topbar-school small span { display: none; }
    .user-box > div:nth-child(2) { display: none; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .monitoring-card-grid { grid-template-columns: 1fr; }
    .dashboard-mode-tab { flex: 1 1 auto; }
    .attendance-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { padding: 14px; }
    .stat strong { font-size: 24px; }
    .panel { padding: 14px; border-radius: 14px; }
    .form-grid { grid-template-columns: 1fr; }
    .attendance-tabs { width: 100%; }
    .attendance-tab { flex: 1; }
    .attendance-toolbar { grid-template-columns: 1fr; }
    .attendance-search { grid-column: auto; }
    .attendance-toolbar .btn, .attendance-toolbar a.btn { width: 100%; }
    .attendance-table-wrap { overflow: visible; }
    .attendance-table { min-width: 0; border-collapse: separate; display: block; }
    .attendance-table thead { display: none; }
    .attendance-table tbody { display: grid; gap: 12px; }
    .attendance-table tr { display: grid; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
    .attendance-table td { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 4px; border: 0; }
    .attendance-table td::before { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
    .attendance-table td:nth-child(1)::before { content: "Kelas"; }
    .attendance-table td:nth-child(2)::before { content: "NIS"; }
    .attendance-table td:nth-child(3)::before { content: "NISN"; }
    .attendance-table td:nth-child(4)::before { content: "Nama Siswa"; }
    .attendance-table td:nth-child(5)::before { content: "Kehadiran"; }
    .attendance-table td:nth-child(6)::before { content: "Keterangan"; }
    .invoice-main { flex-direction: column; }
    .invoice-amount { justify-items: start; }
    .billing-document-main { flex-direction: column; }
    .billing-document-status { justify-items: start; }
    .document-workflow { align-items: flex-start; flex-direction: column; }
    .document-workflow i { display: none; }
    .bank-card-header { align-items: flex-start; }
    .bank-active { padding: 5px 7px; }
    .bank-active > span { display: none; }
    .bank-account-row { align-items: stretch; flex-direction: column; }
    .bank-copy-button { width: 100%; }
    .school-logo-grid { grid-template-columns: 1fr; }
    .help-hero { align-items: stretch; flex-direction: column; padding: 20px; }
    .help-role-card { flex-basis: auto; }
    .help-step-grid, .help-guide-grid { grid-template-columns: 1fr; }
    .help-support-grid { grid-template-columns: 1fr; }
    .help-panel > :not(.panel-head) { margin-left: 14px; margin-right: 14px; }
    .help-role-detail { align-items: stretch; flex-direction: column; }
    .help-role-detail .btn { width: 100%; }
    .help-legend span:last-child { flex-basis: 100%; margin-left: 0; }
    .akpd-grid, .akpd-form, .akpd-summary { grid-template-columns: 1fr; }
    .akpd-form .full { grid-column: auto; }
    .modal-backdrop { padding: 10px; align-items: end; }
    .modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        padding: 18px;
    }
    .modal-actions { position: sticky; bottom: 0; padding-top: 12px; background: #fff; }
}
@media (max-width: 560px) {
    .help-support-card { grid-template-columns: 42px minmax(0, 1fr); }
    .help-whatsapp-button { grid-column: 1 / -1; width: 100%; }
}
.akpd-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 18px;
    align-items: start;
}
.akpd-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    margin-top: 14px;
}
.akpd-form:first-of-type { border-top: 0; margin-top: 0; }
.akpd-form .full { grid-column: 1 / -1; }
.akpd-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.akpd-matrix-wrap {
    max-height: 65vh;
    overflow: auto;
}
.akpd-matrix th,
.akpd-matrix td {
    text-align: center;
    white-space: nowrap;
}
.akpd-matrix th:first-child,
.akpd-matrix td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    min-width: 210px;
    background: #fff;
    box-shadow: 8px 0 14px rgba(15, 76, 129, .08);
}
.akpd-matrix thead th:first-child {
    z-index: 3;
    background: #f8fafc;
}
.akpd-matrix input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}
.akpd-tabs {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 14px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #eaf1f7;
}
.akpd-tab {
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 10px;
    background: transparent;
    color: #536b80;
    font-weight: 900;
}
.akpd-tab.active { background: #fff; color: var(--primary); box-shadow: 0 4px 14px rgba(15,76,129,.12); }
.akpd-student-panel { max-width: 1120px; }
.akpd-instruction-card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid #b9ddf4;
    border-radius: 16px;
    background: linear-gradient(135deg, #f7fcff, #edf7ff);
    color: #294a65;
}
.akpd-instruction-card h3 { margin: 0 0 8px; color: var(--primary); }
.akpd-instruction-card ol { margin: 8px 0 12px 20px; padding: 0; line-height: 1.6; }
.akpd-student-session-select { max-width: 560px; border-top: 0; margin-top: 0; padding-top: 0; }
.akpd-domain-card {
    margin: 14px 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 76, 129, .07);
}
.akpd-domain-toggle {
    display: flex;
    width: 100%;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    text-align: left;
    background: linear-gradient(135deg, #ffffff, #f3f9ff);
    color: #16324b;
}
.akpd-domain-toggle span { display: grid; gap: 4px; }
.akpd-domain-toggle small { color: var(--muted); font-weight: 700; line-height: 1.45; }
.akpd-domain-toggle b {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e6f3ff;
    color: var(--primary);
    font-size: 12px;
}
.akpd-domain-body { padding: 0 18px 18px; }
.akpd-domain-guide {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    background: #f8fbfe;
    color: #536b80;
    line-height: 1.55;
}
.akpd-domain-guide p { margin: 4px 0; }
.akpd-question-list { display: grid; gap: 10px; }
.akpd-question-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 13px 14px;
    border: 1px solid #d9e6f0;
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.akpd-question-card:hover { border-color: #9fd0f2; box-shadow: 0 8px 18px rgba(15,76,129,.08); background: #fcfeff; }
.akpd-question-text { color: #20384f; line-height: 1.5; }
.akpd-question-text small { display: block; margin-top: 5px; color: var(--muted); }
.akpd-answer-options {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}
.akpd-answer-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #cfe0ef;
    border-radius: 999px;
    background: #f8fbfe;
    color: #385771;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.akpd-answer-choice input { width: 16px; height: 16px; accent-color: var(--brand); }
.akpd-answer-choice:has(input:checked) { border-color: var(--brand); background: #eaf7ff; color: var(--primary); }
@media (max-width: 640px) {
    .akpd-tabs { width: 100%; }
    .akpd-tab { flex: 1; padding-left: 8px; padding-right: 8px; }
    .akpd-grid, .akpd-form, .akpd-summary { grid-template-columns: 1fr; }
    .akpd-form .full { grid-column: auto; }
    .akpd-domain-toggle { align-items: flex-start; flex-direction: column; }
    .akpd-question-card { grid-template-columns: 1fr; }
    .akpd-answer-options { justify-content: stretch; }
    .akpd-answer-choice { flex: 1; justify-content: center; }
}
@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr; }
    .monitoring-mini-grid { grid-template-columns: 1fr; }
    .attendance-summary-grid { grid-template-columns: 1fr; }
    .toolbar input, .toolbar select, .toolbar .btn { flex-basis: 100%; }
    .btn { width: 100%; }
    .user-box .btn { width: auto; }
    .actions .btn { width: auto; margin-bottom: 4px; }
}

.learning-profile-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 16px}
.learning-profile-tab{border:1px solid #cfe0ef;background:#fff;color:var(--primary);border-radius:999px;padding:10px 16px;font-weight:900;cursor:pointer}
.learning-profile-tab.active{background:var(--primary);color:#fff;border-color:var(--primary);box-shadow:0 12px 24px rgba(15,76,129,.18)}
.learning-profile-grid{display:grid;grid-template-columns:minmax(320px,.9fr) minmax(420px,1.25fr);gap:18px;align-items:start}
.learning-profile-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:18px}
.learning-profile-form-grid .full{grid-column:1/-1}
.learning-profile-form-grid label,.learning-profile-question{display:grid;gap:8px;font-weight:850}
.learning-profile-form-grid input,.learning-profile-form-grid select,.learning-profile-form-grid textarea,.learning-profile-question textarea,.learning-profile-question input:not([type=checkbox]):not([type=radio]){width:100%;min-height:46px;border:1px solid #cdddec;border-radius:14px;padding:10px 13px;background:#fff;color:#10243a}
.learning-profile-form-grid textarea,.learning-profile-question textarea{min-height:86px;resize:vertical}
.learning-profile-cards{display:grid;gap:12px;padding:18px}
.learning-profile-card{display:flex;justify-content:space-between;gap:16px;align-items:center;border:1px solid #dbe9f4;border-radius:18px;background:linear-gradient(135deg,#fff,#f8fbfe);padding:16px;box-shadow:0 12px 28px rgba(15,76,129,.07)}
.learning-profile-card h3{margin:6px 0 5px}
.learning-profile-card p,.learning-profile-card small{display:block;margin:0;color:var(--muted)}
.learning-profile-form{padding:18px;border-top:1px solid #dbe9f4}
.learning-profile-form-head{padding:16px;border:1px solid #dbe9f4;border-radius:18px;background:#f7fbff;margin-bottom:14px}
.learning-profile-form-head h3{margin:0 0 5px}
.learning-profile-section{display:grid;gap:12px;margin:0 0 16px;padding:16px;border:1px solid #dbe9f4;border-radius:20px;background:#fff}
.learning-profile-section h3{margin:0}
.learning-profile-question{padding:14px;border:1px solid #e0ebf4;border-radius:16px;background:#fbfdff;line-height:1.45}
.learning-profile-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.learning-profile-options label{display:flex;align-items:flex-start;gap:9px;padding:10px;border:1px solid #d6e6f2;border-radius:14px;background:#fff;font-weight:750;cursor:pointer}
.learning-profile-options input,.learning-profile-likert input{accent-color:var(--primary)}
.learning-profile-likert{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.learning-profile-likert label{display:grid;gap:6px;text-align:center;padding:10px;border:1px solid #d6e6f2;border-radius:14px;background:#fff;cursor:pointer}
.learning-profile-likert span{display:grid;gap:3px;font-weight:950;color:var(--primary)}
.learning-profile-likert small{font-size:11px;color:var(--muted);font-weight:700}
.learning-profile-summary{display:grid;gap:14px;margin-bottom:14px}
.learning-profile-score-block{border:1px solid #dbe9f4;border-radius:18px;padding:14px;background:#fff}
.learning-profile-score-block h3{margin:0 0 12px}
.learning-profile-score-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.learning-profile-score{display:grid;gap:7px;padding:12px;border-radius:14px;background:#f7fbff;border:1px solid #e0ebf4}
.learning-profile-score span{color:var(--muted);font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.03em}
.learning-profile-score strong{font-size:22px;color:var(--primary)}
.learning-profile-score div{height:7px;border-radius:999px;background:#dbe9f4;overflow:hidden}
.learning-profile-score i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand),var(--primary))}
@media (max-width:900px){
    .learning-profile-grid,.learning-profile-form-grid,.learning-profile-options,.learning-profile-score-grid{grid-template-columns:1fr}
    .learning-profile-card{display:grid}
    .learning-profile-likert{grid-template-columns:repeat(5,minmax(54px,1fr));overflow-x:auto}
}

/* UI/UX refresh 2026-07-28: global polish for all tenant modules */
html { scroll-behavior: smooth; }
body {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 90% 8%, rgba(14,165,233,.10), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, #eef6fd 100%);
}
.main { flex: 1 1 auto; min-width: 0; }
.content {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: clamp(16px, 2vw, 30px);
}
.topbar {
    min-height: 78px;
    height: auto;
    padding: 10px clamp(16px, 2vw, 28px);
    gap: 14px;
}
.topbar-school { flex: 1 1 auto; min-width: 0; }
.topbar-school h1 {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-school small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 7px;
    line-height: 1.35;
}
.user-box { flex: 0 0 auto; }
.stat,
.panel,
.login-card,
.billing-document-card,
.learning-profile-card,
.learning-profile-section,
.akpd-question-card {
    border-color: rgba(15,76,129,.12);
    box-shadow: 0 18px 45px rgba(15,76,129,.08);
}
.panel {
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255,255,255,.96);
}
.panel-head {
    gap: 14px;
    padding-bottom: 16px;
}
.panel-head h2 { line-height: 1.25; }
.panel-subtitle,
.panel-head p { line-height: 1.45; }
.toolbar,
.row-actions,
.modal-actions {
    gap: 9px;
    flex-wrap: wrap;
}
.btn { min-width: max-content; }
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(14,165,233,.28);
    outline-offset: 2px;
}
.table-wrap {
    width: 100%;
    border: 1px solid #dbe8f3;
    border-radius: 16px;
    background: #fff;
}
.table-wrap table { min-width: 760px; }
th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7fbff;
}
td { line-height: 1.45; }
.stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: stretch;
}
.stat {
    min-height: 108px;
    display: grid;
    align-content: center;
}
.attendance-summary-grid,
.monitoring-card-grid,
.learning-profile-score-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.dashboard-mode-switch {
    border: 1px solid #dbe8f3;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
}
#dashboardClassFilter {
    min-width: min(240px, 100%);
}
.modal {
    max-width: min(920px, calc(100vw - 28px));
}
.login-screen {
    min-height: 100svh;
}
.login-card {
    max-width: min(100%, 520px);
}
.login-school-card,
.login-socials a {
    transition: transform .14s ease, box-shadow .14s ease;
}
.login-socials a:hover,
.login-school-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15,76,129,.10);
}
@media (max-width: 900px) {
    .app::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 45;
        pointer-events: none;
        opacity: 0;
        background: rgba(8,47,73,.34);
        backdrop-filter: blur(2px);
        transition: opacity .2s ease;
    }
    .sidebar.open + .main::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(8,47,73,.34);
        backdrop-filter: blur(2px);
    }
    .sidebar { box-shadow: 18px 0 44px rgba(8,47,73,.22); }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        background: rgba(255,255,255,.94);
        backdrop-filter: blur(14px);
    }
    .content { padding: 18px; }
    .toolbar .btn,
    .toolbar input,
    .toolbar select { min-width: 0; }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    .content { padding: 16px; }
    .topbar {
        min-height: 70px;
        align-items: center;
    }
    .topbar-school h1 {
        max-width: 42vw;
        font-size: 17px;
    }
    .topbar-school small {
        display: block;
        overflow: hidden;
        max-width: 44vw;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-box {
        gap: 8px;
        margin-left: auto;
    }
    .dashboard-mode-switch {
        display: grid;
        grid-template-columns: 1fr;
        padding: 8px;
    }
    .dashboard-mode-tab,
    #dashboardClassFilter { width: 100%; }
    .stats,
    .attendance-summary-grid,
    .monitoring-mini-grid,
    .monitoring-card-grid,
    .learning-profile-score-grid {
        grid-template-columns: 1fr;
    }
    .stat { min-height: 92px; }
    .panel { border-radius: 18px; }
    .panel-head {
        padding: 16px;
        gap: 12px;
    }
    .table-wrap {
        margin-inline: -2px;
        border-radius: 14px;
    }
    .table-wrap table { min-width: 700px; }
    .toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }
    .toolbar .btn,
    .row-actions .btn { width: 100%; }
    .login-screen {
        display: grid;
        align-items: start;
        padding: 0;
    }
    .login-visual {
        min-height: 285px;
        border-radius: 0 0 28px 28px;
    }
    .login-card {
        width: calc(100% - 32px);
        margin: -28px auto 20px;
        padding: 24px;
    }
}
@media (max-width: 420px) {
    .content { padding: 14px; }
    .topbar-school h1 { max-width: 38vw; }
    .topbar-school small { max-width: 38vw; }
    .panel,
    .stat { border-radius: 16px; }
    .btn { min-width: 0; }
}

/* Dashboard accuracy/responsive hardening 2026-07-29 */
.app { width: 100%; max-width: 100%; }
.sidebar { flex: 0 0 270px; }
.main,
.content,
.content > section,
#dashboardClassicPanel,
#dashboardMonitoringPanel,
.dashboard-monitoring,
.monitoring-grid,
.monitoring-grid-bottom,
.monitoring-grid > *,
.monitoring-grid-bottom > *,
.monitoring-card,
.monitoring-card > div,
.monitoring-donut-wrap,
.monitoring-legend,
.monitoring-list-item,
.monitoring-list-item > div {
    min-width: 0;
    max-width: 100%;
}
.monitoring-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .85fr) minmax(0, .95fr);
}
.monitoring-grid-bottom {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr);
}
.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}
.monitoring-card span,
.monitoring-card small,
.monitoring-list-item strong,
.monitoring-list-item small {
    overflow-wrap: anywhere;
}
.monitoring-legend-item {
    grid-template-columns: 12px minmax(0, 1fr) auto;
}
.stat {
    position: relative;
    overflow: hidden;
    border-left: 4px solid #2563eb;
}
.stat.tone-cyan { border-left-color: #0891b2; }
.stat.tone-present,
.stat.tone-green { border-left-color: #16a34a; }
.stat.tone-permit,
.stat.tone-purple { border-left-color: #7c3aed; }
.stat.tone-sick,
.stat.tone-orange { border-left-color: #d97706; }
.stat.tone-absent { border-left-color: #dc2626; }

@media (max-width: 1500px) {
    .monitoring-grid,
    .monitoring-grid-bottom {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar { flex-basis: auto; }
    .main,
    .content { width: 100%; }
}

@media (max-width: 640px) {
    .monitoring-card {
        min-height: 96px;
        padding: 15px;
    }
    .monitoring-card-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    .monitoring-card strong { font-size: 26px; }
    .monitoring-service-table,
    .dashboard-absence-table,
    .table-wrap table { min-width: 640px; }
}

/* Siswa Card and product branding */
.login-product-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    padding: 7px 11px;
    border: 1px solid #d7e5f1;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: #0f4c81;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.login-product-brand img { width: 22px; height: 22px; border-radius: 7px; }
.student-card-panel { overflow: hidden; }
.student-card-panel .panel-head { align-items: flex-start; }
.student-card-period,
.student-card-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 800;
}
.student-card-ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 0 20px 20px;
}
.student-card-ranking-grid > section {
    min-width: 0;
    padding: 16px;
    border: 1px solid #d9e5ef;
    border-radius: 16px;
    background: #fbfdff;
}
.student-card-list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.student-card-list-head span {
    color: #0e7490;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.student-card-list-head h3 { margin: 3px 0 0; font-size: 17px; }
.student-card-list-head small { max-width: 130px; color: var(--muted); text-align: right; }
.student-card-rank-list { display: grid; gap: 8px; }
.student-card-rank-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid #dce7f0;
    border-radius: 12px;
    background: #fff;
    color: #17324d;
    text-align: left;
    cursor: pointer;
}
.student-card-rank-item:hover { border-color: #7dd3fc; box-shadow: 0 8px 18px rgba(14,116,144,.10); }
.student-card-rank-item.attention:hover { border-color: #fbbf24; }
.student-card-rank-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}
.student-card-rank-item.attention .student-card-rank-number { background: #fef3c7; color: #92400e; }
.student-card-rank-copy { min-width: 0; }
.student-card-rank-copy strong,
.student-card-rank-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-card-rank-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.student-card-rank-score { color: #0f4c81; font-size: 20px; font-weight: 900; }
.student-card-privacy {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 20px 20px;
    padding: 11px 13px;
    border-radius: 11px;
    background: #eef7fb;
    color: #31516a;
    font-size: 12px;
}
.student-card-privacy span { color: #0891b2; }
.student-card-privacy p { margin: 0; }
.student-card-self {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 20px 20px;
    padding: 18px;
    border: 1px solid #cce5f2;
    border-radius: 16px;
    background: linear-gradient(135deg,#f0f9ff,#fff);
}
.student-card-score-ring {
    display: grid;
    flex: 0 0 78px;
    place-items: center;
    width: 78px;
    height: 78px;
    border: 7px solid #38bdf8;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 3px #e0f2fe;
}
.student-card-score-ring strong,
.student-card-score-ring span { grid-area: 1/1; }
.student-card-score-ring strong { align-self: center; margin-top: -10px; color: #0f4c81; font-size: 23px; }
.student-card-score-ring span { align-self: end; margin-bottom: 13px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.student-card-self-copy { min-width: 0; flex: 1; }
.student-card-self-copy > span { color: #0e7490; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.student-card-self-copy h3 { margin: 4px 0; }
.student-card-self-copy p { margin: 0 0 5px; color: #405d76; }
.student-card-self-copy small { color: var(--muted); }
.student-card-button { background: #e0f2fe; color: #075985; }
.student-card-modal { width: min(760px, 100%); }
.student-card-detail-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border: 1px solid #cce5f2;
    border-radius: 16px;
    background: linear-gradient(135deg,#f0f9ff,#fff);
}
.student-card-detail-hero h3 { margin: 8px 0 3px; font-size: 24px; }
.student-card-detail-hero p { margin: 0 0 9px; color: #526b82; }
.student-card-detail-hero small { display: block; margin-top: 9px; color: var(--muted); }
.student-card-score-ring.large { flex-basis: 104px; width: 104px; height: 104px; border-width: 9px; }
.student-card-score-ring.large strong { font-size: 30px; }
.student-card-score-ring.large span { margin-bottom: 17px; }
.student-card-metrics {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
    margin: 16px 0;
}
.student-card-metrics > div { min-width: 0; padding: 13px; border: 1px solid #dde7ef; border-radius: 13px; background: #fff; }
.student-card-metrics span,
.student-card-metrics strong,
.student-card-metrics small { display: block; }
.student-card-metrics span { min-height: 30px; color: var(--muted); font-size: 11px; font-weight: 750; }
.student-card-metrics strong { margin: 5px 0; color: #0f4c81; font-size: 20px; }
.student-card-metrics small { color: var(--muted); font-size: 10px; }
.student-card-explanation { padding: 14px 16px; border-left: 4px solid #0891b2; border-radius: 0 12px 12px 0; background: #eff9fc; color: #31516a; }
.student-card-explanation p { margin: 5px 0; }
.module-filter-bar {
    margin: 0 20px 16px;
    padding: 14px;
    border: 1px solid #dce7f0;
    border-radius: 14px;
    background: #f8fbfd;
}
.module-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    align-items: end;
    gap: 12px;
}
.module-filter-grid label {
    min-width: 0;
    color: #405d76;
    font-size: 11px;
    font-weight: 800;
}
.module-filter-grid input,
.module-filter-grid select {
    width: 100%;
    min-width: 0;
    margin-top: 6px;
}
.module-filter-reset { min-height: 42px; }
.module-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px 20px;
}
.module-pagination > span {
    min-width: 250px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}
.module-pagination .btn:disabled {
    cursor: not-allowed;
    opacity: .48;
}
.data-table .row-number {
    width: 64px;
    min-width: 64px;
    text-align: center;
}
.main {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}
.main > .content { flex: 1 0 auto; }
.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px 18px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.82);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.app-footer a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }

@media (max-width: 820px) {
    .student-card-ranking-grid { grid-template-columns: 1fr; }
    .student-card-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .module-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
    .student-card-ranking-grid { padding: 0 14px 14px; }
    .student-card-ranking-grid > section { padding: 12px; }
    .student-card-list-head { display: block; }
    .student-card-list-head small { display: block; max-width: none; margin-top: 4px; text-align: left; }
    .student-card-self { align-items: flex-start; flex-wrap: wrap; margin: 0 14px 14px; }
    .student-card-self .btn { width: 100%; }
    .student-card-detail-hero { align-items: flex-start; flex-direction: column; }
    .student-card-metrics { grid-template-columns: 1fr; }
    .student-card-rank-score { font-size: 17px; }
    .student-card-privacy { margin: 0 14px 14px; }
    .module-filter-bar { margin: 0 14px 14px; }
    .module-filter-grid { grid-template-columns: 1fr; }
    .module-filter-reset { width: 100%; }
    .module-pagination { flex-wrap: wrap; padding: 14px; }
    .module-pagination > span { order: -1; width: 100%; min-width: 0; }
    .module-pagination .btn { flex: 1; }
    .app-footer { padding: 14px 16px; }
}
