/* ==========================================================
   АИС «Комнатки» — стили работающего макета
   ========================================================== */
:root {
  --ink: #14213d;
  --ink-2: #1f2f52;
  --ink-3: #2c3e66;
  --gold: #d4a94a;
  --gold-soft: #f6ecd4;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e6e2da;
  --text: #1c2333;
  --muted: #6b7385;
  --ok: #1f8a62;
  --ok-soft: #e1f3eb;
  --warn: #b7791f;
  --warn-soft: #fbf0dc;
  --bad: #c0392b;
  --bad-soft: #fbe5e2;
  --info: #2f6fb3;
  --info-soft: #e3eefa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 8px 24px rgba(20, 33, 61, .06);
  --shadow-lg: 0 24px 60px rgba(20, 33, 61, .25);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: #d6d0c4; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible { outline: 3px solid rgba(212, 169, 74, .45); outline-offset: 1px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #c99c3c; border-color: #c99c3c; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #a83224; border-color: #a83224; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(20, 33, 61, .06); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; height: 34px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .01em; }
.field > label .req { color: var(--bad); margin-left: 2px; }
.input, select.input, textarea.input {
  height: 40px; padding: 0 12px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 169, 74, .2); outline: none; }
.input.invalid { border-color: var(--bad); background: #fffafa; }
.field .err { font-size: 12px; color: var(--bad); min-height: 0; }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; }

/* ---------- Экран входа ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at -10% 110%, rgba(212, 169, 74, .25), transparent 60%),
    radial-gradient(700px 400px at 110% -10%, rgba(80, 120, 200, .25), transparent 60%),
    linear-gradient(160deg, #14213d 0%, #0e1830 100%);
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--gold); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 24px; height: 24px; color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 24px; letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; opacity: .7; letter-spacing: .12em; text-transform: uppercase; }
.login-hero h1 { font-family: var(--serif); font-size: 44px; font-weight: 700; max-width: 520px; margin: 18px 0 14px; line-height: 1.12; }
.login-hero h1 em { color: var(--gold); font-style: normal; }
.login-hero p.lead { max-width: 480px; font-size: 16px; opacity: .8; margin: 0; }
.hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin-top: 34px; position: relative; z-index: 1; }
.hero-feature { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.hero-feature svg { width: 18px; height: 18px; color: var(--gold); flex: none; margin-top: 2px; }
.hero-foot { font-size: 12px; opacity: .55; position: relative; z-index: 1; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 26px; font-weight: 800; color: var(--ink); }
.login-card .sub { color: var(--muted); margin: 6px 0 26px; }
#login-alert .alert { margin-bottom: 16px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.pwd-note { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.pwd-note svg { width: 14px; height: 14px; }
.demo-box { margin-top: 26px; border: 1px dashed #d6cfbf; border-radius: 12px; padding: 14px; background: var(--surface-2); }
.demo-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.demo-list { display: grid; gap: 6px; }
.demo-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; }
.demo-item:hover { border-color: var(--gold); }
.demo-item b { font-size: 13px; }
.demo-item .mono { color: var(--muted); }
.login-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; }

/* ---------- Плашки (alerts) ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-size: 13.5px; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert b { display: block; }
.alert-bad { background: var(--bad-soft); color: #8e2a1f; border-color: #f2c7c0; }
.alert-warn { background: var(--warn-soft); color: #7b5313; border-color: #f0dbb2; }
.alert-ok { background: var(--ok-soft); color: #156447; border-color: #bfe5d3; }
.alert-info { background: var(--info-soft); color: #234f80; border-color: #c4daf2; }

/* ---------- Каркас приложения ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #14213d 0%, #101b33 100%);
  color: #cdd5e6; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
}
.sidebar .brand { padding: 4px 8px 6px; color: #fff; }
.sidebar .brand-name { font-size: 21px; }
.role-chip { margin: 0 6px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.role-chip .who { color: #fff; font-weight: 700; font-size: 13.5px; }
.role-chip .role svg { width: 12px; height: 12px; flex: none; }
.role-chip .role { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink); background: var(--gold); padding: 2px 8px; border-radius: 99px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #7d8aa8; padding: 0 12px; margin: 6px 0 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cdd5e6; font-weight: 600; font-size: 13.5px; }
.nav-link svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(212,169,74,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.active svg { color: var(--gold); opacity: 1; }
.nav-link .count { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; padding: 0 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; font-size: 11.5px; color: #7d8aa8; padding: 0 10px; }

.main { min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(244, 242, 238, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; font-weight: 800; color: var(--ink); }
.topbar .crumbs { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }
.session-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.session-pill svg { width: 15px; height: 15px; color: var(--muted); }
.session-pill.low { background: var(--warn-soft); border-color: #f0dbb2; color: #7b5313; }
.secure-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); font-weight: 700; }
.secure-pill svg { width: 15px; height: 15px; }
.content { padding: 26px 28px 60px; position: relative; flex: 1; }

/* Водяной знак сеанса (сдерживание утечек через снимки экрана) */
.watermark {
  position: fixed; inset: 0; left: 264px; pointer-events: none; z-index: 1; overflow: hidden; opacity: .045;
}
.watermark span { position: absolute; transform: rotate(-24deg); font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap; }
.content > *, .topbar { position: relative; z-index: 2; }

