/* abusemanager — токены и компоненты (docs/design/DESIGN.md, эталон docs/design/case-mockup.html).
   Bootstrap 5 переопределяется через свои CSS-переменные; тёмная тема — те же токены в [data-theme=dark]. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../vendor/inter/inter-latin-400.da03732a27e1.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../vendor/inter/inter-latin-500.51205681a1ba.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../vendor/inter/inter-latin-600.2ede57db1a3a.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../vendor/inter/inter-latin-700.8ca0a5155296.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../vendor/inter/inter-cyrillic-400.74a70a8b71d0.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../vendor/inter/inter-cyrillic-500.0f5211cce140.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../vendor/inter/inter-cyrillic-600.40727edfba55.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../vendor/inter/inter-cyrillic-700.fc4bfa8e4204.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ---------- токены ---------- */
:root {
  --sidebar: #0c2420; --sidebar-2: #12302a; --sidebar-text: #b9d3cc; --sidebar-muted: #6f948a;
  --accent: #10b981; --accent-600: #059669; --accent-700: #047857; --accent-50: #ecfdf5; --accent-100: #d1fae5;
  --bg: #f4f7f6; --card: #ffffff; --border: #e5ecea; --text: #10201c; --muted: #6b7c77; --soft: #f7faf9;
  --danger: #e11d48; --danger-50: #fff1f2; --warn: #d97706; --warn-50: #fffbeb; --warn-text: #92400e;
  --info: #0284c7; --info-50: #f0f9ff; --neutral-50: #eef2f1;
  --radius: 14px; --radius-sm: 10px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sidebar-w: 232px;

  --bs-body-font-family: var(--font); --bs-body-font-size: 14px; --bs-body-color: var(--text); --bs-body-bg: var(--bg);
  --bs-border-color: var(--border); --bs-link-color: var(--accent-600); --bs-link-hover-color: var(--accent-700);
  --bs-link-color-rgb: 5, 150, 105; --bs-link-hover-color-rgb: 4, 120, 87;
  --bs-primary: var(--accent-600); --bs-primary-rgb: 5, 150, 105; --bs-danger: var(--danger); --bs-danger-rgb: 225, 29, 72;
  --bs-secondary-color: var(--muted); --bs-tertiary-bg: var(--soft); --bs-border-radius: var(--radius-sm);
  --bs-font-monospace: var(--mono); --bs-focus-ring-color: rgba(16, 185, 129, .25);
}
[data-theme="dark"] {
  --sidebar: #07140f; --sidebar-2: #0f2620; --sidebar-text: #a8c7bf; --sidebar-muted: #5f8479;
  --accent-50: #0f2a22; --accent-100: #134034; --accent-700: #34d399;
  --bg: #0b1512; --card: #111e1a; --border: #22332e; --text: #e3eeeb; --muted: #8fa6a0; --soft: #15241f;
  --danger-50: #3a1520; --warn-50: #33260f; --warn-text: #fbbf24; --info-50: #0c2533; --neutral-50: #1c2b27;
  color-scheme: dark;
}

