:root {
  --bg: #f3f4f0;
  --card: #ffffff;
  --ink: #0e0f0c;
  --ink-2: #2b2d29;
  --muted: #6b6f68;
  --faint: #9a9d96;
  --line: #e6e7e2;
  --line-2: #f0f1ec;
  --lime: #d8f36a;
  --lime-2: #c8e84c;
  --lime-soft: #f3fbd6;
  --side: #121311;
  --side-2: #1c1d1a;
  --side-ink: #e9eae5;
  --side-muted: #8f928b;
  --red: #e5484d;
  --red-soft: #fdecec;
  --green: #2f8f3e;
  --green-soft: #e3f6dc;
  --violet: #6847d8;
  --violet-soft: #eee9ff;
  --amber: #c8580f;
  --amber-soft: #fff0e2;
  --blue: #2563eb;
  --blue-soft: #e7efff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14, 15, 12, .04), 0 1px 1px rgba(14, 15, 12, .02);
  --shadow-lg: 0 24px 60px -20px rgba(14, 15, 12, .35);
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

.side {
  background: var(--side);
  color: var(--side-ink);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--lime);
  display: grid; place-items: center; color: var(--side); flex-shrink: 0;
}
.brand-title { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.brand-title span { font-weight: 400; color: var(--side-muted); margin-left: 4px; }
.brand-sub { font-size: 12px; color: var(--side-muted); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--side-ink); text-decoration: none; font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { background: var(--side-2); }
.nav a.active { background: var(--lime); color: var(--side); font-weight: 600; }
.nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav .badge {
  margin-left: auto; background: var(--lime); color: var(--side);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px;
}
.nav a.active .badge { background: var(--side); color: var(--lime); }
.nav-sep { height: 1px; background: #2a2b28; margin: 14px 8px; }

.me { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 18px 8px 0; }
.me-ava {
  width: 46px; height: 46px; border-radius: 50%; background: var(--lime); color: var(--side);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.me-name { font-weight: 600; }
.me-sub { font-size: 12px; color: var(--side-muted); display: flex; align-items: center; gap: 6px; }

.main { min-width: 0; padding: 18px 28px 40px; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs b { color: var(--ink); font-weight: 500; }
.crumbs svg { width: 18px; height: 18px; color: var(--ink); }
.burger { display: none; border: 0; background: var(--card); border-radius: 10px; padding: 8px; }
.search {
  margin-left: auto; position: relative; width: min(400px, 40vw);
}
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 10px 14px 10px 40px; outline: none;
}
.search input:focus { border-color: var(--ink); }
.search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow-y: auto;
}
.search-results a, .search-results .empty {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none;
}
.search-results a:hover, .search-results a.focus { background: var(--line-2); }
.search-results small { color: var(--muted); margin-left: auto; font-size: 11px; }
.search-results .empty { color: var(--muted); }

.icon-btn {
  position: relative; border: 0; background: transparent; padding: 8px; border-radius: 10px;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; }
.dot {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 46px; line-height: 1.02; letter-spacing: -.03em; margin: 0 0 6px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); font-size: 19px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.demo-tag { width: 100%; text-align: right; font-size: 12px; color: var(--muted); margin-bottom: -6px; }

/* ---------- Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  padding: 10px 16px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { border-color: #cfd1ca; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #262824; border-color: #262824; }
.btn-lime { background: var(--lime-soft); border-color: transparent; }
.btn-lime:hover { background: #ebf7c2; border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--red); }

.link { color: var(--ink); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c4c6bf; background: none; border: 0; padding: 0; }
.link svg { width: 14px; height: 14px; }
.link:hover { text-decoration-color: var(--ink); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card-head h2 svg { width: 20px; height: 20px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.sub { color: var(--muted); font-size: 13px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 0; background: var(--line-2); color: var(--ink-2);
  border-radius: 999px; padding: 6px 14px; font-size: 13px;
  transition: background-color .15s ease;
}
.chip:hover { background: #e6e8e0; }
.chip.active { background: var(--lime); color: var(--ink); font-weight: 600; }
.chip .count { opacity: .55; margin-left: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-primary { background: var(--blue-soft); color: var(--blue); }
.pill-repeat { background: var(--violet-soft); color: var(--violet); }
.pill-publishing { background: var(--amber-soft); color: var(--amber); }
.pill-published { background: var(--lime); color: var(--ink); }
.pill-pending { background: var(--amber-soft); color: var(--amber); }
.pill-paid { background: var(--green-soft); color: var(--green); }
.pill-cancelled { background: var(--line-2); color: var(--muted); }
.pill-off { background: var(--red-soft); color: var(--red); }
.pill-on { background: var(--green-soft); color: var(--green); }
.pill .b { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 10px 12px; outline: none;
  transition: border-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { min-height: 80px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%230e0f0c' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--green); }
.input-icon .input { padding-left: 38px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.ava {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--ink);
}

.empty-state { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty-state b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.kpi:hover { border-color: #cfd1ca; }
.kpi-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--line-2); display: grid; place-items: center; flex-shrink: 0; }
.kpi-ico svg { width: 24px; height: 24px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-note { font-size: 12px; color: var(--red); display: flex; align-items: center; gap: 6px; }
.kpi-note svg { width: 14px; height: 14px; }
.kpi .chev { margin-left: auto; color: var(--ink); width: 18px; height: 18px; flex-shrink: 0; }
.kpi.accent { background: var(--lime-soft); border-color: #e2f2a8; }
.kpi.accent .kpi-ico { background: var(--lime); }

/* ---------- Dashboard grid ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 412px; gap: 14px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mini-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.t { width: 100%; border-collapse: collapse; min-width: 640px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; background: var(--line-2); }
.t th:first-child { border-radius: 10px 0 0 10px; }
.t th:last-child { border-radius: 0 10px 10px 0; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background-color .12s ease; }
.t tbody tr.clickable:hover { background: #fafbf7; cursor: pointer; }
.client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client b { font-weight: 500; display: block; }
.client small { color: var(--faint); font-size: 12px; }
.when-over { color: var(--red); }
.when-today { color: var(--ink); font-weight: 500; }
.t .amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-row {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px;
  border: 0; background: var(--line-2); border-radius: 12px; padding: 10px 14px; font-weight: 500; text-align: left;
}
.add-row:hover { background: #e9ebe3; }
.add-row svg { width: 18px; height: 18px; }

.more-btn { border: 0; background: transparent; border-radius: 8px; padding: 4px 6px; color: var(--ink); }
.more-btn:hover { background: var(--line-2); }
.more-btn svg { width: 18px; height: 18px; }

/* ---------- Памятка менеджера ---------- */
.memo-item { padding: 14px 0; border-top: 1px solid var(--line-2); }
.memo-item:first-of-type { border-top: 0; }
.memo-q { font-weight: 600; margin-bottom: 6px; }
.memo-a { white-space: pre-line; color: var(--ink-2); background: var(--line-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; line-height: 1.5; }
.memo-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line-2);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.memo-link:last-child { border-bottom: 0; }
.memo-link span { flex: 1; font-weight: 500; }
.memo-link small { color: var(--muted); font-variant-numeric: tabular-nums; }
.memo-link svg { width: 16px; height: 16px; color: var(--muted); }
.memo-link:hover span { text-decoration: underline; }

/* ---------- Portfolio cards ---------- */
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pf-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.pf-card .shot { aspect-ratio: 16 / 8.5; overflow: hidden; background: var(--line-2); }
.pf-card .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.pf-card:hover .shot img { transform: scale(1.04); }
.pf-card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pf-card .meta b { font-weight: 500; }
.pf-card .meta p { margin: 0; color: var(--muted); font-size: 12px; }
.pf-card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.tag { background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.apps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.app-item { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; padding: 6px; border-radius: 14px; transition: background-color .15s ease; }
.app-item:hover { background: var(--line-2); }
.app-item img { width: 50px; height: 50px; border-radius: 13px; outline: 1px solid rgba(0, 0, 0, .06); outline-offset: -1px; }
.app-item b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-item small { color: var(--faint); font-size: 11px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.app-item small svg { width: 11px; height: 11px; flex-shrink: 0; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.app-card { display: flex; gap: 14px; align-items: center; }
.app-card img { width: 64px; height: 64px; border-radius: 16px; outline: 1px solid rgba(0, 0, 0, .06); outline-offset: -1px; }
.app-card b { display: block; font-size: 15px; }
.store-links { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Payroll bar ---------- */
.payline { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.payline h3 { margin: 0; font-size: 17px; display: flex; gap: 10px; align-items: center; }
.payline h3 svg { width: 20px; height: 20px; }
.payline .p { display: flex; flex-direction: column; }
.payline .p small { font-size: 11px; color: var(--muted); }
.payline .p b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payline .op { color: var(--muted); font-size: 18px; }
.payline .total b { color: var(--green); font-size: 22px; }

/* ---------- Mini cards ---------- */
.mini h3 { margin: 0; font-size: 16px; }
.mini .sub { margin-bottom: 14px; }
.mini-ico { width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: 14px; }
.mini-ico svg { width: 30px; height: 30px; }
.video-thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #111; margin-bottom: 14px; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}
.play svg { width: 18px; height: 18px; margin-left: 3px; }
.video-card:hover .play, .video-thumb:hover .play { transform: scale(1.08); }

/* ---------- Videos page ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.video-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); text-align: left; padding: 0; display: flex; flex-direction: column; }
.video-card .video-thumb { margin: 0; border-radius: 0; }
.video-card .vb { padding: 12px 14px 14px; }
.video-card .vb b { display: block; font-size: 15px; margin-bottom: 2px; }
.video-card .vb p { margin: 0; color: var(--muted); font-size: 13px; }
.video-card .vb .row { margin-top: 10px; }

/* ---------- Sheets panel ---------- */
.sheet-hint { font-size: 12px; color: var(--faint); margin-top: 6px; }
.map-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.map-row:last-child { border-bottom: 0; }
.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12px; background: var(--line-2); border-radius: 8px; padding: 2px 6px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 8px; }
.log { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--side); color: #cfe9a0; border-radius: 12px; padding: 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.mod { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.mod:hover { background: #fafbf7; }
.mod input { display: none; }
.mod .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #c9cbc4; display: grid; place-items: center; flex-shrink: 0; }
.mod .box svg { width: 14px; height: 14px; opacity: 0; color: var(--ink); }
.mod.on { border-color: #d6ec8a; background: var(--lime-soft); }
.mod.on .box { background: var(--lime); border-color: var(--lime-2); }
.mod.on .box svg { opacity: 1; }
.mod b { display: block; font-weight: 600; }
.mod small { color: var(--muted); }
.mod .price { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mod .price small { display: block; font-weight: 500; font-size: 11px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--line-2); padding: 3px; }
.stepper button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 9px; font-size: 18px; }
.stepper button:hover { background: #e3e5dd; }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.calc-row b { display: block; }
.calc-row small { color: var(--muted); }
.fee { display: grid; grid-template-columns: 1fr 150px 90px; gap: 10px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line-2); }
.fee .input { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.kp { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; position: sticky; top: 18px; }
.kp-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.kp-brand img { width: 44px; height: 44px; border-radius: 50%; }
.kp-brand b { display: block; font-size: 22px; letter-spacing: .12em; line-height: 1.1; }
.kp-brand small { color: var(--muted); font-size: 11px; }
.kp-site { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.kp-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.kp-head h3 { margin: 0; font-size: 20px; }
.kp-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kp-line small { display: block; color: var(--muted); font-size: 11px; }
.kp-line b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kp-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 4px; font-weight: 600; }
.kp-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding: 16px; background: var(--side); color: #fff; border-radius: 14px; }
.kp-total b { font-size: 26px; color: var(--lime); font-variant-numeric: tabular-nums; }
.kp-disc { color: var(--green); }

/* ---------- Modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(14, 15, 12, .45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--card); border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 20px 0; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 0 20px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.video-frame { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 14px; background: #000; display: block; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.menu { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; animation: pop .12s ease; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 9px; }
.menu button:hover { background: var(--line-2); }
.menu button svg { width: 16px; height: 16px; }
.menu hr { border: 0; height: 1px; background: var(--line-2); margin: 4px 0; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--side); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 360px; animation: pop .2s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: var(--red); }
.toast b { color: var(--lime); }

.history { border-left: 2px solid var(--line); margin: 6px 0 0 6px; padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.history div { position: relative; font-size: 13px; }
.history div::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); border: 2px solid var(--card); }
.history small { color: var(--faint); display: block; }

/* Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #ebece6; border-radius: 16px; padding: 10px; min-height: 160px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; }
.col-head small { color: var(--muted); font-weight: 500; }
.col.drop { outline: 2px dashed var(--ink); outline-offset: -4px; }
.lead-card { background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: grab; box-shadow: var(--shadow); }
.lead-card:active { cursor: grabbing; }
.lead-card b { display: block; font-weight: 600; }
.lead-card p { margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.lead-card small { font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1380px) {
  .dash { grid-template-columns: minmax(0, 1fr) 360px; }
  .kpi-value { font-size: 22px; }
}
@media (max-width: 1180px) {
  .dash, .calc { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kp { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; width: 270px; transform: translateX(-100%); transition: transform .25s ease; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .burger { display: grid; place-items: center; }
  .main { padding: 14px 16px 40px; }
  .crumbs { display: none; }
  .search { width: auto; flex: 1; }
  .page-head h1 { font-size: 34px; }
  .page-head p { font-size: 16px; }
  .pf-grid, .apps-row { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .kpis, .pf-grid, .apps-row, .mini-pair, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .fee { grid-template-columns: 1fr 1fr; }
  .fee .field:first-child { grid-column: 1 / -1; }
  .map-row { grid-template-columns: 1fr; }
  .payline { gap: 12px; }
}

@media print {
  body { background: #fff; }
  .side, .topbar, .page-head, .no-print, .toasts { display: none !important; }
  .main { padding: 0; }
  .calc { display: block; }
  .calc > :first-child { display: none; }
  .kp { border: 0; position: static; padding: 0; }
  .kp-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
