/* ==========================================================================
   Анализатор конфигураций — «мягкая система»
   Светлая основа, пастельные акценты, крупные радиусы, спокойные тени.
   Тёмная тема — тот же язык на глубоком сине-сером.
   ========================================================================== */

@import url("/static/inter.css");

:root {
  --bg: #f6f7fb;
  --bg-glow-1: #e9ecff;
  --bg-glow-2: #e6f7ef;
  --canvas: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f7;
  --ink: #171b26;
  --text: #2b3142;
  --text-dim: #6f7a92;
  --muted: #6f7a92;
  --line: #e8ebf2;
  --line-strong: #d8dded;

  --accent: #2f5cf6;
  --accent-soft: #eef1ff;
  --accent-line: #d5ddff;
  --accent-ink: #1c3ecb;

  --mint: #d9f2e6;
  --mint-ink: #1f7a52;
  --lav: #e7e4fb;
  --lav-ink: #5b4bb8;
  --peach: #ffe8dc;
  --peach-ink: #b45b2c;

  --ok: #1f7a52;   --ok-bg: #d9f2e6;
  --warn: #a8601c; --warn-bg: #ffe8dc;
  --err: #b23b3b;  --err-bg: #ffe1e1;
  --info: #1c3ecb; --info-bg: #eef1ff;

  --focus: #2f5cf6;
  --r-xl: 22px;
  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --r-pill: 99px;

  --shadow: 0 10px 30px rgba(23, 27, 38, .07);
  --shadow-sm: 0 2px 8px rgba(23, 27, 38, .06);
  --shadow-pop: 0 18px 44px rgba(23, 27, 38, .16);

  --fs: 14px;
  --fs-sm: 12.8px;
  --fs-xs: 11.5px;
  --scale: 1;
  --appbar: 64px;
  --sidebar: 264px;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #10131c;
  --bg-glow-1: rgba(47, 92, 246, .18);
  --bg-glow-2: rgba(31, 122, 82, .15);
  --canvas: #10131c;
  --surface: #171b27;
  --surface-2: #1c2130;
  --surface-3: #232a3a;
  --ink: #f2f5fb;
  --text: #d7dce8;
  --text-dim: #9aa4b8;
  --muted: #9aa4b8;
  --line: #262d3d;
  --line-strong: #333c4f;

  --accent: #6f8dff;
  --accent-soft: #1e2740;
  --accent-line: #2c3a5e;
  --accent-ink: #a9bbff;

  --mint: #17372c; --mint-ink: #79dcb1;
  --lav: #262345;  --lav-ink: #b4a6ff;
  --peach: #3a271c; --peach-ink: #ffb98c;

  --ok: #7fdcb3;   --ok-bg: #17372c;
  --warn: #ffb98c; --warn-bg: #3a271c;
  --err: #ff9a9a;  --err-bg: #3d1f22;
  --info: #a9bbff; --info-bg: #1e2740;
  --focus: #6f8dff;

  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, .5);
}

html[data-font="s"] { --fs: 12.5px; --fs-sm: 11.8px; --fs-xs: 10.8px; --scale: .94; }
html[data-font="m"] { --fs: 14px;   --fs-sm: 12.8px; --fs-xs: 11.5px; --scale: 1; }
html[data-font="l"] { --fs: 16px;   --fs-sm: 14.2px; --fs-xs: 12.5px; --scale: 1.07; }
html[data-family="serif"] body { font-family: Georgia, "Times New Roman", serif; }
html[data-family="mono"] body { font-family: var(--mono); }

/* ---------- основа ---------- */

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  background-image:
    radial-gradient(900px 420px at 92% -10%, var(--bg-glow-1) 0%, transparent 60%),
    radial-gradient(720px 400px at -6% 104%, var(--bg-glow-2) 0%, transparent 65%);
  background-attachment: fixed;
  font: var(--fs)/1.55 var(--sans);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 650; letter-spacing: -.02em; }
p { margin: 0 0 .75em; } p:last-child { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .93em; font-variant-ligatures: none; }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.dim { color: var(--text-dim); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none; }
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

