/* Тренажёр «Управление компанией». Дашборд - тёмный, кейс и разбор - светлые. Токены - в :root. */
:root {
  --dark-bg: #0B0F14;
  --dark-card: #11161D;
  --dark-text: #E6EAF0;
  --dark-muted: #8A94A3;
  --dark-line: #1E2630;
  --light-bg: #F7F8FA;
  --light-card: #FFFFFF;
  --light-text: #1B2330;
  --light-muted: #5F6B7A;
  --light-line: #E1E5EB;
  --accent: #3D7EFF;
  --good: #2FA36B;
  --bad: #D9534F;
  --warn: #C98A1B;
  --radius: 10px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.t-body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--light-bg); color: var(--light-text); font-size: 16px; line-height: 1.6; overflow-x: hidden; }
body.t-dark { background: var(--dark-bg); color: var(--dark-text); }

.t-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gutter); border-bottom: 1px solid var(--light-line); background: var(--light-card); flex-wrap: wrap; }
.t-dark .t-top { background: var(--dark-card); border-color: var(--dark-line); }
.t-brand { font-weight: 600; color: inherit; text-decoration: none; }
.t-brand[aria-current="page"] { color: var(--accent); }
.t-tabs { display: flex; gap: 8px; }
.t-tabs a { color: inherit; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid currentColor; opacity: .7; }
.t-tabs a[aria-current="page"] { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }

.t-main { max-width: 760px; margin: 0 auto; padding: 16px var(--gutter) 96px; }
.t-main h1 { font-size: 22px; line-height: 1.3; margin: 8px 0 12px; }
.t-main h2 { font-size: 18px; margin: 20px 0 8px; }
.t-muted { color: var(--light-muted); }
.t-dark .t-muted { color: var(--dark-muted); }

