/* Школа.ЭДО — оформление интерфейса */

:root {
  --brand: #0f5c6b;
  --brand-dark: #0b4653;
  --brand-deep: #0d2b34;
  --brand-soft: #e4f1f3;
  --brand-line: #bfdde2;
  --accent: #b97a24;
  --accent-soft: #fbf1e2;
  --bg: #f1f4f6;
  --panel: #ffffff;
  --ink: #1b2a33;
  --muted: #687b86;
  --muted-2: #8b9aa3;
  --line: #e2e8ec;
  --line-strong: #cfd9df;
  --danger: #ae3b3b;
  --danger-soft: #fbeaea;
  --ok: #2b7654;
  --ok-soft: #e6f3ec;
  --warn: #8a6414;
  --warn-soft: #fdf6e7;
  --shadow: 0 1px 2px rgba(20, 45, 58, .05), 0 4px 14px rgba(20, 45, 58, .05);
  --radius: 12px;
  --radius-sm: 8px;
  --sans: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Times New Roman", "PT Serif", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.wrap { overflow-wrap: anywhere; }

/* ---------- Каркас ---------- */

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--brand-deep);
  color: #c9dde2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 20px 18px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
  color: #eaf5f7; flex: none;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text b { display: block; color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand-text span { display: block; font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: #86a7b0; margin-top: 2px; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: #b9cfd5; font-size: 14px;
}
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.active svg { opacity: 1; }
.nav a .nav-count {
  margin-left: auto; background: var(--accent); color: #23160a;
  border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}