.ico { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.ico-lg { width: 20px; height: 20px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: calc(12.8px * var(--scale)); font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-dim); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line-strong)); background: var(--surface); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err-bg); color: var(--err); }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: calc(11.8px * var(--scale)); border-radius: 10px; }
.btn-icon { min-height: 32px; width: 32px; padding: 0; }
.btn-link { border: 0; background: none; color: var(--text-dim); font: inherit; font-size: var(--fs-sm);
  cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--ink); }

/* ---------- поля ---------- */

.field { margin-bottom: 13px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label, .field label {
  display: block; margin: 0; font-size: var(--fs-xs); font-weight: 650; color: var(--text-dim);
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 13px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm);
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; font-family: var(--mono); font-size: var(--fs-xs); }
select { appearance: none; padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[readonly] { background: var(--surface-2); color: var(--text-dim); }
.hint { margin-top: 5px; font-size: var(--fs-xs); color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-3); }
.seg button { border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-dim);
  min-height: 28px; padding: 0 14px; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg.small button { min-height: 24px; padding: 0 10px; font-size: var(--fs-xs); }

/* ---------- метки ---------- */

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-dim); font-size: var(--fs-xs); font-weight: 650;
  white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.ink { background: var(--ink); color: var(--surface); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.kv { display: flex; gap: 10px; font-size: var(--fs-sm); align-items: baseline; padding: 4px 0; }
.kv .k { color: var(--muted); min-width: 130px; }
.kv > span:last-child { margin-left: auto; text-align: right; }

.note { margin-top: 10px; padding: 10px 13px; border-radius: var(--r); font-size: var(--fs-sm); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.err { background: var(--err-bg); color: var(--err); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.info { background: var(--info-bg); color: var(--info); }
.callout { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px;
  font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- каркас ---------- */

.appbar { position: sticky; top: 0; z-index: 30; height: var(--appbar);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(14px); }
.mark { width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), #7b5cf6); }
.mark svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-name { font-size: calc(14.5px * var(--scale)); font-weight: 650; color: var(--ink); letter-spacing: -.015em; }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 1px; }
.vbar { width: 1px; height: 26px; background: var(--line); }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.who { display: flex; align-items: center; gap: 8px; }
.monogram { width: 32px; height: 32px; border-radius: 50%; background: var(--lav); color: var(--lav-ink);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 18px;
  max-width: 1440px; margin: 0 auto; padding: 18px 24px 40px; align-items: start;
  min-height: calc(100vh - var(--appbar)); }
.sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 14px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--appbar) + 14px);
  display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - var(--appbar) - 28px); overflow: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px;
  color: var(--text); font-size: calc(13.2px * var(--scale)); cursor: pointer; border: 1px solid transparent; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.nav-item.plain { color: var(--text-dim); font-weight: 600; cursor: default; }
.nav-item.plain:hover { background: transparent; color: var(--text-dim); }
.nav-item .count { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
.nav-label { padding: 12px 11px 5px; font-size: 10.5px; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: var(--r); background: var(--surface-2);
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }

.content { min-width: 0; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin: 2px 2px 16px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 7px; align-items: center; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 5px; }
.crumbs .sep { opacity: .5; }
.page-title { font-size: calc(25px * var(--scale)); font-weight: 700; letter-spacing: -.03em; }
.page-sub { margin-top: 4px; font-size: calc(13px * var(--scale)); color: var(--text-dim); }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.page-body.narrow { max-width: 900px; }

/* ---------- карточки ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.card-head h2, .card-head h3 { font-size: calc(14px * var(--scale)); font-weight: 650; }
.card-sub { margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }
.card-head .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 20px; }
.card-body.flush { padding: 0; }
.card-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px;
  border-top: 1px solid var(--line); background: transparent;
  font-size: var(--fs-xs); color: var(--muted); }
.card.accent { border-color: var(--accent-line); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.stat-v { margin-top: 8px; font-size: calc(22px * var(--scale)); font-weight: 650; color: var(--ink);
  letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.stat-hint { margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- таблицы ---------- */

.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
table.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl th.num { text-align: right; }
table.tbl .right, table.tbl th.right { text-align: right; }
table.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
table.tbl.compact td { padding: 9px 16px; }
.cell-title { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
a.cell-title:hover { color: var(--accent); }
.cell-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
table.tbl tr.row-overdue td { background: color-mix(in srgb, var(--err-bg) 55%, transparent); }

/* ---------- сводка, метрики, график ---------- */

.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px;
  padding: 10px 16px; font-size: var(--fs-xs); color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm); }
