/* А:СТАРТ CRM — стили. Цвета и размеры — токены в :root, тёмная тема переопределяет только их. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --surface-3: #e7ecf4;
  --border: #e1e6ef;
  --border-strong: #cdd5e1;
  --text: #0f1b33;
  --text-2: #4a5873;
  --muted: #7d8aa3;
  --primary: #1e40af;
  --primary-hover: #1a3796;
  --primary-soft: #e8eefc;
  --primary-text: #1e3a8a;
  --on-primary: #ffffff;
  --accent: #b45309;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --success: #15803d;
  --warn-soft: #fff4e0;
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, .06);
  --shadow: 0 4px 16px rgba(15, 27, 51, .08), 0 1px 3px rgba(15, 27, 51, .06);
  --shadow-lg: 0 24px 64px rgba(15, 27, 51, .18), 0 4px 12px rgba(15, 27, 51, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 240px;
  --font: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* тона для меток */
  --t-gray-bg: #eef1f6; --t-gray-fg: #4a5873;
  --t-muted-bg: #f1f2f5; --t-muted-fg: #8a93a6;
  --t-blue-bg: #e6eeff; --t-blue-fg: #1e40af;
  --t-green-bg: #e3f5e9; --t-green-fg: #166534;
  --t-amber-bg: #fff1d6; --t-amber-fg: #92400e;
  --t-red-bg: #fde8e8; --t-red-fg: #b91c1c;
  --t-teal-bg: #dff5f3; --t-teal-fg: #0f6b63;
  --t-violet-bg: #efe8ff; --t-violet-fg: #5b21b6;
  --t-orange-bg: #ffecdf; --t-orange-fg: #b4460f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1322;
    --surface: #141c2f;
    --surface-2: #1a2338;
    --surface-3: #222d46;
    --border: #253049;
    --border-strong: #33405e;
    --text: #e6ebf5;
    --text-2: #b1bbd0;
    --muted: #7f8aa5;
    --primary: #5b82f0;
    --primary-hover: #7094f5;
    --primary-soft: #1d2a4d;
    --primary-text: #a9bff8;
    --accent: #f0a445;
    --danger: #f07171;
    --danger-soft: #3a1d24;
    --success: #4ccf7c;
    --warn-soft: #3a2c14;
    --shadow: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
    --t-gray-bg: #232d44; --t-gray-fg: #b8c2d6;
    --t-muted-bg: #1e263a; --t-muted-fg: #7f8aa5;
    --t-blue-bg: #1d2c55; --t-blue-fg: #9db8ff;
    --t-green-bg: #163726; --t-green-fg: #7fe0a3;
    --t-amber-bg: #3b2d12; --t-amber-fg: #f5c46b;
    --t-red-bg: #401c22; --t-red-fg: #ff9a9a;
    --t-teal-bg: #133734; --t-teal-fg: #6fe0d4;
    --t-violet-bg: #2c2150; --t-violet-fg: #c4b1ff;
    --t-orange-bg: #3d2415; --t-orange-fg: #ffb07a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-lg { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sep { height: 1px; background: var(--border); margin: 8px 0; }

/* ── Каркас ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 15px; letter-spacing: -.5px;
}
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.1; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer;
  padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-align: left; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 500; }
.nav-item .count {
  margin-left: auto; font-size: 12px; min-width: 22px; text-align: center; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-weight: 500;
}
.nav-item.active .count { background: var(--surface); color: var(--primary-text); }
.nav-item .count.warn { background: var(--t-amber-bg); color: var(--t-amber-fg); }
.nav-sub { padding-left: 8px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 34px; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font: 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.page { padding: 20px 24px 120px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.page-desc { color: var(--text-2); margin: 2px 0 0; }

/* ── Кнопки и поля ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }

.input, select.input, textarea.input {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; }

/* ── Метки ──────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; border: 0; background: var(--t-gray-bg); color: var(--t-gray-fg);
}
button.chip { cursor: pointer; }
button.chip:hover { filter: brightness(.96); }
.chip .i { width: 12px; height: 12px; }
.chip { max-width: 100%; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btn.grow { min-width: 0; }
.tone-gray { background: var(--t-gray-bg); color: var(--t-gray-fg); }
.tone-muted { background: var(--t-muted-bg); color: var(--t-muted-fg); }
.tone-blue { background: var(--t-blue-bg); color: var(--t-blue-fg); }
.tone-green { background: var(--t-green-bg); color: var(--t-green-fg); }
.tone-amber { background: var(--t-amber-bg); color: var(--t-amber-fg); }
.tone-red { background: var(--t-red-bg); color: var(--t-red-fg); }
.tone-teal { background: var(--t-teal-bg); color: var(--t-teal-fg); }
.tone-violet { background: var(--t-violet-bg); color: var(--t-violet-fg); }
.tone-orange { background: var(--t-orange-bg); color: var(--t-orange-fg); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: currentColor; }

/* ── Сводка (KPI) ───────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -.3px; margin-top: 2px; }
.kpi-sub { font-size: 12px; color: var(--muted); }

/* ── Панель фильтров ────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px dashed var(--border-strong); background: transparent; cursor: pointer; color: var(--text-2); font-size: 13px;
}
.filter-btn:hover { background: var(--surface); }
.filter-btn.on { border-style: solid; border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.filter-btn .x { margin-left: 2px; opacity: .7; }

/* ── Таблица ────────────────────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 500; font-size: 12.5px;
  color: var(--text-2); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.t th.sortable { cursor: pointer; }
.t th.sortable:hover { color: var(--text); }
.t td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { cursor: pointer; transition: background .12s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tbody tr.sel { background: var(--primary-soft); }
.t tbody tr.open { box-shadow: inset 3px 0 0 var(--primary); }
.t .c-check { width: 36px; padding-right: 0; }
.t .name { font-weight: 500; }
.t .sub { color: var(--muted); font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .proj { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .num { text-align: right; white-space: nowrap; }
.issue-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12.5px; font-weight: 500; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 32px; height: 32px; margin-bottom: 8px; stroke-width: 1.5; }

/* ── Панель массовых действий ───────────────────────────────────────────── */
.bulkbar {
  position: fixed; left: calc(var(--sidebar) + (100vw - var(--sidebar)) / 2); bottom: 20px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border-radius: 14px;
  background: #0f1b33; color: #fff; box-shadow: var(--shadow-lg); max-width: calc(100vw - var(--sidebar) - 32px); flex-wrap: wrap;
}
.bulkbar .count { font-weight: 600; margin-right: 8px; white-space: nowrap; }
.bulkbar .btn { background: transparent; border-color: transparent; color: #e6ebf5; height: 32px; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .1); }
.bulkbar .btn.primary { background: var(--primary); color: #fff; }
.bulkbar .btn.primary:hover { background: var(--primary-hover); }
.bulkbar .divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .15); margin: 0 4px; }

