/* Шрифт и палитра — как на сайте (public/css/style.css): Manrope, кремовый фон, графитовый текст, жёлтый акцент */
@font-face { font-family: 'Involve'; src: url('fonts/manrope-cyrillic.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: 'Involve'; src: url('fonts/manrope-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #F5F1EB; --bg-alt: #F0EBE3; --surface: #FBFAF7; --text: #1A1A1A; --muted: #6B6763; --subtle: #8A857F;
  --line: rgba(26,26,26,.12); --line-strong: rgba(26,26,26,.28);
  /* --accent — главный цвет действий (тёмные кнопки, как «Записаться» на сайте); --brand — фирменный жёлтый для отметок */
  --accent: #1A1A1A; --accent-text: #F5F1EB; --brand: #D6C53C; --brand-deep: #7A6A12;
  --danger: #A8352E; --ok: #2E6B34; --info: #2F5E8E; --radius: 6px;
  --font: 'Involve', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ring: 0 0 0 3px rgba(214,197,60,.55);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
code { font-size: .88em; word-break: break-all; background: var(--bg-alt); padding: 1px 4px; border-radius: 3px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--text); text-decoration: none; min-width: 0; }
.top__logo { height: 30px; width: auto; display: block; }
.top__label { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.top__menu { font-size: 20px; background: none; border: 0; color: var(--text); padding: 4px 8px; cursor: pointer; }
.top__user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.top__user form { margin: 0; }
@media (max-width: 600px) { .top__label { display: none; } .top__user span { display: none; } .top__logo { height: 26px; } }

.shell { display: block; }
.nav { display: none; flex-direction: column; padding: 8px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav.is-open { display: flex; }
.nav a { position: relative; padding: 9px 10px 9px 14px; border-radius: 4px; color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--bg-alt); }
.nav a.is-active { background: var(--bg); font-weight: 600; }
.nav a.is-active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand); }
.nav__soon { padding: 10px 8px; color: var(--muted); font-size: 13px; }
.main { padding: 16px; max-width: 1100px; }

@media (min-width: 900px) {
  .top__menu { display: none; }
  .shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 53px); }
  .nav { display: flex; border-bottom: 0; border-right: 1px solid var(--line); }
  .main { padding: 24px 32px; }
}

.h1 { font-size: 30px; font-weight: 300; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 18px; }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
@media (max-width: 600px) { .h1 { font-size: 25px; } }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card--narrow { max-width: 420px; margin: 8vh auto; padding: 28px 24px; }
.bare__logo { display: block; height: 44px; width: auto; margin: 0 auto 20px; }
body.bare { padding: 0 16px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

.kv { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0 0 8px; }
@media (min-width: 700px) { .kv { grid-template-columns: 200px 1fr; } .kv dd { margin: 0; } }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 22px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .01em; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: #000; border-color: #000; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--text); }
.btn--sm { min-height: 32px; padding: 4px 14px; font-size: 13px; }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--accent); }
.btn--ghost:disabled:hover { background: transparent; border-color: var(--line-strong); }

.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--text); width: 100%; }
input, select, textarea { accent-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--text) !important; box-shadow: var(--ring); border-radius: 4px; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-alt); color: var(--subtle); cursor: not-allowed; }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--danger) !important; }
::placeholder { color: var(--subtle); }

