:root {
  --navy: #1e293b;
  --navy-deep: #16202f;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e4e9f2;
  --line-soft: #eef2f8;
  --bg: #f4f7fb;
  --card: #ffffff;
  --emerald: #10b981;
  --emerald-dark: #047857;
  --blue: #3b82f6;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 16px;
  --shadow: 0 18px 40px -28px rgba(15, 23, 42, .55);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--blue); text-decoration: none; }

.hidden { display: none !important; }

/* ---------- вход ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #e8f1ff 0%, transparent 60%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px 30px 26px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 18px;
}

.login-card h1 { font-size: 20px; margin: 0 0 6px; }

.login-card p.hint { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.field { margin-bottom: 14px; }

.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #bfd3f5;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
  background: #fff;
}

.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 18px; }

.login-error {
  background: #fef4f4;
  border: 1px solid #f7d4d4;
  color: #b42318;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- каркас ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .03em;
  flex: 0 0 auto;
}

.brand-text b { display: block; font-size: 14px; }

.brand-text span { display: block; font-size: 11.5px; color: var(--muted); }

.nav {
  display: flex;
  gap: 4px;
  margin-left: 18px;
  flex-wrap: wrap;
}

.nav button {
  border: 0;
  background: transparent;
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}

.nav button:hover { background: var(--line-soft); }

.nav button.active { background: var(--navy); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.user-name { font-size: 13px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.role-badge { font-size: 11px; color: var(--muted); }

.shell { max-width: 1440px; margin: 0 auto; padding: 24px; }

.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; }

.page-head h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }

.page-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 720px; }

.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: transform .12s, box-shadow .15s, background .15s;
  white-space: nowrap;
}

.btn:hover { background: #fbfcfe; }

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 14px 24px -18px rgba(15, 23, 42, .85);
}

.btn-primary:hover { background: var(--navy-deep); }

.btn-emerald { background: var(--emerald); border-color: var(--emerald); color: #fff; }

.btn-emerald:hover { background: #0ea271; }

.btn-ghost { background: transparent; }

.btn-danger { color: #b42318; border-color: #f3d3d3; background: #fff6f6; }

.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }

.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-head h3 { margin: 0; font-size: 15px; }

.card-head .sub { color: var(--muted); font-size: 12.5px; }

.card-body { padding: 18px 20px; }

/* ---------- выбор оборудования ---------- */
.eq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.eq-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .18s, transform .15s;
}

.eq-card:hover { box-shadow: 0 16px 30px -24px rgba(15, 23, 42, .7); transform: translateY(-1px); }

.eq-card.active { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(30, 41, 59, .12); }

.eq-code {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: #eef2f8;
  border-radius: 6px;
  padding: 2px 7px;
  margin-bottom: 8px;
}

.eq-card.active .eq-code { background: var(--navy); color: #fff; }

.eq-brand { font-size: 15px; font-weight: 700; }

.eq-model { font-size: 12px; color: var(--muted); margin-top: 2px; }

.eq-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 8px; }

/* ---------- переключатель режима ---------- */
.mode-switch {
  display: inline-flex;
  background: #eef2f8;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.mode-switch button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.mode-switch button span.tag {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.mode-switch button.active { background: #fff; color: var(--navy); box-shadow: 0 6px 14px -10px rgba(15, 23, 42, .6); font-weight: 600; }

/* ---------- раскладка ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

.col-side { display: grid; gap: 14px; }

/* ---------- чек-лист ---------- */
.checklist-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px 10px; }

.checklist-top h3 { margin: 0; font-size: 16px; }

.checklist-top .sub { font-size: 12.5px; color: var(--muted); }

.progress-strip { padding: 0 20px 14px; }

.progress-bar { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }

.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, var(--emerald)); transition: width .2s; }

.progress-text { font-size: 12px; color: var(--muted); margin-top: 6px; }

.acc { border-top: 1px solid var(--line-soft); }

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.acc-head:hover { background: #fbfcfe; }

.acc-num { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.acc-name { font-weight: 600; font-size: 13.5px; }

.acc-count { margin-left: auto; font-size: 11.5px; color: var(--emerald-dark); background: #ecfdf5; border-radius: 999px; padding: 2px 8px; }

.acc-body { padding: 0 20px 14px 20px; display: none; }

.acc.open .acc-body { display: block; }

.acc-tools { display: flex; gap: 8px; margin-bottom: 8px; }

.item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.item:hover { background: #f8fbff; }

.item input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--emerald); }

.item.done { color: var(--ink); }

.item.done span { text-decoration: none; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }

table.grid th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  background: #f7fafd;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }

table.grid tr:hover td { background: #fbfcfe; }

table.grid td.actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--navy);
}

.badge.green { background: #ecfdf5; color: var(--emerald-dark); }

.badge.red { background: #fef4f4; color: #b42318; }

.badge.amber { background: #fff8eb; color: #b45309; }

.badge.blue { background: #eff6ff; color: #1d4ed8; }

.muted { color: var(--muted); }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- формы в модалке ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  overflow-y: auto;
  z-index: 60;
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 660px;
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .8);
  overflow: hidden;
}

.modal-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; }

.modal-head h3 { margin: 0; font-size: 17px; }

.modal-head .close { margin-left: auto; border: 0; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; }

.modal-body { padding: 18px 22px; max-height: 62vh; overflow-y: auto; }

.modal-foot { padding: 14px 22px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line-soft); }

/* ---------- редактор шаблона ---------- */
.tpl-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

.tpl-cat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fbfcfe; }

