/* Kashmeta campus portal (teachers, reviewers, administrators, learners). System font, no external resources. */
:root {
  color-scheme: light;
  --page: #f3f4f7; --surface: #ffffff; --surface-2: #f7f8fa; --ink: #0f1220; --ink-2: #4d5060; --muted: #7d7f8a; --hair: #e3e4e9; --axis: #c6c8d0;
  --shadow: 0 1px 2px rgba(15, 18, 32, 0.06), 0 4px 16px rgba(15, 18, 32, 0.05);
  --brand: #0b1033; --brand-2: #151b4d; --cyan: #22d3ee; --accent: #2a78d6; --accent-ink: #1c5cab; --focus-ring: #2a78d6;
  --series-1: #2a78d6; --series-2: #eb6834; --wash: rgba(42, 120, 214, 0.10);
  --s-good: #0ca30c; --s-warn: #fab219; --s-serious: #ec835a; --s-crit: #d03b3b; --s-neutral: #8f919c;
  --good-text: #006300; --crit-text: #b42828; --warn-text: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0f; --surface: #1a1a1c; --surface-2: #212124; --ink: #f0eff2; --ink-2: #c4c3cc; --muted: #8d8c96; --hair: #2d2d31; --axis: #3b3b40;
    --shadow: none; --accent: #3987e5; --accent-ink: #86b6ef; --series-1: #3987e5; --series-2: #d95926; --wash: rgba(57, 135, 229, 0.16);
    --good-text: #0ca30c; --crit-text: #f07070; --warn-text: #fab219;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0f; --surface: #1a1a1c; --surface-2: #212124; --ink: #f0eff2; --ink-2: #c4c3cc; --muted: #8d8c96; --hair: #2d2d31; --axis: #3b3b40;
  --shadow: none; --accent: #3987e5; --accent-ink: #86b6ef; --series-1: #3987e5; --series-2: #d95926; --wash: rgba(57, 135, 229, 0.16);
  --good-text: #0ca30c; --crit-text: #f07070; --warn-text: #fab219;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; text-decoration: none; }
.logo-img { height: 28px; width: auto; display: block; flex: none; }   /* the official Kashmeta logo */
.brand .brand-tag { border-left: 1px solid rgba(255,255,255,.22); padding-left: 12px; }
.brand b { letter-spacing: 0.14em; font-size: 15px; display: block; }
.brand span { color: #b9c3e6; font-size: 12px; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user .who { text-align: right; line-height: 1.25; }
.user .who small { color: #b9c3e6; display: block; }
.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; text-decoration: none; }
.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 50px); }
nav.side { background: var(--surface); border-right: 1px solid var(--hair); padding: 14px 10px; }
nav.side h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 16px 10px 6px; }
nav.side a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
nav.side a:hover { background: var(--surface-2); color: var(--ink); }
nav.side a.on { background: var(--wash); color: var(--accent-ink); font-weight: 600; }
main#view { padding: 22px 28px 60px; min-width: 0; max-width: 1280px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; border-bottom: 1px solid var(--hair); padding: 8px 12px; }
  nav.side h4 { display: none; }
  main#view { padding: 16px; }
  .user .who { display: none; }
}

/* ---------------------------------------------------------------- page parts */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 22px; margin: 0; }
.head p { margin: 4px 0 0; color: var(--muted); }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.card h3 { font-size: 13.5px; margin: 14px 0 6px; }
.card > p.lead, .muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 14px 16px; }
.tile .l { font-size: 12.5px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 600; margin-top: 2px; }
.tile .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.hero { font-size: 48px; font-weight: 600; line-height: 1.05; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--hair); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--crit-text); }
.btn.small { padding: 4px 9px; font-size: 12px; font-weight: 500; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: 10px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--hair); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
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; }
table.t tr:hover td { background: var(--surface-2); }
table.grid td.cell { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 230px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* chips and status (always icon + label) */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--hair); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--s-neutral); flex: none; }
.chip.good i { background: var(--s-good); } .chip.good { color: var(--good-text); }
.chip.warn i { background: var(--s-warn); } .chip.warn { color: var(--warn-text); }
.chip.crit i { background: var(--s-crit); } .chip.crit { color: var(--crit-text); }
.chip.info i { background: var(--accent); }
.mark { font-weight: 700; }
.mark.ok { color: var(--good-text); } .mark.no { color: var(--crit-text); }