/* ---------- Карточки, сетки ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
.section-gap { margin-top: 18px; }

.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: #8a6a22; }
.kpi .ico svg { width: 18px; height: 18px; }
.kpi .ico.blue { background: var(--info-soft); color: var(--info); }
.kpi .ico.green { background: var(--ok-soft); color: var(--ok); }
.kpi .ico.red { background: var(--bad-soft); color: var(--bad); }
.kpi .value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.kpi .delta { font-size: 12px; color: var(--muted); }

.welcome { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, #14213d, #2c3e66); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; position: relative; }
.welcome::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(212,169,74,.35), transparent 70%); }
.welcome h2 { font-family: var(--serif); font-size: 26px; }
.welcome p { margin: 4px 0 0; opacity: .8; }

/* Полоски загрузки */
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 54px; gap: 12px; align-items: center; padding: 8px 0; }
.bar-row .name { font-weight: 600; font-size: 13.5px; }
.bar { height: 10px; border-radius: 99px; background: #efebe3; overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.bar .occ { background: var(--ink); }
.bar .res { background: var(--gold); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Тулбар списков ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1 1 260px; min-width: 200px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.toolbar .search .input { padding-left: 36px; }
.toolbar select.input { width: auto; min-width: 150px; }
.toolbar .spacer { flex: 1; }
.toolbar .count { font-size: 12.5px; color: var(--muted); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid #f0ede7; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf8; }
.table tr.clickable { cursor: pointer; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eeeae2; color: #545b6b; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-ink { background: #e4e8f1; color: var(--ink-3); }
.stars { color: var(--gold); letter-spacing: 1px; }

/* ---------- Карточка гостя ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 22px; }
.avatar { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.profile-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); }
.dl { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0; }
.dl > div { padding: 12px 20px; border-top: 1px solid #f0ede7; }
.dl > div:nth-child(odd) { color: var(--muted); font-weight: 600; font-size: 13px; }
.pd-value { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-value .mono { font-size: 14px; letter-spacing: .04em; }
.pd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #8a6a22; background: var(--gold-soft); border-radius: 6px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .05em; }
.pd-tag svg { width: 12px; height: 12px; }
.reveal-timer { font-size: 12px; color: var(--warn); font-weight: 700; }

/* ---------- Отчёт / печатная форма ---------- */
.report-paper { background: #fff; max-width: 980px; margin: 0 auto; padding: 44px 52px; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 6px; font-size: 13px; color: #111; }
.stamp { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.grif { border: 2px solid var(--bad); color: var(--bad); padding: 8px 14px; border-radius: 4px; text-align: center; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; line-height: 1.4; transform: rotate(-1.5deg); }
.grif small { display: block; font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11px; }
.report-paper h2 { text-align: center; font-size: 18px; margin: 8px 0 4px; }
.report-paper .rp-sub { text-align: center; color: #555; margin-bottom: 22px; }
.report-paper table { width: 100%; border-collapse: collapse; }
.report-paper th, .report-paper td { border: 1px solid #999; padding: 6px 8px; text-align: left; font-size: 12px; }
.report-paper th { background: #f1f1f1; }
.report-paper td:first-child { white-space: nowrap; }
.report-paper tfoot td { font-weight: 800; }
.report-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; font-size: 12.5px; }
.report-sign .line { border-bottom: 1px solid #333; height: 26px; margin-bottom: 4px; }
.report-meta { margin-top: 28px; font-size: 11px; color: #666; border-top: 1px dashed #bbb; padding-top: 10px; }

/* ---------- Журнал ---------- */
.ev { font-weight: 700; font-size: 12px; }
.chain-ok { color: var(--ok); }
.chain-bad { color: var(--bad); }
.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
tr.tampered td { background: var(--bad-soft) !important; }

/* ---------- Модальные окна ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 22, 42, .55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px 8px; }
.modal-head .m-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.modal-head .m-ico.danger { background: var(--bad-soft); color: var(--bad); }
.modal-head .m-ico.warn { background: var(--warn-soft); color: var(--warn); }
.modal-head .m-ico svg { width: 22px; height: 22px; }
.modal-head h3 { font-size: 18px; font-weight: 800; color: var(--ink); }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 14px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.countdown { font-size: 46px; font-weight: 800; text-align: center; color: var(--warn); font-variant-numeric: tabular-nums; margin: 6px 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Тосты ---------- */
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .2s ease; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #6fe0b1; }
.toast.bad { background: #8e2a1f; }
.toast.warn svg { color: var(--gold); }

/* ---------- Страница 403 ---------- */
.denied { max-width: 560px; margin: 40px auto; text-align: center; padding: 40px; }
.denied .code { font-family: var(--serif); font-size: 72px; color: var(--bad); line-height: 1; }
.denied h2 { margin: 10px 0; color: var(--ink); }

/* ---------- О прототипе ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--ok); font-weight: 800; }
.no { color: #c9c2b4; }
.view { color: var(--warn); font-weight: 800; }
.nav-map { width: 100%; height: auto; display: block; }
.checklist td:nth-child(3) { min-width: 220px; }
.tabs { display: flex; gap: 6px; padding: 6px; background: #ebe7df; border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 18px; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.rating { color: var(--gold); letter-spacing: 1px; }
.list-plain { margin: 0; padding-left: 18px; }
.list-plain li { margin: 4px 0; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { color: var(--ink); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-21, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 24px; }
  .login-hero h1 { font-size: 32px; }
  .hero-features { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-flex; }
  .watermark { left: 0; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 50px; }
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl > div:nth-child(even) { border-top: 0; padding-top: 0; }
  .report-paper { padding: 24px 18px; }
  .secure-pill { display: none; }
  .bar-row { grid-template-columns: 100px minmax(0, 1fr) 44px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 17px; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, #toast-root, .watermark { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .report-paper { box-shadow: none; border: 0; padding: 0; max-width: none; }
}