/* ---------- каркас ---------- */
html, body { background: var(--bg); color: var(--text); }
body { font: 14px/1.45 var(--font); margin: 0; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { color: var(--accent-700); }
.mono, code, .font-monospace { font-family: var(--mono) !important; }
code { color: inherit; font-size: 12px; }

.am-shell { display: flex; min-height: 100vh;
  /* фон колонки меню на всю высоту страницы (само меню — sticky на высоту окна) */
  background: linear-gradient(90deg, var(--sidebar) 0 var(--sidebar-w), var(--bg) 0); }
.am-shell[data-sidebar="collapsed"] { background: linear-gradient(90deg, var(--sidebar) 0 68px, var(--bg) 0); }
.am-side {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; transition: width .15s ease;
}
.am-brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 14px; color: #fff; }
.am-logo { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-600)); color: #fff; font-weight: 700; }
.am-brand b { display: block; font-size: 16px; color: #fff; }
.am-brand small { color: var(--sidebar-muted); }
.am-sec { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-muted); padding: 14px 10px 6px; }
.am-nav { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--sidebar-text); font-weight: 600; white-space: nowrap; }
.am-nav i { font-size: 17px; width: 20px; text-align: center; opacity: .85; }
.am-nav:hover { background: var(--sidebar-2); color: #fff; }
.am-nav[aria-current="page"] { background: var(--sidebar-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.am-cnt-off { background: var(--sidebar-muted) !important; }
.am-cnt { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.am-collapse-btn { margin-top: auto; background: none; border: 0; color: var(--sidebar-muted); text-align: left; padding: 9px 10px; border-radius: 10px; font-weight: 600; }
.am-collapse-btn:hover { color: #fff; background: var(--sidebar-2); }
/* свёрнутое меню — только иконки */
.am-shell[data-sidebar="collapsed"] .am-side { width: 68px; }
.am-shell[data-sidebar="collapsed"] .am-label, .am-shell[data-sidebar="collapsed"] .am-sec,
.am-shell[data-sidebar="collapsed"] .am-brand div:last-child, .am-shell[data-sidebar="collapsed"] .am-cnt { display: none; }

.am-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.am-top { display: flex; gap: 12px; align-items: center; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.am-search { flex: 1; min-width: 8.5rem; max-width: 420px; position: relative; }
.am-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.am-search input { width: 100%; min-width: 0; text-overflow: ellipsis; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 8px 34px; color: var(--text); }
.am-search input:focus { outline: 2px solid var(--accent-100); border-color: var(--accent); }
.am-spacer { flex: 1; }
.am-page { padding: 20px 24px 40px; }
.am-menu-btn { display: none; }

.am-seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.am-seg button, .am-seg label { border: 0; background: none; padding: 4px 9px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer; }
.am-seg [aria-pressed="true"], .am-seg input:checked + label { background: var(--accent-600); color: #fff; }
.am-seg input { position: absolute; opacity: 0; pointer-events: none; }
.am-seg.am-seg-light input:checked + label { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.am-seg.am-seg-block { display: flex; width: 100%; }
.am-seg.am-seg-block label { flex: 1; text-align: center; padding: 6px 4px; }

.am-user { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 5px 10px; font-weight: 600; background: var(--card); color: var(--text); }
.am-av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-600); color: #fff; display: grid; place-items: center; font-size: 12px; text-transform: uppercase; }

/* ---------- кнопки ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; padding: 8px 14px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-primary { --bs-btn-bg: var(--accent-600); --bs-btn-border-color: var(--accent-600); --bs-btn-hover-bg: var(--accent-700); --bs-btn-hover-border-color: var(--accent-700); --bs-btn-active-bg: var(--accent-700); --bs-btn-active-border-color: var(--accent-700); --bs-btn-disabled-bg: var(--accent-600); --bs-btn-disabled-border-color: var(--accent-600); box-shadow: 0 6px 16px -6px rgba(5,150,105,.6); }
.btn-success { --bs-btn-bg: var(--accent-600); --bs-btn-border-color: var(--accent-600); --bs-btn-hover-bg: var(--accent-700); --bs-btn-hover-border-color: var(--accent-700); }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #be123c; --bs-btn-hover-border-color: #be123c; }
.btn-outline-secondary, .btn-default, .btn-warning, .btn-outline-danger { --bs-btn-bg: var(--card); --bs-btn-color: var(--text); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--soft); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--border); --bs-btn-active-bg: var(--soft); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--border); }
.btn-warning { --bs-btn-color: var(--warn-text); }
.btn-outline-danger { --bs-btn-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--soft); }
.am-tool { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); display: inline-grid; place-items: center; color: var(--muted); font-size: 15px; }
.am-tool[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- карточки, плитки, значки ---------- */
.am-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.am-card > h2, .am-card > h3, .am-card-h { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.am-card-h .am-r { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--muted); }
.am-decide { border: 1.5px solid var(--accent); background: linear-gradient(180deg, var(--accent-50), var(--card) 60%); }
.am-placeholder { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 14px; color: var(--muted); font-size: 13px; background: var(--soft); }

.am-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.am-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.am-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--card); }
.am-tile small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.am-tile b { font-size: 15px; display: block; }
.am-tile span { color: var(--muted); font-size: 12px; }
.am-tile[data-tone="accent"] small { color: var(--accent-600); }
.am-tile[data-tone="warn"] small { color: var(--warn); }
.am-tile[data-tone="danger"] small { color: var(--danger); }

.am-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--neutral-50); color: var(--muted); }
.am-pill[data-tone="accent"] { background: var(--accent-100); color: var(--accent-700); }
.am-pill[data-tone="warn"] { background: var(--warn-50); color: var(--warn); }
.am-pill[data-tone="danger"] { background: var(--danger-50); color: var(--danger); }
.am-pill[data-tone="info"] { background: var(--info-50); color: var(--info); }
.am-pill[data-tone="dark"] { background: var(--text); color: var(--card); }

.am-hint { background: var(--warn-50); color: var(--warn-text); border-radius: 10px; padding: 9px 11px; font-size: 13px; margin-bottom: 10px; }
.am-hint[data-tone="info"] { background: var(--info-50); color: var(--info); }
.am-step { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.am-legend { font-size: 12px; color: var(--muted); margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }

.am-actions { display: flex; flex-direction: column; gap: 8px; }
.am-actions > form, .am-actions > .btn { width: 100%; }
.am-actions .btn { width: 100%; text-align: left; padding: 10px 14px; }
.am-action-form { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); padding: 12px; margin: 2px 0 6px; }
.am-action-form h4 { font-size: 13px; font-weight: 700; margin: 0 0 8px; }

.am-kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 10px; font-size: 13px; align-items: center; }
.am-kv > label, .am-kv > dt { color: var(--muted); margin: 0; font-weight: 400; }
.am-kv > dd { margin: 0; font-weight: 600; }
.am-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.am-check { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--neutral-50); color: var(--muted); cursor: pointer; margin: 0; }
.am-check:has(input:checked) { background: var(--accent-100); color: var(--accent-700); }
.am-check[data-kind="hold"]:has(input:checked) { background: var(--danger-50); color: var(--danger); }
.am-check input { accent-color: var(--accent-600); margin: 0; }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); background-color: var(--card); color: var(--text); font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-100); }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-text { color: var(--muted); font-size: 12px; }
.form-check-input:checked { background-color: var(--accent-600); border-color: var(--accent-600); }

