/* KPSS Yoldaşım Yönetim Paneli — tasarım belirteçleri ve bileşenler
   Tek vurgu rengi (kobalt), sistem yazı tipi, 4px aralık ölçeği, ince çizgili yüzeyler. */

:root {
  color-scheme: light;
  --page: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --ink: #15171c;
  --ink-2: #5c6270;
  --muted: #8a909c;
  --line: #e4e6eb;
  --line-strong: #cfd3db;
  --accent: #2a63d6;
  --accent-ink: #1f4fb3;
  --accent-soft: #e6eefc;
  --accent-soft-2: #c9d9f8;
  --on-accent: #ffffff;
  --good: #0ca30c;
  --good-ink: #0a6d0a;
  --good-soft: #e3f5e3;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --warn-soft: #fff1cf;
  --bad: #d03b3b;
  --bad-ink: #b02e2e;
  --bad-soft: #fbe4e4;
  --shadow-pop: 0 12px 32px rgba(21, 23, 28, 0.14), 0 1px 2px rgba(21, 23, 28, 0.08);
  --grid: #e6e8ec;
  --axis: #c3c6cd;
  --series-1: #2a63d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #6250d6;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --sidebar-w: 236px;
  --bottom-nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121418;
    --surface: #1b1e24;
    --surface-2: #20242b;
    --surface-3: #2a2f38;
    --ink: #eef0f3;
    --ink-2: #aab0bb;
    --muted: #7d8490;
    --line: #2b2f38;
    --line-strong: #3b404b;
    --accent: #5b8af0;
    --accent-ink: #86a9f5;
    --accent-soft: #1f2d4d;
    --accent-soft-2: #2b3f6b;
    --on-accent: #0b1430;
    --good: #0ca30c;
    --good-ink: #5ccf5c;
    --good-soft: #15301a;
    --warn: #fab219;
    --warn-ink: #f0c25c;
    --warn-soft: #3a2d0e;
    --bad: #e05252;
    --bad-ink: #f08080;
    --bad-soft: #3d1c1c;
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --grid: #2b2f38;
    --axis: #3b404b;
    --series-1: #5b8af0;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #9085e9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121418;
  --surface: #1b1e24;
  --surface-2: #20242b;
  --surface-3: #2a2f38;
  --ink: #eef0f3;
  --ink-2: #aab0bb;
  --muted: #7d8490;
  --line: #2b2f38;
  --line-strong: #3b404b;
  --accent: #5b8af0;
  --accent-ink: #86a9f5;
  --accent-soft: #1f2d4d;
  --accent-soft-2: #2b3f6b;
  --on-accent: #0b1430;
  --good: #0ca30c;
  --good-ink: #5ccf5c;
  --good-soft: #15301a;
  --warn: #fab219;
  --warn-ink: #f0c25c;
  --warn-soft: #3a2d0e;
  --bad: #e05252;
  --bad-ink: #f08080;
  --bad-soft: #3d1c1c;
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --grid: #2b2f38;
  --axis: #3b404b;
  --series-1: #5b8af0;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #9085e9;
}

/* ---------- temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.ic-inline { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- yerleşim ---------- */
.app { min-height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.brand-name { font-weight: 600; line-height: 1.15; }
.brand-sub { font-size: 0.8125rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 20px; height: 20px; flex: none; opacity: 0.85; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.active svg { opacity: 1; }
.nav .nav-live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 0.875rem; color: var(--ink-2); }
.sidebar-user .who { font-weight: 500; color: var(--ink); }
.sidebar-user svg { width: 18px; height: 18px; flex: none; }
.sidebar-actions { display: flex; gap: 6px; }

.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 28px 32px 48px; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .lead { color: var(--ink-2); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head .hint { color: var(--muted); font-size: 0.875rem; }

.bottom-nav { display: none; }

/* ---------- butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), transform 80ms var(--ease);
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-strong)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-danger.btn-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 0.875rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; color: var(--ink-2);
  animation: spin 700ms linear infinite;
}
.btn-primary.is-busy::after { color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 7px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-invalid { border-color: var(--bad); }
.input-sm, .select-sm { min-height: 32px; padding: 4px 9px; font-size: 0.875rem; }
.input-xs { width: 5.5em; text-align: center; }
.input-time { width: 9em; }
.textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 0.875rem; }
.selectw { position: relative; display: inline-block; }
.selectw .select { appearance: none; padding-right: 32px; width: 100%; }
.selectw::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.selectw.block { display: block; }
.search { position: relative; }
.search .input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 0.75rem var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--surface-2); }
.field-error { color: var(--bad-ink); font-size: 0.875rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form-grid { display: grid; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.inline-save { font-size: 0.8125rem; color: var(--muted); min-width: 5em; }
.inline-save.ok { color: var(--good-ink); }
.inline-save.err { color: var(--bad-ink); }

/* anahtar (switch) */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line-strong); transition: background 120ms var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 140ms var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.5; }

