/* =====================================================================
   БухОфис — дизайн-система
   Светлая, спокойная, плотная там, где нужна таблица, и воздушная в формах.
   ===================================================================== */
:root {
  --primary: #17357a;
  --primary-600: #102a63;
  --primary-50: #eaf0fb;
  --primary-100: #d3e0f6;
  --ink: #14203a;
  --ink-2: #414b66;
  --muted: #66718c;
  --muted-2: #98a2ba;
  --bg: #edf0f6;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --line: #e2e7f0;
  --line-strong: #ccd4e3;
  --side: #0a1d45;
  --side-2: #12295b;
  --side-line: #213a72;
  --ok: #12945a;   --ok-bg: #e3f6ec;
  --warn: #b7791f; --warn-bg: #fdf3dc;
  --bad: #d0343c;  --bad-bg: #fdeaea;
  --info: #2b6ad6; --info-bg: #e8f0ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 32, 58, .05), 0 4px 16px rgba(20, 32, 58, .05);
  --shadow-pop: 0 12px 40px rgba(20, 32, 58, .2);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --font: "Inter", "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* обратная совместимость со старыми шаблонами */
  --blue: var(--primary); --blue-dark: var(--primary-600); --blue-light: var(--primary-50);
  --card: var(--surface); --border: var(--line); --border-strong: var(--line-strong);
  --text: var(--ink); --green: var(--ok); --red: var(--bad); --amber: var(--warn);
  --viz-1: #17357a; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4;
  --viz-muted: #898781; --viz-grid: #e6e5df; --viz-good: #0ca30c; --viz-warning: #d97706; --viz-critical: #d03b3b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.muted { color: var(--muted); }
.num-tabular { font-variant-numeric: tabular-nums; }

/* ---------- Каркас ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--side); color: #cdd8ee;
  display: flex; flex-direction: column; padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh;
  transition: width .16s ease; overflow: hidden;
}
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 18px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, #4a78d6, #17357a); color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(23, 53, 122, .45);
}
.sidebar-toggle {
  background: transparent; border: 0; color: #8fa1c9; border-radius: 9px; padding: 0;
  width: 34px; height: 34px; cursor: pointer; flex: 0 0 34px; display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.sidebar-toggle svg { width: 20px; height: 20px; display: block; }
.sidebar-toggle .chev { transition: transform .16s ease; transform-origin: 14.5px 12px; }
.app-shell.collapsed .sidebar-toggle .chev { transform: scaleX(-1); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--accent, #ff6a13); outline-offset: 2px; }
.sidebar-toggle:hover { color: #fff; border-color: #3b5590; }

.sidebar-search { position: relative; margin: 0 0 14px; }
.sidebar-search .search-ico { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; color: #7f92bd; pointer-events: none; }
.sidebar-search input[type=search] {
  width: 100%; background: var(--side-2); border: 1px solid var(--side-line); border-radius: 9px; color: #eaf0ff;
  font: inherit; font-size: 13px; padding: 9px 12px 9px 34px;
}
.sidebar-search input[type=search]::placeholder { color: #7f92bd; }
.sidebar-search input[type=search]:focus { outline: none; border-color: #4a78d6; background: #172e63; }
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; width: 340px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 60; padding: 6px;
}
.search-results.open { display: block; }
.search-results .grp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.search-results a.result-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; }
.search-results a.result-item:hover { background: var(--primary-50); text-decoration: none; }
.search-results a.result-item .r-sub { color: var(--muted); font-size: 11.5px; }
.search-results .empty { padding: 14px 10px; color: var(--muted); font-size: 12.5px; text-align: center; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #6f86b5; padding: 14px 10px 6px; white-space: nowrap; }
.sidebar nav a {
  color: #cdd8ee; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; display: flex; align-items: center; gap: 11px;
  white-space: nowrap; overflow: hidden; position: relative;
}
.sidebar nav a:hover { background: var(--side-2); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(107, 149, 230, .22); color: #fff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #6b95e6; }
.nav-ico { flex-shrink: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.nav-ico svg { width: 17px; height: 17px; }
.nav-count { margin-left: auto; background: var(--side-2); color: #9db0d8; font-size: 11px; padding: 1px 7px; border-radius: 20px; }

.sidebar-footer { border-top: 1px solid var(--side-line); padding-top: 12px; margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: #2f3766; color: #cbd5ff;
}
.user-chip .who { min-width: 0; line-height: 1.25; }
.user-chip .who b { display: block; font-size: 13px; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { display: block; font-size: 11.5px; color: #8fa1c9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; gap: 6px; }
.foot-actions a, .foot-actions button {
  flex: 1; text-align: center; font: inherit; font-size: 12px; color: #aab0d2; background: var(--side-2);
  border: 1px solid transparent; border-radius: 8px; padding: 7px 6px; cursor: pointer;
}
.foot-actions a:hover, .foot-actions button:hover { color: #fff; text-decoration: none; border-color: var(--side-line); }
.foot-actions form { flex: 1; display: flex; }
.foot-actions form button { width: 100%; }

.app-shell.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.collapsed .brand-text, .app-shell.collapsed .nav-label, .app-shell.collapsed .who, .app-shell.collapsed .sidebar-search,
.app-shell.collapsed .nav-group, .app-shell.collapsed .nav-count, .app-shell.collapsed .foot-actions { display: none; }
.app-shell.collapsed .brand, .app-shell.collapsed .org-sel { display: none; }
.app-shell.collapsed .sidebar nav a { justify-content: center; padding: 11px 0; }
.app-shell.collapsed .user-chip { justify-content: center; }

.content { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1480px; }
.content-wide { max-width: none; }
.content-full { margin: 0 auto; width: 100%; max-width: 440px; padding: 8vh 20px 40px; }

/* ---------- Шапка страницы ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.page-head .crumbs a { color: var(--muted); }
.page-head .crumbs a:hover { color: var(--primary); }
.subtitle { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.page-head .actions, .toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }

/* ---------- Карточки, сетки ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .content { padding: 20px 16px 50px; } }

.stat-row { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  min-width: 170px; flex: 1; box-shadow: var(--shadow); position: relative;
}
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--bad); } .stat .delta.flat { color: var(--muted); }
.stat.compact { padding: 10px 14px; min-width: 130px; box-shadow: none; }
.stat.compact .num { font-size: 18px; }

/* ---------- Таблицы ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th {
  color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); white-space: nowrap;
}
tbody tr:hover td { background: #fafbff; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: none; background: var(--surface-2); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.c, th.c { text-align: center; }
td.nowrap, .nowrap { white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.tbl-num { color: var(--muted-2); width: 44px; font-variant-numeric: tabular-nums; text-align: right; }
.row-dim td { color: var(--muted); }
.row-dim td a { color: var(--muted); }

/* Плотная «таблица-лист» (РПВ, статистика) */
.sheet-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sheet-scroll { overflow: auto; max-height: calc(100vh - 250px); }
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.sheet thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: none; letter-spacing: 0; padding: 9px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.sheet tbody td { border-bottom: 1px solid var(--line); padding: 0; }
.sheet tbody tr:nth-child(even) td { background: #fbfbfe; }
.sheet tbody tr:hover td { background: var(--primary-50); }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; padding: 8px 7px; white-space: nowrap; }
.sheet .txt { padding: 8px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--surface-2); padding: 9px 10px; }

