:root {
    --bg: #F5F7F5;
    --surface: #FFFFFF;
    --surface-2: #F8FAF8;
    --border: #E5E7EB;
    --border-strong: #D1D5DB;
    --text: #111827;
    --text-mid: #374151;
    --muted: #6B7280;
    --faint: #9CA3AF;
    --primary: #16A34A;
    --primary-dark: #15803D;
    --primary-soft: #DCFCE7;
    --primary-tint: #F0FDF4;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --warning: #D97706;
    --warning-soft: #FFFBEB;
    --info: #2563EB;
    --info-soft: #EFF6FF;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.14);
    --sidebar: 248px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ms {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    user-select: none;
    flex-shrink: 0;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ── Layout ─────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary);
    display: grid; place-items: center;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--text-mid); font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-tint); color: var(--primary-dark); }
.nav a.active .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

.sidebar-foot {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 14px 8px 0;
    display: flex; align-items: center; gap: 10px;
}
.avatar-sm {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 700;
    display: grid; place-items: center; text-transform: uppercase;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 28px 36px 64px; }
.content { max-width: 1120px; margin: 0 auto; }

.topbar { display: none; }

/* ── Page header ────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--primary-dark); text-decoration: underline; }
.crumbs .ms { font-size: 16px; color: var(--faint); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.25; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 10px;
    font-weight: 600; font-size: 14px; white-space: nowrap;
    border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn .ms { font-size: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--text-mid); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); border-color: #FECACA; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; color: var(--muted); }
.btn-icon:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-icon.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.btn:disabled, .btn-icon:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ── Cards & panels ─────────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head .count { color: var(--muted); font-weight: 600; }
.panel-body { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ── Stats ──────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat-icon.green { background: var(--primary-soft); color: var(--primary-dark); }
.stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.purple { background: #F5F3FF; color: #7C3AED; }
.stat-num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }

.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; }
.step-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700; font-size: 13px; display: grid; place-items: center;
}
.steps strong { display: block; font-size: 14px; }
.steps strong + span { color: var(--muted); font-size: 13px; }
.step-num .ms { font-size: 16px; }

/* ── Course cards ───────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cover {
    aspect-ratio: 16 / 9; background: linear-gradient(135deg, #22C55E, #15803D);
    display: grid; place-items: center; color: rgba(255,255,255,.9); overflow: hidden; position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ms { font-size: 44px; }
.course-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-card h3 { font-size: 15px; font-weight: 700; line-height: 1.35; }
.course-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 6px; }
.course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-meta .ms { font-size: 16px; }

.chip {
    display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
    padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--surface-2); color: var(--text-mid); border: 1px solid var(--border);
}
.chip.green { background: var(--primary-tint); color: var(--primary-dark); border-color: #BBF7D0; }
.chip.amber { background: var(--warning-soft); color: var(--warning); border-color: #FDE68A; }
.chip.blue { background: var(--info-soft); color: var(--info); border-color: #BFDBFE; }
.chip.gray { color: var(--muted); }
.chip .ms { font-size: 14px; }

/* ── Lists ──────────────────────────────────────────── */
.list { list-style: none; }
.list-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-top: 1px solid var(--border);
}
.list-row:first-child { border-top: none; }
a.list-row:hover, .list-row.clickable:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.row-sub span { display: inline-flex; align-items: center; gap: 4px; }
.row-sub .ms { font-size: 15px; }
.row-actions { display: flex; gap: 2px; align-items: center; }
.order-badge {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
    background: var(--primary-soft); color: var(--primary-dark);
}
.order-badge.locked { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.thumb { width: 56px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Forms ──────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hint { font-size: 12px; color: var(--muted); }
.req { color: var(--danger); }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input, .textarea, .select {
    width: 100%; border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); padding: 9px 12px; font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.input { height: 40px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
    width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong);
    position: relative; transition: background .15s; flex-shrink: 0;
}
.switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-text span { font-size: 12px; color: var(--muted); }

/* File drop */
.file-box {
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-2); padding: 14px; display: flex; align-items: center; gap: 12px;
    position: relative; transition: border-color .15s, background .15s;
}
.file-box.drag { border-color: var(--primary); background: var(--primary-tint); }
.file-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.file-text { flex: 1; min-width: 0; }
.file-text strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text span { font-size: 12px; color: var(--muted); }
.file-box .btn-icon { position: relative; z-index: 1; }
.file-preview { margin-top: 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.file-preview img { width: 100%; max-height: 220px; object-fit: cover; background: var(--surface-2); }
.file-preview video { width: 100%; max-height: 220px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.danger-zone { border-color: #FECACA; }
.danger-zone .panel-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-zone strong { display: block; }
.danger-zone strong + span { color: var(--muted); font-size: 13px; }

/* ── Tabs ───────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab .badge { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.tab.active .badge { background: var(--primary-soft); border-color: #BBF7D0; color: var(--primary-dark); }

/* ── Quiz ───────────────────────────────────────────── */
.callout {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--radius); font-size: 13px;
    background: var(--info-soft); color: #1E40AF; border: 1px solid #BFDBFE; margin-bottom: 16px;
}
.callout .ms { font-size: 18px; margin-top: 1px; }

.quiz-list { display: flex; flex-direction: column; gap: 12px; }
.quiz-card { padding: 16px 18px; }
.quiz-top { display: flex; gap: 12px; align-items: flex-start; }
.quiz-num { font-weight: 800; color: var(--faint); min-width: 26px; padding-top: 1px; }
.quiz-q { flex: 1; font-weight: 600; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.quiz-tags { display: flex; gap: 6px; margin: 8px 0 0 38px; flex-wrap: wrap; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0 38px; }
.option {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 10px; font-size: 13px; background: var(--surface);
}
.option.correct { border-color: #86EFAC; background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; }
.option-key {
    width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.option.correct .option-key { background: var(--primary); color: #fff; border-color: var(--primary); }

.quiz-editor { padding: 18px; border-color: #86EFAC; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented .ms { font-size: 16px; }
.opt-edit { display: flex; align-items: center; gap: 10px; }
.opt-edit .input { flex: 1; }
.correct-pick {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted);
    white-space: nowrap; background: var(--surface);
}
.correct-pick.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); }
.tf-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-pick button {
    height: 52px; border-radius: 12px; border: 1.5px solid var(--border-strong); font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-mid); background: var(--surface);
}
.tf-pick button.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); }

/* ── Characters ─────────────────────────────────────── */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.char-card { padding: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.char-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.char-card.inactive { opacity: .6; }
.char-card h3 { font-size: 15px; font-weight: 700; }
.char-card p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.char-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.char-avatar {
    --c: #16A34A;
    width: 72px; height: 72px; border-radius: 50%;
    background: color-mix(in srgb, var(--c) 14%, white);
    border: 3px solid color-mix(in srgb, var(--c) 45%, white);
    color: var(--c); display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
    font-weight: 800; font-size: 22px;
}
.char-avatar img { width: 100%; height: 100%; object-fit: cover; }
.char-avatar .ms { font-size: 36px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 40; }
.char-avatar.sm { width: 44px; height: 44px; border-width: 2px; font-size: 16px; }
.char-avatar.sm .ms { font-size: 22px; }
.char-avatar.lg { width: 96px; height: 96px; border-width: 4px; }
.char-avatar.lg .ms { font-size: 48px; }

.chapter-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cchar { padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; }
.cchar-body { flex: 1; min-width: 0; }
.cchar-body strong { display: block; font-size: 15px; }
.cchar-body .tagline { font-size: 13px; font-weight: 600; }
.cchar-body p { font-size: 13px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
    width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border-strong); position: relative;
}
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatch.on::after { content: 'check'; font-family: 'Material Symbols Rounded'; color: #fff; font-size: 18px; position: absolute; inset: 0; display: grid; place-items: center; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick {
    aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
    display: grid; place-items: center; color: var(--text-mid);
}
.icon-pick:hover { background: var(--surface-2); }
.icon-pick.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); box-shadow: 0 0 0 1px var(--primary); }
.icon-pick .ms { font-size: 22px; }