.sidebar-foot {
  margin-top: auto; padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11.5px; color: #7d9aa3; line-height: 1.5;
}
.sidebar-foot .foot-mode { color: #8fb3bd; margin-top: 2px; }
.sidebar-foot .foot-version { margin-top: 8px; color: #6f929b; }
.sidebar-foot .foot-exit {
  width: 100%; justify-content: center; margin: 8px 0 2px;
  background: #fff; border-color: #fff; color: var(--brand-deep); font-weight: 600;
}
.sidebar-foot .foot-exit:hover { background: #e9f2f4; border-color: #e9f2f4; }
.sidebar-author { margin-top: 4px; color: #6f929b; font-size: 10.5px; letter-spacing: .03em; }
.sidebar-author a {
  color: #8fb3bd; text-decoration: none;
  border-bottom: 1px dotted rgba(143, 179, 189, .5);
}
.sidebar-author a:hover { color: #cfe3e8; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 22px 32px 0; flex-wrap: wrap;
}
.page-title { min-width: 0; flex: 1 1 300px; }
.page-title h1 { font-size: 24px; margin: 0; letter-spacing: -.2px; overflow-wrap: anywhere; }
.page-title .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }

.search {
  display: flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 7px 11px; min-width: 230px;
}
.search svg { width: 15px; height: 15px; color: var(--muted-2); }
.search input { border: 0; outline: 0; font: inherit; background: transparent;
  width: 100%; color: var(--ink); }

.user-chip {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px 5px 5px; position: relative;
}
.user-chip:hover { border-color: var(--line-strong); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex: none;
}
.user-chip .who { line-height: 1.15; }
.user-chip .who b { font-size: 12.8px; font-weight: 600; display: block; }
.user-chip .who span { font-size: 11px; color: var(--muted); }

.menu {
  position: absolute; top: 46px; right: 0; min-width: 190px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 40, 50, .16);
  padding: 6px; z-index: 30;
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 8px 10px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.menu button:hover { background: var(--brand-soft); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }

.page { padding: 18px 32px 46px; }

.auth-banner {
  margin: 14px 32px -2px;
  background: var(--warn-soft);
  border: 1px solid #f0dfb4;
  color: var(--warn);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 12.8px;
  line-height: 1.4;
}
.auth-banner b { font-weight: 650; }
.auth-banner code {
  font-family: "Consolas", monospace;
  background: #fff8e8;
  padding: 0 4px;
  border-radius: 4px;
}
.imp-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #eef4fb;
  border-color: #cfe0f2;
  color: #2f5d86;
}
.imp-banner .btn { flex-shrink: 0; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--ink); border-radius: 9px; padding: 8px 14px;
  font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--muted-2); }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(15, 92, 107, .22);
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { color: var(--danger); border-color: #e8c9c9; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); width: 30px; height: 30px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--ink); }

/* ---------- Карточки ---------- */

.card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 8px 10px; }
.card + .card { margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
.stat {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px 17px; border-top: 3px solid var(--brand-line);
}
.stat .label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); }
.stat .value { font-size: 27px; font-weight: 650; letter-spacing: -.5px; margin-top: 5px; }
.stat .note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.warn { border-top-color: #e3b04b; }
.stat.ok { border-top-color: #4f9d77; }
.stat.info { border-top-color: #4a8fa8; }
.stat.bad { border-top-color: #c26262; }
.stat.click { cursor: pointer; }
.stat.click:hover { box-shadow: 0 4px 18px rgba(20, 45, 58, .11); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > *, .grid-main > * { min-width: 0; }
.card { min-width: 0; }
.page { min-width: 0; }

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 10.8px; letter-spacing: .075em;
  text-transform: uppercase; color: var(--muted);
  font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fbfcfd;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: #f7fafb; }
.table .title { font-weight: 600; }
.table .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 34px 18px; text-align: center; color: var(--muted);
}
.empty .big { font-size: 15px; color: var(--ink); margin-bottom: 4px; }

/* на узких экранах убираем второстепенные колонки реестра, чтобы не было прокрутки */
@media (max-width: 1280px) {
  .table .col-updated { display: none; }
}
@media (max-width: 1120px) {
  .table .col-author, .table .col-files { display: none; }
}

/* ---------- Бейджи ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 2px 9px; font-size: 11.8px;
  font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.draft { background: #f2f5f7; color: #5f7280; border-color: #e3e9ed; }
.badge.on_approval { background: var(--warn-soft); color: var(--warn); border-color: #f0dfb4; }
.badge.approved { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-line); }
.badge.signed { background: var(--ok-soft); color: var(--ok); border-color: #c6e2d3; }
.badge.registered { background: #e8f0fb; color: #2c568f; border-color: #cddcf3; }
.badge.archived { background: #f0f0f2; color: #6d6d78; border-color: #e0e0e5; }
.badge.rejected { background: var(--danger-soft); color: var(--danger); border-color: #ecc9c9; }
.badge.plain { background: var(--brand-soft); color: var(--brand-dark); }
.badge.step-pending { background: var(--warn-soft); color: var(--warn); }
.badge.step-done { background: var(--ok-soft); color: var(--ok); }
.badge.step-rejected { background: var(--danger-soft); color: var(--danger); }
.badge.step-skipped { background: #f0f0f2; color: #6d6d78; }

.kind-pill {
  display: inline-block; font-size: 11.5px; letter-spacing: .01em;
  background: #eef3f5; color: #45606c; border-radius: 6px;
  padding: 2px 7px; white-space: nowrap;
}
.kind-pill.restricted { background: #fbeaea; color: #9d3d3d; }

/* ---------- Формы ---------- */

.form-row { display: grid; gap: 13px; margin-bottom: 13px; }
.form-row.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; max-width: 100%; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13.8px; color: var(--ink);
  background: #fff; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 92, 107, .1);
}
.field textarea { min-height: 78px; resize: vertical; }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.form-error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid #ecc9c9;
  border-radius: 8px; padding: 8px 11px; font-size: 13px; margin-bottom: 12px;
}
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- Модальные окна ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12, 30, 37, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--panel); border-radius: 14px; width: 100%;
  max-width: min(520px, calc(100vw - 24px));
  box-shadow: 0 24px 60px rgba(10, 30, 38, .32); animation: pop .16s ease-out;
}
.modal.wide { max-width: min(760px, calc(100vw - 24px)); }
@keyframes pop { from { transform: translateY(-8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line);
}

/* ---------- Уведомления ---------- */

#toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  background: var(--brand-deep); color: #fff; border-radius: 9px;
  padding: 10px 15px; font-size: 13.5px; max-width: 380px;
  box-shadow: 0 12px 30px rgba(10, 30, 38, .3); animation: pop .16s ease-out;
}
.toast.error { background: #7f2c2c; }
.toast.ok { background: #215c41; }

/* ---------- Вход ---------- */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 30px 16px;
  background: radial-gradient(1200px 600px at 70% -10%, #17414d 0%, var(--brand-deep) 55%, #081c23 100%);
}
.login-card {
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 400px;
  padding: 30px 30px 26px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}
.login-card .logo {
  width: 46px; height: 46px; border-radius: 13px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.login-card .logo svg { width: 25px; height: 25px; }
.login-card h1 { font-size: 21px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px 14px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 18px; }

/* ---------- Карточка документа ---------- */

.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.doc-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.doc-head h1 { font-size: 22px; margin: 4px 0 6px; line-height: 1.25; max-width: 760px; overflow-wrap: anywhere; }
.doc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.8px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions [data-act="toggle-more"] { margin-left: auto; }
@media (max-width: 1240px) {
  .doc-head { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .doc-head > div:first-child { flex: 0 0 auto; }
  .doc-head h1 { max-width: none; }
}

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 0 0 10px;
}
.section-title h3 { margin: 0; font-size: 14px; font-weight: 650; }
.section-title .hint { color: var(--muted); font-size: 12px; }

.files { display: flex; flex-direction: column; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.file-row:last-child { border-bottom: 0; }
.file-ico {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.file-ico.img { background: #eaf3e8; color: #37633a; }
.file-ico.pdf { background: #fdeceb; color: #9c3636; }
.file-main { min-width: 0; flex: 1; }
.file-main .name { font-weight: 600; font-size: 13.6px; overflow-wrap: anywhere; }
.file-main .meta { color: var(--muted); font-size: 11.8px; margin-top: 2px; }

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: 10px;
  padding: 16px; text-align: center; color: var(--muted);
  font-size: 13px; cursor: pointer; transition: .15s;
  background: #fbfcfd; margin-top: 12px;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone b { color: var(--brand); font-weight: 650; }
.dropzone svg { width: 22px; height: 22px; vertical-align: -5px; }

/* компактные формы внутри карточки */
.plain-form { display: grid; gap: 8px; margin-top: 14px; }
.plain-form .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.plain-input {
  width: 100%; max-width: 100%; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--ink);
  background: #fff; outline: none;
}
.plain-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 92, 107, .1); }
.comment-form { display: flex; gap: 8px; margin-top: 14px; }
.comment-form .plain-input { flex: 1 1 auto; }
@media (max-width: 620px) {
  .plain-form .row2 { grid-template-columns: minmax(0, 1fr); }
  .comment-form { flex-direction: column; }
}

/* ---------- Маршрут ---------- */

.callout {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--warn-soft); border: 1px solid #f0dfb4;
  border-radius: 10px; padding: 11px 14px; margin-bottom: 14px;
}
.callout.ok { background: var(--ok-soft); border-color: #c6e2d3; }
.callout.bad { background: var(--danger-soft); border-color: #ecc9c9; }
.callout .grow { flex: 1; min-width: 180px; }
.callout b { font-weight: 650; }

.timeline { position: relative; margin: 4px 0 0; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff;
}
.tl-dot.done { background: var(--ok); border-color: var(--ok); }
.tl-dot.pending { background: #fff; border-color: #d9a93a; }
.tl-dot.rejected { background: var(--danger); border-color: var(--danger); }
.tl-dot.skipped { background: #c9d1d6; border-color: #c9d1d6; }
.tl-body .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-body .who { font-weight: 600; font-size: 13.6px; }
.tl-body .when { color: var(--muted); font-size: 11.8px; }
.tl-body .note { color: var(--muted); font-size: 12.6px; margin-top: 3px; }

/* ---------- Подписи, история ---------- */

.sig-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
}
.sig-row:last-child { border-bottom: 0; }
.sig-seal {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--ok-soft); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #c6e2d3;
}
.sig-seal svg { width: 17px; height: 17px; }
.sig-main .who { font-weight: 600; font-size: 13.4px; }
.sig-main .meta { color: var(--muted); font-size: 11.9px; margin-top: 2px; }
.sig-main .code { font-family: "Consolas", monospace; font-size: 11.6px; }
.sig-warn { color: var(--danger); font-size: 11.8px; margin-top: 3px; }

.hist { font-size: 12.8px; }
.hist-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hist-item:last-child { border-bottom: 0; }
.hist-item .at { color: var(--muted-2); white-space: nowrap; font-size: 11.8px; min-width: 96px; }
.hist-item .what b { font-weight: 600; }
.hist-item .who { color: var(--muted); }

.details { display: grid; gap: 9px; font-size: 13.2px; }
.details .row { display: flex; justify-content: space-between; gap: 14px; }
.details .k { color: var(--muted); }
.details .v { text-align: right; overflow-wrap: anywhere; }

/* ---------- Фильтры ---------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.filters .field input, .filters .field select { padding: 7px 9px; font-size: 13.2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { opacity: .7; margin-left: 3px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 0; }

/* ---------- Прочее ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
  border: 0; background: transparent; padding: 9px 13px; font-size: 13.4px;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

.preview-frame {
  width: 100%; height: 520px; border: 1px solid var(--line);
  border-radius: 10px; background: #eef1f3;
}
.help-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  font-weight: 700; font-size: 15px; color: var(--brand);
  border: 1px solid var(--line); background: #fff; line-height: 1;
}
.help-btn:hover { background: var(--brand-soft); }
.help-list { margin: 0 0 12px; padding-left: 20px; }
.help-list li { margin-bottom: 7px; line-height: 1.4; font-size: 13px; }
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 8px 12px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.bulk-count { font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-right: 4px; }
.check-col { width: 34px; text-align: center; }
.check-col input { cursor: pointer; }
.cert-sign {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.cert-sign .btn { align-self: flex-start; }
.preview-img {
  max-width: 100%; max-height: 70vh; object-fit: contain;
  display: block; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line);
}

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--brand-line); border-top-color: var(--brand);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); color: var(--muted); z-index: 50;
}

@media (max-width: 1080px) {
  .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  .topbar { padding: 16px 16px 0; flex-wrap: wrap; }
  .page { padding: 14px 16px 40px; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .search { min-width: 0; flex: 1; }
}


.nav-block { display: flex; flex-direction: column; }
.nav-row { display: flex; align-items: center; gap: 2px; }
.nav-row > a { flex: 1; min-width: 0; }
.nav-caret {
  background: none; border: 0; color: #9fb8c0; cursor: pointer;
  padding: 8px 9px; font-size: 11px; line-height: 1; opacity: .85;
  border-radius: 8px;
}
.nav-caret:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-block.open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; flex-direction: column; gap: 1px; padding: 2px 0 4px 32px; }
.nav-block.open .nav-sub { display: flex; }
.nav-sub a { font-size: 13px; padding: 6px 10px; color: #9fb8c0; }
.nav-sub a:hover { color: #fff; }
.nav-sub a.active { background: rgba(255, 255, 255, .1); color: #fff; }
