/* iSchool Grading Studio: polished components (loaded after app.css) */
.boot { min-height: 100vh; display: grid; place-items: center; gap: 12px; background: var(--bg); }
.boot img { height: 54px; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.small { font-size: .78rem; } .block { display: block; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.card.empty { display: flex; gap: 10px; justify-content: center; align-items: center; }

/* sidebar */
.nav-title { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; opacity: .65; margin: 14px 10px 4px; font-weight: 800; }
nav a .ico { display: inline-flex; width: 22px; justify-content: center; }
nav a .ico svg { width: 19px; height: 19px; }
.nav-badge { margin-left: auto; font-style: normal; background: var(--orange); color: #fff; border-radius: 999px; font-size: .68rem; padding: 1px 8px; font-weight: 800; }
nav a.active .nav-badge { background: var(--blue); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; background: var(--soft); color: var(--dark); }
.avatar.sm.green { background: #16A34A1f; color: var(--green); } .avatar.sm.red { background: #DC26261c; color: var(--red); }
.avatar.sm.amber { background: #C763161c; color: var(--amber); } .avatar.sm.blue { background: #056FEC1a; color: var(--blue); }
.side-foot { gap: 10px; } .side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.26); }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: rgba(243,249,254,.92); backdrop-filter: blur(8px); padding: 10px 0; margin: -18px 0 14px; }
.run-pick { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; color: var(--blue); }
.run-pick select { border: 0; font-weight: 800; min-width: 220px; background: transparent; padding: 6px; }
.chip.ghost { color: var(--muted); background: transparent; font-weight: 600; }
.chip.pulse:before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: pulse 1.4s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.btn span svg { width: 16px; height: 16px; vertical-align: -3px; }

/* page structure */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin-bottom: 2px; } .page-head p { margin: 0; max-width: 760px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 10px; } .section-head h2 { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .card-head h3 { margin-bottom: 8px; }
.count { font-weight: 800; color: var(--dark); background: var(--soft); border-radius: 999px; padding: 6px 14px; }
.actions.col { flex-direction: column; align-items: stretch; }
.grid2.top { align-items: start; }

/* dashboard */
.hero { position: relative; overflow: hidden; }
.hero:after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #FFD70033, transparent 70%); }
.hero-text { flex: 1; } .hero-text h1 { margin: 0; }
.hero-ring { position: relative; width: 110px; height: 110px; display: grid; place-content: center; text-align: center; z-index: 1; }
.hero-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hero-ring circle { fill: none; stroke-width: 11; } .ring-bg { stroke: #E3F0FA; }
.ring { stroke: var(--blue); stroke-dasharray: 314; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.hero-ring b { font: 700 1.25rem Alexandria, sans-serif; line-height: 1; } .hero-ring small { color: var(--muted); font-size: .7rem; display: block; }
.kpi { display: flex; gap: 12px; align-items: flex-start; transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(5,111,236,.10); }
.kpi-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--accent, var(--blue)); background: color-mix(in srgb, var(--accent, var(--blue)) 12%, white); flex: none; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-box { position: relative; height: 240px; }
.sheet { transition: transform .15s ease, box-shadow .15s ease; } .sheet:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(5,111,236,.12); }
.sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tag.blue { color: var(--blue); background: #056FEC1a; } .tag.dark { color: var(--dark); background: #043FAD1a; }

/* students */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 7px 14px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; font: inherit; color: var(--muted); transition: all .15s ease; }
.pill b { font: 700 1.05rem Alexandria, sans-serif; color: var(--ink); }
.pill:hover { border-color: var(--blue); }
.pill.on { background: var(--dark); border-color: var(--dark); color: #DCEBFF; } .pill.on b { color: #fff; }
.pill.green b { color: var(--green); } .pill.amber b { color: var(--amber); } .pill.orange b { color: #E26A0A; } .pill.red b { color: var(--red); } .pill.grey b { color: var(--grey); }
.pill.on.green b, .pill.on.amber b, .pill.on.orange b, .pill.on.red b, .pill.on.grey b { color: var(--yellow); }
.filters .search { flex: 1; min-width: 220px; }
.filters .range .inline input { width: 72px; } .filters .range em { font-style: normal; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; flex-wrap: wrap; }
.toolbar .seg { margin: 0; }
.toolbar label.inline { margin: 0 0 0 auto; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.toolbar select { width: auto; margin: 0; }
.sid { display: flex; gap: 10px; align-items: center; }
.table.sticky thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.table-wrap { max-height: 70vh; overflow: auto; padding: 0; }
.table-wrap .table td, .table-wrap .table th { padding-left: 12px; }
.table tbody tr:nth-child(even) { background: #FAFDFF; }
.table tr.fresh td { animation: fresh 2.5s ease-out 1; }
@keyframes fresh { 0% { background: #FFF6BF; } 100% { background: transparent; } }
.sort { color: var(--blue); margin-left: 4px; }
.score-pill { display: inline-block; min-width: 64px; text-align: center; font-weight: 800; border-radius: 999px; padding: 3px 10px; font-size: .82rem; }
.score-pill.green { color: var(--green); background: #16A34A1a; } .score-pill.blue { color: var(--blue); background: #056FEC1a; }
.score-pill.red { color: var(--red); background: #DC26261a; } .score-pill.amber { color: var(--amber); background: #C763161a; } .score-pill.grey { color: var(--grey); background: #94A3B81a; }
.mini-bar { display: inline-block; vertical-align: middle; margin-right: 6px; }
.mini-bar > div.green { background: var(--green); } .mini-bar > div.red { background: var(--red); } .mini-bar > div.amber { background: var(--amber); }
.pager .muted { margin-right: auto; }
.table.grid { font-size: .8rem; }
.table.grid th.cell-head { text-align: center; padding: 6px 4px; font-size: .68rem; }
.table.grid td.cell { text-align: center; font-weight: 800; padding: 6px 4px; border-left: 2px solid #fff; }
.c-met { background: #16A34A26; color: var(--green); } .c-not { background: #DC26261f; color: var(--red); } .c-na { background: #C763161c; color: var(--amber); }
.rate-row td { background: var(--soft); text-align: center; font-weight: 800; }
td.ok { color: var(--green); font-weight: 800; } td.warn { color: var(--amber); font-weight: 800; }

/* segmented controls */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; margin-bottom: 12px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font: 800 .82rem Nunito, sans-serif; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--blue); } .seg button.on { background: var(--blue); color: #fff; }
.seg.small { margin: 0; } .seg.small button { padding: 4px 11px; font-size: .76rem; }
.seg.big button { padding: 8px 18px; font-size: .9rem; }

/* student detail */
.task-head { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 2px 8px; } .task-head h3 { margin: 0; }
.crit { border-left: 5px solid var(--line); }
.crit.edge-green { border-left-color: var(--green); } .crit.edge-red { border-left-color: var(--red); } .crit.edge-amber { border-left-color: var(--amber); }
.cid { background: var(--soft); color: var(--dark); border-radius: 8px; padding: 1px 8px; font-size: .8rem; }
.cname { font-weight: 700; flex: 1; min-width: 200px; }
.detail-head h1 { margin: 2px 0; }

/* audit */
.queue .q { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 12px; cursor: pointer; text-align: left; font: inherit; }
.queue .q small { display: block; color: var(--muted); font-size: .72rem; }
.queue .q.AIflag { border-color: #FFB27A; } .queue .q.similarity { border-color: #FFD58A; }
.queue .q:hover { border-color: var(--blue); } .queue .q.done { opacity: .45; }

/* rules */
.settings label { background: #FBFDFF; border: 1px solid #E6F1FA; border-radius: 12px; padding: 10px 12px; margin: 0; }
.settings label small { display: block; margin-top: 4px; font-weight: 400; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; margin-top: 6px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #CBD5E1; border-radius: 999px; transition: .2s; }
.switch i:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--blue); } .switch input:checked + i:before { transform: translateX(20px); }
.sticky-save { position: sticky; bottom: 12px; display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; width: fit-content; box-shadow: 0 8px 24px rgba(4,63,173,.12); }
ul.rules { list-style: none; padding: 0; margin: 6px 0; } ul.rules li { background: var(--soft); border-radius: 10px; padding: 6px 10px; margin: 4px 0; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; font-weight: 700; padding: 0 4px; } .link.danger { color: var(--red); }

/* runs */
.runs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.run-card.live { border-color: var(--green); box-shadow: 0 0 0 3px #16A34A1a; } .run-card.current { outline: 2px solid var(--blue); }
.run-card .crit-top { justify-content: space-between; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover { border-color: var(--blue); color: var(--blue); }
.drop span { display: block; font-weight: 600; }

/* how it works */
.flow-card { padding: 10px; overflow-x: auto; }
.flow { width: 100%; min-width: 900px; height: auto; display: block; }
.flow-line { fill: none; stroke: #CAE2F0; stroke-width: 6; stroke-dasharray: 2 14; stroke-linecap: round; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.flow-dot { fill: var(--orange); filter: drop-shadow(0 0 6px #FF7F1C); }
.flow-dot.two { fill: var(--yellow); filter: drop-shadow(0 0 6px #FFD700); }
.node { cursor: pointer; }
.node rect { fill: #fff; stroke: var(--line); stroke-width: 2; animation: glow 12s ease-in-out infinite; animation-delay: var(--d); }
@keyframes glow { 0%, 10% { stroke: var(--blue); stroke-width: 4; fill: #ECF8FF; } 14%, 100% { stroke: var(--line); stroke-width: 2; fill: #fff; } }
.node:hover rect { stroke: var(--blue); }
.node.sel rect { stroke: var(--orange); stroke-width: 4; fill: #FFF7EF; animation: none; }
.node .badge-dot { fill: var(--blue); } .node.sel .badge-dot { fill: var(--orange); }
.node .num { fill: #fff; font: 800 14px Nunito, sans-serif; }
.node .lbl { fill: var(--ink); font: 700 17px Alexandria, sans-serif; }
.node .sub { fill: var(--muted); font: 600 12.5px Nunito, sans-serif; }
.flow-card.paused .flow-line, .flow-card.paused .node rect { animation-play-state: paused; }
.flow-card.paused .flow-dot { display: none; }
.step-detail { border-left: 6px solid var(--orange); }
.step-detail h2 { margin-top: 2px; } .step-detail li { margin: 6px 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; margin-top: 6px; }
.run-step { position: relative; padding-top: 22px; animation: rise .5s ease both; animation-delay: var(--d); }
.run-step .step-no { position: absolute; top: -12px; left: 16px; background: var(--orange); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; box-shadow: 0 4px 10px #FF7F1C55; }
.run-step .kpi-ico { --accent: var(--blue); margin-bottom: 6px; }
.run-step p { color: var(--muted); font-size: .88rem; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 1100px) { .steps, .kpis.three { grid-template-columns: 1fr 1fr; } .guide-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .steps, .kpis.three { grid-template-columns: 1fr; } .top { position: static; margin-top: 0; } .toolbar label.inline { margin-left: 0; } }

/* Export page */
.export-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px;margin-bottom:14px}
.export-card{display:flex;align-items:center;gap:14px;text-decoration:none;color:inherit;transition:transform .15s,box-shadow .15s}
.export-card:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(5,111,236,.15)}
.export-card div{flex:1;display:flex;flex-direction:column;gap:2px}
.export-kind{font:800 12px/1 Nunito,sans-serif;padding:10px 8px;border-radius:10px;min-width:48px;text-align:center;color:#fff;background:var(--blue,#056FEC)}
.export-kind.xlsx{background:#16A34A}.export-kind.json{background:#FF7F1C}.export-kind.csv{background:#043FAD}
.export-dl{color:var(--blue,#056FEC)}

/* Plain-language explanation for unverifiable criteria */
.explain-check{margin:6px 0 2px;padding:8px 12px;border-radius:10px;background:var(--sky-soft,#ECF8FF);color:var(--text,#0f172a);font-size:14px}
.explain-check b{color:#C76316}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .explain-check{background:rgba(5,172,255,.12);color:inherit}}
:root[data-theme="dark"] .explain-check{background:rgba(5,172,255,.12);color:inherit}

/* Run phase: similarity progress */
.chip.purple { color: #6D28D9; background: #7C3AED1f; }
.sim-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sim-steps .tag { font-size: 12px; }

/* Audit workspace */
.audit-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.audit-kind { display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer; border: 2px solid transparent; font: inherit; color: inherit; }
.audit-kind.on { border-color: var(--accent); box-shadow: 0 8px 22px rgba(5,111,236,.12); }
.audit-kind .kpi-ico { color: var(--accent); }
.audit-kind small { display: block; font-weight: 700; color: var(--muted, #64748B); }
.audit-kind b { font-size: 26px; color: var(--accent); margin-right: 6px; }
.audit-kind span:not(.kpi-ico) { font-size: 12px; color: var(--muted, #64748B); }
.mini-bar { height: 5px; border-radius: 4px; background: #E2E8F0; margin-top: 6px; overflow: hidden; }
.mini-bar div { height: 100%; background: var(--accent); }
.audit-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.audit-table td.finding { max-width: 340px; }
.audit-table tr.decided td { opacity: .78; }
.audit-table .row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.section-title { margin: 22px 0 10px; color: var(--dark, #043FAD); }
.tag.purple { color: #6D28D9; background: #7C3AED1f; }
.decision-bars { margin: 10px 0 14px; }
.decision-bars .stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #E2E8F0; margin: 6px 0 4px; }
.decision-bars .seg-confirmed { background: #DC2626; } .decision-bars .seg-cleared { background: #16A34A; }
.decision-bars .seg-follow_up { background: #FF7F1C; } .decision-bars .seg-open { background: #CBD5E1; }
.kpi-inline { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; } .kpi-inline b { font-size: 28px; color: var(--green, #16A34A); }
.audit-panel .decision-row { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid #E2E8F0; }
.audit-panel .decision-row:first-of-type { border-top: 0; }
.audit-panel .what, .audit-panel .current, .audit-panel .controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) { .audit-table .row-actions .seg { display: none; } }

/* Student: submission files & links */
.sources-card .link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.sources-card .link-row b { min-width: 96px; }
.sources-table td { vertical-align: top; }
.sources-table a.btn small { opacity: .75; margin-left: 4px; }

/* Accuracy & AI analysis tabs */
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
#chartAccSheets, #chartAccClasses, #chartAiSheets { min-height: 260px; }
section .chart-box:has(#chartAccSheets), section .chart-box:has(#chartAccClasses), section .chart-box:has(#chartAiSheets) { height: 290px; }
@media (max-width: 1100px) { .kpis.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .kpis.four { grid-template-columns: 1fr; } }
