/* Платформа Armigo. Палитра и шрифты — по брендбуку (02-brand-logos/BRANDBOOK.md):
   основа #13265c, акцент абрикос #f39a3c (не текстом на светлом), фоны белый и «туман» #eef2f9.
   Заголовки Montserrat 800 заглавными, текст Manrope, жирное, кнопки и подписи — Rubik. */
:root {
  --ink: #13265c; --ink-soft: #4a5a86; --bg: #ffffff; --mist: #eef2f9; --line: #d6ddec;
  --panel: #ffffff; --apricot: #f39a3c; --side: #13265c; --side-fg: #ffffff; --side-muted: #a9b5d3;
  --ok: #2f7d4a; --bad: #b3372b; --warn: #9a5b0d;
  --ff-display: "Montserrat", system-ui, sans-serif;
  --ff-text: "Manrope", system-ui, sans-serif;
  --ff-bold: "Rubik", system-ui, sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f9; --ink-soft: #a9b5d3; --bg: #0b1533; --mist: #13214a; --line: #25386b;
    --panel: #101d44; --side: #08102a; --ok: #6cc28a; --bad: #ff8a7a; --warn: #f3b86c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 15px/1.55 var(--ff-text); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
h2 { font-size: 18px; }
b, strong { font-family: var(--ff-bold); font-weight: 700; }
a { color: inherit; }
.lbl { font: 700 11px/1 var(--ff-bold); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

/* каркас: слева меню, справа содержимое; на телефоне меню сверху */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { min-width: 0; background: var(--side); color: var(--side-fg); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.side .logo img { height: 44px; width: auto; display: block; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px;
  text-decoration: none; font: 700 12px/1.2 var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; color: var(--side-fg); }
.side nav a:hover, .side nav a:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.side nav a[aria-current="page"] { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--apricot); }
.side nav .soon { font-size: 10px; letter-spacing: .06em; color: var(--side-muted); }
.side .me { margin-top: auto; display: grid; gap: 8px; font-size: 13px; color: var(--side-muted); }
.side .me b { color: var(--side-fg); font-weight: 500; font-family: var(--ff-text); }
.side .me button { background: none; border: 1px solid rgba(255,255,255,.25); color: var(--side-fg); border-radius: 999px;
  padding: 6px 12px; font: 700 11px var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; justify-self: start; }
.main { padding: 32px clamp(16px, 4vw, 48px) 64px; min-width: 0; display: grid; gap: 24px; align-content: start; max-width: 1100px; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { padding: 14px 16px; gap: 12px; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side nav a { white-space: nowrap; }
  .side .me { margin-top: 0; grid-auto-flow: column; justify-content: space-between; align-items: center; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 8px; align-content: start; min-width: 0; }
a.card { text-decoration: none; }
a.card:hover { border-color: var(--ink-soft); }
.card h2 { font-size: 16px; }
.pill { display: inline-block; font: 700 10px/1 var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; padding: 5px 8px; border-radius: 999px; background: var(--mist); color: var(--ink-soft); justify-self: start; }
.pill.ok { color: var(--ok); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  font: 700 12px/1 var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; background: var(--apricot); color: #13265c; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--apricot); outline-offset: 2px; }

.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th { text-align: left; font: 700 11px/1.2 var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); background: var(--mist); padding: 10px 12px; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.off td { color: var(--ink-soft); }
form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
input[type=text], select { font: 500 14px var(--ff-text); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.addform { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 10px; align-items: end; }
.addform label { display: grid; gap: 6px; }
@media (max-width: 760px) { .addform { grid-template-columns: 1fr; } }
.note { background: var(--mist); border-radius: var(--r); padding: 12px 16px; }
.note.bad { color: var(--bad); }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.login .box { background: var(--panel); color: var(--ink); border-radius: 18px; padding: 36px clamp(20px, 5vw, 44px); width: min(100%, 440px); display: grid; gap: 18px; }
.login .box img { height: 40px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }

/* онбординг */
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.big { font: 800 28px/1 var(--ff-display); font-variant-numeric: tabular-nums; }
.progress { height: 10px; border-radius: 5px; background: var(--mist); overflow: hidden; }
.progress div, .mini div { height: 100%; background: var(--apricot); border-radius: inherit; }
.mini { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 3px; background: var(--mist); overflow: hidden; margin-right: 6px; }
.card .btn + .btn { margin-left: 6px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.pill.warn { color: var(--warn); }
a.lbl { text-decoration: none; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
textarea { width: 100%; font: 500 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; resize: vertical; tab-size: 2; }
textarea:focus-visible { outline: 2px solid var(--apricot); outline-offset: 2px; }
.editor input[type=text] { width: 100%; }
.hist { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13px; max-height: 60vh; overflow: auto; }
.hist a[aria-current] { font-weight: 700; }
code { font: 600 .9em ui-monospace, Menlo, monospace; background: var(--mist); padding: 1px 5px; border-radius: 4px; }

/* заявки и клиенты */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font: 700 12px/1 var(--ff-bold); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; color: var(--ink-soft); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--apricot); }
.today { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.stat b { font: 800 26px/1.1 var(--ff-display); font-variant-numeric: tabular-nums; }
.stat .muted { font-size: 13px; }
.stat.bad { border-color: var(--bad); } .stat.bad b { color: var(--bad); }
.stat.warn { border-color: var(--warn); } .stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--ok); }
.pill.bad { color: var(--bad); } .pill.ok { color: var(--ok); }
.pill.st-new { color: var(--bad); } .pill.st-in_work, .pill.st-offer { color: var(--warn); } .pill.st-won { color: var(--ok); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.filters a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; }
.filters a[aria-current] { border-color: var(--ink); font-weight: 600; }
input[type=search], input[type=date] { font: 500 14px var(--ff-text); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.filters input[type=search] { margin-left: auto; width: min(100%, 260px); }
input.late { border-color: var(--bad); color: var(--bad); }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 34ch; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo li { display: flex; gap: 10px; align-items: flex-start; }
.todo li.done > span { color: var(--ink-soft); text-decoration: line-through; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split .col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }
.lead { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.lead:first-of-type { border-top: 0; padding-top: 0; }
.lead:target { background: var(--mist); margin: 0 -12px; padding: 12px; border-radius: 10px; }
.quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--apricot); background: var(--mist); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed p { margin: 2px 0 0; white-space: pre-wrap; }
.deal-row { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.deal-row:hover { border-color: var(--ink-soft); }
.form { display: grid; gap: 10px; margin: 0; }
.form label { display: grid; gap: 6px; }
.form input[type=text], .form select, .form textarea, .form input[type=date] { width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.form textarea, .lead textarea { font: 500 14px/1.5 var(--ff-text); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li.done .step-body > span:first-child { color: var(--ink-soft); text-decoration: line-through; }
.step-body { display: grid; gap: 6px; min-width: 0; }
.check-btn { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); color: var(--ink);
  font: 700 13px var(--ff-bold); cursor: pointer; display: grid; place-items: center; }
.check-btn:hover:not(:disabled) { border-color: var(--apricot); }
li.done .check-btn { background: var(--apricot); border-color: var(--apricot); color: #13265c; }
.btn.sm { padding: 7px 12px; font-size: 11px; }
.pay { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.pay:first-of-type { border-top: 0; }
.pay.paid b { color: var(--ok); }

/* соцсети */
.newpost { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 10px; }
.newpost label { display: grid; gap: 6px; }
.newpost input, .newpost select { width: 100%; }
@media (max-width: 860px) { .newpost { grid-template-columns: 1fr; } }
.plan { display: grid; gap: 10px; }
.week { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.week.current { border-color: var(--apricot); }
.week-head { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--mist); font-size: 13px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { padding: 8px; border-left: 1px solid var(--line); display: grid; gap: 6px; align-content: start; min-height: 64px; min-width: 0; }
.day:first-child { border-left: 0; }
.day.weekend { background: color-mix(in srgb, var(--mist) 45%, transparent); }
.day.is-today .lbl { color: var(--ink); }
.day.is-today { box-shadow: inset 0 3px 0 var(--apricot); }
@media (max-width: 900px) {
  .days { grid-template-columns: minmax(0, 1fr); }
  .day { border-left: 0; border-top: 1px solid var(--line); min-height: 0; }
  .day:not(:has(.post-chip)) { display: none; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .post-chip { width: min(100%, 260px); }
.post-chip { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); border-left: 3px solid var(--line);
  text-decoration: none; background: var(--bg); font-size: 13px; line-height: 1.35; min-width: 0; }
.post-chip:hover { border-color: var(--ink-soft); }
.post-chip .t { overflow-wrap: anywhere; }
.post-chip .lbl { font-size: 10px; }
.post-chip.st-published { border-left-color: var(--ok); }
.post-chip.st-approved, .post-chip.st-scheduled { border-left-color: var(--apricot); }
.post-chip.st-review { border-left-color: var(--warn); }
.post-chip.st-rejected { opacity: .55; }
.pill.st-published, .pill.st-approved, .pill.st-scheduled { color: var(--ok); } .pill.st-review { color: var(--warn); } .pill.st-draft { color: var(--ink); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.issues li { padding: 8px 10px 8px 30px; border-radius: 8px; background: var(--mist); position: relative; font-size: 14px; }
.issues li::before { position: absolute; left: 10px; top: 8px; font-weight: 700; }
.issues li.error { color: var(--bad); } .issues li.error::before { content: "✕"; }
.issues li.warn { color: var(--warn); } .issues li.warn::before { content: "!"; }
.ok-line { color: var(--ok); margin: 0; font-weight: 600; }
.bad-text { color: var(--bad); }
.flow { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-soft); }
.flow li.done { color: var(--ok); }
.flow li.done::marker { content: "✓  "; }
.tg-preview { white-space: pre-wrap; background: var(--mist); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.tg-img { border-radius: 12px; max-height: 260px; object-fit: cover; width: 100%; }
.check-line { display: flex !important; gap: 8px; align-items: center; grid-template-columns: none; }
.counter { font-size: 13px; }
input[type=time], input[type=file] { font: 500 14px var(--ff-text); color: var(--ink); }
input[type=time] { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }

/* пульт */
.take { margin: 0; max-width: 75ch; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 9rem) 1fr 3.5rem; gap: 10px; align-items: center; font-size: 13px; }
.hbars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { height: 10px; border-radius: 5px; background: var(--mist); overflow: hidden; }
.hbars .track span { display: block; height: 100%; border-radius: inherit; background: var(--ink); min-width: 2px; }
.hbars .track span.won { background: var(--apricot); } .hbars .track span.lost { background: var(--ink-soft); }
.hbars .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px; margin-top: 8px; }
.cols .col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 4px; text-align: center; min-width: 0; }
.cols .v { font-size: 12px; font-variant-numeric: tabular-nums; }
.cols .bar-box { display: flex; align-items: flex-end; justify-content: center; }
.cols .bar { width: min(100%, 26px); background: var(--ink); border-radius: 5px 5px 2px 2px; display: flex; align-items: flex-end; overflow: hidden; min-height: 2px; }
.cols .won { width: 100%; background: var(--apricot); }
.cols .lbl { font-size: 9px; letter-spacing: .04em; }
.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 14px; }
.kv b { font-variant-numeric: tabular-nums; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.spark { color: var(--apricot); }
.stat .ok-text, .stat .bad-text { font-size: 13px; }