.summary b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.summary .sep { opacity: .45; padding: 0 4px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
@media (max-width: 1240px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.metric::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: 0; }
.metric.accent::after { opacity: 1; }
.metric.ok::after { opacity: 1; background: var(--ok); }
.metric.warn::after { opacity: 1; background: var(--warn); }
.metric.err::after { opacity: 1; background: var(--err); }
.metric-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.metric-v { margin: 10px 0 3px; font-size: clamp(20px, calc(27px * var(--scale)), 30px); line-height: 1.1;
  letter-spacing: -.03em; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
   font-size: var(--fs-xs); color: var(--muted); }
.metric.accent .metric-v { color: var(--accent-ink); }
.metric.warn .metric-v { color: var(--warn); }
.metric.err .metric-v { color: var(--err); }
.metric.ok .metric-v { color: var(--ok); }

.chart { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: end; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 156px;
  font-size: 10px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart-plot { display: flex; align-items: flex-end; gap: 7px; height: 156px;
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px),
                    linear-gradient(to top, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 100% 50%, 100% 25%; background-position: bottom, bottom; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 100%; min-width: 0; gap: 6px; }
.chart-bar { width: 100%; max-width: 30px; border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, #93a7ff, #e6eaff); transition: filter .12s; }
html[data-theme="dark"] .chart-bar { background: linear-gradient(180deg, #7f9bff, #2a3557); }
.chart-col:hover .chart-bar { filter: brightness(.94); }
.chart-x { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.chart-legend { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }
.chart-empty { display: grid; place-items: center; height: 156px; color: var(--muted);
  font-size: var(--fs-sm); border: 1px dashed var(--line-strong); border-radius: var(--r); }

.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; width: 120px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }

.health-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.health-row:last-of-type { border-bottom: 0; }
.health-note { font-size: var(--fs-xs); color: var(--muted); padding: 2px 0 6px; }

.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--peach); color: var(--peach-ink);
  border: 1px solid color-mix(in srgb, var(--peach-ink) 22%, transparent);
  border-left: 4px solid var(--warn);
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 10px; font-size: var(--fs-sm); cursor: pointer; }
.alert::before { content: "!"; display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: color-mix(in srgb, var(--warn) 22%, transparent);
  font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.alert > span:first-of-type { flex: 1; }
.alert.error { background: var(--err-bg); color: var(--err); font-weight: 600;
  border-color: color-mix(in srgb, var(--err) 22%, transparent); border-left-color: var(--err); }
.alert.error::before { background: var(--err); color: #fff; }
.alert:hover { filter: brightness(.985); text-decoration: none; }
.alert-go { font-size: var(--fs-xs); font-weight: 650; white-space: nowrap; opacity: .9; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.cols > .card { height: 100%; display: flex; flex-direction: column; }
.cols > .card { margin-bottom: 0; }
.cols.wide-left { grid-template-columns: 1.55fr 1fr; }

/* ---------- модалки ---------- */

.overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start;
  justify-content: center; padding: 48px 16px; overflow: auto;
  background: rgba(18, 22, 33, .42); backdrop-filter: blur(3px); }
.overlay.on { display: flex; }
.modal { width: 640px; max-width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-pop); animation: pop .14s ease-out;
  display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.modal-body { overflow: auto; min-height: 0; }
.modal-head { flex: 0 0 auto; }
.modal-foot { flex: 0 0 auto; }
.modal-foot { position: sticky; bottom: 0; background: var(--surface); }
.modal.narrow { width: 460px; }
@keyframes pop { from { transform: translateY(8px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal-head h3 { font-size: calc(16px * var(--scale)); font-weight: 700; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.modal-foot .sp { margin-left: auto; }

/* ---------- загрузка выгрузки ---------- */

.dropzone { display: block; border: 1.5px dashed var(--line-strong); border-radius: var(--r);
  padding: 22px 16px; text-align: center; color: var(--text-dim); font-size: var(--fs-sm);
  cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.tabswitch { display: flex; gap: 6px; margin-bottom: 14px; }
.tabswitch button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-dim);
  font: inherit; font-size: var(--fs-xs); font-weight: 600; padding: 7px 12px;
  border-radius: var(--r-pill); cursor: pointer; }
.tabswitch button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- уведомления ---------- */

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { min-width: 220px; max-width: 380px; padding: 11px 14px; border-radius: var(--r);
  background: var(--ink); color: var(--surface); font-size: var(--fs-sm); box-shadow: var(--shadow-pop); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }

/* ---------- пустые состояния и скелетоны ---------- */

.empty-state { padding: 34px 18px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.empty-state h3 { font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: 4px; }
.empty-state .icon { color: var(--line-strong); margin-bottom: 10px; }
.empty-state .icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.skel { height: 10px; border-radius: 4px; background: var(--surface-3);
  animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

/* ---------- вход ---------- */

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 26px; }
.auth-card { display: grid; grid-template-columns: 1.05fr .95fr; width: min(1040px, 100%);
  margin: 0 auto; background: var(--surface); border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.auth-card .auth-form { max-width: none; }
.auth-card input { min-width: 0; }
.auth-left { padding: 40px 42px; display: flex; flex-direction: column; gap: 30px; }
.auth-right { padding: 40px 42px; display: flex; flex-direction: column; justify-content: center;
  background: var(--surface-2); border-left: 1px solid var(--line); }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand .mark { width: 36px; height: 36px; }
.auth-brand .brand-name { font-size: 15px; }
.auth-lead { margin-top: auto; }
.auth-lead h1 { font-size: calc(28px * var(--scale)); line-height: 1.18; letter-spacing: -.035em; margin-bottom: 10px; }
.auth-lead p { color: var(--text-dim); font-size: var(--fs); max-width: 42ch; }
.auth-facts { margin-top: 24px; display: flex; flex-direction: column; gap: 9px; }
.fact { display: flex; gap: 10px; font-size: var(--fs-sm); color: var(--text); }
.fact .dot { margin-top: 7px; background: var(--accent); border-radius: 50%; }
.fact dt { display: none; }
.fact dd { margin: 0; }
.auth-bottom { margin-top: auto; display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--muted); }
.auth-form { width: 100%; max-width: 340px; }
.auth-form h2 { font-size: calc(19px * var(--scale)); margin-bottom: 4px; }
.auth-form .sub { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 20px; }
.auth-form .btn-primary { width: 100%; min-height: 42px; font-size: var(--fs-sm); margin-top: 6px; }
.auth-legal { margin-top: 16px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }

/* ---------- чат ---------- */

.chat { display: flex; flex-direction: column; flex: 1; min-height: calc(100vh - var(--appbar) - 56px); }
.chat-scroll { flex: 1; overflow: auto; padding: 22px 22px 56px; }
.thread { max-width: 760px; margin: 0 auto; }

.msg { margin: 0 0 16px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: var(--accent-soft); color: var(--ink); padding: 11px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 18px 18px 6px 18px; max-width: 76%; white-space: pre-wrap;
  font-size: calc(13.4px * var(--scale)); line-height: 1.6; }
.msg.bot .who { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.msg.bot .who .name { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 650; }
.msg.bot .who .time { font-size: var(--fs-xs); color: var(--muted); }
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px; padding: 13px 16px; color: var(--text);
  font-size: calc(13.4px * var(--scale)); line-height: 1.62; }
.msg.bot .bubble > *:first-child { margin-top: 0; }
.msg.bot .bubble :is(h1, h2, h3) { font-size: calc(14px * var(--scale)); margin: 16px 0 6px; }
.msg.bot .bubble p, .msg.bot .bubble ul, .msg.bot .bubble ol { margin: .5em 0; }
.msg.bot .bubble ul, .msg.bot .bubble ol { padding-left: 1.45em; }
.msg.bot .bubble li { margin: .22em 0; }
.msg.bot .bubble li::marker { color: var(--muted); }
.msg.bot .bubble pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; overflow: auto; font-size: var(--fs-xs); line-height: 1.55; }
.msg.bot .bubble code { background: var(--accent-soft); color: var(--accent-ink);
  padding: 1px 5px; border-radius: 6px; }
.msg.bot .bubble pre code { background: none; color: inherit; padding: 0; }
.msg.bot .bubble table { border-collapse: collapse; margin: .6em 0; font-size: var(--fs-xs); width: 100%; }
.msg.bot .bubble th, .msg.bot .bubble td { border-bottom: 1px solid var(--line); padding: 7px 9px; }
.msg.bot .bubble thead th { border-bottom-color: var(--line-strong); color: var(--muted);
  font-weight: 650; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
.msg.bot .bubble blockquote { margin: .5em 0; padding: 9px 13px; border-left: 3px solid var(--accent-line);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-dim); background: var(--surface); }
.msg.bot .bubble .mermaid { margin: .8em 0; padding: 8px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.msg.bot .bubble .mermaid svg { max-width: 100%; height: auto; }

.steps { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-dim);
  font-family: var(--mono); font-size: 10.5px; }
.step.run { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }
.step.run:after { content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--accent); border-top-color: transparent; animation: spin .7s linear infinite; }
.step.err { border-color: transparent; background: var(--err-bg); color: var(--err); }
@keyframes spin { to { transform: rotate(360deg); } }

.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 20px 16px; }
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer-box { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); background: var(--surface); padding: 8px 8px 8px 12px;
  transition: border-color .12s, box-shadow .12s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box textarea { border: 0; background: transparent; padding: 5px 0; min-height: 24px;
  max-height: 170px; font-family: inherit; font-size: calc(13.4px * var(--scale)); resize: none; box-shadow: none; }
.composer-box textarea:focus { box-shadow: none; border: 0; }
.composer-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 10.5px; color: var(--muted); }
.composer-meta .sp { margin-left: auto; }
.kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 5px;
  font-family: var(--mono); font-size: 10px; background: var(--surface); }

/* базы и сессии */

.new-session { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  min-height: 34px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 12px;
  background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-xs);
  font-weight: 600; cursor: pointer; margin: 6px 0; }
.new-session:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.base { display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; cursor: pointer;
  border-radius: 12px; border: 2px solid transparent; margin-bottom: 4px; }
.base:hover { background: var(--surface-2); }
.base.active { border-color: var(--accent); background: var(--accent-soft); }
.base .dot { margin-top: 6px; }
.base .t { font-size: var(--fs-sm); color: var(--ink); font-weight: 600; }
.base .m { font-size: var(--fs-xs); color: var(--muted); margin-top: 1px; }

.sessions { display: flex; flex-direction: column; gap: 2px; }
.session { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 11px;
  cursor: pointer; color: var(--text-dim); font-size: var(--fs-sm); }
.session:hover { background: var(--surface-2); color: var(--ink); }
.session.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.session .st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session .stime { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.session .act { display: none; gap: 2px; flex: 0 0 auto; }
.session:hover .act { display: flex; }
.session:hover .stime { display: none; }
.session .ico { width: 13px; height: 13px; opacity: .65; }
.icon-btn { width: 22px; height: 22px; border: 0; background: none; color: var(--muted); border-radius: 7px;
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn.danger:hover { background: var(--err-bg); color: var(--err); }

/* ---------- вкладки админки ---------- */

.tabs { display: flex; gap: 4px; padding: 0 20px; background: transparent; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; border: 0; background: none; cursor: pointer; padding: 11px 10px 12px;
  font: inherit; font-size: var(--fs-sm); color: var(--text-dim); border-radius: 10px 10px 0 0; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button.on { color: var(--ink); font-weight: 650; }
.tabs button.on:after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .sp { margin-left: auto; }
.keybox { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong);
  font-family: var(--mono); font-size: var(--fs-xs); word-break: break-all; }
.keybox .val { flex: 1; }

/* ---------- фиксированный чат ---------- */

.shell.fixed { height: calc(100vh - var(--appbar)); overflow: hidden; }
.shell.fixed .content, .shell.fixed .chat { min-height: 0; height: 100%; overflow: hidden; }
.shell.fixed .chat-scroll { overflow-y: auto; }
.shell.fixed .sidebar { position: static; height: 100%; }
body.chat-page { height: 100vh; overflow: hidden; }

/* ---------- приветствие и подсказки ---------- */

.hello { margin: 2px 0 16px; }
.hello h1 { font-size: calc(27px * var(--scale)); font-weight: 700; letter-spacing: -.035em; }
.hello p { margin: 7px 0 0; font-size: calc(13.5px * var(--scale)); color: var(--text-dim); max-width: 74ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: var(--r-pill); padding: 8px 14px; font: inherit; font-size: var(--fs-sm);
  cursor: pointer; box-shadow: var(--shadow-sm); }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- адаптив ---------- */

@media (max-width: 1120px) {
  .cols, .cols.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-left { padding: 26px 22px; gap: 20px; }
  .auth-right { padding: 26px 22px; border-left: 0; border-top: 1px solid var(--line); }
  .appbar { padding: 0 14px; }
  .shell { padding: 14px; }
  .page-head { margin: 0 0 14px; }
  .row-2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.checks { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }

/* ---------- меню пользователя в шапке ---------- */

.usermenu { position: relative; }
.usermenu-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid transparent; border-radius: var(--r-pill); background: transparent;
  color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.usermenu-btn:hover { background: var(--surface-2); }
.usermenu.open .usermenu-btn { background: var(--surface-2); border-color: var(--line); }
.usermenu-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-caret { color: var(--text-dim); transition: transform .15s; }
.usermenu.open .usermenu-caret { transform: rotate(180deg); }

.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 232px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: 6px; display: none;
}
.usermenu.open .menu-pop { display: block; animation: pop .12s ease-out; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-name { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.menu-mail { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; text-decoration: none;
}
.menu-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.menu-item .ico { width: 16px; height: 16px; color: var(--text-dim); }
.menu-item.danger { color: var(--err); }
.menu-item.danger .ico { color: var(--err); }
.menu-item.danger:hover { background: var(--err-bg); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@media (max-width: 720px) { .usermenu-name { display: none; } }

/* ---------- менеджеры: карточки ---------- */

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.person { display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; }
.person:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.person-off { opacity: .62; }
.person-top { display: flex; gap: 10px; align-items: flex-start; }
.person-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
  background: var(--lav); color: var(--accent); display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
.person-id { flex: 1; min-width: 0; }
.person-name { font-weight: 650; color: var(--ink); }
.person-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.person-contacts { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.person-contact a { color: var(--accent); text-decoration: none; word-break: break-all; }
.person-contact a:hover { text-decoration: underline; }
.person-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.person-count { font-size: var(--fs-xs); color: var(--muted); }
.person-actions { display: flex; gap: 6px; }

.person-form { padding: 0 18px 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); }
.person-form-head { padding-top: 14px; margin-bottom: 10px; }
.person-form-title { font-weight: 650; }
.person-form-actions { display: flex; gap: 8px; margin-top: 12px; }

.empty { text-align: center; padding: 26px 16px; }
.empty-title { font-weight: 650; margin-bottom: 4px; }
.empty-sub { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 12px; }

/* ---------- CRM: канбан и панель сделки ---------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(238px, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { display: flex; flex-direction: column; gap: 8px; min-height: 170px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.board-title { font-size: var(--fs-sm); font-weight: 650; }
.board-sum { font-size: var(--fs-xs); font-weight: 650; color: var(--accent); }
.board-hint { font-size: 11px; color: var(--muted); }
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-empty { padding: 12px 0; text-align: center; font-size: var(--fs-xs); color: var(--muted); }

.deal { padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.deal:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.deal-closed { opacity: .72; }
.deal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.deal-amount { font-weight: 650; color: var(--ink); }
.deal-title { margin: 4px 0 6px; font-size: var(--fs-sm); font-weight: 600; }
.deal-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.deal-overdue { color: var(--err); }
.deal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

.drawer { position: fixed; top: 0; right: 0; z-index: 150; display: flex; flex-direction: column;
  width: 440px; max-width: 92vw; height: 100vh; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15, 23, 42, .12);
  transform: translateX(102%); transition: transform .18s ease; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: var(--fs-md); font-weight: 650; }
.drawer-body { flex: 1; overflow: auto; padding: 0 18px 24px; }
.drawer-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer-section:first-child { margin-top: 0; padding-top: 14px; border-top: 0; }
.drawer-h { margin-bottom: 8px; font-weight: 650; }
.drawer-actions { display: flex; gap: 8px; margin-top: 10px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(15, 23, 42, .35); }

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; }
.feed-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.feed-kind { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.feed-text { margin: 2px 0; font-size: var(--fs-sm); }
.feed-meta { font-size: 11px; color: var(--muted); }
.feed-add { display: flex; gap: 6px; margin-top: 8px; }
.feed-add input, .feed-add select { flex: 1; min-width: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: var(--fs-sm); }
.task-done span { color: var(--muted); text-decoration: line-through; }
.task-due { margin-left: auto; font-size: 11px; color: var(--muted); }
.contact-row { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.contact-row:last-child { border-bottom: 0; }

@media (max-width: 720px) { .drawer { width: 100%; } .board { grid-auto-columns: 86%; } }

/* ---------- чат организации: карточки баз ---------- */
.base { transition: background .12s, border-color .12s; border: 1px solid transparent; }
.base:hover { background: var(--surface-2); border-color: var(--line); }
.base.active { background: var(--lav); border-color: transparent; }
.base.active .t { color: var(--ink); }

/* доска CRM: на широком экране все шесть колонок без прокрутки */
.board { grid-auto-columns: minmax(196px, 1fr); }
@media (min-width: 1320px) { .board { grid-auto-columns: minmax(0, 1fr); } }
.deal-amount, .board-sum { white-space: nowrap; }

/* ---------- поддержка: заявки и живой чат ---------- */

.nav-badge, .pill-dot { display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }

.support-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px;
  height: calc(100vh - 190px); min-height: 460px; }
.support-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.support-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px; border-bottom: 1px solid var(--line); }
.support-threads { flex: 1; overflow: auto; padding: 6px; }
.thread { padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.thread:hover { background: var(--surface-2); }
.thread.active { background: var(--lav); }
.thread-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.thread-org { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: none; }
.thread-subject { font-size: var(--fs-sm); font-weight: 600; margin: 2px 0 3px; }
.thread-last { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }

.support-chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.support-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); }
.support-org { font-size: var(--fs-md); font-weight: 650; }
.support-head-right { display: flex; align-items: center; gap: 8px; }
.link-quiet { margin-left: 8px; font-size: 11px; color: var(--muted); text-decoration: none; }
.link-quiet:hover { color: var(--accent); }
.chip { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 11px; }

.support-chat .msgs, .support-wrap .msgs { flex: 1; overflow: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble { max-width: 78%; padding: 8px 11px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); }
.msg-row.mine .msg-bubble { background: var(--lav); border-color: transparent; }
.msg-author { font-size: 11px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.msg-text { font-size: var(--fs-sm); line-height: 1.45; }
.msg-time { margin-top: 3px; font-size: 10px; color: var(--muted); }

.composer-wrap { border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.composer-hint { margin-top: 6px; font-size: 11px; color: var(--muted); }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }

.support-wrap { display: flex; flex-direction: column; height: calc(100vh - 190px);
  min-height: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; }

@media (max-width: 980px) {
  .support-shell { grid-template-columns: 1fr; height: auto; }
  .support-list { max-height: 240px; }
  .support-chat { height: 60vh; }
}
.session-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.session-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-bottom { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.session-bottom .muted:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* поддержка: сайдбар без горизонтальной прокрутки */
.sidebar { overflow-x: hidden; }
.who-name { font-weight: 650; font-size: var(--fs-sm); }
.sidebar .cell-sub, .sidebar .who, .session-title, .session-bottom .muted {
  overflow-wrap: anywhere; word-break: break-word; }
.session-bottom .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session, .session-top, .session-bottom { min-width: 0; max-width: 100%; }
.session-bottom .muted { min-width: 0; flex: 1 1 auto; }
.session-bottom .muted:last-child { flex: 0 0 auto; white-space: nowrap; }