.alert { padding: 10px 14px; border-radius: 4px; border-left: 3px solid var(--danger); background: #F6E6E3; color: var(--danger); }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; border-left: 3px solid var(--ok); background: #E6EEE3; color: var(--ok); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 500; }
.badge.is-ok { color: var(--ok); border-color: var(--ok); }
.badge.is-err { color: var(--danger); border-color: var(--danger); }

.console { background: #111; color: #ddd; padding: 12px; border-radius: 8px; max-height: 50vh; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.changed { padding-left: 18px; font-size: 13px; }
.log { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.table tbody tr:hover td { background: var(--bg); }
.qr { display: block; margin: 12px auto; background: #fff; padding: 8px; border-radius: 8px; }

/* ── Прайс ─────────────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form--grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .form--grid { grid-template-columns: repeat(2, 1fr); align-items: end; } }
.import { margin-top: 12px; }
.psec { border: 1px solid var(--line); }
.psec__head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.psec__title { flex: 1 1 200px; font: inherit; font-weight: 600; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }
.plist { list-style: none; margin: 0 0 10px; padding: 0; }
.prow { display: grid; grid-template-columns: 18px 1fr 1fr; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prow input, .prow textarea { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); min-width: 0; width: 100%; }
.prow__handle { cursor: grab; color: var(--muted); user-select: none; grid-row: span 3; }
.prow__name { grid-column: 2 / 4; }
.prow__dur { grid-column: 2 / 3; }
.prow__tools { display: flex; gap: 4px; grid-column: 3 / 4; justify-content: flex-end; }
.prow__desc { grid-column: 2 / 4; }
.prow--head { display: none; }
.prow.is-drag { opacity: .4; }
@media (min-width: 900px) {
  .prow { grid-template-columns: 18px minmax(200px, 1fr) 100px 100px 90px 160px; }
  .prow__handle { grid-row: auto; }
  .prow__name, .prow__dur, .prow__tools { grid-column: auto; }
  .prow__desc { grid-column: 2 / -1; }
  .prow--head { display: grid; color: var(--muted); font-size: 12px; border-bottom: 0; padding-bottom: 0; }
}
.savebar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .alert { flex-basis: 100%; margin: 0; }
.table td.nowrap { white-space: nowrap; }
.table select { min-width: 220px; font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }

/* ── Акции ─────────────────────────────────────────────────── */
.akrow { align-items: center; }
.akrow__main { flex: 1 1 260px; }
.akrow__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.akrow__tools { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.akform__img { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; object-fit: cover; }
.akform .form--grid { margin: 0; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.akblock { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin: 0 0 12px; display: grid; gap: 10px; }

/* ── Блог: редактор ────────────────────────────────────────── */
.ed { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ed__bar { position: sticky; top: 53px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 10px 10px 0 0; }
.ed__btn { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; }
.ed__btn.is-on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ed__btn:hover { border-color: var(--text); }
.ed__btn:disabled { opacity: .4; }
.ed__area .ProseMirror { min-height: 320px; padding: 14px 16px; outline: none; line-height: 1.6; }
.ed__area .ProseMirror h2 { font-size: 20px; margin: 18px 0 8px; }
.ed__area .ProseMirror h3 { font-size: 17px; margin: 14px 0 6px; }
.ed__area .ProseMirror p { margin: 0 0 10px; }
.ed__area .ProseMirror blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--brand); }
.ed__area .ProseMirror table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.ed__area .ProseMirror th, .ed__area .ProseMirror td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.ed__area .ProseMirror th { background: var(--surface); }
.ed__area .ProseMirror img { max-width: 100%; height: auto; border-radius: 8px; }
.ed__area .ProseMirror .selectedCell { background: rgba(214,197,60,.25); }
.ed__code { width: 100%; min-height: 320px; border: 0; padding: 14px; font: 13px/1.5 ui-monospace, Menlo, monospace; background: var(--bg); color: var(--text); }
.relgrid { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.relgrid label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
@media (min-width: 900px) { .relgrid { grid-template-columns: 1fr 1fr; } }

/* ── Страницы ──────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filters input, .filters select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.filters input { flex: 1 1 240px; }
.snippet { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-family: Arial, sans-serif; }
.snippet__url { font-size: 13px; color: #006621; }
.snippet__title { font-size: 18px; color: #1a0dab; margin: 2px 0; }
.snippet__desc { font-size: 14px; color: var(--muted); }
.frag-search { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); margin-bottom: 8px; }
.fgroup { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.fgroup summary { cursor: pointer; padding: 4px 0; }
.frag { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.frag__meta { font-size: 12px; color: var(--muted); }
.frag input, .frag textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); width: 100%; }
.frag .is-changed { border-color: var(--brand-deep); box-shadow: 0 0 0 2px rgba(214,197,60,.45); }
.codehost { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.codehost .cm-editor { height: 65vh; font-size: 13px; }
.errlist { list-style: none; margin: 0; flex-basis: 100%; }
.errlist__link { cursor: pointer; text-decoration: underline; }

/* ── Заявки ────────────────────────────────────────────────── */
.stats--leads .stat { text-decoration: none; color: var(--text); }
.filters__date, .filters__check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.filters__date input { flex: 0 1 auto; }
.lead { padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--line); }
.lead--new { border-left-color: var(--brand); }
.lead--called { border-left-color: var(--info); }
.lead--booked { border-left-color: var(--ok); }
.lead--refused { border-left-color: var(--muted); opacity: .8; }
.lead__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.lead__meta { font-size: 13px; margin: 4px 0 8px; }
.lead__msg { margin: 0 0 8px; }
.lead__form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lead__form select, .lead__form input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }
.lead__form input { flex: 1 1 200px; }
.lead__hist { margin-top: 6px; font-size: 13px; }
.num { width: 120px; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }
.filters select { max-width: 100%; min-width: 0; }

/* ── Справочники ── */
.code-ta { font: 13px/1.45 ui-monospace, Menlo, monospace; }
.rvw { padding: 12px 14px; }
.rvw--hidden { opacity: .6; border-style: dashed; }
.rvw__text { margin: 6px 0 8px; white-space: pre-line; }
.rvw .actions select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }

/* ── Поиск и замена, меню ── */
.hit { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.hit del { background: color-mix(in srgb, var(--danger) 18%, transparent); text-decoration: line-through; }
.hit ins { background: color-mix(in srgb, var(--ok) 18%, transparent); text-decoration: none; }
.menu-group { margin: 14px 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.menu-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.menu-item summary { cursor: pointer; }
.menu-forms { display: grid; gap: 10px; padding: 10px 0; }
.pair { margin-bottom: 4px; }

/* ── Медиатека ── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media { margin: 0; padding: 8px; display: grid; gap: 6px; }
.media img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.media figcaption { display: grid; gap: 4px; font-size: 13px; }
.media--unused { border-style: dashed; }
.media__alt { display: flex; gap: 4px; }
.media__alt input { flex: 1; min-width: 0; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); }

/* Проверки: скриншоты «до/после» */
.shots{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px;align-items:start}
.shots figure{margin:0}
.shots figcaption{font-size:13px;color:var(--muted);margin-bottom:4px}
.shots img{width:100%;height:auto;max-height:70vh;object-fit:cover;object-position:top;border:1px solid var(--line);border-radius:6px}
@media (max-width:700px){.shots{grid-template-columns:1fr}}

/* Линии и мелочи в духе сайта */
.card { box-shadow: none; }
.nav { gap: 1px; }
.savebar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
details > summary { cursor: pointer; }
.console { background: #0F0F10; color: #E4DFD7; }
/* Кнопки-иконки в строках таблиц — компактные круги, чтобы строка прайса оставалась плотной */
.prow__tools .btn { min-width: 32px; padding: 4px 8px; }
.prow__tools { gap: 4px; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; margin-right: 10px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--text); }
