/* CRM франшизы Kyoto Spa. Стиль Ильи v3 "Индиго и небо" (~/.claude/skills/ilya-style): белый фон, индиго и голубой,
   перелив только в шапке, шапке таблицы и номерах; один шрифт Onest. Раскладка по ~/.claude/docs/verstka.md:
   доска, таблицы и ряды карточек во всю ширину, текст колонкой не шире 110 знаков. */
:root {
  --ground: #ffffff; --surface: #ffffff; --surface-2: #f7f8fc; --tint-1: #eeedff; --tint-2: #e5f2ff; --tint-zebra: #f7f8ff;
  --hairline: #e3e6f3; --track: #e3e6f3; --ink: #14151c; --ink-body: #3d3f4c; --ink-muted: #5d6070;
  --accent: #4f46e5; --accent-2: #4ea1f3; --on-accent: #fff; --accent-text: #4338ca; --accent-soft: #eeedff;
  --gradient: linear-gradient(135deg, #4f46e5 0%, #4ea1f3 100%); --gradient-row: linear-gradient(90deg, #4f46e5 0%, #4ea1f3 100%);
  --gradient-soft: linear-gradient(135deg, #eeedff 0%, #e5f2ff 100%);
  --glass: rgba(255,255,255,.16); --glass-line: rgba(255,255,255,.40);
  --bad: #c0265e; --bad-soft: #ffe6ef; --warn: #7d5a00; --warn-soft: #fff2c9;
  --shadow-panel: 0 0 0 1px #e3e6f3; --shadow-lift: 0 12px 32px rgba(79,70,229,.14);
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px #4f46e5;
  --r-chip: 8px; --r-card: 18px; --r-panel: 22px; --r-pill: 999px;
  --side: 232px; --read: 860px;
  --font: Onest, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--ground);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
@media (min-width: 1700px) { body { font-size: 17px; } }
a { color: var(--accent-text); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 0;
  border-radius: var(--r-pill); background: var(--tint-1); color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .1s ease-out, background-color .15s; }
.btn:hover { background: #e2e0ff; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible, .card:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.btn.pri { background: var(--accent); color: var(--on-accent); }
.btn.pri:hover { background: #4338ca; }
.btn.bad { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn.ghost:hover { background: var(--tint-1); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

.tag { display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 600; line-height: 1; padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-body); white-space: nowrap; }
.tag.ok { background: var(--accent-soft); color: var(--accent-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.sky { background: var(--tint-2); color: #165a9c; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--surface-2); color: var(--ink-body); border-radius: var(--r-pill); padding: 8px 14px; font-weight: 600;
  font-size: 14px; cursor: pointer; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--hairline); }
.chip.on { background: var(--accent); color: #fff; box-shadow: none; }
.chip small { font-weight: 500; opacity: .75; margin-left: 4px; }

.fld { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.fld input, .fld select, .fld textarea, .inp { font-size: 16px; font-weight: 500; color: var(--ink); background: #fff; border: 1px solid var(--hairline);
  border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%; }
.fld textarea, textarea.inp { min-height: 96px; resize: vertical; line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .inp:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--bad); font-size: 14px; font-weight: 600; }
.muted { color: var(--ink-muted); }

/* оболочка: меню слева, работа во всю ширину */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; border-right: 1px solid var(--hairline); background: #fff; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .mk { width: 38px; height: 38px; border-radius: 12px; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.brand span { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink-body); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--tint-1); color: var(--accent-text); }
.nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .n { margin-left: auto; font-size: 13px; font-weight: 700; background: var(--bad); color: #fff; border-radius: var(--r-pill); padding: 2px 8px; }
.side .grow { flex: 1; }
.side .me { font-size: 14px; color: var(--ink-muted); padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.main { min-width: 0; padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 22px; }

/* шапка раздела: перелив, заголовок, цифры на стекле */
.hero { background: var(--gradient); color: #fff; border-radius: var(--r-panel); padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero h1 { font-size: 30px; font-weight: 800; line-height: 1.1; }
.hero p { margin: 6px 0 0; opacity: .9; font-size: 15px; max-width: 70ch; }
.hero .figs { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.hero .fig { background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); border-radius: 16px; padding: 10px 16px; min-width: 112px; }
.hero .fig b { display: block; font-size: 26px; font-weight: 800; line-height: 1.05; }
.hero .fig span { font-size: 14px; opacity: .9; }
.hero .fig.hot b { color: #fff; }
.hero .fig.hot { background: rgba(192,38,94,.55); }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.head h1 { font-size: 30px; font-weight: 800; }
.head .sp { flex: 1; }
.head .lede { width: 100%; margin: 0; color: var(--ink-body); max-width: 64ch; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bar .sp { flex: 1; }
.search { max-width: 320px; }

/* доска */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(225px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--r-card); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.col h3 { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px 0; }
.col h3 b { color: var(--accent-text); }
.col .hint { font-size: 14px; color: var(--ink-muted); padding: 0 6px 4px; line-height: 1.35; }
.col.lost { background: #fff6f9; }
.card { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-panel); cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.card:hover { box-shadow: var(--shadow-lift); }
.card .nm { font-weight: 700; font-size: 15px; line-height: 1.3; }
.card .ln { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--ink-muted); }
.card.late { box-shadow: 0 0 0 2px var(--bad); }
.empty { color: var(--ink-muted); font-size: 14px; padding: 8px 6px; }
.empty-big { text-align: center; padding: 40px 20px; color: var(--ink-body); background: var(--surface-2); border-radius: var(--r-panel); }

/* таблица */
.tw { background: #fff; border-radius: var(--r-panel); box-shadow: var(--shadow-panel); overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t thead tr { background: var(--gradient-row); }
.t th { color: #fff; font-size: 13.5px; font-weight: 600; text-align: left; padding: 12px 16px; white-space: nowrap; }
.t td { padding: 12px 16px; border-top: 1px solid var(--hairline); vertical-align: top; }
.t tbody tr:nth-child(even) td { background: var(--tint-zebra); }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--tint-1); }
.t .num { text-align: right; white-space: nowrap; }
.t input.inp { min-height: 36px; padding: 6px 10px; max-width: 150px; text-align: right; }

/* карточка заявки: слева данные, справа что говорить и история */
.lead { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lead > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: #fff; border-radius: var(--r-panel); box-shadow: var(--shadow-panel); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.panel h2 .sp { flex: 1; }
.panel.soft { background: var(--gradient-soft); box-shadow: none; }
.lh { display: flex; flex-direction: column; gap: 8px; }
.lh h1 { font-size: 30px; font-weight: 800; line-height: 1.1; }
.lh .ln { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-body); }
.back { align-self: flex-start; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.steps button { border: 0; cursor: pointer; font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-muted); }
.steps button.done { background: var(--tint-2); color: #165a9c; }
.steps button.cur { background: var(--accent); color: #fff; }
.steps button.lost { background: var(--bad); color: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--tint-1); }
.q:nth-child(even) { background: var(--tint-2); }
.q span { font-weight: 600; font-size: 15px; line-height: 1.35; }
.q small { display: block; font-weight: 500; color: var(--ink-muted); font-size: 13px; }
.seg { display: inline-flex; background: #fff; border-radius: var(--r-pill); padding: 3px; box-shadow: inset 0 0 0 1px var(--hairline); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-muted); white-space: nowrap; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button.on.no { background: var(--bad); }
.okline { background: var(--accent); color: #fff; border-radius: 14px; padding: 12px 14px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.okline .btn { background: #fff; color: var(--accent-text); }
.calls b { font-size: 22px; font-weight: 800; }

/* речевые модули и возражения */
.mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.mod { background: var(--tint-1); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.mod:nth-child(even) { background: var(--tint-2); }
.mod.msg { background: #fff; box-shadow: var(--shadow-panel); }
.mod h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod .goal { font-size: 14.5px; color: var(--ink-body); margin: 0; }
.mod .body { white-space: pre-wrap; font-size: 15.5px; line-height: 1.6; margin: 0; max-width: 95ch; }
.mod.msg .body { background: #e9fbe9; border-radius: 12px 12px 12px 4px; padding: 12px 14px; }
.mod .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.side-list .mod { padding: 14px 16px; }
.obj { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.ob { background: var(--tint-1); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.ob:nth-child(even) { background: var(--tint-2); }
.ob h3 { font-size: 17px; font-weight: 800; line-height: 1.3; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.ob .ask { font-size: 15px; margin: 0; }
.ob .ask b { color: var(--accent-text); }
.ob .a { font-size: 15px; line-height: 1.55; margin: 0; color: var(--ink-body); }
.cat { font-size: 20px; font-weight: 800; margin: 8px 0 -2px; }

/* материалы */
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.mat { background: var(--tint-1); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.mat:nth-child(even) { background: var(--tint-2); }
.mat h3 { font-size: 17px; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mat p { margin: 0; font-size: 14.5px; color: var(--ink-body); }
.mat .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.mat-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.mat-mini b { font-size: 15px; }
.mat-mini .sp { flex: 1; }

/* история */
.hist { display: flex; flex-direction: column; gap: 10px; }
.ev { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 14.5px; }
.ev time { color: var(--ink-muted); font-size: 13px; padding-top: 2px; }
.ev .tx { white-space: pre-wrap; }
.ev.note .tx { background: var(--tint-1); border-radius: 10px; padding: 8px 10px; }
.ev .who { color: var(--ink-muted); font-size: 13px; }

/* статистика */
.figs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.f { background: var(--tint-1); border-radius: var(--r-card); padding: 16px 18px; }
.f:nth-child(even) { background: var(--tint-2); }
.f b { display: block; font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.f span { font-size: 14px; color: var(--ink-body); font-weight: 500; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar-cell i { display: block; height: 10px; border-radius: 99px; background: var(--gradient-row); min-width: 2px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 18px; align-items: start; }
.sec h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }

/* окно */
.modal-bg { position: fixed; inset: 0; background: rgba(20,21,28,.4); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: var(--r-panel); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(20,21,28,.25); }
.modal h2 { font-size: 22px; font-weight: 800; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; font-weight: 500; color: var(--ink); }
.checks label { display: inline-flex; gap: 6px; align-items: center; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 14px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }

/* вход */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--gradient-soft); z-index: 70; }
.lg-box { background: #fff; border-radius: 26px; padding: 30px 28px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lift); }
.lg-box form { display: flex; flex-direction: column; gap: 14px; }
.lg-box h1 { font-size: 24px; font-weight: 800; }
.lg-mk { width: 48px; height: 48px; border-radius: 14px; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.lg-h { margin: 0; color: var(--ink-body); }
.lg-sw { border: 0; background: none; color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }

/* узкий экран: одна колонка, "Что делать сейчас" сразу после звонков, а не под контактами */
@media (max-width: 1100px) { .lead { display: flex; flex-direction: column; gap: 16px; } .lead > div { display: contents; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--hairline); overflow-x: auto; gap: 4px; }
  .brand { padding: 0 6px 0 0; } .brand b, .brand span { display: none; } .brand .mk { width: 34px; height: 34px; }
  .nav { flex-direction: row; } .nav a { padding: 8px 10px; font-size: 14px; white-space: nowrap; } .nav a svg { display: none; }
  .side .grow, .side .me { display: none; }
  .main { padding: 14px 12px 48px; gap: 16px; }
  .hero { padding: 18px; } .hero h1, .head h1, .lh h1 { font-size: 24px; } .hero .figs { margin-left: 0; }
  .board { grid-auto-columns: 84vw; }
  .ev { grid-template-columns: 1fr; gap: 2px; }
  .search { max-width: none; flex: 1 1 100%; }
}