/* forms */
form.f, .f { display: grid; gap: 12px; }
.f label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.f input[type=text], .f input[type=email], .f input[type=number], .f input[type=date], .f input[type=time], .f input[type=url], .f input[type=password], .f input[type=search], .f select, .f textarea,
input.in, select.in, textarea.in { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--hair); background: var(--surface); font-weight: 400; color: var(--ink); width: 100%; }
.f textarea, textarea.in { min-height: 70px; resize: vertical; }
.f .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.f .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.f .check input { margin-top: 3px; }
.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.error { color: var(--crit-text); font-size: 13px; }
fieldset { border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.picklist { max-height: 340px; overflow-y: auto; border: 1px solid var(--hair); border-radius: 10px; }
.picklist label { display: grid; grid-template-columns: 20px 1fr auto; gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--hair); font-weight: 400; cursor: pointer; }
.picklist label:last-child { border-bottom: 0; }
.picklist .meta { grid-column: 2; font-size: 12px; color: var(--muted); }
.codebox { font: 600 22px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.16em; background: var(--surface-2); border: 1px dashed var(--axis); border-radius: 10px; padding: 10px 14px; display: inline-block; }
.copy { display: grid; grid-template-columns: 170px 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.copy code { background: var(--surface-2); padding: 5px 8px; border-radius: 6px; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
@media (max-width: 700px) { .copy { grid-template-columns: 1fr; } }

/* dialogs and toasts */
dialog { border: 1px solid var(--hair); border-radius: 14px; padding: 0; width: min(720px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
dialog::backdrop { background: rgba(8, 10, 20, 0.45); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--hair); }
dialog .dh h3 { margin: 0; font-size: 16px; }
dialog .db { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
dialog .df { padding: 12px 18px; border-top: 1px solid var(--hair); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; }
.toast.err { background: var(--s-crit); color: #fff; }

/* charts (single-series bars, dumbbell); values also in tables */
.bars { display: grid; gap: 8px; }
.bars .bar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.bars .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 14px; position: relative; border-left: 1px solid var(--axis); }
.bars .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 0 4px 4px 0; max-width: 100%; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--muted); font-size: 11px; }
svg.chart .grid { stroke: var(--hair); stroke-width: 1; }
svg.chart .rowline { stroke: var(--axis); stroke-width: 2; }
svg.chart .d1 { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
svg.chart .d2 { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
svg.chart .hit { fill: transparent; cursor: default; }
svg.chart .hit:hover + .dot, svg.chart g.r:hover .dot { filter: brightness(1.1); }
#tip { position: fixed; pointer-events: none; z-index: 70; background: var(--surface); color: var(--ink); border: 1px solid var(--hair); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 320px; }
#tip b { font-size: 14px; }
#tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }

/* case editor */
.step { border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.step h3 { margin: 0 0 8px; font-size: 14px; }
.opt { display: grid; grid-template-columns: 26px 1fr; gap: 6px 8px; align-items: start; margin-bottom: 8px; }
.opt .fb { grid-column: 2; }
.persona { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--ink-2); }
.q { border: 1px solid var(--hair); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.q p { margin: 0 0 8px; font-weight: 600; }
.q label { display: flex; gap: 8px; padding: 4px 0; font-weight: 400; }
.likert { display: grid; grid-template-columns: 1fr repeat(5, 44px); gap: 4px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.likert span.h { font-size: 11px; color: var(--muted); text-align: center; }
.likert input { justify-self: center; }

/* ---------------------------------------------------------------- lecture slides */
.small { font-size: 12.5px; }
.drop { border: 2px dashed var(--axis); border-radius: 12px; padding: 22px 16px; display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer; background: var(--surface-2); }
.drop .big { font-size: 15px; font-weight: 600; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--wash); }
.uploading { display: flex; gap: 12px; align-items: center; border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.uploading .grow { flex: 1; display: grid; gap: 6px; min-width: 0; }
.upthumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--hair); overflow: hidden; flex: none; }
.upthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.progress { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.25s; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.deck { border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; background: var(--surface); display: grid; grid-template-rows: auto 1fr auto; }
.deck .pic { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--hair); }
.deck .pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.deck .nothumb { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--warn-text); font-size: 12.5px; }
.deck .info { padding: 10px 12px 4px; display: grid; gap: 3px; min-width: 0; }
.deck .info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck .info .muted { font-size: 12.5px; }
.deck .chips { margin-top: 4px; }
.deck > .actions { padding: 8px 12px 12px; }
.deck.unfinished { border-style: dashed; }
img.slideview { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 8px; display: block; }
.slidenav { justify-content: center; margin-top: 10px; }
ol.steps { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 8px; }
ol.steps code { font-size: 12.5px; }

/* ---------------------------------------------------------------- safety */
.reports { display: grid; gap: 12px; }
.report { border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.report.urgent { border-color: var(--s-crit); box-shadow: inset 4px 0 0 var(--s-crit); }
.report .rhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report .rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .report .rgrid { grid-template-columns: 1fr; } }
.report .rnote { margin: 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ids { overflow-wrap: anywhere; }
.actions input.in { width: auto; min-width: 240px; }
