/* ===================== Safia Knowledge Base — Styles ===================== */
:root {
  --ink: #1c1f2a;
  --ink-soft: #2a2e3c;
  --gold: #c6a038;
  --gold-light: #e2c168;
  --gold-dark: #8a6d3b;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --border: #e7e3da;
  --text: #23252d;
  --text-muted: #6b6f7d;
  --green: #2e7d4f;
  --red: #c14545;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(28, 31, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(28, 31, 42, 0.14);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; background: var(--surface); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #241d08; box-shadow: 0 4px 14px rgba(198, 160, 56, 0.35); }
.btn--gold:hover { box-shadow: 0 6px 18px rgba(198, 160, 56, 0.45); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--bg); }
.btn--telegram { background: #26a5e4; color: #fff; }
.btn--lg { padding: 13px 26px; font-size: 15px; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn--block { width: 100%; justify-content: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  position: relative; font-size: 18px; color: var(--text);
}

/* ---------- Chips ---------- */
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip--active { background: var(--ink); color: var(--gold-light); border-color: var(--ink); }
.chip--sm { padding: 5px 12px; font-size: 12px; }
.chip--lg { padding: 11px 18px; font-size: 14px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip-row--wrap { row-gap: 10px; }

/* ---------- Toast ---------- */
#toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); transition: all .25s ease; font-size: 13.5px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast--ok i { color: var(--gold-light); }
.toast--err i { color: #ff8080; }

/* ===================== LANDING ===================== */
.landing { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--ink);
  color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.brand-text { font-weight: 800; font-size: 19px; line-height: 1; display: flex; flex-direction: column; }
.brand-text em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.brand--sm .brand-mark { width: 32px; height: 32px; font-size: 16px; }

.site-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 40px 0 60px; }
.eyebrow { color: var(--gold-dark); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hero__text h1 { font-size: 40px; line-height: 1.15; margin: 14px 0 16px; }
.hero__text p { color: var(--text-muted); font-size: 16px; line-height: 1.6; max-width: 480px; }
.hero__actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero__art { position: relative; height: 320px; }
.hero-card {
  position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px;
}
.hero-card i { color: var(--gold); font-size: 20px; }
.hero-card--1 { top: 10%; left: 4%; }
.hero-card--2 { top: 46%; left: 30%; }
.hero-card--3 { top: 74%; left: 2%; }
.hero-card--1, .hero-card--3 { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero-card--1 i, .hero-card--3 i { color: var(--gold-light); }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 10px 0 50px; }
.stat-card { background: var(--ink); border-radius: var(--radius); padding: 26px; color: #fff; text-align: center; }
.stat-card__value { font-size: 34px; font-weight: 800; color: var(--gold-light); }
.stat-card__label { margin-top: 6px; color: #cfd2db; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }

.modules h2 { text-align: center; font-size: 26px; margin-bottom: 28px; }
.modules__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.module-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease;
}
.module-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.module-card__icon {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(198,160,56,.14); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}
.module-card h3 { font-size: 16px; margin-bottom: 6px; }
.module-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; min-height: 40px; }
.module-card__link { color: var(--gold-dark); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; }

.site-footer { margin-top: 60px; border-top: 1px solid var(--border); padding-top: 26px; text-align: center; color: var(--text-muted); }
.site-footer p { margin: 10px 0; font-size: 13.5px; }
.site-footer__links { display: flex; justify-content: center; gap: 10px; font-size: 13px; }
.site-footer .brand--sm { justify-content: center; display: inline-flex; }

/* ===================== AUTH ===================== */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; position: relative; background: radial-gradient(circle at 20% 20%, #fbf7ec, var(--bg) 60%); }
.auth__back { position: absolute; top: 26px; left: 26px; display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; font-size: 13.5px; }
.auth__panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 40px 38px; width: 420px; max-width: 100%; }
.auth__brand { justify-content: center; display: flex; margin-bottom: 18px; }
.auth__panel h1 { text-align: center; font-size: 22px; }
.auth__sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin: 8px 0 26px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; background: var(--bg); color: var(--text);
}
.field input:focus, .field textarea:focus, .field input:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 1px; background: var(--surface); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===================== APP SHELL ===================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--ink); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 20px 14px; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 8px 10px 20px; }
.sidebar .brand-text { color: #fff; }
.sidebar .brand-text em { color: #9298a8; }
.sidebar__nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: #c3c6d1; font-weight: 600; font-size: 14px; border: none; background: none; width: 100%; text-align: left;
}
.nav-item i { font-size: 18px; width: 20px; text-align: center; color: #8a8fa0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item--active { background: rgba(198,160,56,.16); color: var(--gold-light); }
.nav-item--active i { color: var(--gold-light); }
.nav-item--logout { margin-top: 10px; color: #e6a2a2; }
.nav-item--logout i { color: #e6a2a2; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 14px 10px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar__user-info { display: flex; flex-direction: column; overflow: hidden; }
.sidebar__user-info strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-info span { font-size: 11.5px; color: #9298a8; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(160deg, var(--gold-light), var(--gold-dark));
  color: #241d08; font-weight: 800; font-size: 13.5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--xs { width: 26px; height: 26px; font-size: 10.5px; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 26px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar__title { font-size: 20px; }
.topbar__actions { display: flex; align-items: center; gap: 14px; }
.badge-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }

.content { padding: 26px; flex: 1; overflow-x: hidden; }

/* ---------- Panels / cards ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.panel__head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panel__head h2 i { color: var(--gold-dark); }
.tag { background: var(--bg); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag--green { background: #e7f5ec; color: var(--green); border-color: #cbe9d5; }
.tag--gold { background: #fbf1da; color: var(--gold-dark); border-color: #f0dfaf; }
.tag--red { background: #fbe9e9; color: var(--red); border-color: #f3caca; }
.tag--muted { background: var(--bg); color: var(--text-muted); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.metrics-grid--3 { grid-template-columns: repeat(3, 1fr); }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.metric-card__head { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.metric-card__head i { color: var(--gold-dark); font-size: 16px; }
.metric-card__value { font-size: 24px; font-weight: 800; }
.metric-card__delta { margin-top: 6px; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.metric-card__delta.up { color: var(--green); }
.metric-card__delta.down { color: var(--red); }

.progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 8px; }
.progress__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.progress__fill--green { background: linear-gradient(90deg, #2e7d4f, #4fae74); }

/* ---------- Q&A list ---------- */
.qa-list { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; }
.qa-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.qa-item__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap; }
.qa-item__time { margin-left: auto; }
.qa-item p { font-size: 14px; margin-bottom: 10px; line-height: 1.4; }
.qa-item__actions { display: flex; gap: 8px; }
.qa-item__reply { display: flex; gap: 8px; margin-top: 10px; }
.qa-item__reply textarea { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; resize: vertical; }
.prio { padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 11px; }
.prio--high { background: #fbe9e9; color: var(--red); }
.prio--medium { background: #fbf1da; color: var(--gold-dark); }
.prio--low { background: var(--bg); color: var(--text-muted); }

.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.notif-item i { color: var(--gold-dark); margin-top: 2px; }
.notif-item span { color: var(--text-muted); font-size: 12px; }

.quick-actions, .quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-grid { margin-bottom: 20px; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 8px; font-weight: 600; font-size: 12.5px; text-align: center;
}
.quick-action i { font-size: 22px; color: var(--gold-dark); }
.quick-action:hover { border-color: var(--gold); background: #fdf9ef; }
.settings-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Greeting / employee ---------- */
.greeting-card { background: linear-gradient(120deg, var(--ink), #2c3040); color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.greeting-card h2 { font-size: 21px; margin-bottom: 6px; }
.greeting-card p { color: #b9bdca; font-size: 13.5px; }
.ai-quick__form { display: flex; gap: 10px; }
.ai-quick__form input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px; background: var(--bg); }
.ai-quick__form input:focus { outline: 2px solid var(--gold-light); background: var(--surface); }
.ai-quick { background: linear-gradient(180deg, #fdf9ef, var(--surface)); }

.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.history-item:hover { background: var(--bg); border-color: var(--border); }
.history-item p { font-size: 13.5px; margin-bottom: 3px; }
.history-item span { font-size: 11.5px; color: var(--text-muted); }

.soc-card { text-align: center; padding: 6px 0; }
.soc-card__icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(198,160,56,.14); color: var(--gold-dark); display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 12px; }
.soc-card h3 { font-size: 16px; margin-bottom: 4px; }
.soc-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.soc-card .btn { margin-top: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.star { color: var(--gold); }
.table-note { padding: 10px 4px 0; font-size: 12px; }
.select-sm { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12.5px; background: var(--bg); }

/* ---------- Charts ---------- */
.bar-chart { width: 100%; height: auto; }
.chart-label { font-size: 11px; fill: var(--text-muted); }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.donut { flex-shrink: 0; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }

/* ---------- Editor / upload ---------- */
.upload-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px; }
.upload-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); padding: 28px; cursor: pointer; color: var(--text-muted); margin-bottom: 14px;
}
.dropzone i { font-size: 26px; color: var(--gold-dark); }
.dropzone:hover { border-color: var(--gold); background: #fdf9ef; }
.upload-url { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; }
.file-xlsx { color: var(--green); font-size: 18px; }
.file-doc { color: #3a6fd6; font-size: 18px; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - 160px); }
.chat-history { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-y: auto; }
.chat-window { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat-window__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bubble { display: flex; gap: 10px; max-width: 72%; }
.bubble--ai { align-self: flex-start; }
.bubble--user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--gold-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.bubble__text { padding: 12px 15px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.bubble--ai .bubble__text { background: var(--bg); border: 1px solid var(--border); border-top-left-radius: 4px; }
.bubble--user .bubble__text { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #241d08; border-top-right-radius: 4px; font-weight: 500; }
.dot-flash { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); display: inline-block; margin: 0 2px; animation: flash 1.2s infinite ease-in-out; }
.dot-flash:nth-child(2) { animation-delay: .2s; }
.dot-flash:nth-child(3) { animation-delay: .4s; }
@keyframes flash { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.chat-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; max-height: 120px; }
.chat-input textarea:focus { outline: 2px solid var(--gold-light); }
.chat-input .btn { align-self: flex-end; border-radius: 50%; width: 44px; height: 44px; padding: 0; justify-content: center; }

/* ---------- Toolbar / search ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; flex: 1; max-width: 420px; }
.search-box i { color: var(--text-muted); }
.search-box input { border: none; outline: none; background: none; flex: 1; font-size: 14px; }

/* ---------- Knowledge base cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: left; }
.kb-card__icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(198,160,56,.14); color: var(--gold-dark); display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 12px; }
.kb-card h3 { font-size: 15px; margin-bottom: 4px; }
.kb-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.kb-card--select { cursor: pointer; width: 100%; transition: border-color .12s ease, box-shadow .12s ease; }
.kb-card--select:hover { border-color: var(--gold); }
.kb-card--chosen { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,160,56,.18); }

/* ---------- Trainer ---------- */
.quiz-panel { max-width: 700px; margin: 0 auto; }
.quiz-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
.quiz-question { font-size: 19px; margin-bottom: 20px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.quiz-option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.quiz-option:hover { border-color: var(--gold); }
.quiz-option--selected { border-color: var(--gold); background: #fdf9ef; box-shadow: 0 0 0 3px rgba(198,160,56,.15); }
.quiz-option__mark { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }

.result-panel { max-width: 620px; margin: 0 auto; text-align: center; }
.result-score { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; margin: 0 auto 16px; }
.result-score--good { background: #e7f5ec; color: var(--green); }
.result-score--bad { background: #fbe9e9; color: var(--red); }
.result-breakdown { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; text-align: left; }
.result-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.result-item.ok i { color: var(--green); }
.result-item.bad i { color: var(--red); }
.result-item p { font-size: 13.5px; margin-bottom: 4px; font-weight: 600; }
.result-item span { display: block; font-size: 12.5px; color: var(--text-muted); }
.correct-answer { color: var(--green) !important; font-weight: 600; }
.result-actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- Library ---------- */
.books-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.book-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.book-cover { height: 130px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; margin-bottom: 12px; }
.book-card h3 { font-size: 13.5px; margin-bottom: 4px; line-height: 1.35; min-height: 36px; }
.book-card p { font-size: 11.5px; margin-bottom: 10px; }
.book-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Orders / stepper ---------- */
.stepper { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.stepper__step { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.stepper__step span { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.stepper__step.active { border-color: var(--gold); color: var(--text); background: #fdf9ef; }
.stepper__step.active span { background: var(--gold); color: #241d08; }
.stepper__step.done span { background: var(--green); color: #fff; }
.step-title { font-size: 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.step-title i { color: var(--gold-dark); }
.stepper-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.form-grid { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.order-summary { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.order-summary__row { display: flex; justify-content: space-between; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.order-summary__total { display: flex; justify-content: space-between; font-size: 19px; font-weight: 800; margin-top: 6px; color: var(--gold-dark); }

/* ---------- Settings ---------- */
.settings-profile { display: flex; gap: 18px; margin-bottom: 18px; }
.settings-profile > div { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.switch-row:last-child { border-bottom: none; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--gold); }
.settings .btn--ghost { margin-bottom: 10px; }

/* ---------- Telegram login panel ---------- */
.tg-panel { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.tg-panel p { font-size: 13.5px; color: var(--text-muted); }
.tg-panel__hint { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tg-panel--error p { color: var(--red); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Staff directory ---------- */
.staff-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.staff-filters { display: flex; gap: 8px; align-items: center; }
.staff-actions { display: flex; gap: 8px; margin-left: auto; }
.staff-actions .btn input[type="file"] { display: none; }
.staff-bulk-bar {
  display: flex; align-items: center; justify-content: space-between; background: #fdf9ef;
  border: 1px solid var(--gold-light); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; font-size: 13.5px; font-weight: 600;
}
.staff-row-actions { display: flex; gap: 6px; }
.staff-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px; }
.staff-pagination__btns { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.icon-btn--sm { width: 30px; height: 30px; font-size: 14px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28, 31, 42, 0.55); display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal { background: var(--surface); border-radius: var(--radius); width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; }
.modal__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal__body select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
  .metrics-grid, .metrics-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .books-grid { grid-template-columns: repeat(3, 1fr); }
  .modules__grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero__art { display: none; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: -100%; z-index: 50; transition: left .2s ease; }
  .metrics-grid, .metrics-grid--3, .quick-actions, .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row, .modules__grid, .books-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-history { display: none; }
}