.t-card { background: var(--light-card); border: 1px solid var(--light-line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.t-dark .t-card { background: var(--dark-card); border-color: var(--dark-line); }

.t-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.t-metric { background: var(--light-card); border: 1px solid var(--light-line); border-radius: var(--radius); padding: 12px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.t-metric .t-value { font-size: 20px; font-weight: 600; }
.t-metric .t-label { font-size: 13px; color: var(--light-muted); }
.t-metric.t-wide { grid-column: span 2; }
.t-bar { height: 8px; background: var(--light-line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.t-bar > span { display: block; height: 100%; background: var(--accent); }
.t-bar.t-fatigue > span { background: var(--warn); }
.t-bar.t-fatigue.t-high > span { background: var(--bad); }

.t-btn { display: inline-block; padding: 12px 18px; border-radius: var(--radius); border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; min-height: 44px; }
.t-btn.t-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.t-btn:disabled { opacity: .45; cursor: not-allowed; }
.t-btn-block { width: 100%; }

.t-option { display: block; width: 100%; text-align: left; background: var(--light-card); border: 1px solid var(--light-line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; font: inherit; color: inherit; cursor: pointer; min-height: 44px; }
.t-option:hover, .t-option.t-selected { border-color: var(--accent); }
.t-option[disabled] { background: #F3F4F6; cursor: not-allowed; }
.t-option .t-cost { font-size: 14px; color: var(--light-muted); margin-top: 4px; }
.t-option .t-cost.t-over { color: var(--warn); }
.t-option .t-unavail { font-size: 14px; color: var(--warn); margin-top: 6px; }
.t-status { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; padding: 10px var(--gutter); background: var(--light-card); border-bottom: 1px solid var(--light-line); }
.t-status .t-label { font-size: 12px; color: var(--light-muted); }
.t-status .t-value { font-size: 16px; font-weight: 600; }
.t-chg { font-size: 13px; margin-left: 4px; }
.t-chg.t-good { color: var(--good); }
.t-chg.t-bad { color: var(--bad); }

.t-delta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-left: 4px solid var(--light-line); background: var(--light-card); border-radius: 6px; margin-bottom: 8px; }
.t-delta.t-good { border-color: var(--good); }
.t-delta.t-bad { border-color: var(--bad); }
.t-delta .t-reason { font-size: 14px; color: var(--light-muted); }

.t-term { border-bottom: 1px dashed var(--accent); cursor: pointer; background: none; padding: 0; font: inherit; color: inherit; }
.t-chip { display: inline-block; margin: 4px 6px 0 0; padding: 4px 10px; border: 1px solid var(--light-line); border-radius: 999px; background: var(--light-card); font-size: 14px; }

.t-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--light-card); border-top: 1px solid var(--light-line); border-radius: 16px 16px 0 0; padding: 18px var(--gutter) 24px; box-shadow: 0 -8px 24px rgba(0,0,0,.12); z-index: 10; max-height: 60vh; overflow: auto; }
.t-sheet[hidden] { display: none; }

.t-field { display: block; margin-bottom: 12px; }
.t-field span { display: block; font-size: 14px; margin-bottom: 4px; color: var(--light-muted); }
.t-field input, .t-field select, .t-field textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--light-line); border-radius: 8px; background: #fff; color: inherit; min-height: 44px; }
.t-fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.t-fieldset legend { font-size: 14px; color: var(--light-muted); padding: 0; margin-bottom: 6px; }
.t-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; }

.t-consequence { border: 1px dashed var(--warn); background: #FFF8EC; }
.t-payoff { border: 1px dashed var(--good); background: #EEF8F2; }
.t-goal { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--light-line); }
.t-goal.t-good { color: var(--good); }
.t-goal strong { white-space: nowrap; }
.t-report-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.t-report-row.t-total { border-top: 1px solid var(--light-line); margin-top: 4px; font-weight: 700; }
.t-draft { background: #FFF8EC; border: 1px solid var(--warn); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.t-prose p, .t-prose li { max-width: 68ch; }

.t-tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: none; background: var(--light-card); border-top: 1px solid var(--light-line); padding: 8px; gap: 8px; z-index: 5; }
.t-tabbar a { flex: 1; text-align: center; padding: 10px; color: inherit; text-decoration: none; border-radius: 8px; min-height: 44px; }
.t-tabbar a[aria-current="page"] { background: var(--accent); color: #fff; }

@media (max-width: 720px) {
  .t-tabbar { display: flex; }
  .t-tabs { display: none; }
}

.t-seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.t-seg .t-btn, .t-conf .t-btn { flex: 1 1 auto; padding: 10px 12px; }
.t-btn.t-selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.t-conf { display: flex; gap: 8px; flex-wrap: wrap; }
.t-option.t-locked { cursor: default; }
.t-option.t-right { border: 3px solid var(--good); background: #E8F6EE; padding: 12px; }
.t-option.t-wrong { border: 3px solid var(--bad); background: #FBEAE9; padding: 12px; }
.t-option.t-locked.t-selected:not(.t-right):not(.t-wrong) { border: 3px solid var(--accent); padding: 12px; }
.t-option .t-note { font-size: 14px; color: var(--light-muted); margin-top: 8px; font-weight: normal; }
.t-key { font-weight: 800; letter-spacing: .04em; }
.t-key-bad { color: var(--bad); }
.t-key-good { color: var(--good); }
.t-option.t-has-mark { display: flex; align-items: flex-start; gap: 12px; }
.t-opt-body { flex: 1; min-width: 0; }
.t-mark { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--light-line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #fff; font-size: 14px; line-height: 1; }
.t-mark-sq { border-radius: 6px; }
.t-option.t-selected .t-mark { background: var(--accent); border-color: var(--accent); }
.t-option.t-selected .t-mark::after { content: "✓"; }
.t-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.t-badge { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; color: #fff; }
.t-badge-you { background: var(--accent); }
.t-badge-good { background: var(--good); }
.t-badge-bad { background: var(--bad); }
.t-badge-muted { background: #fff; color: var(--light-muted); border-color: var(--light-line); }