/* ---------- заметки и журнал ---------- */
.am-feed { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 2px; }
.am-note { border-radius: 12px; padding: 9px 11px; font-size: 13px; }
.am-note small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.am-note[data-kind="system"] { background: var(--soft); }
.am-note[data-kind="mine"] { background: var(--accent-50); margin-left: 24px; }
.am-note[data-kind="other"] { background: var(--card); border: 1px solid var(--border); margin-right: 24px; }
.am-note[data-off-policy] { box-shadow: inset 3px 0 0 var(--warn); }
.am-note .am-row { display: flex; gap: 6px; }
.am-note .am-row span:first-child { color: var(--muted); flex-shrink: 0; }

/* ---------- таблицы ---------- */
.am-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.am-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; background: var(--soft); border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 600; }
.am-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.am-table tbody tr[data-href] { cursor: pointer; }
.am-table tbody tr[data-href]:hover td { background: var(--accent-50); }
.am-table tr:last-child td { border-bottom: 0; }
.am-table td.mono { white-space: nowrap; }
.am-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.am-sub { color: var(--muted); font-size: 12px; }
.am-danger-link { color: var(--danger); word-break: break-all; }

/* ---------- обзор ---------- */
.am-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.am-stat { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); }
.am-stat:hover { border-color: var(--accent); color: var(--text); }
.am-stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--accent-100); color: var(--accent-700); flex-shrink: 0; }
.am-stat[data-tone="info"] .am-stat-ico { background: var(--info-50); color: var(--info); }
.am-stat[data-tone="warn"] .am-stat-ico { background: var(--warn-50); color: var(--warn); }
.am-stat[data-tone="danger"] .am-stat-ico { background: var(--danger-50); color: var(--danger); }
.am-stat[data-tone="neutral"] .am-stat-ico { background: var(--neutral-50); color: var(--muted); }
.am-stat b { font-size: 24px; line-height: 1.1; display: block; }
.am-stat span { color: var(--muted); font-size: 13px; }
.am-bar { height: 8px; border-radius: 99px; background: var(--neutral-50); overflow: hidden; }
.am-bar > div { height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- карточка кейса ---------- */
.am-crumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.am-chead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.am-chead h1 { margin: 0; font: 700 24px/1.2 var(--mono); word-break: break-all; }
.am-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.am-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.am-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.am-ident { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.am-shield { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-600)); }
.am-ident .am-nm { font: 700 18px var(--mono); word-break: break-all; }
.am-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.am-intel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.am-box { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.am-box .am-hd { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-weight: 700; background: var(--accent-50); }
.am-box .am-bd { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.am-shot { height: 130px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-weight: 600;
  background: repeating-linear-gradient(45deg, var(--neutral-50), var(--neutral-50) 10px, var(--soft) 10px, var(--soft) 20px); }
.am-shot-frame { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); max-height: 520px; overflow-y: auto; }
.am-shot-img { display: block; width: 100%; height: auto; filter: blur(18px) saturate(.6); transition: filter .15s; }
[data-shot].am-shot-revealed .am-shot-img { filter: none; }
.am-tl { position: relative; height: 74px; border-top: 2px solid var(--border); margin: 30px 10px 10px; }
.am-pt { position: absolute; top: -8px; transform: translateX(-50%); text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.am-pt i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin: 0 auto 6px; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--accent); }
.am-pt[data-tone="danger"] i { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.am-pt[data-tone="warn"] i { background: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
details.am-card > summary { cursor: pointer; list-style: none; }
details.am-card > summary::-webkit-details-marker { display: none; }

/* ---------- фильтры списка ---------- */
.am-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.am-filters .form-control, .am-filters .form-select { width: auto; min-width: 150px; }
.am-filters .am-grow { flex: 1; min-width: 220px; }
.am-filters details { width: 100%; }
.am-filters details > summary { cursor: pointer; color: var(--accent-600); font-weight: 600; font-size: 13px; }
.am-filters details[open] > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- вход ---------- */
.am-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.am-auth .am-card { width: 100%; max-width: 420px; padding: 28px; }
.am-auth-top { position: fixed; top: 12px; right: 16px; }
.qr-box svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 10px; }
.secret-code { font-family: var(--mono); letter-spacing: .08em; word-break: break-all; }

.alert { border-radius: var(--radius-sm); }
.dropdown-menu { border-color: var(--border); border-radius: var(--radius-sm); background: var(--card); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--soft); color: var(--text); }
.pagination { --bs-pagination-color: var(--accent-600); --bs-pagination-active-bg: var(--accent-600); --bs-pagination-active-border-color: var(--accent-600); --bs-pagination-bg: var(--card); --bs-pagination-border-color: var(--border); }

