/* Shared shell for the student + admin dashboards.
   Layout concept: a calm light workspace with a slim dark rail; big rounded panels; one dark "hero" card per view. */
:root { --rail: #0b0c0f; --panel: #ffffff; --soft: #f5f6f8; --ok: #1f9d55; --warn: #b7791f; --bad: #d64545; }
body.dash { background: #eceef1; min-height: 100svh; }
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100svh; }
.rail { position: sticky; top: 0; height: 100svh; background: var(--rail); color: #f2f4f7; display: flex; flex-direction: column; padding: calc(22px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); }
.rail .brand { color: #f2f4f7; padding: 4px 10px 22px; }
.rail nav { display: grid; gap: 4px; }
.rail a, .rail button.navb { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #a9afb9; text-decoration: none; font: 500 14px var(--f-body); border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.rail a:hover, .rail button.navb:hover { color: #fff; background: rgba(255,255,255,.06); }
.rail a.on { color: #0b0c0f; background: #f2f4f7; }
.rail svg { width: 18px; height: 18px; flex: none; }
.rail .grow { flex: 1; }
.rail .me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); margin-top: 12px; }
.rail .me .av { width: 36px; height: 36px; border-radius: 50%; background: #2a5bff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.rail .me b { display: block; font-size: 13px; font-weight: 500; }
.rail .me span { font-family: var(--f-hud); font-size: 10px; color: #8b93a1; }
.main { min-width: 0; padding: calc(24px + env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-right, 0px)) 60px 28px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.04em; }
.top .sub { color: var(--dim); font-size: 14px; margin-top: 4px; }
.top .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo-pill { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px; background: #fff4e5; color: #8a5a00; font-size: 12px; border: 1px solid #f5d9a8; }
.panel { background: var(--panel); border-radius: 24px; padding: 22px; border: 1px solid rgba(12,14,18,.06); min-width: 0; }
.panel h2 { font-size: 18px; letter-spacing: -.02em; font-weight: 500; }
.panel .ph { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel .ph .hud { font-size: 10px; }
.grid { display: grid; gap: 16px; }
.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.k2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 8px; }
.kpi .lbl { font-size: 13px; color: var(--dim); }
.kpi .val { font-family: var(--f-display); font-size: 30px; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .meta { font-size: 12px; color: var(--dim); }
.kpi.dark { background: #0b0c0f; color: #f2f4f7; border-color: #0b0c0f; }
.kpi.dark .lbl, .kpi.dark .meta { color: #a9afb9; }
.bar { height: 8px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; background: var(--cyan); }
.kpi.dark .bar { background: rgba(255,255,255,.12); }
.kpi.dark .bar i { background: #f2f4f7; }
.section { margin-top: 16px; scroll-margin-top: 20px; }
.tbl-wrap { overflow-x: auto; margin: 0 -6px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--soft); color: #3a404a; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: #e7f6ee; color: var(--ok); } .pill.warn { background: #fdf3e2; color: var(--warn); } .pill.bad { background: #fdeaea; color: var(--bad); } .pill.blue { background: #e8eeff; color: #2a5bff; }
.empty { padding: 28px; text-align: center; color: var(--dim); font-size: 14px; border: 1.5px dashed var(--line); border-radius: 18px; }
.input, select.input, textarea.input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--chrome); font: inherit; font-size: 14px; }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(42,91,255,.12); }
.btn.sm { padding: 9px 14px; font-size: 13px; }
.btn.light { background: #fff; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: #0b0c0f; color: #fff; font-size: 14px; transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.drawer-veil { position: fixed; inset: 0; z-index: 70; background: rgba(11,12,15,.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.drawer { position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; padding: calc(24px + env(safe-area-inset-top, 0px)) 26px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; box-shadow: -30px 0 80px rgba(0,0,0,.18); }
.drawer .x { position: absolute; right: 18px; top: calc(18px + env(safe-area-inset-top, 0px)); }
.loading { padding: 80px 20px; text-align: center; color: var(--dim); }
@media (max-width: 1100px) { .k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .k2, .k3 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 60; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; align-items: center; padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)); overflow-x: auto; }
  .rail .brand, .rail .grow, .rail .me, .rail .hide-m { display: none; }
  .rail nav { display: flex; gap: 2px; }
  .rail a, .rail button.navb { flex-direction: column; gap: 4px; font-size: 10px; padding: 8px 10px; white-space: nowrap; }
  .main { padding: calc(18px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); }
  .k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.entry:last-child { border-bottom: 0; }
.entry b { font-family: var(--f-display); font-weight: 500; font-variant-numeric: tabular-nums; }
.entry .x { border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 18px; padding: 4px 8px; }