.tpl-cat-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

.tpl-cat-head input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

.tpl-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }

.tpl-item textarea {
  flex: 1;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  resize: vertical;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-btn:hover { color: var(--red); border-color: #f3d3d3; background: #fff6f6; }

/* ---------- уведомления ---------- */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  z-index: 90;
}

.toast {
  background: var(--navy);
  color: #fff;
  padding: 11px 15px;
  border-radius: 11px;
  box-shadow: 0 18px 30px -20px rgba(15, 23, 42, .9);
  font-size: 13px;
  max-width: 360px;
}

.toast.ok { background: #0d7a56; }

.toast.warn { background: #b45309; }

.toast.err { background: #b42318; }

/* ---------- оверлей экспорта ---------- */
.export-loader {
  position: fixed;
  inset: 0;
  background: rgba(244, 247, 251, .92);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 80;
  font-size: 14px;
  color: var(--text);
}

body.exporting .export-loader { display: flex; }

body.exporting #app { display: none; }

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: var(--emerald);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- отчёт (A4, для PDF) ---------- */
.report-stage { position: absolute; left: -20000px; top: 0; }

#report {
  width: 794px;
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  font-size: 10.5px;
  line-height: 1.55;
}

.rep-head {
  background: #1e293b;
  color: #fff;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 3px solid #10b981;
}

.rep-kicker { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #9fb0c8; font-weight: 600; }

.rep-brand { font-size: 23px; font-weight: 700; margin-top: 6px; line-height: 1.2; }

.rep-model { font-size: 10.5px; color: #c9d5e6; margin-top: 3px; }

.rep-head-right { text-align: right; flex: 0 0 auto; }

.rep-no-label { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: #9fb0c8; }

.rep-no { font-size: 11.5px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.rep-date { font-size: 10px; color: #c9d5e6; margin-top: 6px; font-variant-numeric: tabular-nums; }

.rep-section { margin-top: 14px; }

.rep-bar {
  background: #1e293b;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 7px 12px 7px 13px;
  box-shadow: inset 4px 0 0 #10b981;
}

.rep-table { width: 100%; border-collapse: collapse; font-size: 10px; }

.rep-table th {
  text-align: left;
  font-weight: 500;
  color: #5b6b85;
  background: #f1f7fd;
  padding: 6px 10px;
  border: 1px solid #dde8f4;
  width: 32%;
}

.rep-table td { padding: 6px 10px; border: 1px solid #dde8f4; font-weight: 600; color: #17233a; }

.rep-works { padding: 2px 0 0; }

.rep-cat { margin-top: 11px; }

.rep-cat:first-child { margin-top: 8px; }

.rep-cat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #1e293b;
  padding: 5px 9px;
  background: #f2f7fe;
  border-left: 3px solid #3b82f6;
  border-bottom: 1px solid #dbe7f6;
}

.rep-cat-num { color: #a8b5c6; font-variant-numeric: tabular-nums; font-size: 9.5px; }

.rep-cat-count { margin-left: auto; font-size: 8.5px; font-weight: 600; color: #047857; background: #ecfdf5; border-radius: 999px; padding: 1px 7px; }

.rep-list { list-style: none; margin: 5px 0 0; padding: 0; }

.rep-list li { display: flex; gap: 7px; padding: 2.5px 0; font-size: 10px; color: #334155; line-height: 1.5; }

.rep-tick {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 3.5px;
  background: #10b981;
  color: #fff;
  font-size: 8px;
  line-height: 12px;
  text-align: center;
  font-weight: 700;
  margin-top: 2px;
}

.rep-box { flex: 0 0 12px; width: 12px; height: 12px; border: 1px solid #93a3b8; border-radius: 2px; background: #fff; margin-top: 2px; }

.rep-sign { width: 100%; border-collapse: collapse; table-layout: fixed; }

.rep-sign td { width: 50%; vertical-align: top; padding: 12px 20px 14px 0; }

.rep-sign td + td { padding-right: 0; padding-left: 20px; }

.rep-sign-label { font-size: 9.5px; color: #475569; }

.rep-sign-item { margin-top: 15px; }

.rep-sign-label + .rep-sign-item { margin-top: 6px; }

.rep-sign-line { border-bottom: 1px solid #94a3b8; height: 22px; }

.rep-sign-name { font-size: 10px; font-weight: 600; margin-top: 4px; min-height: 13px; color: #17233a; }

.rep-sign-cap { font-size: 8px; color: #a6b3c4; margin-top: 1px; }

.rep-sign-date { font-size: 9.5px; color: #475569; padding-top: 6px; }

.rep-sign-date strong { color: #17233a; font-weight: 600; font-variant-numeric: tabular-nums; }

.rep-note { font-size: 10px; color: #3f4d63; padding: 9px 11px; border: 1px solid #dde8f4; border-top: 0; background: #f8fbff; line-height: 1.55; }

.rep-doc { margin-top: 16px; background: #f5f9ff; border: 1px solid #dbe7f6; border-top: 2px solid #3b82f6; padding: 10px 13px; }

.rep-doc-title { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: #64748b; font-weight: 600; margin-bottom: 6px; }

.rep-doc-row { display: flex; gap: 10px; font-size: 9.5px; color: #475569; padding: 1.5px 0; }

.rep-doc-row span { flex: 0 0 120px; color: #94a3b8; }

.rep-doc-row b { font-weight: 600; color: #334155; font-variant-numeric: tabular-nums; }

.rep-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 8px; color: #94a3b8; text-align: center; }

.rep-verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #fbfcfe;
  color: #334155;
}

.rep-verdict.ok { background: #edfdf5; border-color: #b9ebd6; border-left: 3px solid #10b981; color: #0d7a56; }

.rep-verdict.fail { background: #fef4f4; border-color: #f7d4d4; border-left: 3px solid #ef4444; color: #b42318; }

.rep-verdict-mark {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
}

.rep-verdict.fail .rep-verdict-mark { background: #ef4444; }

.rep-blank .rep-list li { padding: 4px 0; }

.rep-blank .rep-box { flex: 0 0 13px; width: 13px; height: 13px; border-color: #7d8b9c; }

.rep-blank .rep-table th { width: 34%; }

.rep-ruled {
  border: 1px solid #e2e8f0;
  border-top: 0;
  padding: 8px 12px 22px;
  background: repeating-linear-gradient(#fff 0 21px, #eef2f7 21px 22px);
  min-height: 96px;
}

.rep-legend {
  font-size: 8.5px;
  color: #7c8899;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: 0;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rep-empty { padding: 10px 12px; font-size: 10px; color: #64748b; background: #fbfcfe; border: 1px solid #e2e8f0; border-top: 0; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { padding: 16px; }
  .topbar-inner { padding: 10px 14px; flex-wrap: wrap; }
  .nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
  .eq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-side { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .page-head .actions { margin-left: 0; }
  .user-name { max-width: 90px; }
  .role-badge { display: none; }
}

@media (max-width: 520px) {
  .eq-grid { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 20px; }
}

/* ---------- дашборд ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue);
}

.kpi.value-emerald { border-top-color: var(--emerald); }
.kpi.value-navy { border-top-color: var(--navy); }
.kpi.value-amber { border-top-color: var(--amber); }
.kpi.value-red { border-top-color: var(--red); }

.kpi-label { font-size: 12px; color: var(--muted); }

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 6px 2px 0;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }

.chart-col .bar {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  border-radius: 6px 6px 2px 2px;
  min-height: 3px;
  transition: height .2s;
}

.chart-col.zero .bar { background: #e2e8f0; }

.chart-col .value { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }

.chart-col .label { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

.mode-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }

.mode-row .mode-name { flex: 0 0 64px; color: var(--text); font-weight: 600; }

.mode-row .mode-track { flex: 1; height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }

.mode-row .mode-fill { height: 100%; border-radius: 999px; background: var(--blue); }

.mode-row .mode-fill.green { background: var(--emerald); }

.mode-row .mode-count { flex: 0 0 32px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.dash-list { display: grid; gap: 8px; }

.dash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 12.8px;
}

.dash-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: 0 0 8px; }

.dash-item.red .dot { background: var(--red); }

.dash-item .who { font-weight: 600; }

.dash-item .what { color: var(--muted); }

.dash-item .when { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

.dash-item.red .when { color: #b42318; }

.dash-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ---------- печатный отчёт-дашборд ---------- */
.dash-report .rep-head { border-bottom: 3px solid #3b82f6; }

.dash-kpi-table { width: 100%; border-collapse: collapse; font-size: 10px; }

.dash-kpi-table td {
  border: 1px solid #dde8f4;
  padding: 8px 10px;
  vertical-align: top;
  width: 25%;
}

.dash-kpi-table .kpi-title { font-size: 8.5px; color: #64748b; text-transform: uppercase; letter-spacing: .08em; }

.dash-kpi-table .kpi-number { font-size: 18px; font-weight: 700; color: #17233a; margin-top: 3px; }

.dash-kpi-table .kpi-note { font-size: 8.5px; color: #94a3b8; margin-top: 2px; }

.dash-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 8px 10px 0; border: 1px solid #dde8f4; border-top: 0; }

.dash-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }

.dash-chart .col i { width: 100%; max-width: 26px; background: #3b82f6; border-radius: 3px 3px 0 0; display: block; }

.dash-chart .col.zero i { background: #e2e8f0; }

.dash-chart .col span { font-size: 7.5px; color: #94a3b8; margin-top: 4px; }

.dash-chart .col b { font-size: 8px; color: #475569; font-weight: 600; margin-bottom: 3px; }

