/* =========================================================
   PAN · реестр компьютеров
   ========================================================= */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #5b6b82;
  --muted: #5f6f85;
  --line: #e7ebf3;
  --line-strong: #d7deea;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --indigo: #4f46e5;
  --navy: #0b1220;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 16px;
  --font: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, Arial, sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 10px 30px -18px rgba(15, 23, 42, .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: #dbeafe; color: #1e3a8a; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  max-width: 1560px;
  height: 66px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .65);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 10px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-top: 1px; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  transition: .15s ease;
}
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { color: var(--text); background: #f1f5f9; }
.nav-link.active { color: #1e40af; background: #eef2ff; }
.nav-export { margin-left: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--text-2); }
.nav-export:hover { border-color: #bfdbfe; color: var(--brand); background: #f8fbff; }

/* ---------- Общий каркас ---------- */
.page { max-width: 1560px; margin: 0 auto; padding: 26px 28px 48px; }
.footer {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.footer-brand { font-weight: 800; letter-spacing: .08em; color: #94a3b8; margin-right: 7px; }
.footer-dot { margin: 0 6px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.mono { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: -.01em; }
.muted { color: var(--muted); }

/* ---------- Уведомления ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .25s ease both;
}
.flash svg { width: 18px; height: 18px; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-close {
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: currentColor;
  opacity: .5;
}
.flash-close:hover { opacity: 1; }
.flash.is-hiding { opacity: 0; transform: translateY(-4px); transition: .25s ease; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: .16s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: #c3ccdb; color: var(--text); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .85);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: #1e40af;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .95);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(220, 38, 38, .85);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(220, 38, 38, .95);
}
.btn-light { background: #fff; border-color: #fff; color: #0f172a; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
.btn-light:hover { background: #f8fafc; border-color: #f8fafc; color: #0f172a; }
.btn-glass { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .2); color: #e2e8f0; backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .36); color: #fff; }
.btn-dark { background: #0f172a; border-color: #0f172a; color: #fff; }
.btn-dark:hover { background: #1e293b; border-color: #1e293b; color: #fff; }
.btn-danger-ghost { color: #b91c1c; border-color: #fecaca; background: #fff; }
.btn-danger-ghost:hover { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 38px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(1000px 500px at 92% -30%, rgba(79, 70, 229, .55), transparent 62%),
    radial-gradient(650px 380px at 70% 140%, rgba(14, 165, 233, .24), transparent 64%),
    linear-gradient(120deg, #090f1c 0%, #0f1a30 55%, #14264a 100%);
  box-shadow: 0 30px 60px -42px rgba(15, 23, 42, .9);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(700px 430px at 78% 20%, #000 20%, transparent 75%);
}
.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -190px;
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, .2);
  box-shadow: 0 0 0 45px rgba(148, 163, 184, .045), 0 0 0 90px rgba(148, 163, 184, .03);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #93c5fd;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
  animation: pulse 2s infinite;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.03em;
}
.hero-copy { min-width: 0; max-width: 100%; }
.hero-copy p { margin: 0; max-width: 700px; color: #a9b7cd; font-size: 14.5px; line-height: 1.6; }
.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 20px;
  color: #8fa0b9;
  font-size: 12px;
}
.hero-meta strong { color: #e2e8f0; font-size: 13px; font-weight: 650; }
.meta-sep { width: 1px; height: 12px; background: rgba(148, 163, 184, .28); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; padding-bottom: 2px; }
.hero + .toolbar-panel,
.hero + .stats-grid,
.hero + .panel,
.hero + .warehouse-cards,
.hero + .detail-layout,
.hero + .form-layout,
.hero + .alert { margin-top: 16px; }

/* ---------- Сводка ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: .18s ease;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: transparent;
  transition: .18s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #d7e2f5; box-shadow: var(--shadow); }
.stat-card:hover::after { background: var(--brand); }
.stat-card.is-active { border-color: #bfdbfe; box-shadow: 0 0 0 3px rgba(37, 99, 235, .07), var(--shadow-sm); }
.stat-card.is-active::after { background: var(--brand); }
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #eef2ff;
  color: #4f46e5;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 750; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 2px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.stat-hint { margin-left: auto; color: var(--muted); font-size: 10.5px; line-height: 1.3; text-align: right; }
.stat-issued .stat-icon { background: #ecfdf5; color: #059669; }
.stat-issued:hover::after { background: #10b981; }
.stat-free .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-free:hover::after { background: #3b82f6; }
.stat-attention .stat-icon { background: #fff7ed; color: #d97706; }
.stat-attention:hover::after { background: #f59e0b; }
.stat-total .stat-icon { background: #f1f5f9; color: #475569; }

/* ---------- Панель фильтров ---------- */
.toolbar-panel { padding: 14px 16px; margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.search-box { position: relative; flex: 1; min-width: 260px; display: flex; align-items: center; }
.search-box > svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 88px 0 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  outline: none;
  transition: .15s ease;
}
.search-box input:focus { background: #fff; border-color: #93b4fb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.search-box input::placeholder { color: #64748b; }
.search-box kbd {
  position: absolute;
  right: 10px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  pointer-events: none;
}
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select {
  appearance: none;
  height: 42px;
  min-width: 160px;
  max-width: 250px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
}
.select-wrap select:focus { background: #fff; border-color: #93b4fb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid #64748b;
  border-bottom: 1.6px solid #64748b;
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}
.select-block { width: 100%; }
.select-block select { width: 100%; max-width: none; }
.btn-reset { min-height: 42px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--text-3); box-shadow: none; }
.btn-reset:hover { background: #f1f5f9; border-color: transparent; color: var(--text-2); box-shadow: none; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.result-count strong { color: var(--text); font-weight: 700; }

/* ---------- Таблица ---------- */
.table-panel { overflow: hidden; }
.table-scroll {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 245px);
  min-height: 380px;
}
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border: 2px solid #f8fafc; border-radius: 99px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.pc-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12.5px;
}
.pc-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #5f6f85;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}
.pc-table th.sortable { cursor: pointer; }
.pc-table th.sortable:hover { background: #f1f5fb; color: var(--text-2); }
.pc-table th.sortable::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .3;
  vertical-align: middle;
}
.pc-table th.sorted-asc::after {
  border-top: 0;
  border-bottom: 4px solid var(--brand);
  opacity: 1;
}
.pc-table th.sorted-desc::after { border-top-color: var(--brand); opacity: 1; }
.pc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f8;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  transition: background .1s ease;
}
.pc-row { cursor: pointer; }
.pc-row:hover td { background: #f6f9ff; }
.pc-row:focus-visible { outline: none; }
.pc-row:focus-visible td { background: #eff6ff; box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe; }
.sticky-col { position: sticky; left: 0; z-index: 5; }
th.sticky-col { z-index: 12; background: #f8fafc; border-right: 1px solid #f1f5f9; }
td.sticky-col { background: #fff; border-right: 1px solid #f1f5f9; }
.pc-row:hover .sticky-col { background: #f6f9ff; }
.pc-row:focus-visible .sticky-col { background: #eff6ff; }
.th-pan { width: 100px; }
.th-status { width: 138px; }
.th-user { width: 152px; }
.th-project { width: 120px; }
.th-model { width: 545px; }
.th-sn { width: 145px; }
.td-pan { white-space: nowrap; }
.pan-link {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef2ff;
  color: #1d4ed8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: .14s ease;
}
.pan-link:hover { background: #dbeafe; color: #1e40af; }
.user-inline { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid hsl(var(--hue) 60% 85%);
  background: hsl(var(--hue) 70% 93%);
  color: hsl(var(--hue) 50% 30%);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .02em;
}
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.td-model { color: var(--text-2); }

/* ---------- Статусы ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(255, 255, 255, .65); }
.badge-lg { padding: 5px 10px; font-size: 12px; gap: 7px; }
.status-issued { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.status-free { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.status-repair { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.status-retired { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.status-burned { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ---------- Пустое состояние ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 20px; text-align: center; }
.empty-icon { width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #94a3b8; }
.empty-icon svg { width: 26px; height: 26px; }
.empty-state h3 { margin: 0 0 4px; font-size: 16px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fcfdff;
  color: var(--muted);
  font-size: 11.5px;
}
.table-footer strong { color: var(--text-2); }
.table-tip { display: flex; align-items: center; gap: 4px; }
.table-tip svg { width: 13px; height: 13px; }

/* ---------- Пагинация ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdff;
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.pagination-link:hover { border-color: var(--brand); color: var(--brand); }
.pagination-link.is-current {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.pagination-link.is-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.pagination-gap { padding: 0 4px; color: var(--muted); }
.pagination-status { margin-left: auto; color: var(--muted); font-size: 11.5px; }
html[data-theme="dark"] .pagination { background: #0c1526; }
html[data-theme="dark"] .pagination-link { background: #111d31; }

/* ---------- Хлебные крошки и заголовки ---------- */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--text-3); font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs svg { width: 12px; height: 12px; opacity: .5; }
.breadcrumbs span { color: var(--text-2); font-weight: 600; }

/* ---------- Карточка ПК ---------- */
.pc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 0 2px 20px; }
.pc-header-main { min-width: 0; }
.pc-ident { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.pc-pan {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid #dbe4ff;
  border-radius: 7px;
  background: #eef2ff;
  color: #1d4ed8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .03em;
}
.pc-header h1 { max-width: 1000px; margin: 0 0 10px; font-size: clamp(21px, 2.3vw, 29px); font-weight: 750; line-height: 1.25; letter-spacing: -.025em; }
.pc-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--text-3); font-size: 12px; }
.pc-sub-item { display: inline-flex; align-items: center; gap: 5px; }
.pc-sub-item svg { width: 14px; height: 14px; color: var(--muted); }
.pc-sub-item.mono { font-size: 11px; }
.pc-header-actions { display: flex; gap: 8px; flex-shrink: 0; padding-top: 4px; }
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 346px; gap: 16px; align-items: start; }
.card-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-side { min-width: 0; }
.card-side-inner { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 16px; }
.card-main .panel { padding: 22px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.section-sub { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.panel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.panel h3 { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; }

/* Закрепление */
.current-user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dbe7fb;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #eef4ff 70%, #e8f0ff);
}
.avatar-xl {
  width: 56px;
  height: 56px;
  border: 1px solid hsl(var(--hue) 60% 85%);
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: hsl(var(--hue) 72% 92%);
  color: hsl(var(--hue) 55% 30%);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: .02em;
}
.avatar-empty { border: 1.5px dashed #cbd5e1; background: #fff; color: #94a3b8; }
.avatar-empty svg { width: 24px; height: 24px; }
.current-user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.small-label { margin-bottom: 2px; color: #7c8ba1; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.current-user-info strong { font-size: 19px; line-height: 1.25; letter-spacing: -.02em; }
.current-user-note { margin-top: 2px; color: #7c8ba1; font-size: 11.5px; }
.current-user-card .badge { margin-left: auto; }
.current-user-card.is-empty { border-style: dashed; border-color: #dbe3ef; background: linear-gradient(135deg, #fbfcfe, #f4f7fb); }
.previous-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.history-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.history-head h3 { margin: 0; color: #64748b; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 700;
}
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 5px; width: 1px; background: #e2e8f0; }
.timeline li { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 5px 0 5px 20px; font-size: 13px; }
.timeline-dot {
  position: absolute;
  top: 11px;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.timeline li:first-child .timeline-dot { background: #3b82f6; box-shadow: 0 0 0 1px #bfdbfe; }
.timeline-main { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.timeline-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.timeline-name { color: var(--text-2); font-weight: 600; }
.timeline-periods { color: var(--muted); font-size: 10.5px; line-height: 1.45; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.timeline-label { color: var(--muted); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; }
.empty-note {
  margin: 18px 0 0;
  padding: 11px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}
.empty-note-ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
html[data-theme="dark"] .empty-note-ok { border-color: #1f5e42; background: #0e2b1e; color: #6ee7b7; }

/* Детали */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 0; }
.detail { min-width: 0; }
.detail.wide { grid-column: 1 / -1; }

/* Характеристики ПК: колонки заполняются без пустых промежутков между строками */
.hardware-panel .details-grid { display: block; columns: 2; column-gap: 24px; }
.hardware-panel .details-grid .detail { margin: 0 0 18px; break-inside: avoid; }
.hardware-panel .details-grid .detail:last-child { margin-bottom: 0; }
.detail dt { margin-bottom: 4px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.detail dd { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.detail dd.mono { font-size: 11.5px; }
.detail dd.money { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.detail dd .detail-line { display: block; }
/* Мониторы: модель, разрешение и серийный номер выровнены в колонки */
.detail dd .monitor-list {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content minmax(0, 1fr);
  column-gap: 3px;
  row-gap: 2px;
  align-items: baseline;
}
.detail dd .monitor-list > span { min-width: 0; }
.detail dd .monitor-model { overflow-wrap: anywhere; }
.detail dd .monitor-resolution,
.detail dd .monitor-serial { white-space: nowrap; }
.detail dd .monitor-sep { color: var(--muted); }
.detail dd .monitor-span { grid-column: 1 / -1; }
@media (max-width: 420px) {
  .detail dd .monitor-list { grid-template-columns: minmax(0, 1fr); }
  .detail dd .monitor-sep { display: none; }
  .detail dd .monitor-resolution,
  .detail dd .monitor-serial { white-space: normal; }
  .detail dd .monitor-serial { margin-bottom: 4px; }
  .detail dd .monitor-serial:last-child { margin-bottom: 0; }
}
.detail dd .detail-note { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.total-highlight { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 6px 11px; border: 1px solid #d1fae5; border-radius: 9px; background: #f0fdf4; }
.total-highlight span { color: #059669; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.total-highlight strong { color: #047857; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Журнал */
.event-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.event-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.event-list li:first-child { padding-top: 0; }
.event-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.event-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: #eff6ff; color: #2563eb; }
.event-icon svg { width: 14px; height: 14px; }
.event-status { background: #fff7ed; color: #d97706; }
.event-user { background: #eff6ff; color: #2563eb; }
.event-created { background: #ecfdf5; color: #059669; }
.event-updated { background: #f1f5f9; color: #475569; }
.event-body p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.event-body time { color: var(--muted); font-size: 10.5px; }
.empty-inline { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: 11px; background: #fafbfd; }
.empty-inline > svg { width: 20px; height: 20px; margin-top: 1px; color: #94a3b8; flex-shrink: 0; }
.empty-inline strong { font-size: 12.5px; }
.empty-inline p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* Боковая колонка карточки */
.card-side .panel { padding: 20px; }
.documents-panel .document-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.document-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.document-title { color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.3; }
.document-meta { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.document-row .btn { flex-shrink: 0; }
.btn-word { width: 40px; min-width: 40px; padding: 0; }
.btn-word svg { width: 20px; height: 20px; }
.document-package {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  transition: color .16s ease;
}
.document-package svg { width: 14px; height: 14px; color: var(--muted); transition: color .16s ease; }
.document-package:hover { color: var(--brand); }
.document-package:hover svg { color: var(--brand); }
.side-details { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.side-details dt { margin-bottom: 2px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-details dd { margin: 0; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.divider { height: 1px; margin: 15px 0; background: var(--line); }
.status-display { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 13px; border: 1px solid; border-radius: 11px; }
.status-display-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255, 255, 255, .6); }
.status-display > div { display: flex; flex-direction: column; min-width: 0; }
.status-display strong { font-size: 13px; line-height: 1.3; }
.status-display span { font-size: 10px; line-height: 1.3; opacity: .75; }
.status-form label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.status-form .select-block { margin-bottom: 10px; }
.panel-hint { margin: 10px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.note-panel { border-color: #fde68a; background: linear-gradient(135deg, #fffbeb, #fff7ed); }
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-head h3 { margin: 0; }
.note-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #fef3c7; color: #b45309; }
.note-icon svg { width: 14px; height: 14px; }
.note-panel p { margin: 0; color: #92400e; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }

/* ---------- Модальное окно ---------- */
.modal {
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(2, 6, 23, .55);
}
.modal[open] { animation: modalIn .18s ease both; }
.modal::backdrop { background: rgba(8, 15, 30, .55); backdrop-filter: blur(4px); }
.modal form { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #fff;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
}
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.modal-note { margin-bottom: 14px; padding: 10px 11px; border: 1px solid #fde68a; border-radius: 9px; background: #fffbeb; color: #92400e; font-size: 11.5px; line-height: 1.5; }
.modal .field { margin-bottom: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Формы ---------- */
.form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 0 2px 20px; }
.form-header h1 { margin: 0 0 6px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 750; letter-spacing: -.025em; }
.form-header p { margin: 0; max-width: 800px; color: var(--text-3); font-size: 13px; }
.form-header-badge { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.alert { display: flex; gap: 11px; margin-bottom: 16px; padding: 13px 15px; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.alert > svg { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }
.alert-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.alert strong { display: block; margin-bottom: 3px; font-size: 12.5px; }
.alert ul { margin: 0; padding-left: 16px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-section { padding: 24px; }
.form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.section-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
}
.form-section-head h2 { margin: 1px 0 2px; font-size: 15px; letter-spacing: -.01em; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 18px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { margin-bottom: 6px; color: #334155; font-size: 11.5px; font-weight: 650; }
.field > span b { color: #dc2626; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: .15s ease;
}
.field input { height: 41px; padding: 0 11px; }
.field textarea { min-height: 64px; padding: 10px 11px; line-height: 1.5; resize: vertical; }
.field select { height: 41px; padding: 0 34px 0 11px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #93b4fb; box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .09); }
.field input::placeholder, .field textarea::placeholder { color: #64748b; }
.field small { margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.field .mono { font-family: var(--font-mono); }
.form-side { min-width: 0; }
.form-side-inner { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 16px; }
.form-side .panel { padding: 20px; }
.form-actions-panel .panel-hint { margin: 0 0 14px; }
.form-actions-panel .btn-block + .btn-block { margin-top: 8px; }
.form-actions-panel .side-details { margin-bottom: 16px; }
.form-actions-panel .btn-block + .panel-hint { margin: 12px 0 0; }
.form-preview h3, .form-help h3 { font-size: 12.5px; }
.preview-user, .preview-empty { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.preview-user strong, .preview-empty strong { display: block; font-size: 13px; }
.preview-user > div > span, .preview-empty > div > span { display: block; color: var(--muted); font-size: 10.5px; }
.avatar-sm {
  width: 34px;
  height: 34px;
  border: 1px solid hsl(var(--hue) 55% 86%);
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: hsl(var(--hue) 70% 93%);
  color: hsl(var(--hue) 50% 30%);
  font-size: 11px;
  font-weight: 750;
}
.avatar-sm.avatar-empty { border: 1px dashed #cbd5e1; background: #fff; color: var(--muted); }
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 10.5px; }
.preview-meta > span:first-child { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.form-help ul { margin: 8px 0 0; padding: 0 0 0 16px; color: var(--text-3); font-size: 11px; line-height: 1.55; }
.form-help li + li { margin-top: 6px; }

/* ---------- 404 ---------- */
.not-found { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.not-found-code {
  font-size: 88px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.07em;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.not-found h1 { margin: 10px 0 6px; font-size: 24px; }
.not-found p { margin: 0 0 20px; color: var(--muted); }

/* ---------- Анимации ---------- */
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1200px) {
  .page { padding: 22px 20px 40px; }
  .topbar-inner { padding: 0 20px; }
  .footer { padding: 0 20px 24px; }
  .card-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .stat-hint { display: none; }
}
@media (max-width: 1040px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 24px; padding: 30px; }
  .card-layout { grid-template-columns: 1fr; }
  .card-side-inner { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .form-layout { grid-template-columns: 1fr; }
  .form-side-inner { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .form-actions-panel { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 30px; }
  .toolbar .search-box { flex-basis: 100%; }
  .toolbar .select-wrap { flex: 1 1 calc(50% - 5px); }
  .select-wrap select { width: 100%; min-width: 0; max-width: none; }
  .result-count { width: 100%; margin-left: 0; }
  .card-side-inner { grid-template-columns: 1fr; }
  .form-side-inner { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .current-user-card { align-items: flex-start; flex-wrap: wrap; }
  .current-user-card .badge { margin-left: 0; }
  .pc-header { flex-direction: column; }
  .pc-header-actions { width: 100%; flex-wrap: wrap; }
  .pc-header-actions .btn { flex: 1 1 120px; }
  .table-scroll { max-height: 65vh; }
}
@media (max-width: 600px) {
  .topbar-inner { height: auto; min-height: 60px; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .brand-text small { display: none; }
  .main-nav { width: 100%; overflow: auto; }
  .nav-link { padding: 7px 9px; font-size: 12px; }
  .nav-export { margin-left: auto; }
  .page { padding: 16px 12px 32px; }
  .main-nav { flex-wrap: wrap; overflow: visible; }
  .nav-export { margin-left: 0; }
  .hero { padding: 24px 20px; border-radius: 18px; }
  .hero-copy { width: 100%; }
  .hero-meta { gap: 9px; font-size: 11px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 144px; min-width: 0; }
  .stats-grid { gap: 10px; }
  .stat-card { gap: 10px; padding: 13px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 9px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10.5px; }
  .panel { padding: 16px; border-radius: 13px; }
  .toolbar-panel { padding: 12px; }
  .search-box input { padding-right: 12px; }
  .search-box kbd { display: none; }
  .toolbar { gap: 8px; }
  .btn-reset { width: 42px; padding: 0; flex-shrink: 0; }
  .btn-reset span { display: none; }
  .footer { flex-direction: column; gap: 6px; padding: 0 14px 24px; }
  .pc-header h1 { font-size: 21px; }
  .pc-sub { gap: 10px; }
  .current-user-info strong { font-size: 17px; }
  .avatar-xl { width: 48px; height: 48px; font-size: 16px; }
  .details-grid { gap: 14px 18px; }
  .hardware-panel .details-grid { columns: 1; }
  .hardware-panel .details-grid .detail { margin-bottom: 14px; }
  .section-head { flex-direction: column; gap: 10px; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { flex: 1; }
  .panel-actions form { flex: 1; }
  .panel-actions form .btn { width: 100%; }
  .event-list li { padding: 10px 0; }
  .modal form { padding: 20px; }
  .form-header { flex-direction: column; gap: 10px; }
  .form-header-badge { padding-top: 0; }
  .form-section { padding: 18px; }
  .form-section-head { margin-bottom: 16px; }
  .form-grid { gap: 14px; }
  .breadcrumbs { font-size: 11px; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; font-size: 11px; }
  .topbar, .footer, .flash-stack, .breadcrumbs, .pc-header-actions, .panel-actions,
  .status-form, .panel-hint, .table-tip, .no-print { display: none !important; }
  .page { max-width: none; padding: 0; }
  .pc-header { padding: 0 0 14px; margin-bottom: 16px; border-bottom: 2px solid #0f172a; }
  .pc-header h1 { font-size: 20px; }
  .card-layout { display: block; }
  .card-main, .card-side { display: block; }
  .card-side-inner { position: static; display: block; }
  .card-main .panel, .card-side .panel {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    break-inside: avoid;
  }
  .current-user-card { background: #f8fafc !important; }
  .event-list li { break-inside: avoid; }
  a { color: #0f172a; }
}

/* =========================================================
   Раздел «Склад»
   ========================================================= */
.nav-settings {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text-2);
  transition: .16s ease;
}
.nav-settings:hover {
  border-color: #bfdbfe;
  color: var(--brand);
  background: var(--surface-soft);
}
.nav-settings .nav-settings-label { display: none; }
.nav-trash {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text-2);
  transition: .16s ease;
}
.nav-trash:hover {
  border-color: #bfdbfe;
  color: var(--brand);
  background: var(--surface-soft);
}
.nav-trash .nav-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  margin-left: 0;
  padding: 0 4px;
  border: 2px solid var(--surface);
  font-size: 9px;
  line-height: 1;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 2px 2px 20px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 750; line-height: 1.15; letter-spacing: -.03em; }
.page-head p { max-width: 820px; margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.55; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.eyebrow-dark { color: #64748b; margin-bottom: 9px; }
.hero-compact { padding: 30px 34px; }

/* ---------- Обзор ---------- */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; margin-top: 16px; }
.dashboard-main, .dashboard-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dashboard-main .panel, .dashboard-side .panel { padding: 20px; }
.compact-list { display: flex; flex-direction: column; }
.compact-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; transition: .14s ease; }
.compact-row:last-child { border-bottom: 0; padding-bottom: 0; }
.compact-row:hover .compact-main strong { color: var(--brand); }
.compact-icon { flex-shrink: 0; width: 72px; }
.compact-icon .badge { width: 100%; justify-content: center; }
.compact-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.compact-main strong { font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-main small { margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.compact-value { font-size: 11.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.compact-arrow { width: 14px; height: 14px; color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; transition: .16s ease; }
.quick-card:hover { border-color: #bfdbfe; background: #f8fbff; transform: translateY(-1px); }
.quick-icon { grid-row: 1; grid-column: 1; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.quick-icon svg { width: 15px; height: 15px; }
.quick-card strong { grid-row: 1; grid-column: 2; font-size: 12.5px; }
.quick-card > span:last-child { grid-row: 2; grid-column: 1 / -1; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.quick-blue { background: #eff6ff; color: #2563eb; }
.quick-green { background: #ecfdf5; color: #059669; }
.quick-violet { background: #f5f3ff; color: #7c3aed; }
.quick-amber { background: #fffbeb; color: #d97706; }
.warehouse-list { display: flex; flex-direction: column; }
.warehouse-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.warehouse-row:last-child { border-bottom: 0; }
.warehouse-mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(135deg, #0f172a, #334155); color: #fff; font-family: var(--font-mono); font-size: 9.5px; font-weight: 800; letter-spacing: .04em; }
.warehouse-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.warehouse-info strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-info span { color: var(--muted); font-size: 10.5px; }
.warehouse-value { color: var(--text-3); font-size: 11px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.warehouse-add { margin-top: 12px; }
.category-list { display: flex; flex-direction: column; gap: 11px; }
.category-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: var(--text-2); font-size: 11.5px; }
.category-head strong { font-variant-numeric: tabular-nums; }
.category-track { height: 6px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.category-track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #6366f1); }
.home-categories { margin-top: 16px; padding: 20px; }
.home-categories .category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 24px; }
@media (max-width: 900px) {
  .home-categories .category-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Таблицы раздела ---------- */
.data-table { width: 100%; min-width: 780px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th { position: sticky; top: 0; z-index: 5; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; color: #5f6f85; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f8; background: #fff; vertical-align: middle; }
.data-table tbody tr:hover td { background: #f6f9ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tfoot td { background: #f8fafc; border-top: 2px solid var(--line-strong); font-weight: 700; }
.table-scroll-auto { max-height: none; min-height: 0; }
.upd-table { min-width: 1060px; }
.upd-col-date { width: 100px; }
.upd-col-number { width: 150px; }
.upd-col-invoice { width: 250px; }
.upd-col-pcs { width: 290px; }
.upd-col-money { width: 120px; }
.upd-supplier { color: var(--text); font-weight: 600; }
.upd-number {
  display: inline-flex;
  padding: 2px 7px;
  border: 1px solid #dbe4ff;
  border-radius: 6px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}
.upd-invoice { color: var(--text-3); font-size: 11.5px; line-height: 1.4; }
.upd-pcs { display: flex; flex-wrap: wrap; gap: 4px; }
.upd-pcs .pan-link { padding: 2px 6px; font-size: 10.5px; }
.upd-total { color: var(--text); font-weight: 700; }
.upd-table tfoot td { font-size: 11.5px; }
.total-cell { font-weight: 750; }
.entity-link { color: #1d4ed8; font-weight: 650; }
.entity-link:hover { color: #1e40af; text-decoration: underline; }
.inline-link { color: var(--brand); font-weight: 600; }
.inline-link:hover { text-decoration: underline; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.cell-main { display: block; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 10.5px; font-weight: 650; line-height: 1.5; }
.tag-link:hover { background: #e2e8f0; color: var(--text); }
.text-green { color: #059669; font-weight: 700; }
.pre-line { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.muted-cell { max-width: 300px; color: var(--text-3); font-size: 11.5px; }
.condition-text { color: var(--text-3); font-size: 11.5px; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Складские статусы и движения ---------- */
.stock-in { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.stock-issued { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.stock-repair { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.stock-written-off { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.act-acceptance { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }
.act-return { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.act-writeoff { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.profile-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.profile-ready { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.movement-badge { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.movement-initial { background: #f0f9ff; color: #0369a1; }
.movement-issue { background: #eef2ff; color: #4338ca; }
.movement-return { background: #ecfdf5; color: #047857; }
.movement-transfer { background: #f5f3ff; color: #6d28d9; }
.movement-writeoff { background: #fef2f2; color: #b91c1c; }

/* ---------- Карточки и детали ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 346px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-main .panel { padding: 22px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side .panel { padding: 20px; }
.alert-warning { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }
.alert-warning p { margin: 0 0 5px; }
.alert-warning a { color: #b45309; text-decoration: underline; }

/* ---------- Склады ---------- */
.warehouse-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.warehouse-card { display: flex; flex-direction: column; gap: 15px; padding: 20px; transition: .16s ease; }
.warehouse-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow); transform: translateY(-2px); }
.warehouse-card-head { display: flex; align-items: flex-start; gap: 12px; }
.warehouse-mark-lg { width: 44px; height: 44px; border-radius: 12px; font-size: 11px; }
.warehouse-card-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.warehouse-card-title strong { font-size: 15px; letter-spacing: -.01em; }
.warehouse-card-title span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.warehouse-card-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.warehouse-card-stats div { display: flex; flex-direction: column; min-width: 0; }
.warehouse-card-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warehouse-card-stats span { color: var(--muted); font-size: 9.5px; }
.warehouse-card-foot { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }

/* ---------- Пустые состояния ---------- */
.empty-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 52px 20px; text-align: center; }
.empty-panel .empty-icon { width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #94a3b8; }
.empty-panel .empty-icon svg { width: 26px; height: 26px; }
.empty-panel h3 { margin: 0 0 5px; font-size: 16px; }
.empty-panel p { max-width: 460px; margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---------- Конструктор акта ---------- */
.checkbox-field { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.checkbox-field input { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
.checkbox-field > span { margin: 0; }
.checkbox-field > small { flex-basis: 100%; margin-left: 24px; }
.act-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.act-type-option { position: relative; cursor: pointer; }
.act-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.act-type-card { display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; transition: .16s ease; }
.act-type-option:hover .act-type-card { border-color: #c3d6f5; }
.act-type-option input:checked + .act-type-card { border-color: #93b4fb; background: #f8fbff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.act-type-option input:focus-visible + .act-type-card { outline: 2px solid #2563eb; outline-offset: 2px; }
.act-type-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.act-type-icon svg { width: 18px; height: 18px; }
.act-type-acceptance { background: #eef2ff; color: #4338ca; }
.act-type-return { background: #ecfdf5; color: #047857; }
.act-type-body { display: flex; flex-direction: column; gap: 2px; }
.act-type-body strong { font-size: 13.5px; }
.act-type-body span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.act-items-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.act-search { flex: 1; min-width: 220px; }
.act-search input { padding-right: 12px; }
.act-date-filter { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; }
.act-date-filter[hidden] { display: none; }
.act-date-filter-caption { color: var(--text-3); }
.act-date-filter label { display: inline-flex; align-items: center; gap: 4px; }
.act-date-filter input { width: 128px; height: 34px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 11px; }
.act-date-reset { border: 0; padding: 0; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; text-decoration: underline; }
.act-date-reset[hidden] { display: none; }
.checkline { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12px; white-space: nowrap; cursor: pointer; }
.checkline input { width: 15px; height: 15px; accent-color: var(--brand); }
.act-items-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.act-items-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px 20px; text-align: center; }
.act-items-empty .empty-icon { width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #94a3b8; }
.act-items-empty .empty-icon svg { width: 22px; height: 22px; }
.act-items-empty strong { font-size: 13.5px; }
.act-items-empty p { max-width: 430px; margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.act-items-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px 180px 100px; gap: 10px; padding: 9px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); color: #7b8aa0; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.act-items-list { max-height: 430px; overflow: auto; }
.act-item-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px 180px 100px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background .12s ease; }
.act-item-row:last-child { border-bottom: 0; }
.act-item-row:hover { background: #f8fbff; }
.act-item-row.is-selected { background: #f0f6ff; }
.act-item-row > input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.act-item-main { display: flex; flex-direction: column; min-width: 0; }
.act-item-title { color: var(--text); font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.act-item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 10.5px; }
.act-item-qty { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.act-item-qty input {
  width: 54px;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
}
.act-item-qty input:disabled { background: #f8fafc; color: #a7b3c5; border-color: #eef2f8; }
.act-item-inv { color: var(--text-3); }
.act-item-status { color: var(--text-3); font-size: 10.5px; }
.act-item-condition select { width: 100%; height: 32px; padding: 0 26px 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--text-2); font-size: 10.5px; }
.act-item-condition select:disabled { background: #f8fafc; color: #a7b3c5; border-color: #eef2f8; }
.act-item-price { text-align: right; font-size: 11.5px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.act-items-head-return, .act-item-row-return { grid-template-columns: 28px minmax(0, 1fr) 112px 90px 180px 100px; }
.act-item-issue { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: var(--text-2); font-size: 10.5px; line-height: 1.35; }
.act-item-issue-act { font-weight: 650; white-space: nowrap; }
.act-item-issue-date { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.act-item-issue.is-empty { color: var(--text-3); }
.act-picked-count { margin-left: auto; }
.act-summary .side-details { margin-bottom: 16px; }
.act-profile-warning { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #fde68a; border-radius: 9px; background: #fffbeb; color: #92400e; font-size: 11px; line-height: 1.45; }
.act-profile-warning strong { font-size: 11.5px; }
.act-profile-warning a { color: #b45309; text-decoration: underline; }
.act-summary .btn-block + .btn-block { margin-top: 8px; }
.btn.is-disabled { opacity: .55; }
.act-lines-table tfoot td { background: #f8fafc; border-top: 2px solid var(--line-strong); font-weight: 700; }

/* ---------- Адаптивность раздела ---------- */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 1040px) {
  .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .warehouse-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act-items-head, .act-item-row { grid-template-columns: 26px minmax(0, 1fr) 80px 160px 90px; }
  .act-items-head-return, .act-item-row-return { grid-template-columns: 26px minmax(0, 1fr) 100px 80px 160px 90px; }
}
@media (max-width: 820px) {
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .warehouse-cards { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .act-type-switch { grid-template-columns: 1fr; }
  .act-items-head { display: none; }
  .act-item-row {
    grid-template-columns: 26px minmax(0, 1fr) 90px;
    grid-template-areas: "check main price" "check condition condition";
    row-gap: 6px;
  }
  .act-item-row-return {
    grid-template-columns: 26px minmax(0, 1fr) 90px;
    grid-template-areas: "check main price" "check issue price" "check condition condition";
  }
  .act-item-row > input { grid-area: check; }
  .act-item-main { grid-area: main; }
  .act-item-row-return .act-item-issue { grid-area: issue; align-self: start; }
  .act-item-status { display: none; }
  .act-item-condition { grid-area: condition; }
  .act-item-price { grid-area: price; }
  .act-items-list { max-height: none; }
}
@media (max-width: 600px) {
  .page-head h1 { font-size: 24px; }
  .hero-compact { padding: 24px 20px; }
  .warehouse-card-stats { grid-template-columns: 1fr 1fr; }
  .act-items-toolbar { flex-wrap: wrap; }
  .act-search { flex-basis: 100%; }
  .act-date-filter { flex-basis: 100%; }
  .act-date-filter-caption { display: none; }
  .act-date-filter label { flex: 1; min-width: 130px; }
  .act-date-filter input { width: 100%; }
  .act-item-row { grid-template-columns: 24px minmax(0, 1fr) 76px; padding: 9px 10px; }
  .act-item-row-return { grid-template-columns: 24px minmax(0, 1fr) 76px; }
  .act-item-price { font-size: 10.5px; }
  .detail-main .panel { padding: 16px; }

  .act-lines-table { min-width: 0; }
  .act-lines-table thead,
  .act-lines-table tfoot { display: none; }
  .act-lines-table,
  .act-lines-table tbody,
  .act-lines-table tr,
  .act-lines-table td { display: block; width: 100%; }
  .act-lines-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .act-lines-table tr:last-child { border-bottom: 0; }
  .act-lines-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    padding: 4px 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .act-lines-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .act-lines-table td.num { text-align: left; }
}

/* ---------- Печать раздела ---------- */
@media print {
  .page-head-actions, .act-items-toolbar, .act-builder .form-side,
  .act-builder .form-section:first-child, .act-type-switch, .act-item-condition,
  .act-item-row > input, .checkline, .search-box, .toolbar, .stat-card::after { display: none !important; }
  .detail-layout, .dashboard-grid, .warehouse-cards { display: block; }
  .detail-main .panel, .card-side .panel, .dashboard-main .panel, .dashboard-side .panel {
    margin-bottom: 12px; padding: 14px; border: 1px solid #cbd5e1; box-shadow: none; break-inside: avoid;
  }
  .data-table { min-width: 0; }
  .data-table th, .data-table td { padding: 5px 7px; }
  .act-item-row { grid-template-columns: 26px minmax(0, 1fr) 160px 90px; }
}

/* ---------- Лицензии ---------- */
.license-key {
  word-break: break-all;
  font-size: 11.5px;
  line-height: 1.45;
}
.license-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.license-group-name {
  color: #1d4ed8;
  font-weight: 650;
}
.license-group-toggle:hover .license-group-name {
  color: #1e40af;
  text-decoration: underline;
}
.license-group-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .15s ease;
}
.license-group-toggle[aria-expanded="true"] .license-group-chevron {
  transform: rotate(180deg);
}
.license-card-row > td {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.license-card-row > td:first-child {
  box-shadow: inset 3px 0 0 #bfdbfe;
}
.license-card-row:hover > td {
  background: var(--surface);
}
.license-card-row .entity-link {
  font-size: 11.5px;
}
.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
html[data-theme="dark"] .license-group-name {
  color: #8fb4ff;
}
html[data-theme="dark"] .license-group-toggle:hover .license-group-name {
  color: #c7d7ff;
}
html[data-theme="dark"] .license-card-row > td:first-child {
  box-shadow: inset 3px 0 0 #2b4a7d;
}
.actions-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.actions-cell form {
  display: inline-flex;
}
.doc-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: .15s ease;
}
.doc-badge:hover {
  border-color: #818cf8;
  background: #e0e7ff;
  color: #312e81;
}
.doc-badge-agreement {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.doc-badge-agreement:hover {
  border-color: #34d399;
  background: #d1fae5;
  color: #065f46;
}
.side-form .field {
  margin-bottom: 12px;
}
.side-form .field:last-of-type {
  margin-bottom: 14px;
}

/* ---------- Переключатель темы ---------- */
.theme-toggle {
  width: 38px;
  height: 38px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--text-2);
  transition: .16s ease;
}
.theme-toggle:hover {
  border-color: #bfdbfe;
  color: var(--brand);
  background: var(--surface-soft);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Обслуживание базы ---------- */
.maintenance-panel { margin-top: 16px; padding: 24px; scroll-margin-top: 82px; }
.maintenance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.maintenance-head h2 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.02em; }
.maintenance-head p { max-width: 920px; margin: 0; color: var(--text-3); font-size: 12.5px; line-height: 1.55; }
.maintenance-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.maintenance-stat {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.maintenance-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.maintenance-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.maintenance-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.maintenance-card h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.maintenance-card > p { margin: 0; color: var(--text-3); font-size: 11.5px; line-height: 1.55; }
.maintenance-card .field { margin: 0; }
.maintenance-card .field > span { font-size: 10.5px; }
.maintenance-card .field input { background: var(--surface); }
.maintenance-card .field input[type="file"] {
  height: auto;
  min-height: 41px;
  padding: 8px;
  font-size: 11px;
}
.maintenance-card .field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.maintenance-card .field input[type="file"]::file-selector-button:hover {
  border-color: #bfdbfe;
  color: var(--brand);
}
.maintenance-card .field small { font-size: 10px; }
.maintenance-card form { display: flex; flex-direction: column; gap: 9px; margin-top: auto; }
.maintenance-card .btn { min-height: 37px; font-size: 12px; }
.maintenance-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.maintenance-actions form { margin: 0; }
.maintenance-actions .btn { width: 100%; }
.maintenance-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.maintenance-icon svg { width: 18px; height: 18px; }
.maintenance-icon-blue { background: #eff6ff; color: #2563eb; }
.maintenance-icon-amber { background: #fffbeb; color: #d97706; }
.maintenance-icon-red { background: #fef2f2; color: #b91c1c; }
.maintenance-card.danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}
.maintenance-card.danger h3 { color: #b91c1c; }
.maintenance-note { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.maintenance-list { margin-top: 20px; }
.maintenance-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.maintenance-list-head h3 { margin: 0; font-size: 13px; }
.maintenance-list-head .muted { font-size: 10.5px; }
.backup-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 90px 90px;
  gap: 12px;
  align-items: center;
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}
.backup-row:first-child { border-top: 0; }
.backup-row-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.backup-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1040px) {
  .maintenance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maintenance-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .maintenance-grid { grid-template-columns: 1fr; }
  .maintenance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maintenance-head { flex-direction: column; gap: 10px; }
  .backup-list { overflow-x: auto; }
  .backup-row { min-width: 560px; }
}
@media (max-width: 600px) {
  .maintenance-panel { padding: 16px; }
  .maintenance-list-head { flex-direction: column; gap: 4px; }
}

/* ---------- Настройки: навигация и обзор ---------- */
.settings-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: .15s ease;
}
.settings-tab svg { width: 16px; height: 16px; }
.settings-tab:hover { background: var(--surface-soft); color: var(--text); }
.settings-tab.is-active { background: #eef2ff; color: #1e40af; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.settings-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 30px -18px rgba(37, 99, 235, .45);
}
.settings-card-head { display: flex; align-items: flex-start; gap: 13px; }
.settings-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.settings-card-icon svg { width: 21px; height: 21px; }
.settings-icon-company { background: #eff6ff; color: #2563eb; }
.settings-icon-maintenance { background: #ecfdf5; color: #047857; }
.settings-icon-sync { background: #eef2ff; color: #4338ca; }
.settings-icon-reminders { background: #fff7ed; color: #c2410c; }
.settings-icon-hardware { background: #f0fdfa; color: #0f766e; }
.settings-card-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.settings-card-title strong { font-size: 16px; letter-spacing: -.015em; }
.settings-card-title span { color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.settings-card-arrow { width: 17px; height: 17px; margin-left: auto; color: var(--muted); transition: .15s ease; }
.settings-card:hover .settings-card-arrow { color: var(--brand); transform: translateX(2px); }
.settings-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.settings-meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11.5px; }
.settings-meta-row strong { color: var(--text-2); font-weight: 650; text-align: right; }
.settings-last-backup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 22px;
}
.settings-last-backup h2 { margin: 0 0 3px; font-size: 14px; }
.settings-last-backup p { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; overflow-wrap: anywhere; }
.settings-last-backup-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11.5px; }
.hero-actions form { display: contents; }

@media (max-width: 1040px) {
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-last-backup { flex-direction: column; align-items: flex-start; }
  .settings-card { padding: 18px; }
}
@media (max-width: 600px) {
  .settings-tabs { flex-wrap: wrap; }
  .settings-tab { flex: 1 1 auto; justify-content: center; padding: 8px 10px; font-size: 11.5px; }
}

/* =========================================================
   Тёмная тема
   ========================================================= */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #070d18;
    --surface: #0f172a;
    --surface-soft: #141f35;
    --text: #e6edf9;
    --text-2: #b6c4da;
    --text-3: #8ea0bb;
    --muted: #8ea0bb;
    --line: #1e2b42;
    --line-strong: #2b3c58;
    --brand: #6b9bff;
    --brand-dark: #4b7ef5;
    --indigo: #9aa5ff;
    --navy: #050a14;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #f87171;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 16px 40px -20px rgba(0, 0, 0, .7);
  }

  html[data-theme="dark"] body { background: var(--bg); }
  html[data-theme="dark"] ::selection { background: #1e3a8a; color: #dbeafe; }

  html[data-theme="dark"] .topbar {
    background: rgba(8, 14, 25, .92);
    border-bottom-color: rgba(43, 60, 88, .9);
  }
  html[data-theme="dark"] .nav-link:hover { background: #172238; }
  html[data-theme="dark"] .nav-link.active { color: #c7d7ff; background: #17264b; }
  html[data-theme="dark"] .nav-export {
    background: var(--surface);
    border-color: var(--line-strong);
  }
  html[data-theme="dark"] .nav-export:hover {
    border-color: #31507f;
    color: #a9c3ff;
    background: #152342;
  }
  html[data-theme="dark"] .theme-toggle:hover {
    border-color: #31507f;
    color: #a9c3ff;
    background: #152342;
  }
  html[data-theme="dark"] .nav-settings:hover,
  html[data-theme="dark"] .nav-trash:hover {
    border-color: #31507f;
    color: #a9c3ff;
    background: #152342;
  }

  html[data-theme="dark"] .btn {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text-2);
  }
  html[data-theme="dark"] .btn:hover {
    border-color: #3a4f70;
    color: var(--text);
  }
  html[data-theme="dark"] .btn-danger-ghost {
    border-color: #6b2733;
    background: #1a0f14;
    color: #fca5a5;
  }
  html[data-theme="dark"] .btn-danger-ghost:hover {
    border-color: #9f3a48;
    background: #2a141a;
    color: #fecaca;
  }
  html[data-theme="dark"] .btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #dc2626;
    color: #fff;
  }
  html[data-theme="dark"] .btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    border-color: #ef4444;
    color: #fff;
  }
  html[data-theme="dark"] .doc-badge {
    border-color: #334e7c;
    background: #14264a;
    color: #bfdbfe;
  }
  html[data-theme="dark"] .doc-badge:hover {
    border-color: #4f74b8;
    background: #1b315e;
    color: #dbeafe;
  }
  html[data-theme="dark"] .doc-badge-agreement {
    border-color: #1f5e4a;
    background: #0f2b24;
    color: #86efac;
  }
  html[data-theme="dark"] .doc-badge-agreement:hover {
    border-color: #2b8a68;
    background: #153a30;
    color: #bbf7d0;
  }
  html[data-theme="dark"] .btn-light {
    background: #fff;
    border-color: #fff;
    color: #0f172a;
  }
  html[data-theme="dark"] .btn-light:hover {
    background: #f8fafc;
    border-color: #f8fafc;
    color: #0f172a;
  }

  html[data-theme="dark"] .flash-success {
    background: #0e2b1e;
    border-color: #1f5e42;
    color: #86efac;
  }
  html[data-theme="dark"] .flash-error {
    background: #331318;
    border-color: #6b2733;
    color: #fca5a5;
  }
  html[data-theme="dark"] .flash-info {
    background: #12233f;
    border-color: #254a7a;
    color: #93c5fd;
  }

  html[data-theme="dark"] .stat-card {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme="dark"] .stat-card:hover { border-color: var(--line-strong); }
  html[data-theme="dark"] .stat-card.is-active {
    border-color: #2f5da8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16), var(--shadow-sm);
  }
  html[data-theme="dark"] .stat-icon { background: #18224a; color: #a5b4fc; }
  html[data-theme="dark"] .stat-issued .stat-icon { background: #0f2f24; color: #6ee7b7; }
  html[data-theme="dark"] .stat-free .stat-icon { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .stat-attention .stat-icon { background: #33240f; color: #fbbf24; }
  html[data-theme="dark"] .stat-total .stat-icon { background: #1a2438; color: #cbd5e1; }

  html[data-theme="dark"] .search-box input,
  html[data-theme="dark"] .select-wrap select {
    background: var(--surface-soft);
    border-color: var(--line-strong);
    color: var(--text);
  }
  html[data-theme="dark"] .search-box input:focus,
  html[data-theme="dark"] .select-wrap select:focus {
    background: #16233a;
    border-color: #3d6bb5;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
  }
  html[data-theme="dark"] .search-box input::placeholder,
  html[data-theme="dark"] .field input::placeholder,
  html[data-theme="dark"] .field textarea::placeholder { color: #8ea0bb; }
  html[data-theme="dark"] .search-box kbd {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme="dark"] .select-wrap::after {
    border-right-color: #8ea0bb;
    border-bottom-color: #8ea0bb;
  }
  html[data-theme="dark"] .btn-reset:hover { background: #1a2438; }
  html[data-theme="dark"] .result-count strong { color: var(--text); }

  html[data-theme="dark"] .table-scroll::-webkit-scrollbar-track { background: #0d1628; }
  html[data-theme="dark"] .table-scroll::-webkit-scrollbar-thumb {
    background: #2b3c58;
    border-color: #0d1628;
  }
  html[data-theme="dark"] .table-scroll::-webkit-scrollbar-thumb:hover { background: #3a4f70; }
  html[data-theme="dark"] .pc-table th,
  html[data-theme="dark"] .data-table th,
  html[data-theme="dark"] .act-items-head {
    background: #0d1729;
    color: #7f93b2;
    border-bottom-color: var(--line);
  }
  html[data-theme="dark"] .pc-table th.sortable:hover { background: #14203a; }
  html[data-theme="dark"] .pc-table td,
  html[data-theme="dark"] .data-table td {
    background: var(--surface);
    border-bottom-color: #172338;
  }
  html[data-theme="dark"] .pc-row:hover td,
  html[data-theme="dark"] .data-table tbody tr:hover td { background: #14203a; }
  html[data-theme="dark"] .pc-row:focus-visible td {
    background: #152647;
    box-shadow: inset 0 1px 0 #2b4c85, inset 0 -1px 0 #2b4c85;
  }
  html[data-theme="dark"] th.sticky-col {
    background: #0d1729;
    border-right-color: #172338;
  }
  html[data-theme="dark"] td.sticky-col {
    background: var(--surface);
    border-right-color: #172338;
  }
  html[data-theme="dark"] .pc-row:hover .sticky-col { background: #14203a; }
  html[data-theme="dark"] .pc-row:focus-visible .sticky-col { background: #152647; }
  html[data-theme="dark"] .data-table tfoot td { background: #0d1729; }
  html[data-theme="dark"] .table-footer { background: #0c1526; }

  html[data-theme="dark"] .pan-link,
  html[data-theme="dark"] .pc-pan,
  html[data-theme="dark"] .upd-number {
    background: #17264b;
    border-color: #2a4370;
    color: #a9c3ff;
  }
  html[data-theme="dark"] .pan-link:hover {
    background: #1e3260;
    color: #dbe7ff;
  }
  html[data-theme="dark"] .project-chip {
    background: #1a2438;
    color: #b6c4da;
  }
  html[data-theme="dark"] .mini-avatar,
  html[data-theme="dark"] .avatar-sm,
  html[data-theme="dark"] .avatar-xl {
    border-color: hsl(var(--hue) 35% 32%);
    background: hsl(var(--hue) 40% 20%);
    color: hsl(var(--hue) 70% 78%);
  }
  html[data-theme="dark"] .avatar-empty {
    border-color: #2b3c58;
    background: #111a2c;
    color: var(--muted);
  }

  html[data-theme="dark"] .badge-dot { box-shadow: 0 0 0 2px rgba(15, 23, 42, .85); }
  html[data-theme="dark"] .status-issued,
  html[data-theme="dark"] .stock-issued,
  html[data-theme="dark"] .act-return,
  html[data-theme="dark"] .profile-ready {
    background: #0e2b1e;
    border-color: #1f5e42;
    color: #6ee7b7;
  }
  html[data-theme="dark"] .status-free,
  html[data-theme="dark"] .stock-in,
  html[data-theme="dark"] .act-acceptance {
    background: #12284a;
    border-color: #254a7a;
    color: #93c5fd;
  }
  html[data-theme="dark"] .status-repair,
  html[data-theme="dark"] .stock-repair,
  html[data-theme="dark"] .profile-warning {
    background: #33240f;
    border-color: #6b4a12;
    color: #fcd34d;
  }
  html[data-theme="dark"] .status-retired,
  html[data-theme="dark"] .stock-written-off {
    background: #1a2438;
    border-color: #2b3c58;
    color: #cbd5e1;
  }
  html[data-theme="dark"] .status-burned,
  html[data-theme="dark"] .movement-writeoff,
  html[data-theme="dark"] .act-writeoff {
    background: #331318;
    border-color: #6b2733;
    color: #fca5a5;
  }
  html[data-theme="dark"] .movement-initial {
    background: #0d2a3a;
    color: #7dd3fc;
  }
  html[data-theme="dark"] .movement-issue {
    background: #18224a;
    color: #a5b4fc;
  }
  html[data-theme="dark"] .movement-return {
    background: #0e2b1e;
    color: #6ee7b7;
  }
  html[data-theme="dark"] .movement-transfer {
    background: #241b45;
    color: #c4b5fd;
  }
  html[data-theme="dark"] .movement-badge { background: #1a2438; color: #cbd5e1; }

  html[data-theme="dark"] .empty-icon,
  html[data-theme="dark"] .empty-panel .empty-icon,
  html[data-theme="dark"] .act-items-empty .empty-icon {
    background: #1a2438;
    color: var(--muted);
  }

  html[data-theme="dark"] .pc-pan { border-color: #2a4370; }
  html[data-theme="dark"] .current-user-card {
    border-color: #24406b;
    background: linear-gradient(135deg, #101d33, #12233f 70%, #14294b);
  }
  html[data-theme="dark"] .current-user-card.is-empty {
    border-color: #26364f;
    background: linear-gradient(135deg, #0e1728, #111c30);
  }
  html[data-theme="dark"] .small-label,
  html[data-theme="dark"] .current-user-note { color: #7f93b2; }
  html[data-theme="dark"] .history-head h3 { color: #8ea0bb; }
  html[data-theme="dark"] .count-pill { background: #1a2438; color: #cbd5e1; }
  html[data-theme="dark"] .timeline::before { background: #26364f; }
  html[data-theme="dark"] .timeline-dot {
    border-color: #0f172a;
    background: #3a4f70;
    box-shadow: 0 0 0 1px #26364f;
  }
  html[data-theme="dark"] .timeline li:first-child .timeline-dot {
    background: #60a5fa;
    box-shadow: 0 0 0 1px #1e3a8a;
  }
  html[data-theme="dark"] .empty-note { background: #111a2c; }
  html[data-theme="dark"] .total-highlight {
    border-color: #1f5e42;
    background: #0e2b1e;
  }
  html[data-theme="dark"] .total-highlight span { color: #6ee7b7; }
  html[data-theme="dark"] .total-highlight strong { color: #a7f3d0; }
  html[data-theme="dark"] .event-list li { border-bottom-color: #172338; }
  html[data-theme="dark"] .event-icon { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .event-status { background: #33240f; color: #fbbf24; }
  html[data-theme="dark"] .event-user { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .event-created { background: #0e2b1e; color: #6ee7b7; }
  html[data-theme="dark"] .event-updated { background: #1a2438; color: #cbd5e1; }
  html[data-theme="dark"] .empty-inline { background: var(--surface); }

  html[data-theme="dark"] .note-panel {
    border-color: #6b4a12;
    background: linear-gradient(135deg, #2a1e0a, #241a08);
  }
  html[data-theme="dark"] .note-icon { background: #3a2a0e; color: #fbbf24; }
  html[data-theme="dark"] .note-panel p { color: #fcd34d; }

  html[data-theme="dark"] .modal { background: #0f172a; }
  html[data-theme="dark"] .icon-btn { background: #111a2c; }
  html[data-theme="dark"] .icon-btn:hover { background: #1a2438; }
  html[data-theme="dark"] .modal-note {
    border-color: #6b4a12;
    background: #2a1e0a;
    color: #fcd34d;
  }
  html[data-theme="dark"] .alert-error {
    border-color: #6b2733;
    background: #331318;
    color: #fca5a5;
  }
  html[data-theme="dark"] .alert-warning {
    border-color: #6b4a12;
    background: #2a1e0a;
    color: #fcd34d;
  }
  html[data-theme="dark"] .alert-warning a { color: #fbbf24; }
  html[data-theme="dark"] .act-profile-warning {
    border-color: #6b4a12;
    background: #2a1e0a;
    color: #fcd34d;
  }
  html[data-theme="dark"] .act-profile-warning a { color: #fbbf24; }

  html[data-theme="dark"] .field > span { color: #c7d3e6; }
  html[data-theme="dark"] .field > span b { color: #f87171; }
  html[data-theme="dark"] .field input,
  html[data-theme="dark"] .field textarea,
  html[data-theme="dark"] .field select {
    background: #0c1526;
    border-color: var(--line-strong);
    color: var(--text);
  }
  html[data-theme="dark"] .field input:focus,
  html[data-theme="dark"] .field textarea:focus,
  html[data-theme="dark"] .field select:focus {
    background: #0f1b30;
    border-color: #3d6bb5;
    box-shadow: 0 0 0 3.5px rgba(59, 130, 246, .14);
  }
  html[data-theme="dark"] .section-number { background: #18224a; color: #a5b4fc; }
  html[data-theme="dark"] .form-help ul { color: var(--text-3); }

  html[data-theme="dark"] .tag { background: #1a2438; color: #cbd5e1; }
  html[data-theme="dark"] .tag-link:hover { background: #24324a; color: var(--text); }
  html[data-theme="dark"] .entity-link { color: #8fb4ff; }
  html[data-theme="dark"] .entity-link:hover { color: #c7d7ff; }
  html[data-theme="dark"] .inline-link { color: var(--brand); }
  html[data-theme="dark"] .text-green { color: #34d399; }

  html[data-theme="dark"] .quick-card {
    background: #111a2c;
    border-color: var(--line);
  }
  html[data-theme="dark"] .quick-card:hover {
    border-color: #2b4c85;
    background: #14233f;
  }
  html[data-theme="dark"] .quick-blue { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .quick-green { background: #0e2b1e; color: #6ee7b7; }
  html[data-theme="dark"] .quick-violet { background: #241b45; color: #c4b5fd; }
  html[data-theme="dark"] .quick-amber { background: #33240f; color: #fbbf24; }
  html[data-theme="dark"] .warehouse-card:hover { border-color: #2b4c85; }
  html[data-theme="dark"] .category-track { background: #1a2438; }

  html[data-theme="dark"] .act-type-card {
    background: var(--surface);
    border-color: var(--line-strong);
  }
  html[data-theme="dark"] .act-type-option:hover .act-type-card { border-color: #3a5f9e; }
  html[data-theme="dark"] .act-type-option input:checked + .act-type-card {
    border-color: #3d6bb5;
    background: #14233f;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
  }
  html[data-theme="dark"] .act-type-acceptance { background: #18224a; color: #a5b4fc; }
  html[data-theme="dark"] .act-type-return { background: #0e2b1e; color: #6ee7b7; }
  html[data-theme="dark"] .act-items-wrap { background: var(--surface); }
  html[data-theme="dark"] .act-items-head { background: #0d1729; }
  html[data-theme="dark"] .act-date-filter input {
    background: #0c1526;
    border-color: var(--line-strong);
    color: var(--text-2);
    color-scheme: dark;
  }
  html[data-theme="dark"] .act-item-row { border-bottom-color: #172338; }
  html[data-theme="dark"] .act-item-row:hover { background: #14203a; }
  html[data-theme="dark"] .act-item-row.is-selected { background: #152647; }
  html[data-theme="dark"] .act-item-condition select {
    background: #0c1526;
    border-color: var(--line-strong);
    color: var(--text-2);
  }
  html[data-theme="dark"] .act-item-condition select:disabled {
    background: #111a2c;
    color: #5f708c;
    border-color: #1e2b42;
  }
  html[data-theme="dark"] .act-lines-table tfoot td { background: #0d1729; }

  html[data-theme="dark"] .maintenance-icon-blue { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .maintenance-icon-amber { background: #33240f; color: #fbbf24; }
  html[data-theme="dark"] .maintenance-icon-red { background: #331318; color: #fca5a5; }
  html[data-theme="dark"] .maintenance-card.danger {
    border-color: #6b2733;
    background: linear-gradient(180deg, #1a0f14 0%, #221015 100%);
  }
  html[data-theme="dark"] .maintenance-card.danger h3 { color: #fca5a5; }
  html[data-theme="dark"] .maintenance-card .field input { background: #0c1526; }
  html[data-theme="dark"] .maintenance-card .field input[type="file"]::file-selector-button {
    border-color: #2b3c58;
    background: #1a2438;
    color: #c7d3e6;
  }
  html[data-theme="dark"] .maintenance-card .field input[type="file"]::file-selector-button:hover {
    border-color: #31507f;
    color: #c7d7ff;
  }
  html[data-theme="dark"] .maintenance-stat,
  html[data-theme="dark"] .maintenance-card,
  html[data-theme="dark"] .backup-row-head { background: var(--surface-soft); }
  html[data-theme="dark"] .settings-tab.is-active { background: #18224a; color: #a5b4fc; }
  html[data-theme="dark"] .settings-icon-company { background: #12284a; color: #93c5fd; }
  html[data-theme="dark"] .settings-icon-maintenance { background: #0e2b1e; color: #6ee7b7; }
  html[data-theme="dark"] .settings-icon-sync { background: #18224a; color: #a5b4fc; }
  html[data-theme="dark"] .settings-icon-reminders { background: #3a2412; color: #fdba74; }
  html[data-theme="dark"] .settings-icon-hardware { background: #0d2b2a; color: #5eead4; }
  html[data-theme="dark"] .settings-card:hover {
    border-color: #334155;
    box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .8);
  }
}

/* ---------- Компактная шапка ---------- */
@media (max-width: 1279px) {
  .topbar-inner { gap: 12px; }
  .main-nav { gap: 0; }
  .nav-link { padding: 7px 8px; font-size: 12px; gap: 5px; }
  .nav-link svg { width: 15px; height: 15px; }
  .theme-toggle { width: 36px; height: 36px; margin-left: 2px; }
  .nav-settings,
  .nav-trash { width: 36px; height: 36px; padding: 0; }
}
@media (max-width: 900px) {
  .topbar-inner {
    height: auto;
    min-height: 66px;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .main-nav { width: 100%; flex-wrap: wrap; gap: 2px; }
  .brand-text small { display: none; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 10px 14px; }
}

/* =========================================================
   Глобальный поиск, массовые действия, напоминания,
   качество данных, вложения и увольнение
   ========================================================= */
/* ---------- Кнопка поиска в шапке ---------- */
.nav-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  margin-left: 4px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
  transition: .16s ease;
}
.nav-search svg { width: 16px; height: 16px; }
.nav-search:hover {
  border-color: #bfdbfe;
  color: var(--brand);
  background: var(--surface-soft);
}
.nav-search kbd {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
}

/* ---------- Диалог поиска ---------- */
.search-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(80vh, 740px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 110px -40px rgba(15, 23, 42, .6);
  overflow: hidden;
}
.search-dialog::backdrop {
  background: rgba(8, 15, 30, .5);
  backdrop-filter: blur(3px);
}
.search-dialog[open] { animation: fadeUp .18s ease both; }
.search-dialog-inner { display: flex; flex-direction: column; max-height: min(80vh, 740px); }
.search-dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.search-dialog-head > svg { width: 20px; height: 20px; color: var(--muted); }
.search-dialog-head input {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}
.search-dialog-head input::placeholder { color: var(--muted); }
.search-esc {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.search-esc:hover { color: var(--text); border-color: var(--line-strong); }
.search-results { flex: 1; overflow-y: auto; padding: 8px; }
.search-hint,
.search-loading,
.search-empty {
  padding: 28px 18px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.65;
  text-align: center;
}
.search-empty { display: flex; flex-direction: column; gap: 3px; }
.search-empty strong { color: var(--text); font-size: 14px; }
.search-empty span { color: var(--muted); font-size: 11.5px; }
.search-groups { display: flex; flex-direction: column; gap: 2px; }
.search-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 5px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.search-group-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-3);
  font-size: 9.5px;
  text-align: center;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: .12s ease;
}
.search-result:hover,
.search-result.is-active { background: var(--surface-soft); }
.search-result-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.search-result-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-meta {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.search-more { margin: 3px 10px 7px; color: var(--muted); font-size: 10.5px; }
.search-dialog-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}
.search-dialog-foot kbd {
  display: inline-block;
  min-width: 18px;
  margin-right: 2px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--text-3);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Массовые действия ---------- */
.th-check,
.td-check { width: 36px; padding-right: 0 !important; text-align: center !important; }
.th-check input,
.td-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  box-shadow: var(--shadow-sm);
}
.bulk-count { color: #1e40af; font-size: 12px; font-weight: 600; }
.bulk-count strong { font-size: 14px; font-weight: 800; }
.bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.select-wrap-sm select {
  min-height: 34px;
  padding: 5px 30px 5px 9px;
  font-size: 11.5px;
}
.bulk-actions .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Напоминания на дашборде ---------- */
.reminders-panel { padding: 20px; margin-bottom: 16px; }
.reminder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.reminder-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.reminder-card.is-clean { opacity: .72; }
.reminder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.reminder-head strong { font-size: 12.5px; line-height: 1.3; letter-spacing: -.01em; }
.reminder-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
}
.reminder-card p { margin: 0; color: var(--text-3); font-size: 11px; line-height: 1.45; }
.reminder-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.reminder-details li {
  overflow: hidden;
  color: var(--text-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-card .reminder-empty { color: var(--muted); font-style: italic; }
.reminder-card .inline-link { margin-top: auto; font-size: 11px; font-weight: 650; }
.tone-warning .reminder-count { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.tone-danger .reminder-count { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.tone-info .reminder-count { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ---------- Плашка качества ---------- */
.quality-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
  transition: .16s ease;
}
.quality-banner:hover { border-color: #93c5fd; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quality-banner-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #dbeafe;
  color: #2563eb;
  flex-shrink: 0;
}
.quality-banner-icon svg { width: 20px; height: 20px; }
.quality-banner-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quality-banner-main strong { font-size: 13px; letter-spacing: -.01em; }
.quality-banner-main span { color: var(--text-3); font-size: 11.5px; }
.quality-banner.is-clean { border-color: #bbf7d0; background: linear-gradient(135deg, #f0fdf4, #f8fffb); }
.quality-banner.is-clean .quality-banner-icon { background: #dcfce7; color: #16a34a; }
.count-pill-danger { background: #fee2e2; color: #b91c1c; }

/* ---------- Страница качества данных ---------- */
.quality-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.quality-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: .15s ease;
}
.quality-summary-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.quality-summary-value { font-size: 22px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.quality-summary-label { color: var(--text-3); font-size: 10.5px; line-height: 1.3; }
.quality-summary-card.tone-warning .quality-summary-value { color: var(--amber); }
.quality-summary-card.tone-danger .quality-summary-value { color: var(--red); }
.quality-summary-card.tone-info .quality-summary-value { color: var(--brand); }
.quality-summary-card.is-clean .quality-summary-value { color: var(--green); }
.quality-groups { display: flex; flex-direction: column; gap: 14px; }
.quality-group { padding: 20px; }
.quality-rows { display: flex; flex-direction: column; margin-top: 10px; }
.quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.quality-row:last-child { border-bottom: 0; }
.quality-row:hover .quality-main strong { color: var(--brand); }
.quality-kind {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.quality-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quality-main strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quality-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quality-more { margin: 10px 0 0; color: var(--muted); font-size: 10.5px; }
.quality-actions { margin-top: 12px; }

/* ---------- Вложения ---------- */
.attachments-panel { margin-top: 16px; padding: 20px; }
.attachment-list { display: flex; flex-direction: column; margin-top: 8px; }
.attachment-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.attachment-row:last-child { border-bottom: 0; }
.attachment-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-3);
  flex-shrink: 0;
}
.attachment-icon svg { width: 17px; height: 17px; }
.attachment-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.attachment-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-name:hover { color: var(--brand); }
.attachment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.attachment-form .field { margin: 0; }
.attachment-form input[type="file"] {
  height: 41px;
  padding: 5px 10px;
  line-height: 27px;
  cursor: pointer;
}
.attachment-form input[type="file"]::file-selector-button {
  height: 27px;
  margin: 0 10px 0 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s ease;
}
.attachment-form input[type="file"]::file-selector-button:hover {
  border-color: #bfdbfe;
  color: var(--brand);
}
.attachments-panel .maintenance-note { margin-top: 8px; }

/* ---------- Увольнение ---------- */
.employee-dismiss-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
  padding: 16px 20px;
  border: 1px solid #dbe7fb;
  background: linear-gradient(135deg, #f8fbff, #eef4ff 70%, #e8f0ff);
}
.dismiss-person { display: flex; align-items: center; gap: 13px; min-width: 0; }
.dismiss-person strong { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.avatar-lg { width: 46px; height: 46px; font-size: 14px; }
.dismiss-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.dismiss-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 96px;
  padding: 8px 14px;
  border: 1px solid #dce7f8;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
}
.dismiss-stat strong { color: var(--text); font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.dismiss-stat span { color: var(--text-3); font-size: 10.5px; }
.dismiss-items { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.dismiss-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dismiss-item:hover { border-color: #c7d7f5; background: #fbfdff; }
.dismiss-item:focus-within { border-color: #93b4fb; }
.dismiss-item:has(> input:checked) {
  border-color: #93b4fb;
  background: #f4f8ff;
  box-shadow: inset 3px 0 0 var(--brand);
}
.dismiss-item > input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.dismiss-item-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dismiss-item-main strong { font-size: 12.5px; }
.dismiss-item-side { display: flex; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.side-mini-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.dismiss-qty { display: flex; flex-direction: column; }
.dismiss-qty input {
  width: 62px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 11.5px;
}
.dismiss-qty input:disabled { background: #f8fafc; color: #a7b3c5; border-color: #eef2f8; }
.dismiss-cond { display: flex; flex-direction: column; }
.dismiss-cond .select-wrap select {
  min-height: 32px;
  padding: 4px 28px 4px 8px;
  font-size: 11px;
}
.dismiss-select-all {
  display: flex;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
}
.undo-items-table { min-width: 0; table-layout: fixed; }
.undo-items-table .undo-col-no { width: 42px; }
.undo-items-table .undo-col-act { width: 68px; }
.undo-items-table .undo-col-serial { width: 155px; }
.undo-items-table .undo-col-condition { width: 135px; }
.undo-items-table .undo-col-status { width: 118px; }
.undo-items-table td { overflow-wrap: anywhere; }
.undo-items-table .undo-col-no,
.undo-items-table .undo-col-act,
.undo-items-table .undo-col-status { white-space: nowrap; }

/* ---------- Автобэкап в настройках ---------- */
.maintenance-card-wide { grid-column: 1 / -1; }
.maintenance-icon-green { background: #dcfce7; color: #16a34a; }
.tag-auto {
  padding: 1px 6px;
  border-radius: 5px;
  background: #dcfce7;
  color: #166534;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auto-backup-form {
  display: grid !important;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.3fr) auto;
  align-items: end !important;
  gap: 14px !important;
  margin-top: 4px !important;
}
.auto-backup-form .checkline { align-self: center; }
.auto-backup-form .form-grid { margin: 0; }
.auto-backup-form .maintenance-actions { margin: 0; }
.form-grid-compact { gap: 10px; }

@media (max-width: 1279px) {
  .nav-search-label { display: none; }
  .reminder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auto-backup-form { grid-template-columns: 1fr !important; }
  .quality-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-summary-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .search-dialog { width: calc(100vw - 16px); max-height: 88vh; border-radius: 14px; }
  .search-dialog-inner { max-height: 88vh; }
  .search-dialog-head { padding: 11px 12px; }
  .search-dialog-head input { font-size: 14px; }
  .search-dialog-foot { padding: 8px 12px; }
  .reminder-grid { grid-template-columns: minmax(0, 1fr); }
  .reminder-card { padding: 12px 14px; }
  .bulk-bar { padding: 10px 12px; }
  .bulk-actions { width: 100%; }
  .bulk-actions .select-wrap { flex: 1; min-width: 130px; }
  .bulk-actions .btn { flex: 1; }
  .attachment-form { grid-template-columns: 1fr; }
  .attachment-form .btn { width: 100%; }
  .dismiss-item { flex-wrap: wrap; }
  .dismiss-item-side { width: 100%; padding-left: 28px; flex-wrap: wrap; }
  .dismiss-cond { flex: 1; min-width: 160px; }
  .dismiss-cond .select-wrap { flex: 1; }
  .dismiss-cond .select-wrap select { width: 100%; }
  .undo-items-table .undo-col-no,
  .undo-items-table .undo-col-condition,
  .undo-items-table .undo-col-status { display: none; }
  .undo-items-table .undo-col-act { width: 64px; }
  .undo-items-table .undo-col-name { width: auto; }
  .undo-items-table .undo-col-serial { width: 38%; }
  .undo-items-table th, .undo-items-table td { padding: 8px 7px; }
  .undo-items-table td { vertical-align: top; }
  .employee-dismiss-summary { padding: 14px; }
  .quality-row { align-items: flex-start; }
  .quality-main small { white-space: normal; }
  .quality-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-summary-value { font-size: 19px; }
}
@media (max-width: 600px) {
  .nav-search { height: 36px; padding: 0 8px; }
  .nav-search kbd { display: none; }
  .quality-banner { align-items: flex-start; padding: 12px 14px; }
  .quality-banner-icon { width: 34px; height: 34px; }
  .quality-banner-main span { font-size: 10.5px; }
}

/* ---------- Тёмная тема: новые компоненты ---------- */
html[data-theme="dark"] .nav-search {
  background: var(--surface);
  border-color: var(--line-strong);
}
html[data-theme="dark"] .nav-search:hover {
  border-color: #31507f;
  color: #a9c3ff;
  background: #152342;
}
html[data-theme="dark"] .nav-search kbd { border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .search-dialog { box-shadow: 0 40px 110px -40px rgba(0, 0, 0, .85); }
html[data-theme="dark"] .search-esc { background: #141f35; border-color: var(--line-strong); }
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .search-result.is-active { background: #14203a; }
html[data-theme="dark"] .search-result-meta { background: #141f35; border-color: var(--line-strong); }
html[data-theme="dark"] .search-dialog-foot kbd { background: #141f35; border-color: var(--line-strong); }
html[data-theme="dark"] .bulk-bar {
  border-color: #2b4c85;
  background: #12233f;
}
html[data-theme="dark"] .bulk-count { color: #93c5fd; }
html[data-theme="dark"] .count-pill-danger { background: #331318; color: #fca5a5; }
html[data-theme="dark"] .reminder-card { background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .reminder-count { background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .tone-warning .reminder-count { background: #33240f; border-color: #6b4a12; color: #fcd34d; }
html[data-theme="dark"] .tone-danger .reminder-count { background: #331318; border-color: #6b2733; color: #fca5a5; }
html[data-theme="dark"] .tone-info .reminder-count { background: #12284a; border-color: #254a7a; color: #93c5fd; }
html[data-theme="dark"] .quality-banner {
  border-color: #254a7a;
  background: linear-gradient(135deg, #101d33, #12233f);
}
html[data-theme="dark"] .quality-banner:hover { border-color: #31507f; }
html[data-theme="dark"] .quality-banner-icon { background: #12284a; color: #93c5fd; }
html[data-theme="dark"] .quality-banner.is-clean { border-color: #1f5e42; background: linear-gradient(135deg, #0e2b1e, #10251c); }
html[data-theme="dark"] .quality-banner.is-clean .quality-banner-icon { background: #14362a; color: #6ee7b7; }
html[data-theme="dark"] .quality-summary-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .quality-kind { background: #1a2438; border-color: var(--line-strong); }
html[data-theme="dark"] .quality-row { border-bottom-color: #172338; }
html[data-theme="dark"] .attachment-icon { background: #1a2438; }
html[data-theme="dark"] .attachment-row { border-bottom-color: #172338; }
html[data-theme="dark"] .employee-dismiss-summary { border-color: #2b4c85; background: linear-gradient(135deg, #101d33, #12233f); }
html[data-theme="dark"] .dismiss-stat { border-color: #22385e; background: #0e1a30; }
html[data-theme="dark"] .dismiss-item { border-color: #1c2b47; background: var(--surface-soft); }
html[data-theme="dark"] .dismiss-item:hover { border-color: #31507f; background: #14203a; }
html[data-theme="dark"] .dismiss-item:has(> input:checked) { border-color: #2f4d84; background: #12233f; }
html[data-theme="dark"] .dismiss-qty input { background: #0c1526; }
html[data-theme="dark"] .dismiss-qty input:disabled { background: #0c1526; color: #64748b; border-color: #1c2b47; }
html[data-theme="dark"] .dismiss-select-all { border-color: #2b3c58; }
html[data-theme="dark"] .maintenance-icon-green { background: #0e2b1e; color: #6ee7b7; }
html[data-theme="dark"] .tag-auto { background: #14362a; color: #6ee7b7; }
html[data-theme="dark"] .auto-backup-form .field input { background: #0c1526; }

@media print {
  .bulk-bar,
  .quality-actions,
  .attachments-panel form,
  .attachment-row form,
  .dismiss-items input,
  .dismiss-item-side .select-wrap,
  .nav-search { display: none !important; }
}

/* =========================================================
   UI 2026-11 · таблица, панели, мобильный режим, печать
   ========================================================= */

/* ---------- Липкая шапка реестра ---------- */
.table-panel-registry { overflow: visible; }
.table-panel-registry .table-scroll {
  overflow: visible;
  max-height: none;
  min-height: 0;
}
#pc-table thead th { top: var(--topbar-h, 66px); z-index: 18; }
#pc-table thead th.sticky-col { z-index: 24; }
#pc-table.is-header-stuck thead th {
  box-shadow: 0 12px 20px -18px rgba(15, 23, 42, .55);
}
@media (max-width: 1200px) {
  .table-panel-registry .table-scroll { overflow-x: auto; }
}

/* ---------- Плотность и видимость колонок ---------- */
#pc-table.density-compact th { padding-top: 8px; padding-bottom: 8px; }
#pc-table.density-compact td { padding-top: 5px; padding-bottom: 5px; }
#pc-table.density-compact .mini-avatar { width: 21px; height: 21px; font-size: 8px; }
#pc-table.hide-col-user [data-col="user"],
#pc-table.hide-col-project [data-col="project"],
#pc-table.hide-col-model [data-col="model"],
#pc-table.hide-col-sn [data-col="sn"] { display: none; }

/* ---------- Кнопка сканера в поиске ---------- */
#search { padding-right: 46px; }
.search-action {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: .15s ease;
}
.search-action:hover { background: #eef2ff; color: var(--brand); }
.search-action svg { width: 17px; height: 17px; }

/* ---------- Чипы фильтров ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.filter-chips[hidden] { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  transition: .14s ease;
}
.filter-chip:hover { border-color: #bfdbfe; color: var(--brand); background: #f5f9ff; }
.filter-chip.is-active { border-color: #bfdbfe; background: #eef4ff; color: #1d4ed8; }
.filter-chip .chip-count {
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--text-3);
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.filter-chip.is-active .chip-count { background: #dbeafe; color: #1d4ed8; }
.filter-chip .chip-x {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font-size: 13px;
  line-height: 1;
}
.filter-chip .chip-x:hover { background: rgba(37, 99, 235, .12); }

/* ---------- Меню «Вид» ---------- */
.view-menu, .status-legend { position: relative; }
.view-menu > summary, .status-legend > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.view-menu > summary::-webkit-details-marker,
.status-legend > summary::-webkit-details-marker { display: none; }
.view-menu[open] > summary, .status-legend[open] > summary {
  border-color: #bfdbfe;
  background: #eef4ff;
  color: var(--brand);
}
.view-menu-panel, .legend-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 290px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.view-menu-section + .view-menu-section {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.view-menu-title {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.view-menu .checkline { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text-2); font-size: 12px; }
.view-menu .checkline input { accent-color: var(--brand); }
.per-page-row { display: flex; align-items: center; gap: 6px; }
.per-page-row input {
  width: 88px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.per-page-row input:focus { outline: 2px solid #bfdbfe; outline-offset: -1px; }
.per-page-row .btn { flex: 1; }
.view-menu-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10.5px; }
.saved-views { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.saved-view-row { display: flex; align-items: center; gap: 5px; }
.saved-view-row .filter-chip { flex: 1; justify-content: space-between; }
.saved-empty { color: var(--muted); font-size: 11px; }

/* ---------- Легенда статусов ---------- */
.legend-popover { width: 320px; }
.legend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.legend-head strong { font-size: 12.5px; }
.legend-list { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-desc { color: var(--muted); font-size: 10.5px; }
.legend-note { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; line-height: 1.45; }

/* ---------- Тосты вместо баннеров ---------- */
.flash-stack {
  position: fixed;
  top: calc(var(--topbar-h, 66px) + 14px);
  right: 18px;
  z-index: 220;
  width: min(390px, calc(100vw - 24px));
  margin: 0;
  pointer-events: none;
}
.flash {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  box-shadow: 0 14px 34px -18px rgba(15, 23, 42, .45);
  animation: toast-in .26s cubic-bezier(.2, .8, .3, 1);
}
.flash::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  opacity: .25;
  transform-origin: left;
  animation: flash-progress 6s linear forwards;
}
.flash:hover::after { animation-play-state: paused; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes flash-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ---------- Скелетоны ---------- */
.skeleton {
  border-radius: 7px;
  background: linear-gradient(90deg, #eef2f8 25%, #f8fafc 37%, #eef2f8 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.25s ease infinite;
}
@keyframes skeleton-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
.search-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; }
.search-skeleton-row { display: flex; align-items: center; gap: 10px; }
.search-skeleton-row .skeleton:first-child { width: 38px; height: 30px; border-radius: 9px; }
.search-skeleton-row .skeleton:last-child { flex: 1; height: 14px; }

/* ---------- QR-сканер ---------- */
.qr-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.qr-dialog::backdrop { background: rgba(8, 14, 25, .55); backdrop-filter: blur(3px); }
.qr-dialog-inner { padding: 18px; }
.qr-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.qr-dialog-head > div { display: flex; flex-direction: column; gap: 2px; }
.qr-dialog-head strong { font-size: 15px; }
.qr-dialog-head span { color: var(--muted); font-size: 11.5px; }
.qr-video-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 13px;
  background: #0b1220;
}
.qr-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.qr-frame {
  position: absolute;
  inset: 16%;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(8, 14, 25, .25);
}
.qr-status { margin: 11px 0 13px; color: var(--text-3); font-size: 12px; text-align: center; }
.qr-status.is-error { color: var(--red); }

/* ---------- Горячие клавиши ---------- */
.shortcuts-title { flex: 1; font-size: 14px; }
.shortcut-list { display: flex; flex-direction: column; }
.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.shortcut-list > div:last-child { border-bottom: 0; }
.shortcut-list kbd {
  min-width: 24px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}
.shortcut-list span { color: var(--text-3); }
.footer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-shortcuts {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.footer-shortcuts:hover { color: var(--brand); }

/* ---------- Дашборд: аналитические панели ---------- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.insight-card { padding: 18px; }
.insight-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.insight-head h2 { margin: 0; font-size: 14px; }
.insight-head p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.insight-value { font-size: 22px; font-weight: 750; letter-spacing: -.03em; }
.insight-value small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.trend-chart { display: flex; align-items: flex-end; gap: 7px; height: 120px; padding-top: 6px; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 88px; }
.trend-bar { width: 8px; min-height: 2px; border-radius: 3px 3px 1px 1px; background: #2563eb; transition: height .3s ease; }
.trend-bar.is-return { background: #34d399; }
.trend-label { color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.trend-legend { display: flex; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 7px; height: 7px; border-radius: 2px; background: #2563eb; }
.trend-legend i.return { background: #34d399; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 6px 10px; align-items: center; }
.bar-row-label { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 11.5px; }
.bar-row-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row-label strong { color: var(--text); font-size: 11px; }
.bar-track { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.bar-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.bar-track.age > span { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.attention-split { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.attention-split a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
}
.attention-split a:hover { border-color: #bfdbfe; color: var(--brand); }
.attention-split strong { font-size: 14px; }
.insight-card.is-trend { grid-column: span 2; }
.bar-row-label a { color: inherit; }
.bar-row-label a:hover { color: var(--brand); }
.bar-track.warning > span { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-track.danger > span { background: linear-gradient(90deg, #dc2626, #f87171); }
.bar-track.muted > span { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.insight-empty { margin: 0; color: var(--muted); font-size: 11.5px; }

/* ---------- Карточка ПК: сводка и быстрые действия ---------- */
.pc-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 2px 14px;
}
.pc-summary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.pc-summary-card span { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pc-summary-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pc-summary-card small { color: var(--text-3); font-size: 10.5px; }
.pc-summary-card.is-warning { border-color: #fde68a; background: #fffdf5; }
.pc-summary-card.is-danger { border-color: #fecaca; background: #fff7f7; }
.pc-summary-card.is-ok { border-color: #bbf7d0; background: #f7fef9; }
.pc-quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 2px 16px; }
.pc-quick-actions .btn { min-height: 34px; }
.copy-btn { position: relative; }
.copy-btn.is-copied { border-color: #bbf7d0; color: #047857; background: #f0fdf4; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 45;
  min-width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.action-menu-panel form, .action-menu-panel a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
}
.action-menu-panel svg { width: 16px; height: 16px; flex-shrink: 0; }
.action-menu-panel form button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.action-menu-panel form:hover, .action-menu-panel a:hover { background: var(--surface-soft); color: var(--brand); }
.action-menu-panel .is-danger { color: var(--red); }
.action-menu-panel .is-danger:hover { background: #fef2f2; color: #b91c1c; }

/* ---------- Таймлайн ---------- */
.event-list.is-timeline { position: relative; }
.event-list.is-timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.event-list.is-timeline li { position: relative; padding-left: 2px; }
.event-list.is-timeline .event-icon { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--surface); }
.event-kind {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Формы: валидация и черновики ---------- */
.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .07);
}
.field-error { margin-top: 5px; color: #dc2626; font-size: 10.5px; line-height: 1.4; }
.field-hint-warn { margin-top: 5px; color: #b45309; font-size: 10.5px; line-height: 1.4; }
.field.is-required > span::after { content: " *"; color: #dc2626; font-weight: 700; }
.draft-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid #fde68a;
  border-radius: 11px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11.5px;
}
.draft-banner strong { font-size: 12px; }
.draft-banner .draft-actions { display: flex; gap: 6px; margin-left: auto; }
.draft-banner .btn { min-height: 28px; padding: 0 9px; font-size: 11px; }

/* ---------- Мобильный режим: таблица как карточки ---------- */
@media (max-width: 760px) {
  .table-panel-registry .table-scroll { overflow: visible; }
  #pc-table { display: block; min-width: 0; }
  #pc-table thead { display: none; }
  #pc-table tbody { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  #pc-table .pc-row {
    position: relative;
    display: block;
    padding: 14px 44px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  #pc-table .pc-row:hover td { background: transparent; }
  #pc-table td {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    border: 0;
    background: transparent !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  #pc-table td::before {
    content: attr(data-label);
    flex: 0 0 104px;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  #pc-table td.td-pan { margin-bottom: 5px; font-size: 15px; }
  #pc-table td.td-pan::before { display: none; }
  #pc-table td.td-check {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0;
  }
  #pc-table td.td-check::before { display: none; }
  #pc-table td.td-model { align-items: flex-start; }
  #pc-table .sticky-col { position: static; border-right: 0; }
  #pc-table .td-sn { font-size: 11px; }
  #pc-table .td-project .project-chip { white-space: normal; }
  #pc-table.hide-col-user [data-col="user"],
  #pc-table.hide-col-project [data-col="project"],
  #pc-table.hide-col-model [data-col="model"],
  #pc-table.hide-col-sn [data-col="sn"] { display: none; }
  .filter-chips { margin-top: 9px; }
  .view-menu-panel, .legend-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 70vh;
    overflow: auto;
  }
  .pc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-card.is-trend { grid-column: auto; }
  .pc-quick-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 520px) {
  .pc-summary { grid-template-columns: 1fr; }
  #pc-table td { flex-wrap: wrap; }
  #pc-table td::before { flex-basis: 100%; }
  #pc-table td.td-check { flex-wrap: nowrap; }
}

/* ---------- Печать: паспорт ---------- */
.passport-page { max-width: 820px; margin: 0 auto; }
.passport-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid #0f172a; }
.passport-brand { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.passport-title { margin: 3px 0 0; font-size: 26px; letter-spacing: -.03em; }
.passport-sub { margin: 4px 0 0; color: var(--text-3); font-size: 12px; }
.passport-qr { width: 92px; height: 92px; padding: 5px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
.passport-qr svg { display: block; width: 100%; height: 100%; }
.passport-page .panel { padding: 22px 24px; margin: 0 0 16px; }
.passport-page .panel h2 { margin: 0 0 16px; }
.passport-page .panel:last-of-type { margin-bottom: 0; }
.passport-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 0; }
.passport-grid > div { min-width: 0; }
.passport-grid .detail { padding: 9px 0; border-bottom: 1px solid #e7ebf3; }
.passport-grid dt { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.passport-grid dd { margin: 3px 0 0; font-size: 12.5px; }
.passport-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 34px; color: var(--text-3); font-size: 11px; }
.passport-sign span { display: block; padding-top: 28px; border-bottom: 1px solid #94a3b8; }

/* ---------- Печать: ведомость инвентаризации ---------- */
.registry-print-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid #0f172a;
}
.registry-print-head > div { display: flex; flex-direction: column; gap: 3px; }
.registry-print-head > div:last-child { text-align: right; }
.registry-print-head strong { font-size: 16px; letter-spacing: -.02em; }
.registry-print-head span { color: var(--text-3); font-size: 11px; }
.print-check-cell { width: 90px; }
.registry-print-page .table-scroll { overflow: visible; max-height: none; min-height: 0; }
.registry-print-page .data-table { min-width: 0; }
.registry-print-page .data-table th { position: static; }

@media print {
  .registry-print-page .page-head { display: none !important; }
  .registry-print-page .page { padding: 0; }
  .registry-print-sheet {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .registry-print-head { border-bottom-color: #0f172a; }
  .registry-print-head strong { font-size: 15px; }
  .registry-print-page .data-table { font-size: 8.5px; table-layout: fixed; width: 100%; }
  .registry-print-page .data-table th:nth-child(1) { width: 4%; }
  .registry-print-page .data-table th:nth-child(2) { width: 10%; }
  .registry-print-page .data-table th:nth-child(3) { width: 29%; }
  .registry-print-page .data-table th:nth-child(4) { width: 14%; }
  .registry-print-page .data-table th:nth-child(5) { width: 14%; }
  .registry-print-page .data-table th:nth-child(6) { width: 11%; }
  .registry-print-page .data-table th:nth-child(7) { width: 10%; }
  .registry-print-page .data-table th:nth-child(8) { width: 8%; }
  .registry-print-page .data-table td:nth-child(2) { white-space: nowrap; }
  .registry-print-page .data-table td:nth-child(7) { overflow-wrap: anywhere; }
  .registry-print-page .data-table th,
  .registry-print-page .data-table td { padding: 3px 4px; border-color: #cbd5e1; }
  .registry-print-page .data-table tbody tr { break-inside: avoid; }
  .print-check-cell { width: auto; height: 22px; border-left: 1px solid #cbd5e1 !important; }
  .registry-print-page .passport-sign { margin-top: 28px; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 12mm 14mm; }

  html, html[data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #ffffff;
    --text: #0f172a;
    --text-2: #1e293b;
    --text-3: #334155;
    --muted: #64748b;
    --line: #cbd5e1;
    --line-strong: #94a3b8;
  }
  html, body {
    background: #fff !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table-panel-registry { overflow: visible; }
  .view-menu, .status-legend, .filter-chips, .bulk-bar, .pc-quick-actions,
  .search-action, .hero-actions, .hero .btn, .stats-grid, .table-footer,
  .card-side, .attachments-panel, .draft-banner, .pc-summary-card.is-warning small { display: none !important; }
  #pc-table thead th { position: static; box-shadow: none; }
  a { color: #0f172a !important; text-decoration: none !important; }

  /* Паспорт: документ на A4, без «карточной» вёрстки. */
  .passport-page { max-width: none; margin: 0; color: #0f172a !important; }
  .passport-head {
    gap: 8mm;
    padding-bottom: 4mm;
    margin-bottom: 5mm;
    border-bottom: 1.5pt solid #0f172a;
  }
  .passport-brand { color: #64748b !important; font-size: 7.5pt; }
  .passport-title { margin: 1mm 0 0; font-size: 21pt; line-height: 1.08; }
  .passport-sub { margin: 1mm 0 0; color: #334155 !important; font-size: 10pt; }
  .passport-qr { width: 24mm; height: 24mm; padding: 1.5mm; border: .5pt solid #94a3b8; border-radius: 2mm; }
  .passport-page .panel {
    padding: 4mm 5mm;
    margin: 0 0 4mm;
    border: .5pt solid #cbd5e1;
    border-radius: 2mm;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .passport-page .panel:last-of-type { margin-bottom: 0; }
  .passport-page .panel h2 {
    margin: 0 0 3mm;
    padding-bottom: 1.5mm;
    border-bottom: .5pt solid #e2e8f0;
    font-size: 11.5pt;
    line-height: 1.2;
  }
  .passport-grid { gap: 2.5mm 8mm; }
  .passport-grid > div { padding-bottom: 1.5mm; border-bottom: .5pt solid #e2e8f0; }
  .passport-grid dt { color: #64748b !important; font-size: 7pt; }
  .passport-grid dd { margin: .8mm 0 0; color: #0f172a !important; font-size: 10pt; line-height: 1.3; }
  .passport-sign { margin-top: 8mm; gap: 14mm; color: #475569 !important; font-size: 8.5pt; }
  .passport-sign span { padding-top: 10mm; border-bottom: .5pt solid #64748b; }

  /* Ведомость инвентаризации. */
  .registry-print-sheet { color: #0f172a !important; }
  .registry-print-head { margin-bottom: 4mm; padding-bottom: 3mm; }
  .registry-print-head span { color: #475569 !important; }
}

/* ---------- Тёмная тема: новые компоненты ---------- */
html[data-theme="dark"] .filter-chip { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .filter-chip:hover,
html[data-theme="dark"] .filter-chip.is-active { background: #17264b; border-color: #31507f; color: #bcd0ff; }
html[data-theme="dark"] .filter-chip .chip-count { background: #1a2438; color: #9db0cc; }
html[data-theme="dark"] .filter-chip.is-active .chip-count { background: #21345c; color: #c7d7ff; }
html[data-theme="dark"] .view-menu-panel,
html[data-theme="dark"] .legend-popover,
html[data-theme="dark"] .action-menu-panel { background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .view-menu[open] > summary,
html[data-theme="dark"] .status-legend[open] > summary { background: #17264b; border-color: #31507f; color: #bcd0ff; }
html[data-theme="dark"] .bar-track { background: #1a2438; }
html[data-theme="dark"] .pc-summary-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .pc-summary-card.is-warning { background: #2a2110; border-color: #6b4a12; }
html[data-theme="dark"] .pc-summary-card.is-danger { background: #2a141a; border-color: #6b2733; }
html[data-theme="dark"] .pc-summary-card.is-ok { background: #0e2b1e; border-color: #1f5e42; }
html[data-theme="dark"] .event-list.is-timeline::before { background: var(--line-strong); }
html[data-theme="dark"] .event-kind { background: #17264b; color: #bcd0ff; }
html[data-theme="dark"] .draft-banner { background: #2a2110; border-color: #6b4a12; color: #fcd34d; }
html[data-theme="dark"] .field-error { color: #fca5a5; }
html[data-theme="dark"] .field-hint-warn { color: #fcd34d; }
html[data-theme="dark"] .search-action:hover { background: #17264b; color: #bcd0ff; }
html[data-theme="dark"] .qr-dialog { background: var(--surface); }
html[data-theme="dark"] .shortcut-list kbd { background: #141f35; border-color: var(--line-strong); }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #172338 25%, #1d2c48 37%, #172338 63%); background-size: 400% 100%; }
html[data-theme="dark"] .passport-brand { color: #8ea0bb; }

@media (max-width: 760px) {
  html[data-theme="dark"] #pc-table .pc-row { background: var(--surface); border-color: var(--line); }
}

/* ---------- Инвентаризация ---------- */
.alert-info { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; }
.alert-info p { margin: 0; }
.alert-success { border: 1px solid #a7f3d0; background: #ecfdf5; color: #065f46; }
.alert-success p { margin: 4px 0 0; }
.inv-sessions-table td:first-child a { font-weight: 700; }
.inv-progress-inline { display: inline-flex; align-items: center; gap: 8px; min-width: 140px; }
.inv-progress-track {
  display: block; width: 90px; height: 6px; border-radius: 999px;
  background: #e2e8f0; overflow: hidden;
}
.inv-progress-fill {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  transition: width .2s ease;
}
.inv-progress-text { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.inv-progress-track-lg { width: 100%; height: 10px; }
.inv-progress-panel { padding: 18px 22px; }
.inv-progress-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.inv-progress-head div { display: flex; flex-direction: column; gap: 3px; }
.inv-progress-head strong { font-size: 13px; }
.inv-progress-head span { color: var(--muted); font-size: 11.5px; }
.inv-progress-percent { color: var(--brand); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.inv-progress-hint { margin: 9px 0 0; color: var(--text-3); font-size: 11.5px; }
.inv-badge-missing { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.inv-session-note { margin: 10px 0 0; max-width: 720px; color: var(--text-3); font-size: 12px; }
.inv-summary-grid { margin-bottom: 0; }
.inv-scan-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 22px; }
.inv-scan-copy h2 { margin: 0 0 3px; font-size: 15px; }
.inv-scan-copy p { margin: 0; max-width: 560px; color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.inv-scan-form { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.inv-scan-box { min-width: 320px; }
.inv-scan-box input { width: 100%; }
.inv-items-table td { vertical-align: middle; }
.inv-row-discrepancy { background: #fffafa; }
.inv-row-pending td { color: var(--text-3); }
.inv-qty-fact { display: block; color: #b45309; font-size: 10px; font-weight: 700; }
.inv-note-text { color: #b45309; }
.inv-actions-cell { min-width: 196px; }
.inv-quick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: nowrap; }
.inv-quick-actions form { display: inline-flex; }
.btn-quiet-success { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.btn-quiet-success:hover { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.btn-quiet-danger { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.btn-quiet-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.inv-row-more { position: relative; display: inline-flex; }
.inv-row-more > summary { list-style: none; cursor: pointer; min-width: 34px; justify-content: center; }
.inv-row-more > summary::-webkit-details-marker { display: none; }
.inv-more-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 310px;
  padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); box-shadow: 0 16px 40px -16px rgba(15, 23, 42, .35);
}
.inv-more-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inv-more-form:first-child { padding-top: 0; }
.inv-more-form:last-of-type { border-bottom: 0; padding-bottom: 0; }
.inv-more-panel .field { gap: 4px; }
.inv-more-panel .field > span { font-size: 10px; }
.inv-more-panel .field input,
.inv-more-panel .field select { min-height: 34px; font-size: 11.5px; }
.inv-timeline { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.inv-timeline li { position: relative; display: flex; gap: 10px; padding: 0 0 14px 4px; }
.inv-timeline li::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 0; width: 1px; background: var(--line-strong); }
.inv-timeline li:last-child { padding-bottom: 0; }
.inv-timeline li:last-child::before { display: none; }
.inv-timeline-dot {
  position: relative; z-index: 1; flex-shrink: 0; width: 11px; height: 11px; margin-top: 4px;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 1px #bfdbfe;
}
.inv-timeline li div { min-width: 0; }
.inv-timeline strong { display: block; color: var(--text-2); font-size: 11.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.inv-timeline span:last-child { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.inv-doc-links { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }

/* ---------- Интеграции ---------- */
.integration-notice { align-items: flex-start; }
.integration-notice p { margin: 4px 0 0; }
.integration-tag { background: #eef2ff; color: #4338ca; }
.integration-preview-panel { margin-top: 16px; padding: 22px; }
.integration-preview-form .form-grid { max-width: 980px; }
.form-grid .checkline.field { flex-direction: row; align-items: center; justify-content: flex-start; gap: 9px; }
.form-grid .checkline.field > input { flex-shrink: 0; }
.form-grid .checkline.field > span { margin-bottom: 0; }
.integration-preview-form textarea { font-family: var(--font-mono); font-size: 11.5px; }
.integration-preview-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.integration-preview-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.integration-result-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.integration-result-stats div {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft);
}
.integration-result-stats span { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.integration-result-stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.tone-green { color: #047857; }
.tone-red { color: #b91c1c; }
.tone-amber { color: #b45309; }
.integration-result-note { margin: 10px 0 0; color: var(--text-3); font-size: 11.5px; }
.integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.integration-grid .panel { padding: 22px; }
.env-status-list { display: flex; flex-direction: column; gap: 7px; }
.env-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-soft); font-size: 11px;
}
.dup-list { display: flex; flex-direction: column; gap: 7px; }
.dup-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid #fde68a; border-radius: 8px;
  background: #fffbeb; font-size: 11px;
}
.dup-row span:last-child { color: #92400e; }
.integration-clean { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.integration-clean p { margin: 0; color: var(--text-3); font-size: 11.5px; }
.integration-runs-panel { margin-top: 16px; padding: 22px; }
.integration-actions-panel { margin-top: 16px; padding: 22px; }
.integration-actions-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.integration-actions-panel .integration-actions-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start; gap: 12px; margin-top: 14px;
}
.integration-actions-grid form { display: flex; flex-direction: column; gap: 6px; }
.integration-actions-grid form > button { width: 100%; }
.integration-actions-grid small { color: var(--text-3); font-size: 10.5px; line-height: 1.45; }
.sync-fields-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.sync-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
.sync-summary-title {
  color: var(--muted); font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.sync-summary-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sync-summary-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-soft); font-size: 11px; color: var(--text-2);
}
.sync-summary-chip strong { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); }

html[data-theme="dark"] .alert-info { background: #0d1c33; border-color: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .alert-success { background: #0e2b1e; border-color: #1f5e42; color: #6ee7b7; }
html[data-theme="dark"] .inv-progress-track { background: #1a2438; }
html[data-theme="dark"] .inv-row-discrepancy { background: #221318; }
html[data-theme="dark"] .inv-badge-missing { background: #331318; color: #fca5a5; border-color: #6b2733; }
html[data-theme="dark"] .inv-more-panel { background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .btn-quiet-success { background: #0e2b1e; border-color: #1f5e42; color: #6ee7b7; }
html[data-theme="dark"] .btn-quiet-success:hover { background: #123a27; border-color: #2b7a58; }
html[data-theme="dark"] .btn-quiet-danger { background: #2a141a; border-color: #6b2733; color: #fca5a5; }
html[data-theme="dark"] .btn-quiet-danger:hover { background: #3a1a22; border-color: #8a3340; }
html[data-theme="dark"] .inv-timeline-dot { box-shadow: 0 0 0 1px #31507f; border-color: var(--surface); }
html[data-theme="dark"] .inv-qty-fact,
html[data-theme="dark"] .inv-note-text { color: #fcd34d; }
html[data-theme="dark"] .integration-tag { background: #18224a; color: #a5b4fc; }
html[data-theme="dark"] .integration-result-stats div,
html[data-theme="dark"] .env-status-row { background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .dup-row { background: #2a2110; border-color: #6b4a12; }
html[data-theme="dark"] .dup-row span:last-child { color: #fcd34d; }
html[data-theme="dark"] .tone-green { color: #6ee7b7; }
html[data-theme="dark"] .tone-red { color: #fca5a5; }
html[data-theme="dark"] .tone-amber { color: #fcd34d; }

@media (max-width: 1180px) {
  .inv-scan-panel { flex-direction: column; align-items: stretch; }
  .inv-scan-form { width: 100%; }
  .inv-scan-box { flex: 1; min-width: 0; }
}
@media (max-width: 900px) {
  .integration-result-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .integration-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .inv-quick-actions { flex-wrap: wrap; justify-content: flex-start; }
  .inv-actions-cell { min-width: 0; }
  .inv-more-panel { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .inv-scan-form { flex-wrap: wrap; }
  .inv-scan-form .btn { width: 100%; }
  .integration-result-stats { grid-template-columns: 1fr 1fr; }
  .integration-preview-panel,
  .integration-actions-panel,
  .integration-runs-panel,
  .integration-grid .panel { padding: 16px; }
  .integration-actions-panel .integration-actions-grid { grid-template-columns: 1fr; }
  .sync-fields-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .inv-progress-head { align-items: flex-start; }
}



/* ---------- Загрузка сотрудников из 1С ЗУП ---------- */
.import-upload-panel,
.import-help-panel,
.import-summary-panel { padding: 22px; }
.import-upload-panel { margin-bottom: 16px; }
.import-upload-form { display: flex; flex-direction: column; gap: 16px; max-width: 780px; }
.import-upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.import-upload-form input[type="file"] {
  height: auto;
  min-height: 44px;
  padding: 8px;
  font-size: 11.5px;
}
.import-upload-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.import-upload-form input[type="file"]::file-selector-button:hover {
  border-color: #bfdbfe;
  color: var(--brand);
}
.import-help-panel { margin-top: 16px; }
.import-help-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; }
.import-help-grid h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.015em; }
.import-help-grid h3 { margin: 0 0 6px; font-size: 13px; }
.import-help-grid p { margin: 0 0 12px; color: var(--text-3); font-size: 12px; line-height: 1.55; }
.import-steps { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12px; line-height: 1.75; }
.import-help-note { padding-left: 26px; border-left: 1px solid var(--line); }
.import-summary-panel { margin-bottom: 16px; }
.import-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.import-stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.import-stat span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.import-stat strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.import-mapping { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; }
.import-status-bulk { margin-top: 14px; margin-bottom: 0; }
.import-bulk-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.import-bulk-controls .select-wrap select { min-width: 150px; }
.import-table { min-width: 1080px; }
.import-select {
  max-width: 320px;
  min-height: 34px;
  padding: 6px 26px 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
}
.import-select:focus { outline: none; border-color: #93b4fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.import-status-select { min-width: 132px; }
.import-status-select.is-unknown { border-color: #f59e0b; background: #fffbeb; }
.import-action-select { min-width: 230px; }
.import-row-manual td { background: #fffdf5; }
.import-apply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.import-apply-actions .muted { font-size: 11.5px; }

html[data-theme="dark"] .import-stat { background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .import-select { background: #0c1526; border-color: #2b3c58; color: #e2e8f0; }
html[data-theme="dark"] .import-status-select.is-unknown { background: #33240f; border-color: #a16207; }
html[data-theme="dark"] .import-row-manual td { background: #221d10; }
html[data-theme="dark"] .import-apply-actions { background: var(--surface-soft); }

@media (max-width: 1100px) {
  .import-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .import-help-grid { grid-template-columns: 1fr; gap: 18px; }
  .import-help-note { padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .import-summary { grid-template-columns: 1fr 1fr; }
  .import-upload-actions .btn,
  .import-apply-actions .btn { width: 100%; }
}

/* ---------- Сотрудники: фото, чек-лист, оргструктура, дубли ---------- */
.employee-header { align-items: flex-start; gap: 18px; }
.employee-header .pc-header-main { flex: 1; }
.employee-photo {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border: 3px solid #fff;
  border-radius: 22px;
  background: #e2e8f0;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.employee-photo-empty {
  display: grid;
  place-items: center;
  background: hsl(var(--hue, 220) 70% 93%);
  color: hsl(var(--hue, 220) 50% 30%);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: .02em;
}
.photo-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-upload .employee-photo { width: 84px; height: 84px; border-radius: 20px; }
.photo-upload-controls { display: flex; flex-direction: column; gap: 7px; color: var(--text-3); font-size: 12px; }
.photo-upload-controls input[type="file"] { max-width: 100%; font-size: 12px; }
.subordinate-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; padding: 0; list-style: none; }
.subordinate-list li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}
.employee-history .timeline-name { font-weight: 500; overflow-wrap: anywhere; }

.checklist-form { display: flex; flex-direction: column; gap: 14px; }
.checklist-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.checklist-group {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.checklist-group h3 {
  margin: 0 0 10px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.checklist-group .checkline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  white-space: normal;
  line-height: 1.4;
}
.checklist-group .checkline input { flex-shrink: 0; margin-top: 2px; }
.checklist-group .checkline > span { display: flex; flex-direction: column; gap: 2px; }
.checklist-group .checkline:has(input:checked) .checkline-title {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
}
.progress-track {
  height: 8px;
  margin: 4px 0 14px;
  border-radius: 999px;
  background: #e8eef8;
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width .3s ease;
}
.offboarding-panel { margin-bottom: 16px; padding: 22px; }

.org-tree { display: flex; flex-direction: column; gap: 14px; }
.org-root { padding: 18px 20px; }
.org-node { margin-top: 14px; padding-left: 18px; border-left: 2px solid var(--line-strong); }
.org-root > .org-node { margin-top: 0; padding-left: 0; border-left: 0; }
.org-node-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.org-node-head strong { display: block; font-size: 14px; }
.org-employees { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }
.org-employee {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: .14s ease;
}
.org-employee:hover { border-color: #bfdbfe; background: #eff6ff; }
.org-employee .mini-avatar { width: 30px; height: 30px; font-size: 10px; }
.org-employee > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.org-employee .entity-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.department-tree { display: flex; flex-direction: column; gap: 12px; }
.department-tree-root {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.department-tree-root strong { display: block; }
.department-tree-child { margin-top: 6px; padding-left: 16px; border-left: 1px dashed var(--line-strong); font-size: 12px; }
.department-tree-child .cell-sub { margin-left: 6px; }

.merge-groups { display: flex; flex-direction: column; gap: 16px; }
.merge-group { padding: 20px; }
.merge-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.merge-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.merge-table { min-width: 900px; }
.merge-table input[type="radio"],
.merge-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.merge-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.merge-actions .panel-hint { max-width: 640px; margin: 0; }

.trash-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.trash-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  transition: .14s ease;
}
.trash-filter:hover { border-color: #bfdbfe; color: var(--brand); }
.trash-filter.active { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.trash-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.trash-actions form { margin: 0; }
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 9.5px;
  font-weight: 750;
}
.toolbar-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.hardware-api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.hardware-api-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.hardware-key-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

html[data-theme="dark"] .employee-photo { border-color: var(--surface); background: #1a2438; }
html[data-theme="dark"] .employee-photo-empty { background: hsl(var(--hue, 220) 35% 22%); color: hsl(var(--hue, 220) 60% 80%); }
html[data-theme="dark"] .checklist-group,
html[data-theme="dark"] .org-employee,
html[data-theme="dark"] .department-tree-root,
html[data-theme="dark"] .hardware-api-item,
html[data-theme="dark"] .subordinate-list li { background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .org-employee:hover { background: #16213a; border-color: #31507f; }
html[data-theme="dark"] .progress-track { background: #1a2438; }
html[data-theme="dark"] .trash-filter { background: var(--surface); border-color: var(--line); color: var(--text-3); }
html[data-theme="dark"] .trash-filter.active { background: #14213f; border-color: #31507f; color: #93c5fd; }
html[data-theme="dark"] .nav-count { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .merge-table-wrap { border-color: var(--line); }
html[data-theme="dark"] .org-node { border-color: var(--line-strong); }
html[data-theme="dark"] .department-tree-child { border-color: var(--line-strong); }

@media (max-width: 900px) {
  .employee-photo { width: 72px; height: 72px; border-radius: 18px; }
  .checklist-groups { grid-template-columns: 1fr; }
  .hardware-api-grid { grid-template-columns: 1fr; }
  .merge-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 600px) {
  .employee-header { flex-direction: column; }
  .photo-upload { flex-direction: column; align-items: flex-start; }
  .org-employees { grid-template-columns: 1fr; }
  .trash-filter { padding: 6px 10px; }
}

/* =========================================================
   Доступность и читаемость (UX-04 … UX-12)
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  transform: translateY(-160%);
  transition: transform .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#main-content:focus { outline: none; }

/* Минимальные размеры вспомогательного текста */
.brand-text small { font-size: 11px; }
.footer { font-size: 12px; }
.footer-brand { color: var(--muted); }
.stat-hint { font-size: 11px; }
.panel-hint { font-size: 12px; }
.field small { font-size: 12px; }
.detail dt,
.side-details dt { font-size: 11px; }
.timeline-label,
.preview-meta > span:first-child,
.warehouse-card-stats span { font-size: 11px; }
.mini-avatar { font-size: 11px; }
.timeline-periods,
.event-body time,
.document-meta,
.cell-sub,
.compact-main small,
.quick-card > span:last-child,
.warehouse-info span,
.act-item-meta,
.act-item-status,
.maintenance-note,
.settings-last-backup p { font-size: 11.5px; }
.section-sub,
.modal-head p,
.form-section-head p,
.status-form label { font-size: 12px; }
.field-error { font-size: 12px; }
#pc-table td::before { font-size: 11px; }

/* Сводка серверных ошибок получает фокус и озвучивается */
.alert-error[id],
.form-errors {
  outline: none;
}
.alert-error[tabindex="-1"]:focus,
.alert-error[tabindex="-1"]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* UX-02: мобильные таблицы склада, номенклатуры, лицензий и сотрудников */
@media (max-width: 760px) {
  .table-panel-cards .table-scroll { max-height: none; min-height: 0; overflow: visible; }
  .table-cards { display: block; min-width: 0; width: 100%; border-collapse: separate; }
  .table-cards thead { display: none; }
  .table-cards tbody { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .table-cards tbody tr {
    display: block;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards td {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    border: 0;
    background: transparent !important;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .table-cards td::before {
    content: attr(data-label);
    flex: 0 0 45%;
    max-width: 160px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .table-cards td:not([data-label])::before,
  .table-cards td.td-check::before { display: none; }
  .table-cards td.num { justify-content: flex-start; }
  .table-cards td.td-check { padding-bottom: 8px; }
  .table-cards .table-footer { border-top: 0; }
  html[data-theme="dark"] .table-cards tbody tr { background: var(--surface); border-color: var(--line); }
}

@media (max-width: 600px) {
  /* UX-03: не занимаем 20% экрана липкой шапкой */
  .topbar { position: static; }
  .table-cards td::before { flex-basis: 100%; }
  .table-cards td { flex-wrap: wrap; }
}

/* UX-12: уважаем настройку reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .skip-link { transition: none; }
  .stat-card:hover,
  .warehouse-card:hover,
  .quick-card:hover,
  .nav-link:hover,
  .btn:hover { transform: none !important; }
}

/* ---------- Пользователи, вход и CSRF ---------- */
.auth-page .main-nav { display: none; }
.auth-shell {
  min-height: calc(100vh - 240px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
}
.auth-card-wide { max-width: 560px; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand strong { display: block; font-size: 15px; }
.auth-brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-sub { margin: 0 0 22px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.auth-form { display: grid; gap: 14px; }
.auth-foot { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-error { max-width: 560px; margin: 48px auto; }
.auth-error p { max-width: 46ch; }

.user-menu { position: relative; }
.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.user-menu-toggle:hover { background: var(--surface-soft); }
.user-menu-toggle > svg { width: 14px; height: 14px; color: var(--muted); }
.user-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--indigo));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-menu-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.user-menu-panel[hidden] { display: none; }
.user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu-head strong { display: block; font-size: 13px; }
.user-menu-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.user-menu-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-link:hover { background: var(--surface-soft); }
.user-menu-logout { color: var(--red); }

.role-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.role-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.role-grid strong { display: block; margin-bottom: 4px; font-size: 13px; }
.role-grid span { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }

.token-reveal { border-color: #bfdbfe; background: #eff6ff; }
.token-value {
  padding: 12px 14px;
  margin: 12px 0;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: var(--surface);
  word-break: break-all;
  font-size: 13px;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.inline-form { display: inline; }
.inline-danger { color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }
.inline-danger:hover { text-decoration: underline; }
.text-red { color: var(--red); font-weight: 700; }
.status-off { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.tag-warn { background: #fef3c7; color: #b45309; }
.toolbar-field { min-width: 130px; }
.toolbar-field > span { font-size: 11px; }

html[data-theme="dark"] .token-reveal { border-color: #1e3a5f; background: #0f2038; }
html[data-theme="dark"] .token-value { border-color: #1d4ed8; }
html[data-theme="dark"] .user-menu-panel { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .status-off { background: #1a2438; color: #94a3b8; border-color: #2a3a55; }
html[data-theme="dark"] .tag-warn { background: #3b2a0e; color: #fcd34d; }

@media (max-width: 900px) {
  .user-menu-name { display: none; }
}