/* çip ve parça (segmented) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 4px 12px; font-size: 0.875rem; font-weight: 500; cursor: pointer; min-height: 30px;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); }
.chip-sm { padding: 2px 9px; min-height: 26px; font-size: 0.8125rem; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: 0.875rem; min-height: 32px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.seg button:focus-visible { outline-offset: -2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; color: var(--ink-2); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-good { background: var(--good-soft); color: var(--good-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-plain::before { display: none; }
.pill-live { display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.pill-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.pill-live.off i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ---------- kartlar ve kutular ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 1rem; }
.card-body { padding: 16px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* istatistik şeridi */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat { padding: 16px 20px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .label { display: block; margin-bottom: 4px; }
.stat .value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.stat .sub { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }
.stat .sub b { color: var(--ink-2); font-weight: 500; }
.stat svg.spark { display: block; margin-top: 8px; width: 100%; height: 28px; }

/* ilerleme çubuğu */
.progress { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 400ms var(--ease); }
.progress.lg { height: 12px; }

/* canlı sınav kartı */
.live-card { border-left: 4px solid var(--accent); }
.live-card .live-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.live-card .live-q { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.live-card .live-q small { font-size: 0.875rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.live-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 0.875rem; margin-top: 8px; }

/* zaman çizelgesi listesi */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.timeline .exam { color: var(--ink-2); font-size: 0.875rem; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.feed li:first-child { border-top: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; background: var(--muted); }
.feed .dot.result { background: var(--accent); }
.feed .dot.exam { background: var(--good); }
.feed .dot.upload { background: var(--series-2); }
.feed .dot.user { background: var(--series-6); }
.feed time { margin-left: auto; color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }

/* ---------- tablolar ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 0.8125rem; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th .dir { opacity: 0.7; margin-left: 2px; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td .primary { font-weight: 500; color: var(--ink); }
.table td .secondary { color: var(--muted); font-size: 0.8125rem; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--ink-2); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager .btn { min-width: 32px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.toolbar .select { width: auto; }

/* ---------- boş / yükleniyor ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty svg { width: 40px; height: 40px; color: var(--muted); margin: 0 auto 10px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 6px; min-height: 1em; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.skel-rows .skeleton { height: 16px; }
.skel-rows .skeleton:nth-child(odd) { width: 70%; }
.skel-rows .skeleton:nth-child(even) { width: 90%; }
.loading-bar { height: 2px; background: var(--accent); position: fixed; top: 0; left: 0; width: 0; z-index: 50; transition: width 300ms var(--ease), opacity 300ms; opacity: 0; }
.loading-bar.on { opacity: 1; width: 70%; }
.loading-bar.done { width: 100%; opacity: 0; }

/* ---------- bildirim ve modal ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--ink); color: var(--page); box-shadow: var(--shadow-pop); font-size: 0.9375rem; animation: toast-in 200ms var(--ease); }
.toast .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast-ok .ic { color: #5ccf5c; }
.toast-err .ic { color: #f08080; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.7; cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, 0.5); display: grid; place-items: center; padding: 16px; z-index: 90; animation: fade 140ms var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow-pop); animation: pop 160ms var(--ease); }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 14px 22px; color: var(--ink-2); }
.modal-body p + p { margin-top: 8px; }
.modal-foot { padding: 8px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 12, 16, 0.88); z-index: 95; display: grid; place-items: center; cursor: zoom-out; animation: fade 140ms var(--ease); }
.lightbox img { max-width: 94vw; max-height: 90dvh; border-radius: 6px; box-shadow: var(--shadow-pop); cursor: zoom-in; transition: transform 200ms var(--ease); }
.lightbox img.zoomed { transform: scale(1.8); cursor: zoom-out; }
.lightbox .cap { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #d8dbe2; font-size: 0.875rem; }

/* ---------- grafikler ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--series-1); opacity: 0.1; }
.chart .series-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .bar { fill: var(--series-1); }
.chart .bar-label { fill: var(--ink-2); font-size: 12px; }
.chart .bar-value { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.chart .hit { fill: transparent; }
.chart .hover-bar { fill: var(--ink); opacity: 0; }
.chart .hover-bar:hover, .chart .bar-group:hover .hover-bar { opacity: 0.05; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--page); font-size: 0.8125rem; padding: 6px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-pop); transform: translate(-50%, calc(-100% - 10px)); z-index: 5; }
.chart-tip b { font-weight: 600; }
.spark path { fill: none; stroke: var(--series-1); stroke-width: 1.5; }
.spark circle { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- giriş ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 28px 24px; }
.login-card .brand { padding: 0 0 20px; }
.login-card h1 { font-size: 1.25rem; margin-bottom: 4px; }
.login-card .lead { color: var(--ink-2); margin-bottom: 20px; }
.login-card form { display: grid; gap: 14px; }
.login-card .code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.login-card .alert { background: var(--bad-soft); color: var(--bad-ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: 0.9375rem; }
.login-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }

/* ---------- deneme detayı ---------- */
.exam-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.title-edit { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-edit h1 { cursor: text; border-bottom: 1px dashed transparent; min-width: 0; overflow-wrap: anywhere; }
.title-edit h1:hover { border-bottom-color: var(--line-strong); }
.title-edit input { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.exam-meta { display: flex; gap: 14px 18px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.exam-meta .field { flex-direction: row; align-items: center; gap: 8px; }
.exam-meta .select, .exam-meta .input { width: auto; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.qcard.no-key { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.qcard .thumb { position: relative; aspect-ratio: 3 / 2; background: var(--surface-3); cursor: zoom-in; }
.qcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.qcard .thumb img:not([src]) { visibility: hidden; }
.qcard .thumb.noimg { cursor: default; }
.qcard .thumb .noimg-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 55%, transparent) 10px 11px); }
.qcard .thumb .noimg-ph svg { width: 26px; height: 26px; opacity: .6; }
.qcard .qnum { position: absolute; left: 10px; top: 10px; background: var(--ink); color: var(--page); font-weight: 600; font-size: 0.875rem; padding: 2px 8px; border-radius: 6px; }
.qcard .qbody { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.answers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.answers button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); min-height: 38px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.answers button:hover { background: var(--surface-2); }
.answers button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.answers button.pending { opacity: 0.6; }
.qstats { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; color: var(--muted); }
.qstats .acts { display: flex; gap: 2px; }
.qmore { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; background: var(--surface-2); }
.qmore .opt { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; font-size: 0.875rem; }
.qmore .opt b { color: var(--ink-2); }
.key-paste { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.key-preview { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.key-preview span { display: inline-grid; place-items: center; min-width: 42px; height: 28px; border-radius: 6px; background: var(--surface-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.key-preview span.chg { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.key-preview span.bad { background: var(--bad-soft); color: var(--bad-ink); }

/* ---------- program ---------- */
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; min-width: 36px; height: 30px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); cursor: pointer; padding: 0 6px; }
.days button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); }
.sched-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 20px; padding: 18px 20px; }
.sched-card + .sched-card { border-top: 1px solid var(--line); }
.sched-card.inactive .sched-title { color: var(--muted); }
.sched-title { font-weight: 600; font-size: 1.0625rem; }
.sched-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.sched-fields .field.full { grid-column: 1 / -1; }
.sched-next { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-next .cur { font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); }

/* ---------- ayarlar ---------- */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting .desc { color: var(--ink-2); font-size: 0.875rem; margin-top: 2px; }

/* ---------- kayıtlar ---------- */
.logbox { background: #0f1115; color: #d4d8e0; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.5; padding: 14px 16px; border-radius: var(--r-md); max-height: 70vh; overflow: auto; white-space: pre; }
.logbox .warn { color: #f0c25c; }
.logbox .err { color: #f08080; }
.logbox .dbg { color: #7d8490; }

/* ---------- öğrenci profili ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 1.125rem; flex: none; }
.mistake-group { padding: 10px 0; border-top: 1px solid var(--line); }
.mistake-group:first-child { border-top: 0; }
.mistake-group h4 { font-weight: 500; margin-bottom: 6px; }
.mistake-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mistake-list span { font-size: 0.8125rem; background: var(--surface-3); border-radius: 6px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.mistake-list span b { color: var(--bad-ink); font-weight: 600; }
.mistake-list span em { color: var(--good-ink); font-style: normal; font-weight: 600; }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); font-weight: 600; font-size: 0.8125rem; }
.rank.top { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- telefon ---------- */
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-main-side { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .sched-card { grid-template-columns: 1fr; }
  .key-paste { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .brand { padding: 0; }
  .topbar .brand-sub { display: none; }
  .content { padding: 16px 16px calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .section { margin-top: 20px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); z-index: 40; }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.6875rem; font-weight: 500; color: var(--ink-2); text-decoration: none; border: 0; background: none; cursor: pointer; padding: 0; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--accent-ink); }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); max-width: none; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; }
  .sheet { position: fixed; inset: auto 0 0; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); z-index: 95; box-shadow: var(--shadow-pop); }
  .sheet a { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: var(--r-sm); color: var(--ink); font-weight: 500; }
  .sheet a svg { width: 22px; height: 22px; color: var(--ink-2); }
  .sheet a.active { background: var(--accent-soft); color: var(--accent-ink); }
  .exam-head { grid-template-columns: 1fr; }
  .qgrid { grid-template-columns: 1fr; }
  .sched-fields { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; }
  .timeline li { grid-template-columns: 50px 1fr; }
  .timeline li .badge { grid-column: 2; justify-self: start; }
  /* tablolar kart olur */
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; }
  .table.cards thead { display: none; }
  .table.cards tr { padding: 10px 14px; border-top: 1px solid var(--line); }
  .table.cards tr:first-child { border-top: 0; }
  .table.cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: left; }
  .table.cards td.num { text-align: right; }
  .table.cards td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; flex: none; }
  .table.cards td.lead { display: block; padding-bottom: 6px; }
  .table.cards td.lead::before { display: none; }
  .table.cards td:empty { display: none; }
  .table.cards td.hide-card { display: none; }
}
@media (min-width: 761px) {
  .sheet { display: none; }
}
@media (max-width: 400px) {
  .answers button { min-height: 36px; }
  .stat .value { font-size: 1.5rem; }
}
