/* TUS Çalışma Platformu — prototip stilleri
   Tek dosya, harici bağımlılık yok. Renkleri :root içinden değiştir. */

:root {
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #ccfbf1;
  --ink: #0b1220;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --sidebar: #0b1220;
  --sidebar-ink: #cbd5e1;
  --warn: #f59e0b;
  --ok: #16a34a;
  --bad: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .sidebar { border-right: 1px solid #16202f; }

[data-theme="dark"] {
  --ink: #e8eef7;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --line: #1e293b;
  --bg: #070c15;
  --surface: #0e1624;
  --surface-2: #121c2c;
  --sidebar: #060a11;
  --brand-soft: #0b3b38;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding-left: 20px; }

.hidden { display: none !important; }

/* ---------- Marka / tipografi ---------- */
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -0.02em;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 17px;
  box-shadow: 0 6px 14px -6px rgba(20, 184, 166, 0.8);
}
.logo small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand);
}
[data-theme="dark"] .eyebrow { color: var(--brand-2); }

/* ---------- Giriş ekranı ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.auth-art {
  position: relative; overflow: hidden; padding: 48px;
  background: radial-gradient(1200px 600px at 15% 0%, #0f766e 0%, #0b3f3a 45%, #071018 100%);
  color: #e6fffb; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.16) 1px, transparent 0);
  background-size: 26px 26px; opacity: 0.5; pointer-events: none;
}
.auth-art .logo { color: #fff; position: relative; z-index: 1; }
.auth-art .logo small { opacity: 0.8; }
.auth-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-copy h1 {
  font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -0.03em;
  font-weight: 800; margin-bottom: 16px;
}
.auth-copy p { color: #b7e7e1; font-size: 16px; max-width: 40ch; }
.auth-bullets { list-style: none; padding: 0; margin-top: 30px; display: grid; gap: 12px; }
.auth-bullets li { display: flex; gap: 10px; align-items: flex-start; color: #d7f5f1; font-size: 14px; }
.auth-bullets span.dot {
  flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); font-size: 12px;
}
.auth-foot { position: relative; z-index: 1; font-size: 12px; color: #8fc9c2; }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-form > p { color: var(--muted); margin-bottom: 26px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px; border-radius: 12px; margin-bottom: 22px;
}
.auth-tabs button {
  border: 0; background: transparent; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.auth-note { font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; }
.auth-error { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Uygulama iskeleti ---------- */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { color: #fff; padding: 0 6px; }
.sidebar .logo small { color: #7dd3c8; opacity: 1; }

.nav { display: grid; gap: 4px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: #64748b; padding: 8px 10px 4px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 11px; font-size: 14px; font-weight: 500; color: #b6c2d4;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(20, 184, 166, 0.14); border-color: rgba(20, 184, 166, 0.3); color: #fff; font-weight: 600; }
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; }
.nav-item .badge {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 999px; background: #14b8a6; color: #04211e;
}

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.goal-mini {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; padding: 13px 14px;
}
.goal-mini .row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.goal-mini .row b { color: #fff; }
.goal-mini .track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.goal-mini .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6, #5eead4); }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
}
.avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, #14b8a6, #0f766e); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 11px; color: #94a3b8; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  margin-left: auto; background: transparent; border: 0; color: #94a3b8;
  font-size: 15px; padding: 6px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.main { min-width: 0; padding: 30px 38px 64px; }
.main-inner { max-width: 1120px; margin: 0 auto; }

.topbar { display: none; }

/* ---------- Sayfa başlıkları ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; letter-spacing: -0.028em; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- Kartlar / yüzeyler ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.pad { padding: 20px 22px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-subjects { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }

/* ---------- Panel ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #0b3f3a 0%, #0f766e 55%, #14b8a6 130%);
  color: #f0fdfa; border-radius: 22px; padding: 28px 30px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 62%);
}
.hero h1 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.03em; margin: 6px 0 8px; font-weight: 800; }
.hero p { color: #c6f3ee; font-size: 14px; max-width: 52ch; }
.hero .eyebrow { color: #99f6e4; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; position: relative; z-index: 1; }

.ring { position: relative; width: 122px; height: 122px; z-index: 1; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .track { stroke: rgba(255,255,255,0.18); }
.ring .value { stroke: #5eead4; transition: stroke-dashoffset .6s ease; }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .label b { font-size: 24px; letter-spacing: -0.02em; }
.ring .label span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: #99f6e4; }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; gap: 12px; }
.section-head h2 { font-size: 16px; letter-spacing: -0.01em; font-weight: 700; }
.link-btn { background: none; border: 0; color: var(--brand); font-size: 13px; font-weight: 600; padding: 0; }
[data-theme="dark"] .link-btn { color: var(--brand-2); }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; transition: transform .08s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #115e57; }
.btn-light { background: #fff; color: #0b3f3a; }
.btn-light:hover { background: #ecfdf9; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--muted-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
[data-theme="dark"] .btn-soft { color: #5eead4; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.chip.brand { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
[data-theme="dark"] .chip.brand { color: #5eead4; }
.chip.warn { background: #fef3c7; border-color: transparent; color: #92400e; }
[data-theme="dark"] .chip.warn { background: #422006; color: #fcd34d; }

/* ---------- Ders kartları ---------- */
.subject-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--muted-2); }
.subject-top { display: flex; align-items: center; gap: 11px; }
.subject-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 19px; background: var(--surface-2); border: 1px solid var(--line);
}
.subject-top h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.subject-top span { font-size: 11.5px; color: var(--muted); }
.subject-card p { font-size: 12.5px; color: var(--muted); }
.progress { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--brand-2); transition: width .4s ease; }
.subject-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* ---------- Ders detayı ---------- */
.detail-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.topic-list { display: grid; gap: 10px; }
.topic {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: border-color .15s, background .15s; width: 100%; text-align: left;
}
.topic:hover { border-color: var(--brand-2); background: var(--surface-2); }
.topic .num {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand);
}
[data-theme="dark"] .topic .num { color: #5eead4; }
.topic .t { min-width: 0; flex: 1; }
.topic .t b { display: block; font-size: 14px; }
.topic .t span { font-size: 12px; color: var(--muted); }
.topic .state { font-size: 12px; color: var(--ok); font-weight: 600; }

.note-view h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 4px; }
.note-meta { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.note-body { font-size: 14.5px; color: var(--ink-2); }
.note-body .lead { font-size: 15.5px; color: var(--ink); margin-bottom: 16px; }
.note-body h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 8px; }
.note-body ul, .note-body ol { display: grid; gap: 6px; margin-bottom: 8px; }
.note-body li { padding-left: 2px; }
.note-body b { color: var(--ink); }
.callout {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--brand-soft); color: #134e4a; font-size: 13.5px;
  border-left: 3px solid var(--brand-2);
}
[data-theme="dark"] .callout { color: #ccfbf1; }

/* ---------- Pop kartlar ---------- */
.study-wrap { max-width: 720px; margin: 0 auto; }
.study-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.study-top .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.study-top .bar i { display: block; height: 100%; background: var(--brand-2); transition: width .3s; }

.flash { perspective: 1600px; height: 340px; cursor: pointer; }
.flash-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); padding: 30px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.flash-back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
.flash-face .top { display: flex; align-items: center; justify-content: space-between; }
.flash-q {
  font-size: clamp(20px, 2.4vw, 27px); line-height: 1.3; letter-spacing: -0.02em;
  font-weight: 700; text-align: center; margin: auto 0; padding: 8px 6px;
}
.flash-a { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; font-weight: 600; text-align: center; margin: auto 0; color: var(--brand); }
[data-theme="dark"] .flash-a { color: #5eead4; }
.flash-hint { text-align: center; font-size: 12px; color: var(--muted); }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px; color: var(--muted);
}