/* ---------- адаптивность ---------- */
@media (max-width: 1100px) {
  .am-grid { grid-template-columns: 1fr; }
  .am-tiles-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .am-shell, .am-shell[data-sidebar="collapsed"] { background: var(--bg); }
  .am-side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; width: 260px !important; }
  .am-shell[data-menu="open"] .am-side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .am-shell[data-sidebar="collapsed"] .am-label, .am-shell[data-sidebar="collapsed"] .am-sec { display: initial; }
  .am-menu-btn { display: inline-grid; }
  .am-collapse-btn { display: none; }
  .am-top { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .am-search { order: 10; max-width: none; flex-basis: 100%; }
  .am-page { padding: 14px; }
  .am-intel { grid-template-columns: 1fr; }
  .am-hide-sm { display: none !important; }
  .am-kv { grid-template-columns: 110px 1fr; }
}

/* ---------- вспомогательные (inline style запрещён CSP) ---------- */
.am-auth-brand, .am-auth-brand b { color: var(--text); padding-left: 0; }
.am-error-card { max-width: 480px; margin: 40px auto; text-align: center; }
.am-left-0{left:0%}.am-left-1{left:1%}.am-left-2{left:2%}.am-left-3{left:3%}.am-left-4{left:4%}.am-left-5{left:5%}.am-left-6{left:6%}.am-left-7{left:7%}.am-left-8{left:8%}.am-left-9{left:9%}.am-left-10{left:10%}.am-left-11{left:11%}.am-left-12{left:12%}.am-left-13{left:13%}.am-left-14{left:14%}.am-left-15{left:15%}.am-left-16{left:16%}.am-left-17{left:17%}.am-left-18{left:18%}.am-left-19{left:19%}.am-left-20{left:20%}.am-left-21{left:21%}.am-left-22{left:22%}.am-left-23{left:23%}.am-left-24{left:24%}.am-left-25{left:25%}.am-left-26{left:26%}.am-left-27{left:27%}.am-left-28{left:28%}.am-left-29{left:29%}.am-left-30{left:30%}.am-left-31{left:31%}.am-left-32{left:32%}.am-left-33{left:33%}.am-left-34{left:34%}.am-left-35{left:35%}.am-left-36{left:36%}.am-left-37{left:37%}.am-left-38{left:38%}.am-left-39{left:39%}.am-left-40{left:40%}.am-left-41{left:41%}.am-left-42{left:42%}.am-left-43{left:43%}.am-left-44{left:44%}.am-left-45{left:45%}.am-left-46{left:46%}.am-left-47{left:47%}.am-left-48{left:48%}.am-left-49{left:49%}.am-left-50{left:50%}.am-left-51{left:51%}.am-left-52{left:52%}.am-left-53{left:53%}.am-left-54{left:54%}.am-left-55{left:55%}.am-left-56{left:56%}.am-left-57{left:57%}.am-left-58{left:58%}.am-left-59{left:59%}.am-left-60{left:60%}.am-left-61{left:61%}.am-left-62{left:62%}.am-left-63{left:63%}.am-left-64{left:64%}.am-left-65{left:65%}.am-left-66{left:66%}.am-left-67{left:67%}.am-left-68{left:68%}.am-left-69{left:69%}.am-left-70{left:70%}.am-left-71{left:71%}.am-left-72{left:72%}.am-left-73{left:73%}.am-left-74{left:74%}.am-left-75{left:75%}.am-left-76{left:76%}.am-left-77{left:77%}.am-left-78{left:78%}.am-left-79{left:79%}.am-left-80{left:80%}.am-left-81{left:81%}.am-left-82{left:82%}.am-left-83{left:83%}.am-left-84{left:84%}.am-left-85{left:85%}.am-left-86{left:86%}.am-left-87{left:87%}.am-left-88{left:88%}.am-left-89{left:89%}.am-left-90{left:90%}.am-left-91{left:91%}.am-left-92{left:92%}.am-left-93{left:93%}.am-left-94{left:94%}.am-left-95{left:95%}.am-left-96{left:96%}.am-left-97{left:97%}.am-left-98{left:98%}.am-left-99{left:99%}.am-left-100{left:100%}
.am-w-0{width:0%}.am-w-1{width:1%}.am-w-2{width:2%}.am-w-3{width:3%}.am-w-4{width:4%}.am-w-5{width:5%}.am-w-6{width:6%}.am-w-7{width:7%}.am-w-8{width:8%}.am-w-9{width:9%}.am-w-10{width:10%}.am-w-11{width:11%}.am-w-12{width:12%}.am-w-13{width:13%}.am-w-14{width:14%}.am-w-15{width:15%}.am-w-16{width:16%}.am-w-17{width:17%}.am-w-18{width:18%}.am-w-19{width:19%}.am-w-20{width:20%}.am-w-21{width:21%}.am-w-22{width:22%}.am-w-23{width:23%}.am-w-24{width:24%}.am-w-25{width:25%}.am-w-26{width:26%}.am-w-27{width:27%}.am-w-28{width:28%}.am-w-29{width:29%}.am-w-30{width:30%}.am-w-31{width:31%}.am-w-32{width:32%}.am-w-33{width:33%}.am-w-34{width:34%}.am-w-35{width:35%}.am-w-36{width:36%}.am-w-37{width:37%}.am-w-38{width:38%}.am-w-39{width:39%}.am-w-40{width:40%}.am-w-41{width:41%}.am-w-42{width:42%}.am-w-43{width:43%}.am-w-44{width:44%}.am-w-45{width:45%}.am-w-46{width:46%}.am-w-47{width:47%}.am-w-48{width:48%}.am-w-49{width:49%}.am-w-50{width:50%}.am-w-51{width:51%}.am-w-52{width:52%}.am-w-53{width:53%}.am-w-54{width:54%}.am-w-55{width:55%}.am-w-56{width:56%}.am-w-57{width:57%}.am-w-58{width:58%}.am-w-59{width:59%}.am-w-60{width:60%}.am-w-61{width:61%}.am-w-62{width:62%}.am-w-63{width:63%}.am-w-64{width:64%}.am-w-65{width:65%}.am-w-66{width:66%}.am-w-67{width:67%}.am-w-68{width:68%}.am-w-69{width:69%}.am-w-70{width:70%}.am-w-71{width:71%}.am-w-72{width:72%}.am-w-73{width:73%}.am-w-74{width:74%}.am-w-75{width:75%}.am-w-76{width:76%}.am-w-77{width:77%}.am-w-78{width:78%}.am-w-79{width:79%}.am-w-80{width:80%}.am-w-81{width:81%}.am-w-82{width:82%}.am-w-83{width:83%}.am-w-84{width:84%}.am-w-85{width:85%}.am-w-86{width:86%}.am-w-87{width:87%}.am-w-88{width:88%}.am-w-89{width:89%}.am-w-90{width:90%}.am-w-91{width:91%}.am-w-92{width:92%}.am-w-93{width:93%}.am-w-94{width:94%}.am-w-95{width:95%}.am-w-96{width:96%}.am-w-97{width:97%}.am-w-98{width:98%}.am-w-99{width:99%}.am-w-100{width:100%}

