/* Общие стили кабинета и суперадминки — спокойно, как системные настройки: серый фон, белые группы без рамок,
   крупные цифры, янтарь только на главных кнопках и активном пункте. Шрифт Onest — свой, из /assets/fonts. */
@font-face { font-family: "Onest"; src: url(/assets/fonts/onest-cyr.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url(/assets/fonts/onest-lat.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #f3f2ef; --card: #ffffff; --ink: #17191c; --mut: #6b6e75; --line: rgba(23, 25, 28, .1); --soft: #efede9; --field: #f6f5f2;
  --acc: #d98a1e; --acc-hover: #c97c12; --acc-ink: #17191c; --acc-text: #9a5b0a; --ok: #2f7d4f; --warn: #a86a00; --bad: #c0362c;
  --s1: #d98a1e; --s2: #3d6f8f; --s3: #8a9a5b; --code: #17191c; --code-ink: #edeae4;
  --r: 20px; --shadow: 0 1px 2px rgba(23, 25, 28, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418; --card: #1c1f24; --ink: #f0eee9; --mut: #9a9ea6; --line: rgba(255, 255, 255, .09); --soft: #25292f; --field: #23272d;
    --acc: #f0a840; --acc-hover: #f5ba62; --acc-ink: #121418; --acc-text: #f0a840; --ok: #5fb383; --warn: #d9a03c; --bad: #ef6b62;
    --s1: #f0a840; --s2: #6fa3c4; --s3: #a9b97a; --code: #0d0f12; --code-ink: #edeae4;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg: #121418; --card: #1c1f24; --ink: #f0eee9; --mut: #9a9ea6; --line: rgba(255, 255, 255, .09); --soft: #25292f; --field: #23272d;
  --acc: #f0a840; --acc-hover: #f5ba62; --acc-ink: #121418; --acc-text: #f0a840; --ok: #5fb383; --warn: #d9a03c; --bad: #ef6b62; --code: #0d0f12; --shadow: none; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--acc-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 32px; font-weight: 640; line-height: 1.15; margin: 0 0 24px; letter-spacing: -.03em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
code { font: 13px ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }

/* боковое меню — полупрозрачная колонка, пункты-«таблетки» */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
nav.side { padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
nav.side .logo { display: flex; align-items: center; gap: 9px; font-weight: 660; font-size: 18px; letter-spacing: -.025em; padding: 4px 10px 22px; color: var(--ink); }
nav.side .logo:hover { text-decoration: none; }
nav.side .logo img { width: 26px; height: 26px; display: block; }
nav.side .logo .ai { font-weight: 500; color: var(--mut); background: none; padding: 0; font-size: inherit; }
nav.side a.t { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink); font-weight: 450; font-size: 15px; }
nav.side a.t:hover { background: var(--soft); text-decoration: none; }
nav.side a.t.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
nav.side a.t.on:before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); margin: 0 9px 2px -2px; vertical-align: middle; }
nav.side .who { margin-top: auto; padding: 16px 12px 4px; font-size: 13px; color: var(--mut); border-top: 1px solid var(--line); line-height: 1.6; }
main { padding: 40px 48px 80px; max-width: 1240px; min-width: 0; }
.topbar { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; overflow-x: auto; gap: 2px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); scrollbar-width: none; }
  nav.side .logo { padding: 4px 8px 4px 0; font-size: 0; gap: 0; }
  nav.side a.t { white-space: nowrap; font-size: 14px; }
  nav.side a.t.on:before { display: none; }
  nav.side .who { display: none; }
  main { padding: 24px 16px 60px; }
  h1 { font-size: 26px; margin-bottom: 18px; }
}

/* группы — белые плоскости без рамок */
.card { background: var(--card); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card > h2:first-child { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.kpi .v { font-size: 34px; font-weight: 640; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--mut); font-size: 13px; margin-top: 4px; }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 16px; } .kpi .v { font-size: 26px; } .card { padding: 18px; } }

/* поля */
label { display: block; font-size: 13px; color: var(--mut); margin: 14px 0 6px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent; background: var(--field); color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, background-color .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line); }
input[type="color"] { padding: 3px; height: 44px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--acc); }
input[type="range"] { accent-color: var(--acc); padding: 0; background: none; }
textarea { min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }

/* кнопки — капсулы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--soft); color: var(--ink);
  font-family: inherit; font-weight: 560; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s; }
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--soft) 80%, var(--ink) 8%); }
.btn.pri { background: var(--acc); color: var(--acc-ink); }
.btn.pri:hover { background: var(--acc-hover); }
.btn.danger { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > h1 { margin-bottom: 0; }
h1 + .card, .row + .card, .row + .grid, .row + .kpis { margin-top: 24px; }
.mut { color: var(--mut); }
.small { font-size: 13px; }

/* таблицы — как списки, без верхнего регистра */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--mut); font-weight: 500; font-size: 13px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--soft) 60%, transparent); }
th:first-child, td:first-child { padding-left: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl { overflow-x: auto; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 560; background: var(--soft); }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
pre.code { background: var(--code); color: var(--code-ink); padding: 16px 18px; border-radius: 14px; overflow-x: auto; font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 10px 0; }

/* галерея примерок */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gi { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.gi .pics { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--card); aspect-ratio: 2 / 1; }
.gi .pics img, .gi .pics div { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--soft); }
.gi .meta { padding: 12px 14px; font-size: 13px; }

/* воронка и графики */
.bar-track { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--acc); border-radius: 4px; }
.funnel .st { display: grid; grid-template-columns: 200px 1fr 64px; gap: 14px; align-items: center; margin: 12px 0; font-size: 14px; }
/* в узкой карточке полоска уходит под подпись — по ширине самой карточки, а не экрана */
.funnel { container-type: inline-size; }
@container (max-width: 460px) { .funnel .st { grid-template-columns: 1fr 64px; row-gap: 6px; } .funnel .st .bar-track { grid-column: 1 / -1; grid-row: 2; } }
.funnel .st > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 220px; display: block; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--mut); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 11px; border-radius: 10px; font-size: 12px; z-index: 50; display: none; white-space: nowrap; }
.alert { padding: 14px 18px; border-radius: 14px; background: var(--card); margin-bottom: 16px; font-size: 14px; box-shadow: var(--shadow); }
.alert.warn { background: color-mix(in srgb, var(--warn) 12%, var(--card)); }

/* вход и регистрация */
.auth { max-width: 420px; margin: 10vh auto; padding: 0 16px; }
.auth .card { padding: 32px; }
.auth h2 { font-size: 24px; font-weight: 640; letter-spacing: -.025em; margin-bottom: 8px; }
.auth .btn.pri { min-height: 46px; padding: 0 24px; font-size: 15px; }

/* тарифы в кабинете */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { border-radius: 16px; padding: 18px; background: var(--field); border: 2px solid transparent; }
.plan.cur { border-color: var(--acc); background: var(--card); }
.plan .pr { font-size: 28px; font-weight: 640; letter-spacing: -.03em; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; z-index: 100; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.hidden { display: none !important; }
