/* МудаНет — дизайн-токены по §5.3 проектного документа.
   Принципы: дизайн как Poka-Yoke, плотность без перегруза,
   статус читается с трёх метров, скучный хром — живые данные. */

:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --border: #E3E2DE;
  --text: #1A1A18;
  --text-muted: #6B6A66;
  --accent: #C2410C;
  --accent-soft: #FFF1E7;
  --st-wait: #9CA3AF;
  --st-test: #2563EB;
  --st-ok: #16A34A;
  --st-fail: #DC2626;
  --st-esc: #D97706;
  --st-frozen: #0E7490;
  --radius: 8px;
  --radius-s: 6px;
  --shadow: 0 1px 2px rgba(26,26,24,.05);
  --shadow-hover: 0 2px 8px rgba(26,26,24,.10);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #161514;
  --surface: #1F1E1C;
  --border: #34322E;
  --text: #ECEBE8;
  --text-muted: #A3A19B;
  --accent: #EA580C;
  --accent-soft: #33200F;
  --shadow: 0 1px 2px rgba(0,0,0,.35);
  --shadow-hover: 0 2px 10px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 .8em; }
.muted { color: var(--text-muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.inline-form { display: inline; }

/* ---------- Каркас кабинета ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--surface);
  padding: 16px 10px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; text-decoration: none !important; }
.brand-name { font-weight: 750; font-size: 16px; color: var(--text); letter-spacing: -.01em; }
.brand-mark { border-radius: 7px; flex-shrink: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: var(--radius-s); color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  border: 0; background: none; cursor: pointer; font-family: inherit; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.logout-form { margin: 0; }
.user-chip { display: flex; gap: 9px; align-items: center; padding: 10px 8px 2px; border-top: 1px solid var(--border); margin-top: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--text-muted); }

.main { flex: 1; min-width: 0; padding: 22px 26px 48px; max-width: 1440px; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: 13px; }
.page-head .spacer { flex: 1; }

/* ---------- Кнопки и формы ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 550; font-family: inherit; cursor: pointer;
  text-decoration: none !important; transition: box-shadow .12s, border-color .12s;
}
.btn:hover { box-shadow: var(--shadow-hover); border-color: var(--text-muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.link-btn { border: 0; background: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--st-fail); }
.field .error { color: var(--st-fail); font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .form-grid, .form-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Карточки и панели ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 15px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- KPI-плитки ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-family: var(--mono); font-size: 30px; font-weight: 650; line-height: 1.15; margin-top: 4px; }
.kpi .kpi-note { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.kpi-good .kpi-value { color: var(--st-ok); }
.kpi-warn .kpi-value { color: var(--st-esc); }
.kpi-bad .kpi-value { color: var(--st-fail); }

/* ---------- Статусы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 650; color: #fff; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.75); }
.badge-wait { background: var(--st-wait); }
.badge-test { background: var(--st-test); }
.badge-ok { background: var(--st-ok); }
.badge-fail { background: var(--st-fail); }
.badge-esc { background: var(--st-esc); }
.badge-frozen { background: var(--st-frozen); }
.stripe-wait { border-left: 3px solid var(--st-wait) !important; }
.stripe-test { border-left: 3px solid var(--st-test) !important; }
.stripe-ok { border-left: 3px solid var(--st-ok) !important; }
.stripe-fail { border-left: 3px solid var(--st-fail) !important; }
.stripe-esc { border-left: 3px solid var(--st-esc) !important; }
.stripe-frozen { border-left: 3px solid var(--st-frozen) !important; }

/* ---------- Таблицы ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--bg); }

/* ---------- Матрица ---------- */
.matrix-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.matrix { border-collapse: separate; border-spacing: 0; min-width: 900px; width: 100%; font-size: 12.5px; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; vertical-align: top; }
table.matrix thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 9px 10px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); text-align: left;
}
table.matrix tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--surface); padding: 10px;
  font-size: 12.5px; font-weight: 600; text-align: left; min-width: 170px; max-width: 210px;
}
table.matrix td { min-width: 150px; height: 64px; }
.mcell { display: flex; flex-direction: column; gap: 4px; padding: 6px; min-height: 64px; }
.mchip {
  display: block; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 5px 7px 5px 9px;
  background: var(--surface); color: var(--text); text-decoration: none !important;
  box-shadow: var(--shadow); transition: box-shadow .12s;
}
.mchip:hover { box-shadow: var(--shadow-hover); }
.mchip .mchip-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.mchip .code { font-family: var(--mono); font-weight: 650; font-size: 11.5px; }
.mchip .mprod { font-size: 11px; color: var(--text-muted); }
.mchip .mmeta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.mplus {
  display: flex; align-items: center; justify-content: center; min-height: 52px; margin: 6px;
  border: 1px dashed var(--border); border-radius: var(--radius-s); color: var(--text-muted);
  font-size: 18px; text-decoration: none !important; opacity: .45; transition: opacity .12s, border-color .12s;
}
.mplus:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* ---------- Канбан ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
@media (max-width: 1280px) { .board { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .board { grid-template-columns: 1fr; } }
.col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; padding: 0 2px; }
.col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.col-count { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }
.col-wait .col-title { color: var(--st-wait); } .col-test .col-title { color: var(--st-test); }
.col-ok .col-title { color: var(--st-ok); } .col-fail .col-title { color: var(--st-fail); }
.col-esc .col-title { color: var(--st-esc); } .col-frozen .col-title { color: var(--st-frozen); }
.col.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.col .wip { font-size: 11px; color: var(--text-muted); }
.col .wip.full { color: var(--st-fail); font-weight: 650; }
.kcard {
  display: block; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 8px 10px; margin-bottom: 8px; cursor: grab; color: var(--text); text-decoration: none !important;
  box-shadow: var(--shadow);
}
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .kc-top { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.kcard .code { font-family: var(--mono); font-weight: 700; font-size: 12px; }
.kcard .kc-axes { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.kcard .kc-text { font-size: 12.5px; line-height: 1.4; }
.kcard .kc-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.kcard .overdue { color: var(--st-fail); font-weight: 650; }

/* ---------- Карточка гипотезы ---------- */
.hyp-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.hyp-head .code-line { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.hyp-head .code { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--text-muted); }
.hyp-statement { font-size: 19px; font-weight: 650; line-height: 1.4; margin: 0; }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.props > div { padding: 8px 0; border-bottom: 1px solid var(--border); }
.props .k { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
.props .v { font-size: 13.5px; margin-top: 2px; }
.budget-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 6px; }
.budget-bar i { display: block; height: 100%; background: var(--st-test); }
.budget-bar i.over { background: var(--st-fail); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ''; position: absolute; left: 9.5px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t-date { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.learned-box { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.learned-box .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 4px; }
.stamp {
  display: inline-block; transform: rotate(-6deg); border: 3px solid var(--st-fail); color: var(--st-fail);
  font-weight: 800; font-size: 13px; letter-spacing: .12em; padding: 3px 10px; border-radius: 4px; text-transform: uppercase;
}

/* ---------- Спринты ---------- */
.sprint-card { display: flex; gap: 16px; align-items: flex-start; }
.sprint-no {
  font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; flex-shrink: 0;
}
.sprint-summary { white-space: pre-line; font-size: 13.5px; }
.countdown { font-family: var(--mono); font-weight: 650; }

/* ---------- Ревью (режим ведущего) ---------- */
.review { max-width: 880px; margin: 0 auto; padding: 28px 20px 60px; }
.review-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.review-timer {
  font-family: var(--mono); font-size: 34px; font-weight: 700; padding: 6px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.review-timer.low { color: var(--st-fail); border-color: var(--st-fail); }
.rcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.rcard .r-statement { font-size: 17px; font-weight: 600; line-height: 1.45; }
.rcard .r-meta { display: flex; gap: 18px; margin: 10px 0 14px; font-size: 12.5px; color: var(--text-muted); font-family: var(--mono); flex-wrap: wrap; }
.verdict-row { display: flex; gap: 8px; flex-wrap: wrap; }
.vbtn { flex: 1; min-width: 130px; padding: 9px 6px; border-radius: var(--radius-s); border: 1.5px solid var(--border); background: var(--bg); font-family: inherit; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--text); }
.vbtn:hover { box-shadow: var(--shadow-hover); }
.vbtn[data-v="ok"]:hover, .vbtn[data-v="ok"].on { border-color: var(--st-ok); color: var(--st-ok); }
.vbtn[data-v="fail"]:hover, .vbtn[data-v="fail"].on { border-color: var(--st-fail); color: var(--st-fail); }
.vbtn[data-v="esc"]:hover, .vbtn[data-v="esc"].on { border-color: var(--st-esc); color: var(--st-esc); }
.vbtn[data-v="frozen"]:hover, .vbtn[data-v="frozen"].on { border-color: var(--st-frozen); color: var(--st-frozen); }
.rcard .learn-area { margin-top: 12px; display: none; }
.rcard.deciding .learn-area { display: block; }
.rcard.done { opacity: .55; }
.rcard.done .verdict-row, .rcard.done .learn-area { display: none; }
.rcard .done-line { display: none; font-weight: 650; margin-top: 8px; }
.rcard.done .done-line { display: block; }

/* ---------- Метрики / графики ---------- */
.chart-svg { width: 100%; height: auto; display: block; }
.bar-row { display: grid; grid-template-columns: 190px 1fr 90px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.bar-row:last-child { border-bottom: 0; }
.bar-track { height: 18px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--st-test); border-radius: 4px; }
.bar-row .num { text-align: right; }

/* ---------- Карта потока (VSM) ---------- */
.vsm { display: flex; gap: 0; overflow-x: auto; padding: 8px 0 16px; align-items: stretch; }
.vsm-stage { min-width: 200px; flex: 1; display: flex; flex-direction: column; }
.vsm-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.vsm-box .v-name { font-weight: 700; font-size: 14px; }
.vsm-box .v-nums { display: flex; gap: 12px; margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.vsm-box .v-conv { color: var(--st-test); font-weight: 650; }
.vsm-arrow { display: flex; align-items: center; color: var(--text-muted); padding: 0 4px; font-size: 18px; }
.vsm-muda { margin-top: 10px; background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: var(--radius-s); padding: 9px 11px; font-size: 12px; }
.vsm-muda .m-tag { color: var(--accent); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.vsm-muda .m-fix { color: var(--text-muted); margin-top: 4px; }
.vsm-muda .m-fix::before { content: '→ '; color: var(--st-ok); }

/* ---------- Ресурсы ---------- */
.res-fresh { color: var(--st-ok); font-weight: 600; }
.res-stale { color: var(--st-esc); font-weight: 600; }
.res-old { color: var(--st-fail); font-weight: 600; }

/* ---------- Тост и модалка ---------- */
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 90; max-width: 380px;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: var(--radius);
  font-size: 13.5px; box-shadow: var(--shadow-hover); animation: toast-in .25s ease;
}
.toast-warn { background: var(--st-esc); color: #fff; }
.toast-err { background: var(--st-fail); color: #fff; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; background: rgba(26,26,24,.45); z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; max-width: 520px; width: 100%; box-shadow: var(--shadow-hover); }

/* ---------- Публичная часть ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.pub-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
.pub-header-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.pub-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 550; }
.pub-nav a { color: var(--text); }
.hero { padding: 72px 0 36px; text-align: center; }
.hero h1 { font-size: 40px; letter-spacing: -.02em; max-width: 720px; margin: 0 auto 14px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 17px; color: var(--text-muted); max-width: 620px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { font-size: 12.5px; color: var(--text-muted); margin-top: 12px; }
.demo-matrix { margin: 44px auto 0; max-width: 880px; }
.section { padding: 48px 0; }
.section h2 { font-size: 26px; text-align: center; margin-bottom: 8px; }
.section .section-sub { text-align: center; color: var(--text-muted); max-width: 640px; margin: 0 auto 32px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: var(--mono);
  margin-bottom: 8px; font-size: 13px;
}
.step h3 { margin-bottom: 4px; }
.step p { font-size: 13px; color: var(--text-muted); margin: 0; }
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .pricing { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pricing { grid-template-columns: 1fr; } }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-hover); }
.price-card .plan { font-weight: 700; font-size: 15px; }
.price-card .price { font-family: var(--mono); font-size: 26px; font-weight: 700; margin: 8px 0 2px; }
.price-card .per { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.price-card ul { margin: 0 0 16px; padding: 0 0 0 18px; font-size: 13px; color: var(--text-muted); flex: 1; }
.price-card li { margin-bottom: 5px; }
.pub-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 13px; }
.login-box { max-width: 380px; margin: 9vh auto; }

/* ---------- Вики ---------- */
.wiki { max-width: 800px; margin: 0 auto; padding: 40px 22px 80px; }
.wiki h1 { font-size: 32px; }
.wiki h2 { font-size: 21px; margin-top: 36px; }
.muda-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.muda-card h3 { margin-bottom: 4px; }
.muda-card .m-found { font-size: 13px; margin-bottom: 6px; }
.muda-card .m-tool { font-size: 12.5px; color: var(--text-muted); }
.muda-card .m-tool::before { content: 'Инструмент: '; font-weight: 650; color: var(--st-ok); }

/* ---------- Отчёт (печать) ---------- */
.report { max-width: 860px; margin: 0 auto; padding: 32px 24px 64px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 22px; }
.report h1 { font-size: 26px; margin: 0; }
.report .lessons li { margin-bottom: 8px; }
@media print {
  body { background: #fff; font-size: 12px; }
  .no-print { display: none !important; }
  .panel, .kpi { box-shadow: none; break-inside: avoid; }
  .report { padding: 0; max-width: none; }
}

/* ---------- Вкладки настроек ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Строки-формы (оси, метрики, поток) ---------- */
.axis-row { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
.axis-row input[type="text"], .axis-row input[type="number"] { padding: 6px 9px; font-size: 13px; }
.axis-row .btn-sm { flex-shrink: 0; padding: 5px 9px; }
.chk { display: flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; font-weight: 600; cursor: pointer; }

/* ---------- Дашборд 2.0 ---------- */
.dash-main { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.dash-three { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 1100px) { .dash-main, .dash-three { grid-template-columns: 1fr; } }

@keyframes growW { from { width: 0; } }
.grow { animation: growW .8s cubic-bezier(.2,.7,.3,1) both; }
@keyframes ringIn { from { stroke-dasharray: 0 999; } }
.ring-anim { animation: ringIn 1s cubic-bezier(.2,.7,.3,1) both; }
@keyframes lineIn { from { opacity: 0; } to { opacity: 1; } }
.line-anim { animation: lineIn .9s ease both; }

/* пульс гипотез */
.pulse-legend { float: right; display: inline-flex; gap: 12px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.pulse-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.pulse-row {
  display: flex; gap: 12px; align-items: center; padding: 10px 10px; margin: 0 -10px;
  border-radius: var(--radius-s); text-decoration: none !important; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.pulse-row:last-of-type { border-bottom: 0; }
.pulse-row:hover { background: var(--bg); }
.pulse-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.pd-go { background: var(--st-ok); animation: pulseGo 2s infinite; }
.pd-slow { background: var(--st-esc); }
.pd-stuck { background: var(--st-fail); animation: pulseBad 1.4s infinite; }
@keyframes pulseGo {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
@keyframes pulseBad {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  70% { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.pulse-main { flex: 1; min-width: 0; }
.pulse-title { display: block; font-size: 13px; font-weight: 600; }
.pulse-title .num { color: var(--accent); }
.pulse-note { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-row { flex-wrap: wrap; }
.pulse-main { min-width: 220px; }
.pulse-meters { display: flex; gap: 14px; flex-shrink: 0; margin-left: auto; }
.pm { display: flex; flex-direction: column; gap: 3px; width: 104px; }
.pm-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.pm b { font-size: 12.5px; font-family: var(--mono); }
.pm-track { height: 5px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.pm-track i { display: block; height: 100%; border-radius: 3px; }
@media (max-width: 760px) { .pulse-meters { display: none; } }

.queue-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12px; }
.queue-chip {
  display: inline-block; padding: 3px 9px; border: 1px solid var(--border); border-radius: 99px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text); text-decoration: none !important; background: var(--bg);
}
.queue-chip:hover { border-color: var(--accent); color: var(--accent); }
.queue-chip.stale { border-color: var(--st-esc); color: var(--st-esc); }

/* кольцо спринта */
.sprint-ring-panel { text-align: center; }
.ring-wrap { display: flex; justify-content: center; margin: 6px 0; }
.ring-meta { font-size: 13.5px; }

/* воронка */
.funnel-row { display: grid; grid-template-columns: 92px 1fr 28px; gap: 8px; align-items: center; padding: 5px 0; text-decoration: none !important; color: var(--text); }
.funnel-row:hover .f-label { color: var(--accent); }
.f-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.f-track { height: 16px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.f-track i { display: block; height: 100%; border-radius: 3px; }
.funnel-row b { text-align: right; font-size: 12.5px; }

/* бублик */
.donut-wrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; flex: 1; min-width: 150px; }
.donut-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.donut-legend b { float: right; font-size: 12px; }

/* теплокарта */
.heat { display: grid; gap: 4px; text-decoration: none !important; max-width: 300px; }
.heat-cell {
  aspect-ratio: 1; border-radius: 4px; background: var(--bg); border: 1px dashed var(--border);
  transition: transform .1s;
}
.heat-cell[style*="background"] { border: 0; }
.heat:hover .heat-cell { transform: scale(.96); }
.heat-cell:hover { transform: scale(1.12) !important; }

/* KPI-доп */
.kpi-ring-tile { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-track { position: relative; height: 6px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); margin-top: 8px; overflow: visible; }
.goal-track i { display: block; height: 100%; border-radius: 3px; }
.goal-track b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-muted); border-radius: 1px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--st-ok); animation: pulseGo 2s infinite; vertical-align: middle; margin-left: 4px; }

/* ---------- Панель фильтров ---------- */
.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input[type="search"] {
  width: auto; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--text);
}
.filter-bar input[type="search"] { min-width: 260px; }

/* ---------- Переключатель воркспейсов ---------- */
.ws-switch { margin: 0 2px 10px; }
.ws-switch select {
  width: 100%; padding: 6px 9px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--bg); color: var(--text);
}
a.user-chip { text-decoration: none !important; color: var(--text); border-radius: var(--radius-s); }
a.user-chip:hover .user-name { color: var(--accent); }

/* ---------- Брендинг ---------- */
.brand-logo { height: 30px; max-width: 150px; object-fit: contain; flex-shrink: 0; }

/* ---------- Мобайл ---------- */
.mobile-top { display: none; }
.backdrop { display: none; }
.burger {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--radius-s); font-size: 18px; line-height: 1; padding: 7px 11px; cursor: pointer;
}

@media (max-width: 760px) {
  .mobile-top {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 60;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 9px 14px;
  }
  .mobile-top .brand { padding: 0; }
  .backdrop {
    position: fixed; inset: 0; background: rgba(26,26,24,.45); z-index: 65;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .backdrop.open { display: block; opacity: 1; pointer-events: auto; }
  .backdrop { display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: 264px; z-index: 70;
    transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto;
    box-shadow: 0 0 32px rgba(0,0,0,.25);
  }
  .sidebar.open { transform: none; }

  .main { padding: 14px 12px 48px; }
  .page-head { gap: 8px; }
  .page-head h1 { font-size: 20px; }
  h1 { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 11px 12px; }
  .kpi .kpi-value { font-size: 23px; }
  .grid-2, .dash-main, .dash-three { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 13px 14px; }

  /* канбан: горизонтальные свайп-колонки (§5.4 проектного документа) */
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .board .col { min-width: 84vw; scroll-snap-align: start; }

  /* таблицы прокручиваются внутри панелей */
  .panel:has(table.data) { overflow-x: auto; }
  table.data { min-width: 520px; }

  .filter-bar input[type="search"] { min-width: 0; flex: 1; }
  .review { padding: 16px 12px 48px; }
  .review-top { flex-direction: column; gap: 10px; align-items: flex-start; }
  .review-timer { font-size: 24px; }
  .vbtn { min-width: 46%; }
  .donut-wrap { justify-content: center; }
  .heat { max-width: 100%; }
  .pricing { grid-template-columns: 1fr; }
  .tabs { gap: 0; }
  .tab { padding: 8px 9px; font-size: 12.5px; }
  .axis-row { flex-wrap: wrap; }
  .axis-row input[type="text"] { min-width: 140px; flex: 1; }
  .ws-switch { margin: 0 2px 10px; }
  .matrix-wrap { margin: 0 -2px; }
  .form-grid, .form-grid-2 { grid-template-columns: 1fr; }

  .hero { padding: 44px 0 24px; }
  .hero h1 { font-size: 28px; }
  .pub-header-in { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  .pub-nav { flex-wrap: wrap; gap: 10px; font-size: 13px; }
  .container { padding: 0 14px; }
  .section { padding: 32px 0; }
  .wiki { padding: 24px 14px 56px; }
}