/* ── Всплывающее меню ───────────────────────────────────────────────────── */
.pop {
  position: fixed; z-index: 90; min-width: 200px; max-width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px;
}
.pop-search { padding: 4px 4px 6px; }
.pop-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; background: none; border-radius: 6px;
  cursor: pointer; text-align: left; color: var(--text);
}
.pop-item:hover, .pop-item.hl { background: var(--surface-2); }
.pop-item .check { margin-left: auto; color: var(--primary); }
.pop-title { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 9px 3px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Боковая карточка ───────────────────────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 27, 51, .18); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(640px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border-left: 1px solid var(--border);
}
.drawer-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.2px; }
.drawer-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.contacts a { color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.contacts a:hover { color: var(--primary); }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.issues { border-radius: var(--radius); background: var(--warn-soft); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 8px; font-size: 13px; }
.issue .i { color: var(--accent); margin-top: 1px; }
.issue.info .i { color: var(--muted); }
.issue b { font-weight: 600; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .i { transition: transform .2s; }
details.fold[open] > summary .i { transform: rotate(90deg); }
.timeline { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tl-item { display: flex; gap: 10px; }
.tl-item .when { color: var(--muted); white-space: nowrap; min-width: 92px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.msg pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; color: var(--text-2); font-size: 13px; }

/* ── Проекты ────────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.tab { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.members { display: flex; flex-direction: column; gap: 4px; }
.member { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.member .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .i { width: 13px; height: 13px; color: var(--accent); }
.card-foot { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 8px; margin-top: auto; }
.callout { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-text); margin-bottom: 12px; }
.callout.warn { background: var(--warn-soft); color: var(--t-amber-fg); }

/* ── Модальные окна ─────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 27, 51, .35); display: grid; place-items: center; padding: 20px; }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(1040px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.narrow { width: min(460px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.vars { display: flex; flex-wrap: wrap; gap: 4px; }
.var { font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; color: var(--text-2); }
.var:hover { border-color: var(--primary); color: var(--primary-text); }
.recips { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 180px; overflow-y: auto; }
.recip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.recip:last-child { border-bottom: 0; }
.recip:hover { background: var(--surface-2); }
.recip.cur { background: var(--primary-soft); }
.recip.skip { color: var(--muted); }
.preview { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; }
.preview .subj { font-weight: 600; margin-bottom: 8px; }
.preview pre { white-space: pre-wrap; font: inherit; margin: 0; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; width: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); }

/* ── Письма и настройки ─────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.list-item:hover { background: var(--surface-2); }
.list-item.active { background: var(--primary-soft); color: var(--primary-text); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; word-break: break-all; }
.steps { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ── Вход ───────────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .panel { width: min(380px, 100%); padding: 28px; box-shadow: var(--shadow); }

/* ── Уведомления ────────────────────────────────────────────────────────── */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: #0f1b33; color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 420px;
}
.toast.error { background: var(--danger); }
.toast .i { flex: none; }

/* ── Адаптив ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .t .hide-md { display: none; }
  .compose { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .brand { padding: 4px 8px; }
  .nav-title, .sidebar-foot, .nav-sub { display: none; }
  .nav-item { width: auto; }
  .page { padding: 14px 14px 120px; }
  .topbar { padding: 10px 14px; }
  .t .hide-sm { display: none; }
  .split, .grid-2, .kv { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .bulkbar { left: 50%; max-width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