.rating { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.rating button {
  border-radius: 13px; padding: 11px 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-weight: 700; display: grid; gap: 2px;
  transition: transform .08s, border-color .15s, background .15s;
}
.rating button small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.rating button:hover { transform: translateY(-1px); }
.rating .again:hover { border-color: #fca5a5; background: #fef2f2; }
.rating .hard:hover { border-color: #fdba74; background: #fff7ed; }
.rating .good:hover { border-color: #5eead4; background: #f0fdfa; }
.rating .easy:hover { border-color: #93c5fd; background: #eff6ff; }
[data-theme="dark"] .rating .again:hover { background: #2a1214; }
[data-theme="dark"] .rating .hard:hover { background: #2a1c0b; }
[data-theme="dark"] .rating .good:hover { background: #07211f; }
[data-theme="dark"] .rating .easy:hover { background: #0b1a2e; }

.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.deck {
  padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); display: grid; gap: 10px; transition: transform .15s, border-color .15s;
}
.deck:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.deck .row { display: flex; align-items: center; gap: 10px; }
.deck h3 { font-size: 14.5px; font-weight: 700; }
.deck .counts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Quiz ---------- */
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.quiz-head .timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.quiz-meta { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.quiz-card { padding: 26px; }
.q-num { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: 0.06em; text-transform: uppercase; }
.q-text { font-size: 19px; line-height: 1.4; font-weight: 700; letter-spacing: -0.015em; margin: 8px 0 20px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px; transition: border-color .15s, background .15s;
  width: 100%;
}
.option:hover:not(.locked) { border-color: var(--brand-2); background: var(--surface-2); }
.option .letter {
  width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.option.correct { border-color: #34d399; background: #ecfdf5; }
.option.correct .letter { background: #10b981; border-color: #10b981; color: #fff; }
.option.wrong { border-color: #f87171; background: #fef2f2; }
.option.wrong .letter { background: #ef4444; border-color: #ef4444; color: #fff; }
[data-theme="dark"] .option.correct { background: #052e24; }
[data-theme="dark"] .option.wrong { background: #2c1013; }
.option.locked { cursor: default; }

.explain {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-2);
}
.explain b { color: var(--ink); }

.quiz-result { padding: 34px; text-align: center; }
.score-big { font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 6px 0; }
.score-big span { font-size: 20px; color: var(--muted); font-weight: 600; }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- İstatistik ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .barwrap { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.chart .bar { width: 100%; border-radius: 7px 7px 3px 3px; background: var(--brand-2); opacity: .85; min-height: 3px; transition: height .4s; }
.chart .col.today .bar { opacity: 1; background: var(--brand); }
.chart .cap { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.chart .num { font-size: 11px; font-weight: 700; color: var(--muted); }

.rows { display: grid; gap: 2px; }
.rowitem { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.rowitem:last-child { border-bottom: 0; }
.rowitem .name { flex: 1; font-size: 13.5px; font-weight: 600; }
.rowitem .val { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Boş durum ---------- */
.empty { padding: 40px 24px; text-align: center; }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.empty p { font-size: 13px; color: var(--muted); max-width: 42ch; margin: 0 auto 16px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast {
  background: #0b1220; color: #fff; padding: 11px 16px; border-radius: 11px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Mobil ---------- */
@media (max-width: 1080px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; height: auto; width: 100%; border-right: 0;
    flex-direction: row; padding: 8px 10px; gap: 0; z-index: 50;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .sidebar .logo, .sidebar .nav-label, .goal-mini, .user-chip { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; gap: 2px; }
  .nav-item { flex-direction: column; gap: 2px; font-size: 10px; padding: 7px 4px; border: 0; flex: 1; text-align: center; }
  .nav-item .ico { font-size: 17px; }
  .nav-item .badge { display: none; }
  .main { padding: 18px 16px 96px; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
  }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .ring { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .flash { height: 300px; }
  .rating { grid-template-columns: repeat(2, 1fr); }
  .quiz-card { padding: 18px; }
}

@media (max-width: 520px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 22px; }
  .flash-face { padding: 20px; }
  .chart { height: 120px; }
}

/* ---------- Yönetim paneli ---------- */
.nav-label.admin { color: #fbbf24; }

.chip.ok { background: #dcfce7; border-color: transparent; color: #166534; }
[data-theme="dark"] .chip.ok { background: #052e16; color: #86efac; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost-soft { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost-soft:hover { border-color: var(--muted-2); color: var(--ink); }
.icon-btn.danger { color: var(--muted-2); }
.icon-btn.danger:hover { background: #fef2f2; color: #dc2626; }
[data-theme="dark"] .icon-btn.danger:hover { background: #2c1013; }

.admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-action {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.admin-action:hover { transform: translateY(-2px); border-color: var(--brand-2); box-shadow: var(--shadow); }
.admin-action .ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-size: 18px; background: var(--brand-soft); color: var(--brand);
}
[data-theme="dark"] .admin-action .ico { color: #5eead4; }
.admin-action b { display: block; font-size: 14px; }
.admin-action span:not(.arrow) { font-size: 12px; color: var(--muted); }
.admin-action .arrow { margin-left: auto; color: var(--muted-2); }

.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.cell-title {
  font-size: 13.5px; font-weight: 600; max-width: 560px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cell-sub { font-size: 11.5px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; white-space: nowrap; }

.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.select { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; align-items: start; }
.form-row { margin-bottom: 16px; }
.form-row > label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.form-error { color: var(--bad); font-size: 12.5px; min-height: 18px; margin: 4px 0 10px; }
.hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }
code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }

.option-row { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.opt-letter { position: relative; flex: none; cursor: pointer; }
.opt-letter input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt-letter span {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; font-weight: 800; color: var(--muted);
}
.opt-letter input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }

.editor-toolbar {
  display: flex; gap: 3px; flex-wrap: wrap; padding: 7px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
  background: var(--surface-2);
}
.editor-toolbar button {
  border: 1px solid transparent; background: transparent; padding: 5px 9px;
  border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.editor-toolbar button:hover { background: var(--surface); border-color: var(--line); }
.editor {
  min-height: 260px; padding: 18px; border: 1px solid var(--line);
  border-radius: 0 0 12px 12px; background: var(--surface); outline: none;
  font-size: 14px; line-height: 1.6;
}
.editor:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1); }
.editor:empty:before { content: attr(data-placeholder); color: var(--muted-2); }
.editor h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.editor ul, .editor ol { padding-left: 20px; }
.editor .callout { margin: 12px 0; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-actions { grid-template-columns: 1fr; }
  .cell-title { max-width: 220px; }
}
.sidebar { overflow-y: auto; }
.danger-text { color: #dc2626; }
.danger-text:hover { border-color: #fca5a5; background: #fef2f2; }
[data-theme="dark"] .danger-text:hover { background: #2c1013; }

/* Uzun e-posta/yönetici etiketi sidebar'ı taşırmasın */
.sidebar-foot, .user-chip { min-width: 0; }
.user-chip .who { flex: 1 1 auto; min-width: 0; }
.user-chip .icon-btn { flex: none; }
.mini-role {
  font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(245, 158, 11, 0.18); color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 5px;
  padding: 1px 4px; vertical-align: middle; margin-left: 4px;
}
.nav-short { display: none; }
@media (max-width: 900px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
}
