:root {
  --ink: #17243b;
  --muted: #78859a;
  --line: #e8edf4;
  --blue: #4263eb;
  --sidebar: #17243b;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f6f8fc; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
a { text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 252px; padding: 26px 17px 18px; background: var(--sidebar); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand:hover { color: #fff; }
.brand small { display: block; margin-top: 3px; color: #9eabc0; font-size: 11px; font-weight: 400; letter-spacing: .1px; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: linear-gradient(140deg, #6684ff, #3858df); font-size: 18px; }
.nav-label { margin: 39px 10px 11px; color: #8290a8; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.settings-label { margin-top: 26px; }
.side-nav { display: grid; gap: 4px; }
.side-nav .nav-link { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; border-radius: 8px; color: #bdc8da; font-size: 13px; }
.side-nav .nav-link:hover:not(.disabled), .side-nav .nav-link.active { background: #263650; color: #fff; }
.side-nav .nav-link.active { box-shadow: inset 3px 0 #7892ff; }
.nav-icon { display: inline-grid; width: 17px; place-items: center; color: #9aabc3; font-size: 16px; }
.side-nav .active .nav-icon { color: #96a9ff; }
.side-nav .disabled { cursor: default; opacity: .58; }
.coming { margin-left: auto; color: #a3b0c5; font-size: 9px; }
.sidebar-bottom { margin-top: auto; }
.help-card { display: grid; gap: 5px; margin: 0 4px 15px; padding: 13px; border: 1px solid #34435c; border-radius: 10px; color: #e2e8f1; font-size: 12px; }
.help-card span { color: #a2aec1; font-size: 11px; line-height: 1.5; }
.sidebar-bottom form { margin: 0; }
.logout-link { width: 100%; border: 0; background: transparent; text-align: left; }
.main-panel { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.topbar-school { color: #68758a; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #e9edff; color: #435fe0; font-size: 13px; font-weight: 700; }
.user-chip-name { font-size: 12px; font-weight: 600; }
.user-chip-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.menu-toggle { display: none; border: 0; background: none; color: var(--ink); font-size: 20px; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 34px 38px 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 7px; color: #7788a6; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
h1 { margin: 0; color: var(--ink); font-size: clamp(24px, 3vw, 29px); font-weight: 700; letter-spacing: -.7px; }
.muted { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.date-pill { padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #64728a; font-size: 12px; }
.date-pill span { margin-right: 5px; color: #8093b3; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card, .panel-card, .form-panel { border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(27, 46, 79, .025); }
.stat-card { min-height: 143px; padding: 17px 18px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #6d7a90; font-size: 12px; }
.stat-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 15px; }
.stat-icon.blue { background: #edf2ff; color: #5574ea; }
.stat-icon.violet { background: #f2edff; color: #8b67df; }
.stat-icon.green { background: #eaf8f1; color: #39a878; }
.stat-icon.amber { background: #fff5e7; color: #dc9a37; }
.stat-value { margin-top: 13px; font-size: 27px; font-weight: 700; letter-spacing: -.7px; }
.stat-value small { margin-left: 2px; color: #738098; font-size: 16px; }
.stat-note { margin-top: 3px; color: #97a1b2; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; }
.panel-card { min-height: 302px; padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.coming-label { padding: 6px 8px; border-radius: 6px; background: #f3f5fa; color: #8793a7; font-size: 9px; white-space: nowrap; }
.empty-chart { position: relative; display: grid; min-height: 218px; place-items: center; margin-top: 10px; }
.chart-placeholder { position: absolute; inset: 27px 2px 6px; display: flex; align-items: end; justify-content: space-around; border-bottom: 1px solid #edf0f5; background: repeating-linear-gradient(to bottom, transparent 0, transparent 44px, #f1f3f7 45px, transparent 46px); opacity: .65; }
.chart-placeholder span { width: 7%; height: 18%; border-radius: 5px 5px 0 0; background: #e3e9ff; }
.chart-placeholder span:nth-child(2n) { height: 27%; }
.chart-placeholder span:nth-child(3n) { height: 39%; }
.empty-state { position: relative; display: grid; max-width: 260px; justify-items: center; gap: 7px; padding: 15px; border: 1px solid #eef1f7; border-radius: 10px; background: rgba(255,255,255,.96); text-align: center; }
.empty-icon { color: #7890e9; font-size: 21px; }
.empty-state strong { font-size: 11px; }
.empty-state > span:last-child { color: var(--muted); font-size: 10px; line-height: 1.5; }
.activity-empty { display: flex; align-items: flex-start; gap: 11px; margin-top: 23px; }
.activity-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #5a76ed; box-shadow: 0 0 0 4px #eef1ff; }
.muted-dot { background: #bcc6d5; box-shadow: 0 0 0 4px #f2f4f8; }
.activity-empty > div { display: grid; flex: 1; gap: 4px; }
.activity-empty strong { font-size: 11px; }
.activity-empty span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.activity-empty time { color: #9ca7b7; font-size: 10px; white-space: nowrap; }
.setup-banner { display: flex; align-items: center; gap: 14px; margin-top: 17px; padding: 16px 18px; border: 1px solid #e2e8ff; border-radius: 10px; background: #f0f3ff; }
.setup-symbol { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #e0e7ff; color: #4b67e7; }
.setup-banner strong { font-size: 12px; }
.setup-banner p { margin: 4px 0 0; color: #77839a; font-size: 11px; line-height: 1.5; }
.setup-banner .btn { flex: 0 0 auto; margin-left: auto; font-size: 11px; }
.form-panel { max-width: 850px; padding: 25px; }
.form-label { margin-bottom: 6px; color: #44516a; font-size: 12px; font-weight: 600; }
.form-control, .form-select { min-height: 41px; border-color: #e1e6ef; border-radius: 7px; font-size: 13px; }
textarea.form-control { min-height: 85px; }
.form-control:focus, .form-select:focus { border-color: #9aabff; box-shadow: 0 0 0 .2rem rgba(66,99,235,.12); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf0f5; }
.btn-primary { border-color: var(--blue); background: var(--blue); }
.btn-primary:hover { border-color: #3453d8; background: #3453d8; }
.field-error { margin-top: 5px; color: #c33b4b; font-size: 11px; }
.messages { margin-bottom: 18px; }
.messages .alert { font-size: 13px; }
.auth-shell { display: flex; min-height: 100vh; flex-direction: column; align-items: center; padding: 34px 20px; background: radial-gradient(ellipse at 50% 0, #eaf0ff 0, #f6f8fc 52%); }
.auth-brand { align-self: flex-start; margin: 0 max(calc((100vw - 1060px) / 2), 0px) 25px; color: var(--ink); }
.auth-brand:hover { color: var(--ink); }
.auth-brand small { color: #7d899d; }
.auth-card { width: min(100%, 430px); padding: 30px; border: 1px solid #e8edf4; border-radius: 14px; background: #fff; box-shadow: 0 13px 45px rgba(28, 48, 86, .08); }
.auth-card h1 { font-size: 24px; }
.auth-card .muted { margin-bottom: 23px; line-height: 1.55; }
.auth-card .form-label { display: block; }
.auth-card .form-control { width: 100%; }
.auth-submit { min-height: 44px; margin-top: 5px; font-size: 13px; font-weight: 600; }
.auth-submit span { float: right; font-size: 17px; line-height: 1; }
.auth-switch { margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf0f5; color: #748097; font-size: 12px; text-align: center; }
.auth-switch a { color: #3f5fdc; font-weight: 600; }
.auth-footer { margin-top: 22px; color: #9ba5b4; font-size: 10px; }
.auth-footer span { margin: 0 4px; }
.register-card { width: min(100%, 670px); }
.register-card .form-section-title { margin: 19px 0 12px; color: #40506b; font-size: 12px; font-weight: 700; }
.register-card .form-section-title:first-of-type { margin-top: 0; }
.register-card .auth-switch { margin-top: 19px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(10,20,40,.22); }
  .main-panel { margin-left: 0; }
  .topbar { height: 62px; padding: 0 17px; }
  .menu-toggle { display: block; }
  .topbar-school { margin-right: auto; margin-left: 13px; }
  .user-chip-name { display: none; }
  .page-content { padding: 25px 17px 36px; }
  .page-heading { align-items: flex-start; }
  .date-pill { margin-top: 4px; white-space: nowrap; }
  .stat-grid { gap: 11px; }
  .stat-card { min-height: 132px; padding: 14px; }
  .stat-note { line-height: 1.4; }
  .setup-banner { align-items: flex-start; flex-wrap: wrap; }
  .setup-banner .btn { margin-left: 48px; }
  .auth-shell { padding: 22px 14px; }
  .auth-brand { margin: 0 0 22px; }
  .auth-card { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 12px; }
  .stat-top { font-size: 11px; }
  .stat-value { font-size: 24px; }
  .date-pill { padding: 8px; font-size: 10px; }
}
