/* ─────────────────────────────────────────────
   Моя Корона — панель управления
   Светлая тема: тёплый «камень», белые карточки, лёгкая морская волна и золото короны.
   Шрифты: Jost (заголовки, крупные числа), Onest (текст) — со своего сервера (assets/fonts).
   ───────────────────────────────────────────── */
:root {
  --bg: #fffdf8;
  --bg2: #f6f2e6;
  --card: #fff;
  --ink: #045269;
  --text: #383838;
  --muted: #5a6a6e;
  --faint: #8d999b;
  --line: #e7e4dc;
  --line2: #d9d6cc;
  --row: #f0eee8;
  --accent: #045269;
  --accent-t: #045269;
  --accent-l: #eaf3f6;
  --accent-ll: #f5f9fb;
  --gold: #d8c600;
  --gold-h: #e3d21f;
  --gold-t: #6e6400;
  --gold-l: #f7f3cf;
  --danger: #b3261e;
  --danger-l: #fbeae8;
  --ok: #2f7d5b;
  --ok-l: #e3f2ea;
  --warn: #8a5b00;
  --warn-l: #fbf1dc;
  --info-l: #eaf3f6;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(4, 82, 105, .04), 0 10px 28px -18px rgba(4, 82, 105, .2);
  --shadow-lg: 0 24px 60px -24px rgba(4, 82, 105, .32);
  --ring: 0 0 0 3px rgba(4, 82, 105, .25);
  --side-w: 264px;
  --top-h: 64px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Jost', 'Onest', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.adm {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 0;
}
a { color: var(--accent-t); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #075e5a; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0 0 .6em; }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg2); padding: .1em .4em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
[hidden] { display: none !important; }
::selection { background: rgba(216, 198, 0, .35); }

.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.strong { font-weight: 600; text-decoration: none; color: var(--ink); }
.strong:hover { color: var(--accent-t); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 1.15rem; font-weight: 600; margin-bottom: .5em; }

/* иконки */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-inline { width: 15px; height: 15px; color: var(--gold-t); }

/* ── знак студии ── */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: #d8c600; }
.brand-mark svg { width: 30px; height: auto; display: block; overflow: visible; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-name { font: 700 .98rem/1.1 var(--display); letter-spacing: .04em; white-space: nowrap; color: var(--ink); }
.brand-sub { font-size: .74rem; color: var(--muted); margin-top: 4px; letter-spacing: .02em; }
.brand-lg .brand-mark { width: 60px; height: 60px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.brand-lg .brand-mark svg { width: 40px; }
.brand-lg .brand-name { font-size: 1.2rem; }

/* ── каркас ── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line); color: var(--ink);
  padding: 18px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
}
.side-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 18px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.side-head .side-close { display: none; }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nav-label { padding: 0 12px 6px; font: 600 .68rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav-sep { margin: 10px 8px; border-top: 1px solid var(--line); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; width: 100%;
  color: var(--ink); text-decoration: none; font: 500 .93rem/1.3 var(--font); background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-link .i { color: var(--muted); transition: color .15s; }
.nav-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link:hover .i { color: var(--accent); }
.nav-link.is-active { background: var(--accent-l); color: var(--accent-t); font-weight: 600; }
.nav-link.is-active .i { color: var(--accent-t); }
.nav-link.is-active::before { content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold); color: var(--ink); font: 700 .74rem/22px var(--font); text-align: center; flex: none; }
.side-foot { position: relative; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }
.nav-user { padding: 8px 10px; }
.nav-user small { display: block; font-size: .74rem; color: var(--muted); font-weight: 400; }
.nav-link > .nav-avatar { flex: none; }
.nav-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--gold); color: var(--ink); font: 700 .85rem var(--display); }
.side-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: var(--top-h);
  padding: 12px 32px; background: rgba(246, 245, 241, .82); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(231, 228, 220, .95);
}
.top-title { font: 600 1.22rem/1.25 var(--display); letter-spacing: -.005em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-role { font-size: .78rem; font-weight: 600; color: var(--gold-t); background: var(--gold-l); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.top .burger { display: none; }
.top-site { flex: none; }
.content { padding: 26px 32px 72px; max-width: 1440px; width: 100%; }

/* ── флеш и предупреждения ── */
.flashes { padding: 16px 32px 0; display: flex; flex-direction: column; gap: 8px; max-width: 1440px; }
.flash, .alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--ok-l); color: #1d5a40; border: 1px solid #cbe6d8;
}
.flash > span, .alert > span { flex: 1; min-width: 0; }
.flash-error, .alert-danger { background: var(--danger-l); color: #8a1d17; border-color: #f2cdc9; }
.flash-warn, .alert-warn { background: var(--warn-l); color: #6b4700; border-color: #f0dfb5; }
.alert-info { background: var(--info-l); color: #145652; border-color: #cfe9e6; }
.alert-success { background: var(--ok-l); }
.alert { margin-bottom: 12px; flex-wrap: wrap; }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; border-radius: 8px; opacity: .6; display: grid; }
.flash-x:hover { opacity: 1; }

/* ── карточки и сетки ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card-title { font: 600 1.02rem/1.3 var(--display); margin-bottom: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card-title .i { color: var(--accent); }
.card-title .small { font-family: var(--font); font-weight: 400; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-title { font: 600 .92rem var(--display); margin: 16px 0 8px; }
details.card > summary { cursor: pointer; list-style: none; margin-bottom: 0; display: flex; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: ''; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .2s;
}
details.card[open] > summary { margin-bottom: 14px; }
details.card[open] > summary::before { transform: rotate(45deg); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-2.tight { gap: 12px; margin: 0; }
.grid-2 > .span-2 { grid-column: 1 / -1; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.side-col { position: relative; }
.sticky-card { position: sticky; top: calc(var(--top-h) + 18px); z-index: 2; }
.narrow { max-width: 640px; }
.grid-title-emoji { display: grid; grid-template-columns: 1fr 110px; gap: 12px; }
.emoji-input { text-align: center; font-size: 1.3rem !important; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.page-head > form { margin: 0; }
.lead-note { margin: 0; color: var(--muted); font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 600; }
.back:hover { color: var(--accent-t); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }

/* ── формы ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.label { font-weight: 600; font-size: .86rem; color: #2a3b3e; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 0; }
.req { color: var(--danger); }
.hint { font-size: .8rem; color: var(--muted); margin: 0; }
.fieldset { border: 1px dashed var(--line2); border-radius: var(--r-sm); padding: 14px; margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=url],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: 10px 13px; min-height: 44px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
textarea.mono { font-size: .85rem; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23045269' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
input::placeholder, textarea::placeholder { color: #9aa4a5; }
input:hover, select:hover, textarea:hover { border-color: #b9bcb3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[readonly] { background: var(--bg); color: var(--muted); }
input[type=file] { font: inherit; font-size: .88rem; max-width: 100%; }
input[type=file]::file-selector-button { font: 600 .85rem var(--font); border: 1px solid var(--line2); background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }
.input-lg { font-size: 1.12rem !important; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input[type=checkbox], .check input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.check-switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #cfd3cf; position: relative; flex: none; cursor: pointer; transition: background .2s;
}
.check-switch input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.check-switch input[type=checkbox]:checked { background: var(--accent); }
.check-switch input[type=checkbox]:checked::after { transform: translateX(18px); }
.counter { font-weight: 500; font-size: .76rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.counter.is-ok { color: var(--ok); }
.counter.is-warn { color: var(--warn); }
.counter.is-over { color: var(--danger); }
.slug-wrap { display: flex; align-items: stretch; border: 1px solid var(--line2); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.slug-wrap:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.slug-prefix { display: flex; align-items: center; padding: 0 10px 0 13px; color: var(--muted); font-family: var(--mono); font-size: .85rem; background: var(--bg); border-right: 1px solid var(--line); white-space: nowrap; }
.slug-suffix { border-right: 0; border-left: 1px solid var(--line); padding: 0 12px; }
.slug-wrap input { border: 0; border-radius: 0; box-shadow: none !important; font-family: var(--mono); font-size: .9rem; min-width: 0; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 48px; }
.pass-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ── кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px;
  font: 600 .9rem/1.2 var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line2); border-radius: var(--r-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-t); background: var(--accent-ll); }
.btn:active { transform: translateY(1px); }
.btn-primary, .btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; text-shadow: 0 1px 2px rgba(90, 82, 0, .35); box-shadow: 0 8px 18px -12px rgba(150, 137, 0, .9); }
.btn-primary:hover, .btn-gold:hover { background: #c9b800; border-color: #c9b800; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger-ghost { background: transparent; border-color: #efc7c3; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-l); border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .83rem; }
.btn-lg { min-height: 50px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
.btn.is-loading::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: var(--r-sm); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; text-decoration: none; transition: background .15s, color .15s; padding: 0;
}
.icon-btn:hover { background: var(--accent-l); color: var(--accent-t); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn-danger:hover { background: var(--danger-l); color: var(--danger); }
.link { font-size: .86rem; font-weight: 600; }

/* сегменты, чипы, вкладки */
.seg { display: inline-flex; padding: 4px; background: var(--bg2); border-radius: 12px; gap: 2px; }
.seg a, .seg label span, .seg button { display: block; padding: 7px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font: 600 .86rem var(--font); cursor: pointer; border: 0; background: none; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg a.is-active, .seg input:checked + span, .seg button.is-active { background: #fff; color: var(--accent-t); box-shadow: 0 1px 2px rgba(4, 82, 105, .08), 0 4px 10px -6px rgba(4, 82, 105, .2); }
.seg label { position: relative; flex: 1; text-align: center; }
.seg input { position: absolute; opacity: 0; }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.seg-block { display: flex; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; white-space: nowrap; }
.chip span { color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.is-active { background: var(--accent-l); border-color: var(--accent); color: var(--accent-t); }
.chip.is-active span { color: var(--accent-t); opacity: .75; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line2); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* «Настройки»: вкладок много — переносим на вторую строку, а не прячем за край (полоса прокрутки скрыта, вкладку не найти) */
.tabs-scroll { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent-t); border-bottom-color: var(--gold); }
.tab.is-active .i { color: var(--accent); }
.tab b { font-weight: 600; font-size: .78rem; color: var(--muted); background: var(--bg2); border-radius: 999px; padding: 1px 8px; }
.search, .filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.search input { width: 260px; }
.filters input[type=search] { width: 220px; }
.filters select { width: auto; min-width: 170px; }

/* пилюли и статусы */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; background: var(--bg2); color: #4a585b; font-size: .76rem; font-weight: 600; white-space: nowrap; text-decoration: none; vertical-align: middle; line-height: 1.6; }
.pill-ok { background: var(--ok-l); color: #1d5a40; }
.pill-low { background: var(--warn-l); color: #6b4700; }
.pill-out { background: var(--danger-l); color: #8a1d17; }
.pill-star, .pill-gold { background: var(--gold-l); color: var(--gold-t); }
.pill-sea { background: var(--accent-l); color: var(--accent-t); }
.pill-link:hover { background: var(--accent-l); color: var(--accent-t); }
button.pill { border: 0; cursor: pointer; font-family: inherit; }
.status { --c: #999; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 7px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 82%, black); background: color-mix(in srgb, var(--c) 13%, white); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.status-lg { font-size: .92rem; padding: 6px 14px; }

/* ── таблицы ── */
.table-wrap { overflow-x: auto; border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card .table { box-shadow: none; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf9f6; white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--r); }
.table th:last-child { border-top-right-radius: var(--r); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--row); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafaf7; }
.table tfoot td { padding: 8px 14px; color: var(--muted); }
.table tfoot .total td { font-weight: 700; color: var(--ink); font-size: 1.05rem; border-top: 1px solid var(--line); }
.table-compact td, .table-compact th { padding: 7px 12px; }
.row-link { cursor: pointer; }
.row-link.is-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.is-muted td, .is-muted { opacity: .6; }
.is-muted:hover td { opacity: 1; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
td.row-actions { display: table-cell; text-align: right; }
td.row-actions > * { display: inline-flex; vertical-align: middle; }
.col-thumb { width: 72px; }
.thumb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--accent-l); color: var(--accent-t); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .i { width: 22px; height: 22px; }
.log-msg { max-width: 520px; word-break: break-word; }
.path { font-family: var(--mono); font-size: .84rem; word-break: break-all; }
.arrow { color: var(--gold-t); margin: 0 6px; }

/* остаток +/- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.stepper button { width: 34px; height: 36px; border: 0; background: transparent; color: var(--accent-t); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--accent-l); }
.stepper input { width: 52px; min-height: 36px; border: 0; border-radius: 0; text-align: center; padding: 0; font-weight: 700; -moz-appearance: textfield; box-shadow: none !important; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper.is-low { border-color: #ead7a6; background: var(--warn-l); }
.stepper.is-out { border-color: #efc7c3; background: var(--danger-l); }
.stepper.is-saving { opacity: .6; }
.stepper.is-saved { box-shadow: 0 0 0 3px rgba(4, 82, 105, .35); }

/* переключатель «на сайте» */
.switch { width: 44px; height: 26px; border-radius: 13px; border: 0; background: #cfd3cf; position: relative; cursor: pointer; padding: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true] i { transform: translateX(18px); }
.switch.is-busy { opacity: .5; }

/* ── пустые состояния ── */
.empty { text-align: center; padding: 52px 20px; background: var(--card); border: 1px dashed var(--line2); border-radius: var(--r); }
.empty-lg { padding: 72px 20px; }
.empty-ico, .empty-emoji {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(160deg, #eaf3f6, #fffdf8); border: 1px solid #d5e5ea; color: var(--accent-t); font-size: 1.8rem; box-shadow: inset 0 -3px 0 var(--gold);
}
.empty-ico .i { width: 28px; height: 28px; stroke-width: 1.6; }
.empty-code { font: 700 .8rem var(--display); letter-spacing: .2em; color: var(--gold-t); margin-bottom: 6px; }
.empty h2 { font: 600 1.3rem/1.3 var(--display); margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 470px; margin: 0 auto 18px; }
.empty-inline { color: var(--muted); padding: 10px 0; }

/* ── дашборд ── */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 15px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-width: 0; overflow: hidden; }
.kpi-link:hover { border-color: var(--accent); color: var(--ink); }
.kpi-hot { background: linear-gradient(160deg, #fbf8dc, #fff); border-color: #e6da7a; }
.kpi-hot:hover { border-color: var(--gold); }
.kpi-hot .kpi-label { color: var(--gold-t); }
.kpi-hot::after { content: ''; position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(216, 198, 0, .25); }
.kpi-label { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.kpi-val { font: 600 1.55rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .78rem; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin: 6px 0 2px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #5cc6bf); border-radius: 3px; }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: #ecebe4; stroke-width: 1; }
.chart-axis { font: 10px var(--font); fill: #8b9698; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: rgba(4, 82, 105, .06); }
.chart-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--row); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list li > a { flex: 1; min-width: 140px; text-decoration: none; color: var(--ink); }
.list li > a:hover { color: var(--accent-t); }
.list-compact li { padding: 6px 0; }
.rank { margin: 0; padding: 0 0 0 1.3em; }
.rank li { padding: 6px 0; border-bottom: 1px solid var(--row); }
.rank li::marker { color: var(--gold-t); font: 600 .78rem var(--display); }
.rank li:last-child { border-bottom: 0; }
.rank li > * { vertical-align: middle; }
.rank li span, .rank li a { display: inline-block; max-width: calc(100% - 60px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank li b { float: right; color: var(--accent-t); font-variant-numeric: tabular-nums; }

/* ── заказ ── */
.order-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.order-head > div { flex: 1; min-width: 180px; }
.order-num { font: 600 1.6rem/1.15 var(--display); letter-spacing: -.01em; }
.order-total { font: 600 1.5rem var(--display); color: var(--accent-t); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0 0 16px; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.postcard { background: var(--gold-l); border: 1px solid #ebe4a4; border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 12px; }
.postcard-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gold-t); }
.postcard p { margin-top: 4px; }
.note { background: var(--bg); border-radius: var(--r-sm); padding: 12px 16px; }
.contact-btns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.contact-btns .btn { justify-content: flex-start; white-space: normal; text-align: left; overflow-wrap: anywhere; }

/* ── категории ── */
.tree { list-style: none; margin: 0; padding: 8px 0; }
.tree-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px calc(18px + var(--depth) * 28px); border-bottom: 1px solid var(--row); flex-wrap: wrap; position: relative; }
.tree-row:last-child { border-bottom: 0; }
.tree-row[style*="--depth:1"]::before, .tree-row[style*="--depth:2"]::before, .tree-row[style*="--depth:3"]::before, .tree-row[style*="--depth:4"]::before {
  content: ''; position: absolute; left: calc(4px + var(--depth) * 28px); top: 0; height: 50%; width: 10px; border-left: 1px solid var(--line2); border-bottom: 1px solid var(--line2); border-bottom-left-radius: 6px; }
.tree-emoji { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-l); color: var(--accent); display: grid; place-items: center; font-size: 1.1rem; overflow: hidden; flex: none; }
.tree-emoji img { width: 100%; height: 100%; object-fit: cover; }
.tree-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.tree-title:hover { color: var(--accent-t); }
.tree-row .row-actions { margin-left: auto; }

/* ── фото товара ── */
.photo-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-list:empty { display: none; }
.photo { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--bg2); }
.photo input[type=text] { min-height: 36px; padding: 6px 10px; font-size: .84rem; }
.photo-grip { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .92); border-radius: 8px; padding: 4px; cursor: grab; display: grid; color: var(--muted); }
.photo-del { font-size: .8rem; color: var(--danger); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.photo-del input { accent-color: var(--danger); }
.photo:has(.photo-del input:checked) img { opacity: .35; filter: grayscale(1); }
.photo-list[data-sortable] .photo:first-child::after { content: 'Главное'; position: absolute; top: 12px; right: 12px; background: var(--gold); color: var(--ink); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.photo.is-dragging { opacity: .4; }
.photo.is-over { border-color: var(--accent); box-shadow: var(--ring); }
.photo-new .photo { border-style: dashed; border-color: var(--accent); }
.photo-new .photo .photo-badge { position: absolute; top: 12px; right: 12px; background: var(--gold); color: var(--ink); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.photo-remove { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--danger); cursor: pointer; display: grid; place-items: center; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 26px 18px; border: 2px dashed var(--line2); border-radius: var(--r); background: #fbfaf7; cursor: pointer; color: var(--accent-t); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-ll); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone .i { width: 28px; height: 28px; }
.dropzone b { color: var(--ink); font-weight: 600; }
.dropzone-lg { padding: 34px 18px; margin-bottom: 20px; }
.upload-progress { font-weight: 700; color: var(--accent-t); }
.image-field { display: flex; flex-direction: column; gap: 10px; }
.image-preview { width: 100%; aspect-ratio: 1; max-width: 220px; border-radius: 14px; overflow: hidden; background: var(--bg2); display: grid; place-items: center; }
.image-preview-wide { aspect-ratio: 16/9; max-width: none; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.video-preview { width: 100%; max-height: 360px; border-radius: 14px; background: #000; }

/* ── SEO-сниппет ── */
.snippets { display: flex; flex-direction: column; gap: 12px; }
.snippet { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-family: Arial, sans-serif; min-width: 0; }
.snippet-src { font: 600 .68rem var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.snippet-title { font-size: 18px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-url { font-size: 13px; color: #1a7a3c; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-desc { font-size: 13px; color: #4d5156; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.snippet-ya .snippet-title { color: #000; font-weight: 500; }
.snippet-ya .snippet-url { color: #006000; }
.snippet-g .snippet-title { color: #1a0dab; font-size: 19px; }
.snippet-g .snippet-url { color: #202124; }
.snippet-fav { font-size: 12px; }

/* ── визуальный редактор ── */
.editor { border: 1px solid var(--line2); border-radius: 14px; background: #fff; position: relative; }
.editor:focus-within { border-color: var(--accent); }
.ed-toolbar { position: sticky; top: var(--top-h); z-index: 6; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: rgba(248, 247, 243, .97); border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; backdrop-filter: blur(6px); }
.ed-group { display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); align-items: center; }
.ed-group:last-child { border-right: 0; }
.ed-btn { min-width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #33474a; cursor: pointer; display: inline-grid; place-items: center; font: 600 .92rem var(--font); padding: 0 6px; }
.ed-btn:hover { background: var(--accent-l); color: var(--accent-t); }
.ed-btn.is-active { background: var(--accent-t); color: #fff; }
.ed-btn:disabled { opacity: .35; pointer-events: none; }
.ed-btn .i { width: 17px; height: 17px; }
.ed-block { width: auto !important; min-height: 34px !important; padding: 4px 30px 4px 10px !important; font-size: .86rem !important; border-radius: 8px !important; background-position: right 10px center !important; }
.ed-area { min-height: 360px; max-height: 75vh; overflow-y: auto; padding: 22px 26px; outline: none; }
.ed-area:empty::before { content: 'Начните писать здесь…'; color: #a2aaab; }
.ed-source { display: block; width: 100%; min-height: 360px; border: 0 !important; border-radius: 0 !important; font: .85rem/1.6 var(--mono) !important; padding: 18px 22px !important; box-shadow: none !important; background: #fafaf7 !important; }
.ed-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.ed-saved { color: var(--ok); }
.ed-hint { margin-left: auto; }
.ed-restore { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; background: var(--warn-l); color: #6b4700; font-size: .88rem; }
.ed-restore span { flex: 1; }
.editor.is-over .ed-area { background: var(--accent-ll); }
.editor.is-full { position: fixed; inset: 0; z-index: 90; border-radius: 0; display: flex; flex-direction: column; }
.editor.is-full .ed-toolbar { top: 0; border-radius: 0; }
.editor.is-full .ed-area, .editor.is-full .ed-source { flex: 1; max-height: none; max-width: 860px; width: 100%; margin: 0 auto; }
body.ed-locked { overflow: hidden; }
.ed-area .ed-selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.ed-uploading { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--accent-l); color: var(--accent-t); font-size: .85rem; }

/* типографика содержимого (как на сайте) */
.prose { font-size: 1rem; line-height: 1.7; color: var(--ink); overflow-wrap: break-word; }
.prose h2 { font: 600 1.35rem/1.3 var(--display); margin: 1.4em 0 .5em; letter-spacing: -.01em; }
.prose h3 { font: 600 1.1rem/1.35 var(--display); margin: 1.2em 0 .4em; }
.prose h4 { font-size: 1rem; margin: 1em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); color: #33474a; }
.prose .callout { margin: 1.2em 0; padding: 14px 18px; border-radius: 12px; background: var(--accent-ll); border: 1px solid var(--accent-l); }
.prose hr { margin: 2em 0; border-top: 1px solid var(--line2); }
.prose figure { margin: 1.4em 0; }
.prose figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.prose figcaption { font-size: .86rem; color: var(--muted); text-align: center; margin-top: 6px; }
.prose figure.align-left { float: left; max-width: 45%; margin: .3em 1.4em 1em 0; }
.prose figure.align-right { float: right; max-width: 45%; margin: .3em 0 1em 1.4em; }
.prose figure.align-center, .prose .align-center { text-align: center; margin-left: auto; margin-right: auto; }
.prose figure.align-center img { margin: 0 auto; }
.prose p.align-right { text-align: right; }
.prose iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 12px; background: #000; display: block; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line2); padding: 8px 10px; text-align: left; min-width: 60px; }
.prose th { background: var(--bg); }
.prose a { color: var(--accent-t); }
.prose::after { content: ''; display: table; clear: both; }
.prose-sm ul { padding-left: 1.2em; margin: 0; }
.prose-sm li { margin-bottom: .6em; }

/* ── медиа ── */
.media-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.media-thumb { display: block; aspect-ratio: 4/3; background: var(--bg2); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-video { display: grid; place-items: center; height: 100%; color: var(--accent); }
.media-video .i { width: 36px; height: 36px; }
.media-meta { padding: 8px 12px 0; display: flex; flex-direction: column; min-width: 0; }
.media-name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-actions { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 10px 12px; gap: 6px; }
.media-actions form { margin: 0; }

/* ── заявки и вопросы ── */
.messages { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { position: relative; }
.msg.is-unread { box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
.msg-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.msg-head > b { font-size: 1.02rem; }
.msg-contact a { text-decoration: none; display: inline-flex; gap: 5px; align-items: center; font-weight: 600; }
.msg-date { margin-left: auto; }
.msg-product, .msg-meta { font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 8px; }
.msg-meta .i { color: var(--accent); width: 16px; height: 16px; }
.msg-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.msg-text { background: var(--bg); border-radius: var(--r-sm); padding: 10px 14px; white-space: normal; overflow-wrap: anywhere; }
.msg-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.msg-actions form { margin: 0; }
.msg-actions .msg-del { margin-left: auto; }
.lead-status { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg2); border-radius: 10px; }
.lead-status button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 .82rem var(--font); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lead-status button::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.lead-status button:hover { color: var(--ink); }
.lead-status button.is-on { background: #fff; box-shadow: 0 1px 2px rgba(4, 82, 105, .08), 0 4px 10px -6px rgba(4, 82, 105, .2); }
.lead-status button.is-on::before { opacity: 1; }
.lead-status .st-new.is-on { color: #8a5b00; }
.lead-status .st-new.is-on::before { background: var(--gold); }
.lead-status .st-work.is-on { color: var(--accent-t); }
.lead-status .st-done.is-on { color: var(--ok); }
.msg.st-done { opacity: .78; }
.msg.st-done:hover { opacity: 1; }

/* ── сотрудники ── */
.staff-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.staff-head > div { flex: 1; min-width: 160px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-l); color: var(--accent-t); display: grid; place-items: center; font: 600 1rem var(--display); flex: none; }
.staff-edit { margin-top: 10px; }
.staff-edit summary { cursor: pointer; color: var(--accent-t); font-weight: 600; margin-bottom: 12px; }
.hint-box p { font-size: .9rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ph { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: .84rem var(--font); color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.ph:hover { border-color: var(--accent); }
.ph span { color: var(--muted); }

/* настройки */
.logo-preview { padding: 24px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; min-height: 120px; color: var(--accent-t); }
.logo-preview .logo-img, .logo-preview svg { max-height: 90px; max-width: 100%; width: auto; }
.logo-svg svg { max-height: 54px; width: auto; }
.fav-preview { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px; background: var(--bg); border-radius: 14px; }
.fav-preview > img:first-child { border-radius: 22px; box-shadow: var(--shadow); background: #fff; }
.fav-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px 10px 0 0; background: #fff; font-size: .82rem; box-shadow: var(--shadow); }
.map-preview { width: 100%; height: 300px; border: 0; border-radius: 14px; background: var(--bg2); }

/* постраничность */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 20px 0; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.pager a { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.pager a:hover { border-color: var(--accent); }
.pager .is-current { background: var(--gold); color: var(--ink); }
.pager-gap { color: var(--muted); }
.pager .pager-total { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .85rem; }

/* всплывающие уведомления */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .25s ease-out; }
.toast.is-error { background: var(--danger-l); color: #8a1d17; border-color: #f2cdc9; border-left-color: var(--danger); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* диалоги */
.confirm-dlg { border: 0; border-radius: 18px; padding: 24px; max-width: 420px; width: calc(100% - 32px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.confirm-dlg::backdrop, .be-dlg::backdrop { background: rgba(4, 82, 105, .3); backdrop-filter: blur(3px); }
.confirm-dlg p { font-size: 1.02rem; margin-bottom: 18px; }
.confirm-dlg .actions { justify-content: flex-end; }

/* ── страницы: вид, конструктор блоков ── */
.kind-pick { display: flex; flex-direction: column; gap: 6px; }
.page-url { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .8rem; color: var(--muted); text-decoration: none; word-break: break-all; }
.page-url:hover { color: var(--accent-t); }
.cover-field { display: flex; gap: 10px; align-items: flex-start; }
.cover-field .field { flex: 1; }
.src-preview { width: 64px; height: 64px; flex: none; border-radius: 10px; background: var(--bg2) center / cover no-repeat; border: 1px solid var(--line); }
.src-row { display: flex; gap: 8px; align-items: center; }
.src-row input { flex: 1; min-width: 0; }
.src-row .src-preview { width: 44px; height: 44px; }

.be-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.be-head-bar .card-title { margin: 0; }
.be-list { display: flex; flex-direction: column; gap: 10px; counter-reset: blk; }
.be-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.be-card:hover { border-color: var(--line2); }
.be-card.is-open { border-color: #bfe3df; box-shadow: 0 10px 26px -20px rgba(11, 125, 120, .5); }
.be-card.is-hidden { background: repeating-linear-gradient(135deg, #fbfbf8 0 10px, #f5f4ef 10px 20px); }
.be-card.is-hidden .be-title, .be-card.is-hidden .be-num { opacity: .55; }
.be-card.is-flash { animation: be-flash 1.2s ease-out; }
@keyframes be-flash { from { box-shadow: 0 0 0 4px rgba(216, 198, 0, .55); } }
.be-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 6px; }
.be-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink); border-radius: 10px; }
.be-toggle:hover { background: var(--accent-ll); }
.be-num { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-l); color: var(--accent-t); font: 600 .76rem var(--display); }
.be-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.be-type { font: 600 .7rem var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-t); }
.be-prev { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-prev.is-empty { color: var(--faint); font-weight: 500; }
.be-chev { flex: none; color: var(--muted); transition: transform .2s; }
.be-card.is-open .be-chev { transform: rotate(180deg); }
.be-tools { display: flex; gap: 0; flex: none; }
.be-tools .icon-btn { width: 34px; height: 34px; }
.be-tools .is-off { color: var(--gold-t); background: var(--gold-l); }
.be-body { padding: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.be-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.be-grid > .be-wide { grid-column: 1 / -1; }
.be-adv { border-top: 1px dashed var(--line2); padding-top: 12px; }
.be-adv > summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted); list-style: none; }
.be-adv > summary::-webkit-details-marker { display: none; }
.be-adv > summary::before { content: '+ '; color: var(--accent); }
.be-adv[open] > summary::before { content: '− '; }
.be-adv[open] > summary { margin-bottom: 12px; }
.be-rep { display: flex; flex-direction: column; gap: 8px; }
.be-rep-list { display: flex; flex-direction: column; gap: 8px; }
.be-rep-list:empty { display: none; }
.be-row { border: 1px solid var(--line); border-radius: 12px; background: #fafaf7; padding: 10px 12px 12px; }
.be-row.is-hot { border-color: #e2d76b; background: #fdfcf0; }
.be-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.be-row-title { font: 600 .78rem var(--display); color: var(--accent-t); }
.be-row-tools { display: flex; }
.be-row-tools .icon-btn { width: 30px; height: 30px; }
.be-row-tools .icon-btn .i { width: 16px; height: 16px; }
.be-str { display: flex; align-items: center; gap: 4px; }
.be-str input { min-height: 38px; padding: 7px 11px; }
.be-str .icon-btn { width: 30px; height: 30px; }
.be-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px dashed var(--line2); border-radius: 9px; background: #fff; color: var(--accent-t); font: 600 .84rem var(--font); cursor: pointer; }
.be-add:hover { border-color: var(--accent); background: var(--accent-ll); }
.be-add .i { width: 15px; height: 15px; }
.be-btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.be-btn-row input { min-height: 38px; padding: 7px 11px; }
.be-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.be-empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--line2); border-radius: 14px; background: #fbfbf8; }
.be-empty p { color: var(--muted); margin-bottom: 12px; }
.be-empty .actions { justify-content: center; }
.be-lock { font-size: .86rem; color: var(--warn); background: var(--warn-l); border-radius: 9px; padding: 8px 12px; }
.be-code { font: .82rem/1.55 var(--mono) !important; min-height: 160px; tab-size: 2; }
.be-json { margin-top: 14px; }
.be-json > summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted); }
.be-json[open] > summary { margin-bottom: 10px; }
.be-json textarea { font: .8rem/1.5 var(--mono); min-height: 240px; }
.be-broken { margin-bottom: 12px; }
.be-rich { border: 1px solid var(--line2); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.be-rich:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.be-rich-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: #f8f7f3; }
.be-rich-bar .ed-btn { min-width: 30px; height: 30px; font-size: .84rem; }
.be-rich-bar .ed-btn .i { width: 15px; height: 15px; }
.be-rich-area { min-height: 110px; max-height: 420px; overflow-y: auto; padding: 10px 14px; outline: none; font-size: .95rem; }
.be-rich-area:empty::before { content: attr(data-ph); color: #a2aaab; }
.be-rich-src { display: block; width: 100%; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-height: 140px; font: .82rem/1.55 var(--mono) !important; background: #fafaf7 !important; }
.be-dlg { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.be-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; position: sticky; top: 0; background: #fff; z-index: 1; }
.be-dlg-head h2 { font: 600 1.1rem var(--display); }
.be-dlg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 20px 20px; }
.be-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s, transform .1s; }
.be-tile:hover { border-color: var(--accent); background: var(--accent-ll); }
.be-tile:active { transform: translateY(1px); }
.be-tile b { font: 600 .9rem var(--display); }
.be-tile span { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.be-tile .be-tile-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-l); color: var(--accent-t); margin-bottom: 6px; }

/* ── SEO и редиректы ── */
.redir-form { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.2fr) 170px; gap: 12px; align-items: end; }
.redir-form .redir-arrow { display: grid; place-items: center; height: 44px; color: var(--gold-t); }
.redir-form .span-all { grid-column: 1 / -1; }
.redir-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.redir-to { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ref-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hits { font: 600 .95rem var(--display); color: var(--accent-t); }

/* ── вход ── */
.login-page { min-height: 100vh; background: var(--bg); }
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 52px; color: var(--ink); background: linear-gradient(160deg, #fcf9e6 0%, #fffdf8 50%, #f3f8fa 100%); border-right: 1px solid var(--line);
}
.login-hero::before { /* золотое свечение */
  content: ''; position: absolute; width: 560px; height: 560px; right: -200px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 198, 0, .16), transparent 62%); pointer-events: none;
}
.login-hero::after { /* тонкая сетка */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(4, 82, 105, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(4, 82, 105, .08) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%, transparent); mask-image: linear-gradient(180deg, transparent, #000 45%, transparent);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero-text { max-width: 470px; }
.login-hero-text h2 { font: 600 clamp(1.6rem, 2.6vw, 2.3rem)/1.18 var(--display); letter-spacing: -.015em; margin-bottom: 16px; }
.login-hero-text h2 em { font-style: normal; color: var(--accent-t); box-shadow: inset 0 -.22em 0 rgba(216, 198, 0, .45); }
.login-hero-text p { color: var(--muted); font-size: 1.02rem; max-width: 400px; }
.login-hero-foot { font-size: .82rem; color: var(--muted); margin: 0; letter-spacing: .03em; }
.login-side { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 390px; }
.login-card h1 { font: 600 1.6rem/1.2 var(--display); letter-spacing: -.01em; margin-bottom: 6px; }
.login-card > .muted { margin-bottom: 22px; }
.login-card .flash { margin: 0 0 14px; }
.login-card form { margin-top: 4px; }
.login-note { margin-top: 20px; font-size: .8rem; color: var(--muted); }

/* ── печать заказа ── */
.print-page { background: #eceae4; margin: 0; font: 14px/1.5 var(--font); color: #111; padding: 24px; }
.print-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.sheet { background: #fff; max-width: 780px; margin: 0 auto; padding: 40px 44px; border-radius: 6px; box-shadow: 0 10px 40px -20px rgba(0,0,0,.3); }
.sheet-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--accent-t); padding-bottom: 14px; margin-bottom: 18px; }
.sheet-brand { font: 700 1.3rem var(--display); color: var(--ink); }
.sheet-num { text-align: right; font-size: 1.1rem; }
.sheet-info, .sheet-items { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.sheet-info th { text-align: left; width: 130px; color: #666; font-weight: 500; padding: 4px 0; vertical-align: top; }
.sheet-info td { padding: 4px 0; }
.sheet-items th, .sheet-items td { border-bottom: 1px solid #ddd; padding: 7px 6px; text-align: left; }
.sheet-items td:nth-child(n+3), .sheet-items th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.sheet-items tfoot td { border: 0; padding: 4px 6px; }
.sheet-items tfoot td:first-child { text-align: right; color: #666; }
.sheet-items tfoot .total td { font-weight: 700; font-size: 1.1rem; color: #111; border-top: 2px solid var(--accent-t); }
.sheet-card, .sheet-note { border: 1px dashed #bbb; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.sheet-card h3, .sheet-note h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #666; margin-bottom: 4px; }
.sheet-foot { margin-top: 24px; text-align: center; color: #777; font-size: .85rem; }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; padding: 0; }
  .sheet { box-shadow: none; padding: 0; max-width: none; }
  @page { margin: 14mm; }
}

/* соцсети */
.social-chips { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.social-card details summary { cursor: pointer; }
.text-danger { color: var(--danger); }

/* ── адаптивность ── */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .redir-form { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .redir-form .redir-code { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  :root { --top-h: 60px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .25s ease, box-shadow .25s; }
  body.side-open .side { transform: none; box-shadow: 20px 0 50px -20px rgba(4, 82, 105, .3); }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(4, 82, 105, .28); }
  body.side-open { overflow: hidden; }
  .side-head .side-close, .top .burger { display: inline-grid; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .sticky-card { position: static; }
  .top, .content, .flashes { padding-left: 20px; padding-right: 20px; }
  .be-dlg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-hero { padding: 28px 22px 30px; gap: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-hero-text h2 { font-size: 1.35rem; margin-bottom: 8px; }
  .login-hero-text p { font-size: .92rem; }
  .login-hero-foot { display: none; }
  .login-side { padding: 28px 18px 40px; place-items: start center; }
}
@media (max-width: 760px) {
  body.adm { font-size: 15px; }
  .top { padding: 10px 14px; gap: 10px; }
  .top-title { font-size: 1.02rem; }
  .top-role { display: none; }
  .top-site { padding: 6px 9px; }
  .top-site span { display: none; }
  .content { padding: 16px 14px 60px; }
  .flashes { padding: 12px 14px 0; }
  .card { padding: 16px; border-radius: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .grid-2.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis, .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-val { font-size: 1.22rem; }
  .search input, .filters input[type=search], .filters select { width: 100%; min-width: 0; }
  .search, .filters { width: 100%; }
  .search input { flex: 1; }
  .filters > * { flex: 1 1 140px; }
  .page-head > .btn { width: 100%; }
  .page-head > .actions { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .order-num { font-size: 1.3rem; }
  .empty h2 { font-size: 1.12rem; }

  /* таблицы → карточки */
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td, .table-cards tfoot { display: block; width: 100%; }
  .table-cards { background: none; border: 0; box-shadow: none; }
  .table-cards thead { display: none; }
  .table-cards tbody tr { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 10px 14px; box-shadow: var(--shadow); position: relative; }
  .table-cards tbody tr:hover td { background: none; }
  .table-cards td { border: 0; padding: 5px 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
  .table-cards td[data-label]::before { content: attr(data-label); flex: 0 0 96px; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
  .table-cards td[data-label] > * { min-width: 0; }
  .table-cards td.col-thumb { float: right; width: auto; padding: 0 0 0 10px; }
  .table-cards td.row-actions { display: flex; justify-content: flex-start; border-top: 1px solid var(--row); margin-top: 6px; padding-top: 8px; }
  .table-cards tfoot { background: var(--card); border-radius: 14px; padding: 8px 14px; }
  .table-cards tfoot tr { display: flex; justify-content: space-between; }
  .table-cards tfoot td { padding: 4px 0; width: auto; }
  .table-wrap:has(> .table-cards) { overflow: visible; }
  .table-wrap > .table:not(.table-cards) { min-width: 560px; }
  .row-link.is-new { box-shadow: inset 4px 0 0 var(--gold), var(--shadow) !important; }
  .row-link.is-new td:first-child { box-shadow: none; }
  .tree-row { padding-left: calc(12px + var(--depth) * 16px); padding-right: 12px; }
  .tree-row::before { display: none; }
  .tree-row .row-actions { width: 100%; justify-content: flex-end; }
  .ed-area { padding: 16px; min-height: 280px; }
  .ed-hint { display: none; }
  .photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .prose figure.align-left, .prose figure.align-right { float: none; max-width: 100%; margin: 1em 0; }
  .sheet { padding: 20px; }
  .grid-title-emoji { grid-template-columns: 1fr 80px; }
  .msg-date { margin-left: 0; width: 100%; }
  .msg-actions .msg-del { margin-left: 0; }
  .lead-status { width: 100%; }
  .lead-status button { flex: 1; justify-content: center; padding: 7px 6px; }

  .be-head { flex-wrap: wrap; padding: 6px; }
  .be-toggle { flex: 1 1 100%; }
  .be-tools { width: 100%; justify-content: flex-end; border-top: 1px solid var(--row); padding-top: 4px; }
  .be-body { padding: 14px 12px; }
  .be-grid { grid-template-columns: minmax(0, 1fr); }
  .be-btn-row { grid-template-columns: minmax(0, 1fr) auto; }
  .be-btn-row input:nth-child(2) { grid-column: 1; grid-row: 2; }
  .be-btn-row > .be-row-tools { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .be-dlg-grid { grid-template-columns: minmax(0, 1fr); padding: 0 14px 16px; }
  .be-dlg-head { padding: 14px 14px 10px; }
  .redir-form { grid-template-columns: minmax(0, 1fr); }
  .redir-form .redir-arrow { display: none; }
  .ref-cell { max-width: none; white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Самозанятый: напоминание выбить чек в «Мой налог» после оплаты */
.receipt-todo { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: #fbf8dc; box-shadow: inset 0 0 0 1px rgba(216, 198, 0, .45); }
.receipt-todo form { margin-top: 4px; }
.receipt-done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.link-btn { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.badge-receipt { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: #fbf8dc; color: #6e6400; font-size: .75rem; font-weight: 600; white-space: nowrap; }

/* Мониторинг сайтов */
.mon-lead { max-width: 640px; margin: 0; }
.mon-ok { color: var(--ok); }
.mon-bad { color: var(--danger); }
.mon-url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-acts { display: flex; gap: 6px; justify-content: flex-end; }
.mon-acts form { margin: 0; }
.mon-table td { vertical-align: top; }
.mon-incidents { margin-top: 20px; }
.mon-incidents li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.mon-spark { display: block; width: 100%; height: 90px; margin: 6px 0 8px; border-radius: 8px; background: var(--bg); }
.mon-spark .ok { fill: var(--accent); opacity: .55; }
.mon-spark .ok:hover { opacity: 1; }
.mon-spark .bad { fill: var(--danger); }
.mon-form { max-width: 920px; }
.mon-del { margin-top: 14px; }
.alert code { padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .06); font-size: .8rem; word-break: break-all; }
@media (max-width: 760px) { .mon-acts { justify-content: flex-start; flex-wrap: wrap; } }
.mon-tabs { margin-bottom: 16px; }
.chip.is-disabled { opacity: .55; cursor: default; }
.chip.is-disabled:hover { border-color: var(--line); }
.mon-kind { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 99px; background: var(--accent-l); color: var(--accent-t); font-size: .72rem; font-weight: 600; }
.mon-kind--subscriber { background: #f3ecfb; color: #6b3fa0; }
.mon-group td { padding-top: 18px; background: var(--bg); border-top: 1px solid var(--line); }
.mon-group td > * { margin-right: 10px; }
.mon-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.mon-kinds legend { margin-bottom: 8px; }
.mon-kind-opt { cursor: pointer; }
.mon-kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mon-kind-opt span { display: grid; gap: 3px; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; }
.mon-kind-opt small { color: var(--muted); }
.mon-kind-opt input:checked + span { border-color: var(--accent); background: var(--accent-l); }
.mon-kind-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mon-warn { margin-top: 4px; font-size: .78rem; font-weight: 600; color: #a35a00; }
.mon-watch { margin-top: 20px; }
.mon-watch summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mon-watch[open] summary { margin-bottom: 10px; }
.mon-watch input { width: 100%; font: .82rem monospace; }

/* ── Клиенты и подписки (личный кабинет) ─────── */
.cab-adm { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.cab-adm > .card, #sites, .cab-adm ~ .card { margin-bottom: 20px; }
.cab-sub { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.cab-sub:first-of-type { border-top: 0; padding-top: 0; }
.cab-sub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cab-sub-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cab-sub-status { display: flex; gap: 6px; align-items: center; }
.cab-sub-status select, .cab-sub-acts select { padding: 6px 10px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; font: inherit; font-size: .86rem; }
.cab-sub-more summary, .cab-sub-add summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent-t); width: max-content; display: inline-flex; align-items: center; gap: 6px; }
.cab-sub-more[open] summary, .cab-sub-add[open] summary { margin-bottom: 12px; }
.cab-sub-add { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line2); }
.cab-limit { display: grid; gap: 6px; }
.cab-limit i { display: block; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--row) var(--p)); }
@media (max-width: 1000px) { .cab-adm { grid-template-columns: minmax(0, 1fr); } }

/* ── Счета на оплату ─────────────────────────── */
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.inv-side { align-self: stretch; min-width: 0; }
.inv-side-in { position: sticky; top: 78px; display: grid; gap: 8px; }
.inv-side-cap { font-size: .78rem; font-weight: 600; color: var(--muted); }
.inv-head { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.inv-chips { justify-content: flex-end; margin: 8px 0 14px; }
.inv-chips .chip { cursor: pointer; padding: 5px 10px; font-size: .78rem; }
.inv-import { display: grid; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.inv-import [hidden] { display: none; }
.inv-drop { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1.5px dashed var(--line2); border-radius: 12px; background: var(--accent-ll); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: .2s; }
.inv-drop:hover, .inv-drop.is-over { border-color: var(--accent); background: var(--accent-l); }
.inv-drop:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.inv-drop[disabled] { opacity: .6; cursor: progress; }
.inv-drop b, .inv-drop small { display: block; }
.inv-drop b { font-weight: 600; }
.inv-drop small { margin-top: 2px; font-size: .82rem; color: var(--muted); }
.inv-import-text summary { font-size: .88rem; color: var(--accent-t); cursor: pointer; }
.inv-import-text textarea { width: 100%; margin-top: 8px; }
.inv-status { margin: 0; font-size: .88rem; color: var(--ink); }
.inv-status.is-err { color: var(--danger); }
.inv-found { display: grid; gap: 3px; margin: 0; padding: 0; font-size: .86rem; list-style: none; }
.inv-found li::before { display: inline-block; width: 1.2em; font-weight: 700; }
.inv-found .is-ok::before { content: '✓'; color: #2f8f4e; }
.inv-found .is-warn::before { content: '!'; color: var(--gold-t); }
.inv-found .is-miss::before { content: '–'; color: var(--faint); }
.inv-found .is-miss { color: var(--muted); }
.inv-found .is-warn { color: var(--gold-t); }
.inv-thumb { justify-self: start; max-width: 100%; max-height: 140px; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.inv-thumb.is-big { width: 100%; max-height: none; cursor: zoom-out; }
input.inv-check { border-color: var(--gold); background: var(--gold-l); }
.inv-buyer { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 12px; margin-top: 12px; }
.inv-buyer .inv-full { grid-column: 1 / -1; }
.inv-rows { display: grid; gap: 10px; }
.inv-row { display: grid; grid-template-columns: 76px 88px minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px 10px; align-items: end; padding: 12px; border-radius: 12px; background: var(--accent-ll); border: 1px solid var(--line); }
.inv-c-name { grid-column: 1 / -1; }
.inv-row label, .inv-c-sum { display: grid; gap: 3px; min-width: 0; }
.inv-row label > span:not(.sr-only), .inv-c-sum > span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.inv-row input { width: 100%; min-width: 0; background: #fff; }
.inv-c-sum output { padding: 9px 0; font-weight: 700; color: var(--ink); white-space: nowrap; }
.inv-rows-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.inv-total { display: grid; justify-items: end; }
.inv-total span { font-size: .78rem; color: var(--muted); }
.inv-total b { font: 600 1.45rem/1.15 var(--display); color: var(--ink); }
.inv-sum-toggle { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--accent-t); }
.inv-more { margin-top: 14px; }
.inv-sheet { container-type: inline-size; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 50px -32px rgba(4, 82, 105, .4); overflow: hidden; }
.inv-sheet--big { min-width: 0; }
.inv-paper { min-height: 136cqw; padding: 7cqw 7cqw 6cqw; font-size: 1.54cqw; line-height: 1.3; color: #111; }
.inv-paper small { display: block; margin-top: .7em; font-size: .72em; color: #595959; }
.inv-note { margin: 0 3em 1em; font-size: .9em; text-align: center; }
.inv-bank { display: grid; grid-template-columns: minmax(0, 1fr) 13.6em; gap: 1.1em; align-items: start; }
.inv-bank table { width: 100%; border-collapse: collapse; }
.inv-bank td { padding: .35em .45em; border: 1px solid #111; vertical-align: top; overflow-wrap: anywhere; }
.inv-bank .k { width: 3em; white-space: nowrap; }
.inv-bank .v { width: 12.6em; white-space: nowrap; font-size: .94em; overflow-wrap: normal; }
.inv-qr { text-align: center; }
.inv-qr svg { display: block; width: 100%; height: auto; }
.inv-qr small { margin: 0; line-height: 1.25; }
.inv-title { margin: 1.5em 0 .4em; padding-bottom: .4em; border-bottom: .16em solid #111; font: 700 1.6em/1.2 var(--font); color: #111; }
.inv-parties { display: grid; grid-template-columns: 7.3em minmax(0, 1fr); gap: .35em 0; margin: .9em 0 1.1em; }
.inv-parties dt { font-weight: 400; }
.inv-parties dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.inv-items { width: 100%; border-collapse: collapse; border: .12em solid #111; }
.inv-items th, .inv-items td { padding: .45em .55em; border: 1px solid #111; text-align: right; white-space: nowrap; vertical-align: top; }
.inv-items th { font-weight: 700; font-size: .95em; }
.inv-items .l { width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.inv-items .c { text-align: center; }
.inv-empty { color: #b08400; font-weight: 400; text-align: center !important; }
.inv-totals { display: grid; justify-content: end; gap: .35em; margin-top: .9em; }
.inv-totals div { display: grid; grid-template-columns: 11em 8em; text-align: right; }
.inv-totals span { font-weight: 700; }
.inv-totals b { font-weight: 400; }
.inv-totals .is-all b { font-weight: 700; font-size: 1.12em; }
.inv-sum { margin: 1em 0 0; padding-bottom: .7em; border-bottom: .16em solid #111; }
.inv-sign { display: flex; align-items: flex-end; gap: 1em; margin: 2.8em .6em 0; }
.inv-sign i { flex: 1; max-width: 20em; border-bottom: 1px solid #111; }
.inv-show { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.inv-sum-card { display: grid; justify-items: start; gap: 6px; }
.inv-sum-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.inv-sum-val { font: 600 1.9rem/1.15 var(--display); color: var(--ink); }
.inv-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.inv-wide-btn { width: 100%; justify-content: center; }
.inv-req { max-width: 720px; }
@media (max-width: 1180px) { .inv-layout, .inv-show { grid-template-columns: minmax(0, 1fr); } .inv-side-in { position: static; } }
@media (max-width: 640px) {
  .inv-head, .inv-buyer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv-head .field:first-child, .inv-buyer .inv-wide { grid-column: 1 / -1; }
  .inv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv-row .icon-btn { grid-column: 1 / -1; justify-self: end; }
  .inv-show > .inv-sheet { order: 2; }
}

/* Аудиты сайтов */
.aud-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.aud-item:last-child { border-bottom: 0; }
.aud-item summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; }
.aud-item p { margin: 8px 0 0; }
.aud-urls { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; overflow-wrap: anywhere; }
.aud-urls li { margin-top: 3px; }
.aud-sub { font: 600 .95rem/1.3 var(--display); margin: 8px 0 0; }
.aud-path { overflow-wrap: anywhere; max-width: 260px; }

/* «Настройки → Уведомления»: MAX и ВКонтакте */
.msgr-box { gap: 10px; padding: 16px 18px; border-radius: 12px; background: var(--bg2); }
.msgr-box p { margin: 0; }
.msgr-head { display: flex; align-items: center; gap: 10px; }
.msgr-box code { overflow-wrap: anywhere; }

/* «Настройки → Вход в кабинет» */
.login-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.login-steps code { overflow-wrap: anywhere; }