pre.am-placeholder { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

/* Узкие окна (~800–1000 px): «+ Новый кейс» и меню пользователя — только иконки, без переноса строки. */
@media (max-width: 1000px) {
  .am-hide-md { display: none !important; }
  .am-top { flex-wrap: nowrap; }
  .am-spacer { display: none; }
  .am-search { max-width: none; }
}

.am-grid-settings { grid-template-columns: minmax(320px, 1fr) minmax(320px, 520px); }
.am-table tr[aria-current="true"] td { background: var(--accent-50); }

/* ---------- справочники (UI-GAPS A.2) ---------- */
.am-info { border: 0; background: none; color: var(--muted); padding: 0 2px; line-height: 1; cursor: help; }
.am-info:hover { color: var(--accent-600); }
.am-pill-btn { border: 0; cursor: pointer; }
.am-pill-btn:hover { filter: brightness(.95); }
.am-ref-item { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; border: 1px solid transparent; }
.am-ref-item.am-ref-hit { border-color: var(--accent); background: var(--accent-50); }
.modal-content { background: var(--card); color: var(--text); border-color: var(--border); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--border); }
.am-tool-wide { width: auto; padding: 0 8px; gap: 4px; display: inline-flex; align-items: center; }
.am-hint[data-hint="danger"] { background: var(--danger-50); color: var(--danger); }
.nav-tabs { --bs-nav-tabs-border-color: var(--border); --bs-nav-link-color: var(--muted); --bs-nav-link-hover-color: var(--text); --bs-nav-tabs-link-active-color: var(--text); --bs-nav-tabs-link-active-bg: var(--card); }
.am-views-menu { min-width: 280px; }
.am-table th a { color: inherit; }