.preview-head { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.preview-head strong { display: block; font-size: 16px; }
.preview-head strong + span { color: var(--muted); font-size: 13px; }

/* ── Modal ──────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 48px 16px; overflow-y: auto; z-index: 50; animation: fade .15s ease;
}
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-foot .right { display: flex; gap: 10px; margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Toasts ─────────────────────────────────────────── */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
    display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px;
    padding: 12px 16px; border-radius: 12px; background: #111827; color: #fff;
    box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .2s ease;
}
.toast.success .ms { color: #4ADE80; }
.toast.error { background: #7F1D1D; }
.toast.error .ms { color: #FCA5A5; }

/* ── States ─────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon .ms { font-size: 28px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 16px; }

.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
    background: var(--danger-soft); border: 1px solid #FECACA; color: #991B1B; font-size: 13px; font-weight: 500;
}
.error-box .ms { font-size: 18px; }

/* ── Login ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at top, #ECFDF3, var(--bg) 60%); }
.login-card { width: 100%; max-width: 400px; padding: 32px; }
.login-logo { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); border: 2px solid var(--primary); color: var(--primary); display: grid; place-items: center; margin: 0 auto 16px; }
.login-logo .ms { font-size: 32px; }
.login-card h1 { text-align: center; font-size: 22px; font-weight: 800; }
.login-card > p { text-align: center; color: var(--muted); margin: 4px 0 24px; }

.muted { color: var(--muted); }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

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

@media (max-width: 820px) {
    .shell { flex-direction: column; }
    .sidebar { display: none; }
    .topbar {
        display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 20;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 12px; overflow-x: auto;
    }
    .topbar .brand { padding: 0 8px 0 0; }
    .topbar .brand-name, .topbar .brand-sub { display: none; }
    .topbar .nav { flex-direction: row; }
    .topbar .nav a { padding: 8px 10px; font-size: 13px; }
    .topbar .btn-icon { margin-left: auto; }
    .main { padding: 20px 16px 48px; }
    .row-fields, .options { grid-template-columns: 1fr; }
    .options, .quiz-tags { margin-left: 0; }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr; }
    .list-row { padding: 12px 14px; }
    .opt-edit { flex-wrap: wrap; }
    .opt-edit .correct-pick { margin-left: auto; }
}

/* ── Yasal metinler ─────────────────────────────────────────────── */
.legal-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.legal-list { padding: 8px; }
.legal-item { padding: 12px; border-radius: var(--radius); display: grid; gap: 8px; }
.legal-item.active { background: var(--primary-tint); }
.legal-item strong { font-size: 14px; }
.legal-langs { display: flex; gap: 6px; flex-wrap: wrap; }
.legal-langs .chip { text-decoration: none; cursor: pointer; }
.legal-body { min-height: 360px; font-size: 14px; }
.legal-html { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface-2); max-height: 420px; overflow: auto; font-size: 14px; line-height: 1.6; }
.legal-html h3 { font-size: 15px; margin: 14px 0 4px; }
.legal-html h3:first-child { margin-top: 0; }
.legal-html p { margin: 0 0 10px; }
.legal-html ul { margin: 0 0 10px 20px; }
@media (max-width: 900px) { .legal-layout { grid-template-columns: 1fr; } }


/* ══════════════════════════════════════════════════════════════════
   Panel 2026-11 — yönetim + eğitmen paneli, üç dil
   ══════════════════════════════════════════════════════════════════ */
:root {
    --purple: #7C3AED; --purple-soft: #F5F3FF;
    --teal: #0F766E; --teal-soft: #F0FDFA;
    --pink: #BE185D; --pink-soft: #FDF2F8;
    --red-soft: #FEF2F2;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-wrap; }
.center { text-align: center; }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal !important; overflow: visible !important; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.border-top { border-top: 1px solid var(--border); }
.narrow-col { max-width: 720px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: middle; }
.loading.full { min-height: 100vh; }
.loading.small { padding: 16px 0; }
.empty-icon.danger { background: var(--danger-soft); color: var(--danger); }

/* ── Kabuk: gruplar, rozetler, dil seçici ───────────────────────── */
.sidebar { padding-bottom: 14px; }
.brand-mark { overflow: hidden; background: #FFF7ED; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-group + .nav-group { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.nav-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 2px 12px 8px; }
.nav-title .ms { font-size: 15px; }
.nav-group.admin .nav a.active { background: var(--purple-soft); color: var(--purple); }
.nav a { position: relative; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.me-row { display: flex; align-items: center; gap: 8px; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; }
.me:hover { background: var(--surface-2); }
.lang-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; align-self: flex-start; }
.lang-switch button { padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.lang-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lang-switch.login-lang { align-self: flex-end; margin: -12px -12px 0 0; }
.login-logo { overflow: hidden; background: #FFF7ED; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.nav-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 4px; flex-shrink: 0; }

.user-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 14px; text-transform: uppercase; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.user-avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.user-avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ── Sayfa başı ─────────────────────────────────────────────────── */
.head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-head { align-items: center; justify-content: flex-start; }

/* ── İstatistik kartları ────────────────────────────────────────── */
.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1640px) { .stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat.link { transition: box-shadow .15s, transform .15s; }
.stat.link:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat-body { min-width: 0; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.pink { background: var(--pink-soft); color: var(--pink); }
.stats.six .stat { padding: 14px 16px; gap: 12px; }
.stats.six .stat-num { font-size: 22px; }
.stats.six .stat-icon { width: 38px; height: 38px; }

/* ── Çipler ve dil rozetleri ────────────────────────────────────── */
.chip.red { background: var(--danger-soft); color: var(--danger); border-color: #FECACA; }
.chip.purple { background: var(--purple-soft); color: var(--purple); border-color: #DDD6FE; }
.chip.tag { background: var(--surface); }
.chip.small { padding: 0 6px; font-size: 11px; }
.chip.diff-1 { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.chip.diff-2 { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.chip.diff-3 { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
a.chip:hover { filter: brightness(.97); text-decoration: none; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.lang-pills { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.lang-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.lang-pill small { font-weight: 600; font-size: 10px; }
.lang-pill.done { background: var(--primary-tint); color: var(--primary-dark); border-color: #BBF7D0; }
.lang-pill.part { background: var(--warning-soft); color: #92400E; border-color: #FDE68A; }
.lang-pill.none { background: var(--surface); color: var(--faint); border-style: dashed; }
.lang-pills.mini .lang-pill { height: 18px; padding: 0 5px; font-size: 10px; }
.fallback-tag { display: inline-block; padding: 0 4px; border-radius: 4px; font-size: 9px; font-weight: 800; background: #FEF3C7; color: #92400E; vertical-align: middle; letter-spacing: .03em; }

/* ── Dil sekmeleri (formlar) ────────────────────────────────────── */
.lang-tabs { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lt-head { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; overflow-x: auto; }
.lt-head button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.lt-head button b { font-weight: 800; font-size: 12px; letter-spacing: .03em; }
.lt-head button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lt-name { font-weight: 500; }
.lt-base { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--primary-dark); background: var(--primary-soft); padding: 1px 6px; border-radius: 999px; }
.lt-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--border-strong); }
.lt-dot.done { background: var(--primary); border-color: var(--primary); }
.lt-pane { padding: 16px; }
.tr-source { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-mid); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; }
.tr-source[hidden] { display: none; }
.tr-source span { font-size: 10px; font-weight: 800; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-top: 2px; }
.tr-source em { font-style: normal; }
.input:disabled { background: var(--surface-2); color: var(--faint); }

/* ── Bilgi kutuları ─────────────────────────────────────────────── */
.callout.soft { background: var(--surface-2); color: var(--text-mid); border-color: var(--border); }
.callout.warn { background: var(--warning-soft); color: #92400E; border-color: #FDE68A; }
.callout.compact { margin: 10px 0 0; padding: 8px 12px; }
.callout a { text-decoration: underline; font-weight: 600; }
.error-box ul { margin: 6px 0 0 18px; }

/* ── Filtreler, araç çubukları, sayfalama ───────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-panel { padding: 12px 14px 2px; margin-bottom: 16px; }
.filter-panel .filters { margin-bottom: 10px; }
.search { position: relative; min-width: 220px; }
.search .ms { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 18px; pointer-events: none; }
.search .input { padding-left: 34px; }
.select { height: 40px; width: auto; max-width: 260px; padding: 0 30px 0 10px; appearance: none; cursor: pointer;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.select:disabled { opacity: .55; cursor: not-allowed; }
.mini-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-mid); cursor: pointer; white-space: nowrap; }
.mini-switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.date-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.date-field .input { width: auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar > p { margin: 0; max-width: 640px; }
.tabs.pills { border-bottom: none; gap: 6px; flex-wrap: wrap; }
.tabs.pills .tab { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; margin: 0; background: var(--surface); }
.tabs.pills .tab.active { border-color: var(--primary); background: var(--primary-tint); }
a.tab:hover { text-decoration: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 2px; flex-wrap: wrap; font-size: 13px; }
.pager-btns { display: flex; align-items: center; gap: 8px; }
.pager-num { font-weight: 700; color: var(--text-mid); }
.refreshing { opacity: .55; transition: opacity .15s; pointer-events: none; }
/* Seçim çubuğu ekranın altında yüzer; görünürken liste kaymaz. */
.bulk-bar { position: fixed; bottom: 18px; left: calc(var(--sidebar) + 36px); right: 36px; max-width: 1120px; margin: 0 auto; z-index: 30;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #111827; color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-lg); animation: rise .15s ease; }
@media (max-width: 820px) { .bulk-bar { left: 12px; right: 12px; bottom: 12px; } }
.bulk-bar .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.bulk-bar .btn-secondary:hover { background: rgba(255,255,255,.16); }
.bulk-bar .btn-ghost { color: #D1D5DB; }
.bulk-bar .btn-danger { background: transparent; border-color: #F87171; color: #FCA5A5; }
.list-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 4px; font-size: 13px; }

/* Özel onay kutusu */
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: inline-grid; place-items: center; flex-shrink: 0; }
.check input:checked + span { background: var(--primary); border-color: var(--primary); }
.check input:checked + span::after { content: 'check'; font-family: 'Material Symbols Rounded'; color: #fff; font-size: 16px; }
.check input:indeterminate + span::after { content: ''; width: 10px; height: 2px; background: var(--primary); }
.check input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Soru kartları ──────────────────────────────────────────────── */
.quiz-card.status-pending { border-left: 4px solid #F59E0B; }
.quiz-card.status-draft { border-left: 4px solid var(--border-strong); }
.quiz-card.status-rejected { border-left: 4px solid var(--danger); }
.quiz-top .check { margin-top: 1px; }
.quiz-context { margin: 6px 0 0 38px; font-size: 12px; }
.quiz-context a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.quiz-context a:hover { color: var(--primary-dark); }
.quiz-context .ms { font-size: 14px; }
.quiz-card .callout.compact { margin-left: 38px; }
.quiz-expl { margin: 10px 0 0 38px; display: flex; gap: 6px; font-size: 13px; color: var(--text-mid); background: #FFFBEB; border: 1px solid #FDE68A; padding: 6px 10px; border-radius: 8px; }
.quiz-expl .ms { font-size: 16px; color: #D97706; }
.quiz-meta { margin: 8px 0 0 38px; font-size: 12px; color: var(--faint); }
.review-item .quiz-card { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.review-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── Soru düzenleyici ───────────────────────────────────────────── */
.modal.xwide { max-width: 1080px; }
.foot-left { display: flex; align-items: center; gap: 8px; }
.quiz-editor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor-top { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.row-fields.three { grid-template-columns: 110px 1fr auto; align-items: end; }
.field.end { justify-content: flex-end; }
.option-key.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.q-preview { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.phone { width: 100%; max-width: 300px; border-radius: 34px; padding: 10px; background: #111827; box-shadow: var(--shadow-lg); margin: 0 auto; }
.phone-screen { border-radius: 26px; overflow: hidden; background: #FFFBF2; min-height: 420px; max-height: 560px; overflow-y: auto; }
.phone.small .phone-screen { min-height: 300px; }
.quiz-screen { background: linear-gradient(180deg, #14532D, #166534); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.qs-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; font-weight: 700; }
.qs-q { font-size: 15px; font-weight: 700; line-height: 1.35; background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px; min-height: 64px; white-space: pre-wrap; word-break: break-word; }
.qs-q .muted { color: rgba(255,255,255,.6); }
.qs-opt { display: flex; gap: 10px; align-items: center; background: #FFF7E6; color: #1F2937; border-radius: 12px; padding: 9px 10px; font-size: 13px; font-weight: 600; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.qs-opt span:first-child { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: #14532D; color: #fff; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.qs-opt.right { background: #DCFCE7; outline: 2px solid #4ADE80; }

/* Eğitim önizlemesi */
.preview-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.preview-side { display: flex; flex-direction: column; gap: 14px; }
.ph-cover { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #22C55E, #15803D); display: grid; place-items: center; color: rgba(255,255,255,.9); }
.ph-cover img { width: 100%; height: 100%; object-fit: cover; }
.ph-cover .ms { font-size: 44px; }
.ph-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ph-body h3 { font-size: 17px; line-height: 1.3; }
.ph-body p { font-size: 13px; color: var(--text-mid); white-space: pre-wrap; }
.ph-chip { align-self: flex-start; font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 999px; }
.ph-section { margin-top: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ph-chapter { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.ph-chapter > span:nth-child(2) { flex: 1; }
.ph-chapter.locked { color: var(--muted); }
.ph-chapter .ms { font-size: 18px; color: var(--primary); }
.ph-chapter.locked .ms { color: var(--faint); }
.ph-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; font-weight: 800; flex-shrink: 0; }

/* ── Tablolar ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:first-child td { border-top: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td, .table tr.clickable:focus td { background: var(--surface-2); }
.table.compact th, .table.compact td { padding: 7px 12px; }
.table .actions { width: 1%; }
.table a { color: var(--text); }
.table a:hover { color: var(--primary-dark); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-user strong { display: block; font-size: 13px; }
.cell-user span { font-size: 12px; color: var(--muted); }
.cell-course { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cell-course strong { display: block; }
.cell-course span { font-size: 12px; color: var(--muted); }
.person-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin: 2px 4px 2px 0; white-space: nowrap; }
.person-chip.owner { background: var(--primary-tint); border-color: #BBF7D0; color: var(--primary-dark); }
.person-chip .ms { font-size: 13px; }
.note-dot { color: var(--warning); vertical-align: middle; margin-left: 4px; }
.note-dot .ms { font-size: 16px; }

/* ── Grafikler ──────────────────────────────────────────────────── */
.chart { margin: 0; }
.chart-plot { position: relative; padding-left: 34px; }
.chart-grid { position: absolute; inset: 0 0 0 34px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid .tick { border-top: 1px solid var(--border); height: 0; position: relative; }
.chart-grid .tick:last-child { border-top-color: var(--border-strong); }
.chart-grid .tick span { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-cols { position: absolute; inset: 0 0 0 34px; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.col-bar { width: 100%; max-width: 24px; background: var(--primary); border-radius: 4px 4px 0 0; transition: background .12s; }
.col:hover .col-bar, .col:focus .col-bar { background: var(--primary-dark); }
.col:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-soft); border-radius: 4px; }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: #111827; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 5; display: flex; flex-direction: column; align-items: center; }
.chart-tip strong { font-size: 14px; }
.chart-tip span { color: #D1D5DB; }
.chart-tip[hidden] { display: none; }
.chart-axis { display: flex; justify-content: space-between; padding: 6px 0 0 34px; font-size: 11px; color: var(--muted); }
.chart-table { margin-top: 10px; font-size: 12px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.chart-table table { margin-top: 8px; max-height: 220px; display: block; overflow-y: auto; }

.bar-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bl-label { color: var(--text-mid); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 10px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.bl-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bl-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 64px; text-align: right; }
.bl-value small { color: var(--muted); font-weight: 600; }

.meter-row { display: grid; grid-template-columns: 90px 1fr 46px; gap: 10px; align-items: center; font-size: 13px; }
.meter-label { font-weight: 600; color: var(--text-mid); }
.meter { height: 10px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; display: block; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter span.mid { background: #EAB308; }
.meter span.low { background: #F97316; }
.meter-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Listeler: yapılacaklar, oranlar, işlemler ──────────────────── */
.todo-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.todo-icon .ms { font-size: 18px; }
.todo-icon.red { background: var(--danger-soft); color: var(--danger); }
.todo-icon.amber { background: var(--warning-soft); color: var(--warning); }
.todo-icon.gray { background: var(--surface-2); color: var(--muted); }
.todo-icon.blue { background: var(--info-soft); color: var(--info); }
.rate { min-width: 48px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.rate.low { background: var(--danger-soft); color: var(--danger); }
.rate.mid { background: var(--warning-soft); color: #B45309; }
.rate.high { background: var(--primary-tint); color: var(--primary-dark); }
.row-sub .warn, .course-meta .warn { color: var(--warning); }
.list.activity .list-row { align-items: flex-start; }
.act-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.act-icon .ms { font-size: 16px; }
.list.compact .list-row { padding: 10px 14px; }
.row-title.wrap { white-space: normal; }

/* ── Eğitim kartları ────────────────────────────────────────────── */
.cover-status { position: absolute; top: 10px; left: 10px; }
.cover-status .chip { background: rgba(255,255,255,.95); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.people { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.people .ms { font-size: 15px; }
.course-card.static:hover { transform: none; }
.desk-meters { display: flex; flex-direction: column; gap: 4px; width: 220px; }
.desk-meters .meter-row { grid-template-columns: 26px 1fr 40px; font-size: 12px; }

/* ── Kişi kartları (eğitmenler) ─────────────────────────────────── */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.person-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.person-top { display: flex; gap: 12px; align-items: center; }
.person-top strong { display: block; font-size: 15px; }
.person-top .muted { font-size: 13px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.mini-stats.three { grid-template-columns: repeat(3, 1fr); }
.mini-stats.four { grid-template-columns: repeat(4, 1fr); }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.mini-stats strong { display: block; font-size: 18px; font-weight: 800; }
.mini-stats span { font-size: 11px; color: var(--muted); font-weight: 600; }
.course-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.course-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.person-foot .muted .ms { font-size: 14px; vertical-align: -2px; }

/* ── Seçim kartları ve listeleri ────────────────────────────────── */
.role-cards { display: flex; flex-direction: column; gap: 8px; }
.role-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.role-card input { grid-row: span 2; accent-color: var(--primary); width: 18px; height: 18px; }
.role-card span { font-size: 13px; color: var(--muted); }
.role-card.on { border-color: var(--primary); background: var(--primary-tint); }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { text-align: left; border: 1.5px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.choice-card:hover { border-color: var(--primary); background: var(--primary-tint); }
.choice-card .ms { font-size: 26px; color: var(--primary); }
.choice-card span { font-size: 13px; color: var(--muted); }
.check-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; max-height: 240px; overflow-y: auto; }
.check-list.tall { max-height: 420px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.check-row:first-child { border-top: none; }
.check-row[hidden] { display: none; }
.check-row > span:not(.chip) { flex: 1; min-width: 0; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-row:hover { background: var(--surface-2); }
.assign-row label.grow { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.owner-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; }
.owner-pick .ms { font-size: 14px; color: #CA8A04; }
.owner-pick input { accent-color: #CA8A04; }
.secret { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; }
.secret code { font-size: 18px; font-weight: 700; letter-spacing: .04em; word-break: break-all; }

.info-list { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 0; font-size: 13px; }
.info-list dt, .info-list dd { padding: 9px 20px; border-top: 1px solid var(--border); }
.info-list dt { color: var(--muted); font-weight: 600; padding-right: 8px; }
.info-list dd { padding-left: 8px; word-break: break-word; }
.info-list dt:first-of-type, .info-list dt:first-of-type + dd { border-top: none; }
.info-list.roles dd { color: var(--text-mid); }

/* ── Çeviri masası ──────────────────────────────────────────────── */
.sticky-filters { position: sticky; top: 8px; z-index: 12; }
.desk-progress { min-width: 240px; }
.desk-item { padding: 14px 16px; margin-bottom: 10px; border-left: 4px solid #F59E0B; }
.desk-item.done { border-left-color: var(--primary); }
.desk-item.chapter-head { margin-top: 22px; }
.desk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.desk-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.desk-kind .ms { font-size: 18px; color: var(--muted); }
.desk-state { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #B45309; }
.desk-item.done .desk-state { color: var(--primary-dark); }
.desk-state .ms { font-size: 16px; }
.desk-fields { display: flex; flex-direction: column; gap: 12px; }
.desk-field { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.desk-src, .desk-dst { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.src-text { font-size: 14px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; white-space: pre-wrap; word-break: break-word; min-height: 40px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--info); }
.link-btn .ms { font-size: 14px; }
.link-btn:hover { text-decoration: underline; }
.save-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #111827; color: #fff; border-radius: 14px; padding: 10px 14px; margin-top: 16px; box-shadow: var(--shadow-lg); }
.save-bar .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }

/* ── Bölüm: dile özel medya ─────────────────────────────────────── */
.lang-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang-media-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; gap: 12px; background: var(--surface-2); }
.lang-media-card .file-box { background: var(--surface); }
.audio { width: 100%; display: block; background: #fff; }

/* ── Ayarlar ────────────────────────────────────────────────────── */
.switch.setting { align-items: flex-start; padding: 4px 0; }
.switch.setting .track { margin-top: 2px; }
.num-row { display: flex; align-items: center; gap: 12px; }
.num-row .input { width: 100px; }
.sticky-actions { position: sticky; bottom: 12px; background: rgba(245, 247, 245, .92); backdrop-filter: blur(6px); padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.in-input { position: absolute; right: 3px; top: 3px; }

/* ── Duyarlı düzen ──────────────────────────────────────────────── */
@media (max-width: 1080px) {
    .quiz-editor-wrap, .preview-wrap { grid-template-columns: 1fr; }
    .q-preview { position: static; }
    .desk-meters { width: 160px; }
}
@media (max-width: 820px) {
    .topbar .lang-switch { margin-left: auto; flex-shrink: 0; }
    .topbar .lang-switch + .btn-icon { margin-left: 0; }
    .topbar > .btn-icon { margin-left: 0; flex-shrink: 0; }
    .topbar .nav a .nav-badge { margin-left: 4px; }
    .stats.six, .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .desk-field, .lang-media, .choice-cards { grid-template-columns: 1fr; }
    .row-fields.three { grid-template-columns: 1fr 1fr; }
    .search { min-width: 0; flex: 1 1 100%; }
    .select { max-width: none; flex: 1 1 calc(50% - 10px); }
    .desk-meters { display: none; }
    .quiz-context, .quiz-expl, .quiz-meta, .quiz-card .callout.compact { margin-left: 0; }
    .bar-list li { grid-template-columns: 84px 1fr auto; }
}
@media (max-width: 520px) {
    .stats.six, .stats.three { grid-template-columns: 1fr; }
    .mini-stats.four { grid-template-columns: repeat(2, 1fr); }
    .people-grid { grid-template-columns: 1fr; }
    .info-list { grid-template-columns: 1fr; }
    .info-list dt { border-top: 1px solid var(--border); padding-bottom: 0; }
    .info-list dd { border-top: none; padding-top: 2px; padding-left: 20px; }
}
.main { padding-bottom: 104px; }
/* Telefon: menü yatay kayar, dil seçici ve hesap düğmeleri sağda sabit kalır. */
@media (max-width: 820px) {
    .topbar { overflow: visible; gap: 6px; }
    .topbar .nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .topbar .nav::-webkit-scrollbar { display: none; }
    .topbar .nav a { white-space: nowrap; flex-shrink: 0; }
    .topbar .lang-switch button { padding: 4px 7px; }
}
@media (max-width: 520px) { .topbar .lang-switch { display: none; } }