/* ---------- Значки, кнопки ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.active, .badge.done, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.fired, .badge.archived, .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.draft, .badge.open, .badge.warn, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.saved, .badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: #eef0f7; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--primary); color: #fff; border: 1px solid transparent;
  border-radius: 9px; padding: 8px 15px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.2;
  transition: background .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 1px; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: #bfc5dc; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-50); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: #f3c6c9; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
form.inline { display: inline; }

/* ---------- Формы ---------- */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=email], input[type=password], input[type=month], input[type=search], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; font: inherit; font-size: 14px;
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; }
.form-grid .c-12 { grid-column: span 12; } .form-grid .c-10 { grid-column: span 10; } .form-grid .c-9 { grid-column: span 9; } .form-grid .c-8 { grid-column: span 8; } .form-grid .c-7 { grid-column: span 7; } .form-grid .c-6 { grid-column: span 6; } .form-grid .c-5 { grid-column: span 5; }
.form-grid .c-4 { grid-column: span 4; } .form-grid .c-3 { grid-column: span 3; } .form-grid .c-2 { grid-column: span 2; }
@media (max-width: 800px) { .form-grid [class*="c-"] { grid-column: span 12; } }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); grid-column: span 12; }
.form-section:first-child { border-top: none; padding-top: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 4px; background: #eceef7; padding: 4px; border-radius: 11px; width: fit-content; max-width: 100%; margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 8px 16px; color: var(--ink-2); font: inherit; font-weight: 600; font-size: 13px; border-radius: 8px; border: none; background: transparent;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs a.active, .tabs button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(23, 26, 46, .12); }
.tab-count { background: #e0e4f5; color: var(--ink-2); border-radius: 20px; font-size: 11px; padding: 0 7px; line-height: 17px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.error-box { background: var(--bad-bg); border: 1px solid #f3c6c9; color: var(--bad); padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.notice { background: var(--info-bg); border: 1px solid #c9dbff; color: #1e4fa8; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.notice.warn { background: var(--warn-bg); border-color: #f2dda6; color: #8a5a10; }
.notice.ok { background: var(--ok-bg); border-color: #bfe6d1; color: #0d7346; }
.empty-state { text-align: center; color: var(--muted); padding: 34px 16px; }

/* ---------- Алфавитный фильтр + счётчик ---------- */
.list-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.list-tools .search { position: relative; width: 300px; max-width: 100%; }
.list-tools .search input[type=search] { padding-left: 34px; }
.list-tools .search svg { position: absolute; left: 11px; top: 11px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.list-tools .grow { flex: 1; }
.counter {
  display: inline-flex; align-items: baseline; gap: 6px; background: var(--primary-50); color: var(--primary-600); border: 1px solid var(--primary-100);
  border-radius: 10px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.counter b { font-size: 17px; font-variant-numeric: tabular-nums; }
.alpha { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.alpha button {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.alpha button:hover { border-color: var(--primary); color: var(--primary); }
.alpha button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.alpha button[disabled] { opacity: .35; cursor: default; border-color: var(--line); color: var(--muted-2); }
.alpha button[disabled]:hover { border-color: var(--line); color: var(--muted-2); }

/* ---------- Табель Т-12 ---------- */
.t12-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 16px 18px; overflow-x: auto; }
.t12 { font-family: "Times New Roman", Times, serif; color: #000; min-width: 1107px; }
.t12-head { display: flex; justify-content: space-between; align-items: flex-start; }
.t12-form-note { text-align: right; font-size: 11px; line-height: 1.35; max-width: 340px; margin-left: auto; }
.t12-okud { display: grid; grid-template-columns: auto 92px; justify-content: end; font-size: 12px; margin-top: 4px; }
.t12-okud div { border: 1px solid #000; padding: 2px 6px; text-align: center; min-height: 20px; }
.t12-okud .lbl { border: none; text-align: right; }
.t12-org { text-align: center; font-size: 15px; border-bottom: 1px solid #000; padding: 2px 0; margin-top: 8px; }
.t12-org-cap { text-align: center; font-size: 9px; margin-bottom: 8px; }
.t12-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.t12-title .mid { text-align: center; flex: 1; font-size: 15px; line-height: 1.3; }
.t12-title .mid b { font-weight: 400; font-size: 17px; }
.t12-docbox { display: grid; grid-template-columns: 90px 90px 120px; text-align: center; font-size: 9px; }
.t12-docbox div { border: 1px solid #000; padding: 2px; min-height: 20px; }
table.t12-grid { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 11px; margin-top: 12px; }
.t12-grid th, .t12-grid td { border: 1px solid #000; padding: 1px 2px; text-align: center; background: #fff; color: #000; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.t12-grid th { line-height: 1.1; vertical-align: middle; overflow: hidden; word-break: break-word; font-size: 8.5px; padding: 1px; }
.t12-grid th.vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: normal; line-height: 1.05; font-size: 7.5px; }
.t12-grid th.dh { font-size: 10px; }
.t12-grid tbody tr:hover td { background: #fff; }
.t12-grid .colno td { font-size: 10px; padding: 1px; font-weight: 700; }
.t12-grid .nm { text-align: left; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.t12-grid .pos { font-size: 10px; white-space: normal; line-height: 1.1; }
.t12-grid td.day { padding: 0; height: 26px; position: relative; }
.t12-grid td.day input {
  width: 100%; height: 26px; border: none; border-radius: 0; background: transparent; text-align: center; padding: 0; font: inherit; font-size: 12px; font-family: "Times New Roman", serif;
  color: #000; box-shadow: none; font-weight: 600;
}
.t12-grid td.day input:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; box-shadow: none; position: relative; z-index: 1; }
.t12-grid td.day.we { background: #fbeeee; }
.t12-grid td.day.we input { color: #a02020; }
.t12-grid td.day.off { background: #eef0f4; }
.t12-grid td.day.off input { color: #8b91a5; }
.t12-grid td.day.tod { box-shadow: inset 0 0 0 2px #f0b429; }
.t12-grid td.day[data-kind="work"] { background: #fff8e1; }
.t12-grid td.day[data-kind="vacation"] { background: #e8f0ff; }
.t12-grid td.day[data-kind="sick"] { background: #fff1de; }
.t12-grid td.day[data-kind="absence"] { background: #fdeaea; }
.t12-grid td.sum { font-weight: 700; background: #fffaf0; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.t12-grid td.day-h { font-weight: 700; }
.t12-sign { display: flex; justify-content: space-between; margin-top: 20px; font-size: 12px; gap: 30px; }
.t12-sign .col { flex: 1; text-align: center; }
.t12-sign .line { border-top: 1px solid #000; margin-top: 22px; font-size: 9px; padding-top: 2px; }
.t12-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-family: var(--font); font-size: 12px; color: var(--ink-2); }
.t12-legend b { font-family: "Times New Roman", serif; margin-right: 4px; color: #000; }
.save-state { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.ok { color: var(--ok); } .save-state.err { color: var(--bad); }

/* ---------- Страница входа ---------- */
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 34px 34px 28px; box-shadow: var(--shadow-pop); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo .brand-mark { width: 40px; height: 40px; font-size: 19px; }
.auth-title { font-size: 20px; font-weight: 700; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.auth-links { margin-top: 16px; text-align: center; font-size: 13px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; }

/* ---------- Прочее ---------- */
.task-list, .plain-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: none; }
.task-meta { color: var(--muted); font-size: 12px; }
.doc-links { display: flex; gap: 8px; flex-wrap: wrap; }
kbd { font-family: var(--mono); font-size: 11px; background: #eef0f7; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dt { border-bottom: none; padding-bottom: 0; } }

/* Документы сотрудника — плитки */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.doc-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.doc-tile:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 6px 20px rgba(59, 91, 219, .12); transform: translateY(-1px); }
.doc-tile .dt-code { font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: .04em; }
.doc-tile .dt-title { font-weight: 650; font-size: 14px; }
.doc-tile .dt-sub { color: var(--muted); font-size: 12px; }
.doc-tile.disabled { opacity: .55; pointer-events: none; background: var(--surface-2); }

/* ---------- Статистика: графики ---------- */
.chart-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.chart-grid.single { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card h2 { margin: 0 0 2px; }
.chart-sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.viz-root { color-scheme: light; position: relative; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink); }
.viz-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend .swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.viz-tooltip {
  position: fixed; pointer-events: none; background: var(--side); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; line-height: 1.5;
  z-index: 60; opacity: 0; transform: translate(-50%, -100%); transition: opacity .08s ease; box-shadow: var(--shadow-pop); white-space: nowrap;
}
.viz-tooltip.visible { opacity: 1; }
.viz-tooltip .tt-title { font-weight: 700; margin-bottom: 3px; }
.viz-tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.viz-tooltip .tt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.viz-axis-label { fill: var(--viz-muted); font-size: 10px; }
.viz-gridline { stroke: var(--viz-grid); stroke-width: 1; }
.viz-value-label { fill: var(--ink); font-size: 10.5px; font-weight: 600; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank-num { width: 20px; flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.rank-list .rank-body { flex: 1; min-width: 0; }
.rank-list .rank-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .rank-org { color: var(--muted); font-size: 11.5px; }
.rank-list .rank-val { font-variant-numeric: tabular-nums; font-weight: 700; flex-shrink: 0; }
.rank-list .rank-bar-track { height: 4px; background: var(--line); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.rank-list .rank-bar-fill { height: 100%; background: var(--viz-1); border-radius: 2px; }
.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row .bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; }
.bar-row .bar-top .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-top .val { font-variant-numeric: tabular-nums; font-weight: 700; flex-shrink: 0; }
.bar-row .track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 4px; }
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 18px; }
details.fold > summary { cursor: pointer; padding: 14px 20px; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--muted-2); transition: transform .12s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 20px 18px; }

/* ---------- Ответы на требования ---------- */
.req-cell { max-width: 640px; white-space: pre-line; line-height: 1.45; }
.req-cell.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.copied { color: var(--ok) !important; }

/* Печать страниц программы (РПВ, договор, табель…): нулевые поля страницы — Chrome не рисует колонтитулы
   (дату, заголовок, адрес localhost); поля — отступом body, повторяются на каждой странице (clone). */
@media print {
  @page { margin: 0; }
  body { margin: 0 !important; padding: 10mm 12mm !important; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .sidebar, .toolbar, .no-print, .page-head .actions { display: none !important; }
  .print-only { display: inline !important; }
  .content, .content-wide { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .t12-wrap, .sheet-card { box-shadow: none; border: none; }
  .sheet-scroll { max-height: none !important; overflow: visible !important; }
  .sheet thead th { position: static !important; }
}

/* ---------- Карточка сотрудника: данные + панель документов ---------- */
.emp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.emp-docs { position: sticky; top: 16px; }
.emp-docs .card { margin-bottom: 0; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-list .doc-tile { padding: 10px 14px; gap: 2px; }
.doc-list .doc-tile .dt-title { font-size: 13.5px; }
@media (max-width: 1100px) { .emp-layout { grid-template-columns: 1fr; } .emp-docs { position: static; order: -1; } }

/* Выпадающие списки в общем стиле */
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236d7390' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 8px; cursor: pointer;
}
input[type=month], input[type=date] { cursor: text; }

/* Узкие экраны: меню становится верхней панелью */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: column; padding: 12px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .sidebar nav a { padding: 8px 10px; }
  .nav-group { display: none; }
  .sidebar-footer { display: none; }
  .page-head { flex-direction: column; }
  .list-tools .search { width: 100%; }
}

/* ---------- Массовое сохранение: главное действие сверху ---------- */
.action-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 16px; }
.action-bar .grow { flex: 1; }
.done-card { border-color: #bfe6d1; background: linear-gradient(180deg, #f4fbf7, #fff); }
.done-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 4px; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 12px 20px 0; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #6d8cff); transition: width .25s; }
#progressText { padding: 0 20px; }

/* ---------- Редактируемые таблицы (отпуска, справка о доходах) ---------- */
.edit-table input, .edit-table select { width: 100%; padding: 6px 8px; font-size: 13px; border: 1px solid transparent; background: transparent; border-radius: 6px; min-width: 0; }
.edit-table input.r { text-align: right; }
.edit-table input:hover, .edit-table select:hover { border-color: var(--line-strong); background: #fff; }
.edit-table input:focus, .edit-table select:focus { border-color: var(--primary); background: #fff; outline: 0; box-shadow: 0 0 0 3px var(--primary-100); }
.edit-table tr.add-row td { background: var(--primary-50); border-top: 2px solid var(--primary-100); }
.edit-table tr.add-row input, .edit-table tr.add-row select { background: #fff; border-color: var(--line-strong); }
.edit-table tfoot td { font-weight: 700; background: var(--surface-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 17px; line-height: 1; text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.icon-btn.danger:hover { background: var(--bad-bg); border-color: #f3c3c6; color: var(--bad); }
form.inline { display: inline; }
.calc-line { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.calc-line > div { display: flex; flex-direction: column; gap: 2px; }
.calc-line b { font-size: 18px; }
.calc-line .big b { font-size: 26px; color: var(--primary); }
.calc-line .grow { flex: 1; }

/* ---------- Задачи и сроки ---------- */
.stat.stat-bad { border-color: #f3c3c6; background: linear-gradient(180deg, #fff5f5, #fff); }
.stat.stat-bad .num { color: var(--bad); }
.stat.stat-warn { border-color: #f2dda6; background: linear-gradient(180deg, #fffaf0, #fff); }
.stat.stat-warn .num { color: var(--warn); }
.panel { margin-bottom: 16px; }
.panel h2 { margin-top: 0; }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px 16px; margin: 6px 0 16px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.tpl input { margin-top: 3px; }
.tpl small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.segmented a { padding: 8px 14px; font-size: 13px; color: var(--ink-2); text-decoration: none; border-right: 1px solid var(--line); }
.segmented a:last-child { border-right: 0; }
.segmented a.on { background: var(--primary); color: #fff; font-weight: 600; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); margin-left: 6px; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: #f3c3c6; }
.chip.warn { background: var(--warn-bg); color: #8a5a10; border-color: #f2dda6; }
.task-group { margin-bottom: 14px; overflow: hidden; }
.task-group.overdue { border-left: 4px solid var(--bad); }
.tg-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: linear-gradient(180deg, #fbfcff, #f5f7fd); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tg-title { flex: 1; min-width: 260px; font-size: 14.5px; }
.tg-progress { min-width: 150px; font-size: 12px; color: var(--muted); }
.tg-progress .bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 4px; overflow: hidden; }
.tg-progress .bar i { display: block; height: 100%; background: var(--ok); }
.tg-actions { display: flex; gap: 8px; align-items: center; }
.task-group.collapsed .tg-body { display: none; }
tr.is-closed td { color: var(--muted); }
tr.is-closed td b { font-weight: 500; }
.bulk-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: var(--side); color: #e7eaff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px); }
.bulk-bar b { font-size: 16px; color: #fff; }
.bulk-bar input[type=date] { background: #fff; border-radius: 8px; }
.bulk-bar .icon-btn { background: transparent; color: #cfd4f5; border-color: #3a4066; }
/* значок срочных задач в меню и плашка «напоминание для всех» */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.collapsed .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.due-banner { display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin-bottom: 16px; border-radius: 12px; background: linear-gradient(90deg, #fff4f4, #fffaf0); border: 1px solid #f3c3c6; color: #7a1f26; font-size: 13.5px; }
.due-banner a { font-weight: 700; color: var(--bad); text-decoration: none; }
.due-banner .x { margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 18px; color: #b06; line-height: 1; }

/* ---------- ИНН: заполнение из реестра ---------- */
.inn-row { display: flex; gap: 8px; align-items: stretch; }
.inn-row input { flex: 1; min-width: 0; }
.inn-row .btn { white-space: nowrap; }
@keyframes autofill-flash { from { background: #d9f7e6; box-shadow: 0 0 0 3px #bfe6d1; } to { background: #fff; box-shadow: none; } }
.filled-auto { animation: autofill-flash 2.4s ease-out; }

.quick-add { margin: 0 20px 14px; padding: 14px 16px 2px; border: 1px dashed var(--primary-100); border-radius: 12px; background: var(--primary-50); }
.quick-add .qa-title { font-weight: 700; font-size: 13px; color: var(--primary-600); margin-bottom: 10px; }
.quick-add .field { margin-bottom: 12px; }
.quick-add label { font-size: 12px; }
#vacTable { table-layout: fixed; width: 100%; min-width: 0; }
#vacTable td, #vacTable th { padding-left: 8px; padding-right: 8px; }
#vacTable input[type=date], #vacTable input[type=month] { padding: 6px 4px; font-size: 12.5px; }
#vacTable td:last-child { white-space: nowrap; }
.edit-table input, .edit-table select { border-color: var(--line); background: #fff; }
.edit-table input:hover, .edit-table select:hover { border-color: var(--line-strong); }

/* ---------- Форма ИП: подразделы регистрации ---------- */
.form-grid .c-1 { grid-column: span 1; }
.form-grid .form-sub { grid-column: span 12; font-size: 13px; font-weight: 700; color: var(--primary-600); margin: 6px 0 10px; padding-left: 10px; border-left: 3px solid var(--primary-100); }
.field .hint { font-size: 12px; margin-top: 4px; color: var(--muted); min-height: 0; }
.field .hint a { font-weight: 700; }
.form-grid textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; resize: vertical; background: #fff; }
.form-grid textarea:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px var(--primary-100); }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 28px; }
.reg-item small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.reg-item b { font-weight: 600; word-break: break-word; }
.sync-panel { margin-bottom: 16px; }

/* =====================================================================
   Форма ИП: разделы-карточки, подкарточки регистрации, навигация, нижняя панель
   ===================================================================== */
.org-form { padding-bottom: 8px; }
.pill-nav { position: sticky; top: 0; z-index: 25; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; margin: 0 0 16px;
  background: rgba(244, 245, 250, .92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.pill-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s; }
.pill-nav a:hover { background: #fff; color: var(--primary); }
.pill-nav a.on { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(59, 91, 219, .28); }
.pill-nav .cnt { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--muted); }
.pill-nav .cnt.full { background: var(--ok-bg); color: var(--ok); }
.pill-nav .cnt.empty { background: #eceef6; color: var(--muted-2); }
.pill-nav a.on .cnt { background: rgba(255, 255, 255, .22); color: #fff; }

.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 24px 8px; margin-bottom: 18px; scroll-margin-top: 78px; }
.fcard-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fcard-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.fcard-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; max-width: 760px; }
.fcard-ico { flex: 0 0 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.fcard-ico svg { width: 22px; height: 22px; }
.tone-blue { background: #e8eeff; color: #17357a; } .tone-violet { background: #f0eaff; color: #7048e8; } .tone-teal { background: #e0f7f4; color: #0f9d8a; }
.tone-amber { background: #fff3d9; color: #d98a06; } .tone-rose { background: #ffe8ee; color: #d6336c; }

/* поля внутри формы ИП — мягче и просторнее */
.org-form .field { margin-bottom: 16px; }
.org-form .field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; margin-bottom: 6px; display: block; }
.org-form input[type=text], .org-form input[type=number], .org-form input[type=date], .org-form input[type=month], .org-form select, .org-form textarea {
  background: #fafbfe; border: 1px solid var(--line-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s, background .15s; }
.org-form input:hover, .org-form select:hover, .org-form textarea:hover { border-color: #b9c0dc; background: #fff; }
.org-form input:focus, .org-form select:focus, .org-form textarea:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100); outline: 0; }
.org-form input::placeholder, .org-form textarea::placeholder { color: #aab0c8; }
.org-form textarea { width: 100%; padding: 10px 12px; font: inherit; resize: vertical; line-height: 1.4; }
.field.from-registry > label::after { content: '· из реестра'; margin-left: 6px; font-size: 10.5px; font-weight: 700; color: var(--ok); text-transform: none; }
.field.from-registry input, .field.from-registry textarea { border-color: #a9dcc2; background: #f6fcf9; }

/* три подкарточки регистрации рядом */
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.subcard { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 2px; background: linear-gradient(180deg, #fbfcff, #fff); }
.subcard-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin-bottom: 14px; color: var(--ink); }
.subcard-note { font-size: 11.5px; color: var(--muted-2); margin: -6px 0 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-blue { background: #17357a; box-shadow: 0 0 0 4px #e8eeff; } .dot-green { background: #12945a; box-shadow: 0 0 0 4px #e3f6ec; } .dot-amber { background: #e59a0a; box-shadow: 0 0 0 4px #fff3d9; }
@media (max-width: 1150px) { .sub-grid { grid-template-columns: 1fr; } }

/* результат запроса в реестр */
.reg-result { border-radius: 14px; padding: 14px 18px; font-size: 13.5px; border: 1px solid #c9dbff; background: #f3f7ff; color: #1e3a8a; }
.reg-result.ok { border-color: #bfe6d1; background: linear-gradient(180deg, #f4fbf7, #fbfefc); color: #14532d; }
.reg-result.warn { border-color: #f2dda6; background: #fffaf0; color: #7a4f0d; }
.reg-result.load { display: flex; align-items: center; gap: 10px; }
.rr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.rr-meta { color: var(--ink-2); margin: 4px 0 8px; font-size: 12.5px; }
.rr-line { margin-top: 4px; line-height: 1.45; } .rr-line.muted { color: var(--muted); font-size: 12.5px; } .rr-line.bad { color: var(--bad); font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe6d1; margin-left: 0; }
.chip.bad { margin-left: 0; }
.spin { width: 14px; height: 14px; border: 2px solid #b6c8ff; border-top-color: var(--primary); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* нижняя панель сохранения */
.save-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); }
.save-bar .grow { flex: 1; }
.save-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.save-info b { font-size: 16px; color: var(--primary); }
.mini-bar { width: 120px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-left: 6px; }
.mini-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #6d8cff); transition: width .3s; }
.inn-row .btn { box-shadow: 0 4px 12px rgba(59, 91, 219, .25); }

/* поле с процентом: число и знак % в одной рамке, ничего не «плывёт» */
.pct { position: relative; }
.pct input { width: 100%; padding-right: 40px !important; text-align: left; font-variant-numeric: tabular-nums; }
.pct span { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 36px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--muted); font-weight: 700; pointer-events: none; }
/* числа без стрелочек-счётчиков (они налезали на значение) */
.org-form input[type=number]::-webkit-outer-spin-button, .org-form input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.org-form input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* единая высота и выравнивание всех полей формы */
.org-form input[type=text], .org-form input[type=number], .org-form input[type=date], .org-form input[type=month], .org-form select { height: 44px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; width: 100%; }
.org-form .field { min-width: 0; }
.org-form .inn-row input { flex: 1 1 auto; min-width: 0; }
.org-form .inn-row .btn { flex: 0 0 auto; height: 44px; }
.org-form input[type=date] { padding-right: 10px; }
.org-form select { padding-right: 34px; }
.org-form .form-grid { align-items: start; }
.steps { margin: 6px 0 14px; padding-left: 20px; line-height: 1.7; color: var(--ink-2); font-size: 13.5px; }
.steps li::marker { color: var(--primary); font-weight: 700; }

/* выбор режима доступа */
.mode-form { display: grid; gap: 10px; }
.mode-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.mode-opt:hover { border-color: var(--primary); }
.mode-opt.on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-100); }
.mode-opt input { margin-top: 4px; }
.mode-opt small { display: block; color: var(--muted); margin-top: 3px; font-size: 12.5px; line-height: 1.45; }