/* Контекстное меню строки списка (этап 7) */
.am-ctx { display: block; position: absolute; z-index: 1060; min-width: 240px; }
.am-ctx[hidden] { display: none !important; }
.am-ctx-col { width: 34px; padding-left: 2px !important; padding-right: 2px !important; }
.am-ctx form { margin: 0; }

/* Лента писем: направление ↗ отправлено / ↙ получено */
.am-dir { display: inline-block; width: 1.2em; font-weight: 700; text-align: center; }
.am-dir[data-dir="out"] { color: var(--accent); }
.am-dir[data-dir="in"] { color: var(--muted); }

/* Очередь инспектора (фаза 7) */
.am-queue-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 12px;
  border: 1px solid var(--accent-100); border-radius: var(--radius-sm); background: var(--accent-50); }
.am-queue-bar .am-spacer { flex: 1; }
.am-kbd { font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.am-danger-flash { outline: 2px solid var(--danger, #dc3545); }

/* Публичная часть (фаза 11): поле-ловушка для ботов — вне экрана */
.am-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.am-public-main { max-width: 760px; }
/* Отчёты (фаза 12): графики SVG без inline-стилей */
.am-daychart { width: 100%; min-width: 320px; height: 90px; display: block; }
.am-bar-created { fill: var(--accent); }
.am-bar-closed { fill: var(--success, #2e9d5b); }
.am-hbar { width: 100%; height: 10px; display: block; }
.am-hbar rect { fill: var(--accent); }
.am-legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.am-legend-created { background: var(--accent); }
.am-legend-closed { background: var(--success, #2e9d5b); }
