/* =====================================================
   OpsCore — Industrial SaaS Design System 2026
   Clarity · Hierarchy · Speed · Operational Focus
   ===================================================== */

:root {
  /* ── Unified UI tokens ── */
  --ui-r: 6px;          /* badges, buttons, pills, small elements */
  --ui-r-lg: 8px;       /* containers, cards, panels */
  --ui-r-xl: 12px;      /* shell, modals */
  --ui-border: 1px solid #E6E8EC;

  /* ── Base unit: 4px ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Layout ── */
  --page-padding:  20px;
  --section-gap:   16px;
  --card-padding:  16px;
  --row-height:    64px;
  --row-compact:   48px;

  /* ── Palette: Neutral ── */
  --bg:             #F7F8FA;   /* заливка плиток и шапок таблиц ВНУТРИ белых блоков */
  --canvas:         #EEF1F5;   /* полотно страницы — снято с макета */
  /* --bg-main использовалась в разметке (настройки, база знаний), но НЕ БЫЛА
     объявлена: браузер подставлял пустоту, и блоки оставались без фона. Третья
     такая переменная за день, после --muted/--card/--hover и --primary-dark. */
  --bg-main:        var(--bg-card);

  /* ── ПСЕВДОНИМЫ: ИМЕНА, КОТОРЫМИ ПОЛЬЗУЕТСЯ РАЗМЕТКА ──
     Все семь используются в коде, но НИ ОДНО не было объявлено: браузер
     подставлял пустоту, и элемент оставался без фона, рамки или цвета. Ошибка
     тихая — в исходнике всё выглядит правильно. Нашла проверка
     scripts/check-css-vars.js; она же не даст завести восьмую такую.
     Значения выбраны по смыслу использования, не наугад:
       --bg-secondary — фон плашек и чипов, это заливка внутри блока;
       --bg-input     — поле ввода, оно белое;
       --bg-hover     — подсветка строки под курсором;
       --bg-elevated  — «приподнятый» блок, у нас это карточка;
       --bg-page      — полотно страницы;
       --border-color — обычная рамка;
       --text-primary — основной текст. */
  --bg-secondary:   var(--bg);
  --bg-input:       var(--bg-card);
  --bg-hover:       var(--bg-muted);
  --bg-elevated:    var(--bg-card);
  --bg-page:        var(--canvas);
  --border-color:   var(--border);
  --text-primary:   var(--text);
  --bg-muted:       #EEF1F5;
  --bg-card:        #FFFFFF;
  --bg-sidebar:     #0F172A;
  --bg-sidebar-hover:  rgba(255,255,255,.06);
  --bg-sidebar-active: rgba(255,255,255,.10);

  --border:         #E6E8EC;
  --border-light:   #F0F2F5;

  --text:           #0F172A;
  --text-secondary: #374151;
  --text-muted:     #6B7280;
  --text-sidebar:   #94A3B8;
  --text-sidebar-active: #F8FAFC;

  /* ── Brand ──
     Зелёный макета, раскатан со всего раздела «Электрохозяйство» на приложение
     29.08.2026. Прежний приглушённый var(--green-700) остался в истории git.
     ПОЧЕМУ --primary ЭТО 700-й, А НЕ ЯРКИЙ 600-й. Сначала было наоборот, и
     проверка контраста нашла разбросанный по разделам нечитаемый зелёный
     текст: в коде десятки мест вида color:${active ? 'var(--primary)' : ...} —
     цвет собирается в момент отрисовки, и заменить их разом нельзя.
     Поэтому безопасное значение по умолчанию — тёмный: как текст он даёт
     5,0:1, как заливка выглядит тем же зелёным, только глубже. Яркий 600-й
     ставится ЯВНО и только под крупную заливку (кнопка .btn-primary). */
  --primary:        var(--green-700);   /* см. пояснение ниже — НЕ 600 */
  --primary-hover:  var(--green-800);
  --primary-light:  var(--green-100);
  --primary-ring:   var(--green-ring);
  --primary-dark:   var(--green-800);   /* использовался, но НЕ был объявлен */

  /* ── Зелёная шкала с макета (пилот: раздел «Электрохозяйство») ──
     Насыщенный зелёный, который выбрал владелец. Глобально --primary пока НЕ
     меняем: токены переопределяются ТОЛЬКО внутри #page-power (app-power.js).
     Разделение обязательное: белый текст на --green-600 даёт контраст 3,3:1 —
     этого хватает крупной заливной кнопке и не хватает мелкому тексту. Поэтому
     600 идёт под ЗАЛИВКИ, а зелёный текст и значки на белом — только 700 (5:1). */
  --green-600:  #16A34A;   /* заливки: кнопки, активная метка, подчёркивание вкладки */
  --green-700:  #15803D;   /* зелёное НА БЕЛОМ: текст, ссылки, статусы; ховер кнопки */
  --green-800:  #166534;   /* нажатие */
  --green-50:   #F0FDF4;
  --green-100:  #E4F2E8;   /* подсветка выбранной строки — снято с макета */
  --green-ring: rgba(22,163,74,.16);

  /* ── Accent: Blue ── */
  --accent:         #2563EB;
  --accent-hover:   #1D4ED8;
  --accent-light:   #EFF6FF;

  /* ── Status ── */
  --success:           #22C55E;
  --success-light:     #F0FDF4;
  --warning:           #F59E0B;
  --warning-light:     #FFFBEB;
  --destructive:       #EF4444;
  --destructive-light: #FEF2F2;
  --info:              #3B82F6;
  --info-light:        #EFF6FF;
  --purple:            #8B5CF6;
  --purple-light:      #F5F3FF;

  /* ── Priority ── */
  --priority-critical: #EF4444;
  --priority-high:     #F59E0B;
  --priority-medium:   #3B82F6;
  --priority-low:      #9CA3AF;

  /* ── Elevation / Shadows ── */
  --shadow-0:  none;
  --shadow-1:  0 1px 2px rgba(15,23,42,.05);
  --shadow-2:  0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-3:  0 12px 32px rgba(15,23,42,.12), 0 4px 8px rgba(15,23,42,.06);
  --shadow-4:  0 24px 48px rgba(15,23,42,.16), 0 8px 16px rgba(15,23,42,.08);
  /* Алиасы */
  --shadow-sm: var(--shadow-1);
  --shadow:    var(--shadow-1);
  --shadow-md: var(--shadow-2);
  --shadow-lg: var(--shadow-3);

  /* ── Radius ── */
  --radius:    10px;
  --radius-sm:  7px;
  --radius-xs:  5px;
  --radius-full: 999px;

  /* ── Motion ── */
  --duration-fast:   120ms;
  --duration-normal: 180ms;
  --duration-slow:   240ms;
  --ease:            cubic-bezier(.4,0,.2,1);
  --transition:      var(--duration-normal) var(--ease);

  /* ── Layout ── */
  --sidebar-w:            240px;
  --sidebar-w-collapsed:   72px;
  --header-h:              56px;

  /* ── Typography ── */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', sans-serif;   /* был Manrope — ушли к одной гарнитуре */
  --font-mono:    ui-monospace, 'Fira Code', monospace;  /* JetBrains не использовался ни разу */

  /* ── Density mode (default: comfortable) ── */
  --density-row:      var(--row-height);
  --density-padding:  var(--card-padding);
  --density-font:     14px;
}


*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }


body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--text);
  font-size: var(--density-font, 14px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

/* Tabular nums для всех числовых значений */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* === Layout === */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  /* Короткая анимация (150мс) — компромисс между плавностью и тем,
     чтобы рассинхрон с мгновенным layout-переключением не бросался в глаза. */
  transition: width .15s ease, transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 14px;
  height: var(--header-h);
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.sidebar-logo svg { color: #fff; }
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }

.sidebar-title {
  color: #fafaf9;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
}

/* Развёрнутое: лого слева, кнопка справа (margin-left:auto прижимает к правому краю). */
.sidebar-toggle {
  margin-left: auto;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.22); }

/* Свёрнуто: шапка переключается в колонку — лого сверху, кнопка под ним.
   Чтобы не было «собирается в середину» — переключение мгновенное (см. правило ниже). */
.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  height: auto;
  padding: 12px 0 10px;
  gap: 8px;
  align-items: center;
}
.sidebar.collapsed .sidebar-toggle { margin-left: 0; }

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title { display: none; }

.sidebar-nav { flex: 1; min-height: 0; padding: 10px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav { scrollbar-width: none; -ms-overflow-style: none; }

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.28);
  padding: 16px 10px 5px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-sidebar);
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover { background: var(--bg-sidebar-hover); color: #e7e5e4; }
.nav-item.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); }
.nav-item.active .nav-badge { background: rgba(255,255,255,.2); }

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* Вложенный пункт меню (подраздел) */
.nav-item-sub {
  padding-left: 28px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
}
.nav-item-sub:hover { opacity: 1; }
.nav-item-sub svg { width: 13px; height: 13px; opacity: 0.7; }
.sidebar.collapsed .nav-item-sub { padding-left: 10px; }
.sidebar.collapsed .nav-item-sub .nav-label { display: none; }

/* === Секции на странице 1С === */
.sync-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin: 0 16px 14px;
}
.sync-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.sync-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sync-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sync-section-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.sync-section-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Карточки счётчиков буфера */
.sync-stat-card {
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sync-stat-card:hover { transform: translateY(-1px); }
.sync-stat-card.active { background: var(--bg-card); }
.sync-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Табы фильтра в буфере */
.sync-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.sync-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.sync-tab:hover { color: var(--text); }
.sync-tab.sync-tab-active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
  font-weight: 600;
}

/* Внутренние табы страницы 1С */
.sync-inner-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 14px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.sync-inner-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sync-inner-tab:hover { border-color: var(--green-700); color: var(--green-700); }
.sync-inner-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--green-700);
  font-weight: 600;
}
.sync-inner-tab .sync-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  color: inherit;
}
.sync-inner-tab:not(.active) .sync-tab-badge {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Строки токенов / лога / обследований */
.sync-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: border-color .15s;
}
.sync-row:hover { border-color: var(--green-700); }

/* === Режим выбора оборудования (пакетная печать QR) === */
.eq-card { position: relative; }
.eq-card .eq-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none; /* клик ловится самой карточкой */
  transition: all .15s;
}
.eq-card .eq-card-checkbox svg {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transition: opacity .15s;
}
body.eq-select-mode .eq-card { cursor: pointer; }
body.eq-select-mode .eq-card .eq-card-checkbox { display: flex; }
body.eq-select-mode .eq-card.is-selected {
  background: #f0fdf4 !important;
  border-color: var(--green-700) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .15);
}
body.eq-select-mode .eq-card.is-selected .eq-card-checkbox {
  background: var(--primary);
  border-color: var(--green-700);
}
body.eq-select-mode .eq-card.is-selected .eq-card-checkbox svg { opacity: 1; }

/* Action-bar внизу страницы */
.eq-select-actionbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  z-index: 1000;
  font-size: 14px;
  animation: eqSelectBarIn .18s ease-out;
}
@keyframes eqSelectBarIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.eq-select-actionbar .eq-sel-count {
  font-weight: 700;
  margin-right: 4px;
}
.eq-select-actionbar .eq-sel-count em {
  font-style: normal;
  color: #86efac;
  margin: 0 2px;
}
.eq-select-actionbar .btn-sel {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s;
}
.eq-select-actionbar .btn-sel:hover { background: rgba(255,255,255,.1); }
.eq-select-actionbar .btn-sel.btn-sel-primary {
  background: var(--primary);
  border-color: var(--green-700);
}
.eq-select-actionbar .btn-sel.btn-sel-primary:hover { background: #16a34a; }
.eq-select-actionbar .btn-sel:disabled { opacity: .4; cursor: not-allowed; }

/* Кнопка-тогл «Выбрать» в активном состоянии */
#eq-select-toggle-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--green-700);
}

/* Таббар внутри раздела «Склад» */
.warehouse-tabbar {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  overflow-x: auto;
  margin: 0 0 16px 0;
  -webkit-overflow-scrolling: touch;
}
.wh-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  text-decoration: none;
  position: relative;
}
.wh-tab:hover { color: var(--text); }
.wh-tab.active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
  font-weight: 600;
}
.wh-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.wh-tab .wh-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 4px;
}
@media (max-width: 768px) {
  .warehouse-tabbar { padding: 0 12px; }
  .wh-tab { padding: 10px 12px; font-size: 12px; }
  .wh-tab svg { display: none; }
}

.nav-badge {
  margin-left: auto;
  background: var(--destructive);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  pointer-events: none;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}


#sidebar-toggle-btn:hover { background: var(--bg-muted) !important; color: var(--text) !important; }

/* Collapsed sidebar */
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-w-collapsed); }
.sidebar.collapsed ~ .mobile-overlay { display: none !important; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer .nav-item { justify-content: center; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 10px; }

/* Badge в свёрнутом sidebar — абсолютное позиционирование */
.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  padding: 0 4px;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  border-radius: 7px;
  margin-left: 0;
}
/* В обычном режиме badge с иконкой-wrap выглядит правильно */
.sidebar:not(.collapsed) .nav-icon-wrap .nav-badge {
  position: absolute;
  top: -5px; right: -7px;
}

/* Tooltip on collapsed */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: #292524;
  color: #fafaf9;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

/* SSE dot */
#sse-dot {
  transition: background .4s, box-shadow .4s;
}
@keyframes ssePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22,163,74,.2); }
  50%       { box-shadow: 0 0 0 5px rgba(22,163,74,.06); }
}
@keyframes ssePulseAnim {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22,163,74,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(22,163,74,.06); }
}

/* =====================================================
   MAIN / HEADER
   ===================================================== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  transition: margin-left .15s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  /* ВОТ ПОЧЕМУ НА ПК ВСЁ ПОТЕРЯЛОСЬ: рабочая область была белой, и серое
     полотно с body до неё не доходило — белые блоки лежали на белом. Ставим
     полотно здесь; полоса за таббаром на телефоне закрывается ниже отдельно. */
  background: var(--canvas);
}

.header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 200px);
  display: block;
}
@media (max-width: 767px) {
  .header-title { max-width: calc(100vw - 140px); font-size: 14px; }
}
.header-spacer { flex: 1; }
.content { padding: 20px; }

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: default;
  flex: 1 1 auto;
  min-width: 140px;
}

.stat-card:hover { border-color: var(--text-muted); }
/* Плитка внутри белого блока — на заливке, как в «Электрохозяйстве». Снаружи,
   прямо на сером полотне, она остаётся белой: серое на сером пропадёт. */
.page-shell .stat-card,
.v4-shell .stat-card,
.section .stat-card { background: var(--bg); }

.stat-card-header { display: none; }


.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.stat-card-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.stat-card-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* Color variants */

.stat-card.card-active {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: var(--primary-light);
}
.stat-card[onclick] { transition: all var(--transition); }
.stat-card[onclick]:active { transform: scale(.96); }

/* Базовые правила подэлементов stat-card (без mobile-override) */
.stat-card-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

/* Row контейнер для stat-card-ов */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.stats-row .stat-card { margin: 0; min-width: 200px; }

/* Карточка счётчика (раздел «Ресурсы») */
.meter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.meter-card::before {
  content: "";
  position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--meter-accent, #d1d5db);
}
.meter-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--meter-accent, var(--primary));
  transform: translateY(-2px);
}
.meter-card-top { display: flex; gap: 12px; align-items: flex-start; }
.meter-card-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.meter-card-name { font-weight: 600; font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-card-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.meter-card-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 16px; }
.meter-card-value { font-size: 23px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.meter-card-unit { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.meter-card-when { font-size: 11px; margin-top: 3px; }
.meter-card-btn { flex-shrink: 0; }

/* Подзаголовок страницы */
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }


/* =====================================================
   SECTION
   ===================================================== */
/* Рамки у блоков нет: на сером полотне блок и так виден, а рамка возвращает ту
   самую «обводку», от которой отказались. Прозрачная, а не none, чтобы не
   поехала раскладка — рамка занимает место. */
.section {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: none;
  transition: box-shadow var(--transition);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -.02em;
}
.section-title svg { width: 16px; height: 16px; color: var(--text-muted); }

.section-body { padding: 0; }

/* =====================================================
   TASK LIST
   ===================================================== */
.task-list { list-style: none; }

/* ─── Task Row (DS 2026) ─── */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast) var(--ease);
  cursor: pointer;
  min-height: var(--density-row, 64px);
  position: relative;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover {
  background: var(--bg-muted);
}

/* Priority stripe — 3px, цвет по системе приоритетов */
.task-priority-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
  min-height: 40px;
  margin: 10px 0;
}
.task-priority-bar.critical { background: var(--priority-critical); }
.task-priority-bar.high     { background: var(--priority-high); }
.task-priority-bar.medium   { background: var(--priority-medium); }
.task-priority-bar.normal   { background: var(--border); }
.task-priority-bar.low      { background: var(--border); }
.task-priority-bar.mine     { background: var(--primary); }

/* Task icon */
.task-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-icon svg { width: 16px; height: 16px; }

.task-info { flex: 1; min-width: 0; }

.task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  letter-spacing: -.01em;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.task-meta-item {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.task-meta-item svg { width: 11px; height: 11px; }

/* ─── Badges (DS 2026 — pill style) ─── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  height: 22px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: .01em;
  flex-shrink: 0;
}

/* Мягкие tint-badge вместо сплошных */
.badge-overdue    { background: #FEE2E2; color: #B91C1C; }
.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-completed  { background: #d6f0df; color: #173626; }
.badge-cancelled  { background: var(--bg-muted); color: var(--text-muted); }


/* Правая колонка: статус + счётчики */
.task-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 90px;
}

/* В строке задачи */
.task-item > .badge,
.task-status-col .badge {
  align-self: center;
  flex-shrink: 0;
  min-width: 90px;
  justify-content: center;
}

/* Зона actions — всегда фиксированная ширина для выравнивания */
.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  width: 66px;
  min-width: 66px;
}
.task-actions:empty { visibility: hidden; }

/* Кнопки быстрых действий в строке задачи */
.task-actions .btn-icon {
  width: 28px; height: 28px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
}
.task-actions .btn-icon:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}
.task-actions .btn-icon.success {
  border-color: #bbf7d0;
  color: var(--green-700);
  background: #eef8f2;
}
.task-actions .btn-icon.success:hover {
  border-color: var(--green-700);
  background: #dcfce7;
  color: #15803d;
}
.task-actions .btn-icon svg { width: 14px; height: 14px; }

.btn-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-muted); color: var(--text); }
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon.success:hover { background: var(--success-light); color: var(--green-700); }
.btn-icon.danger:hover  { background: var(--destructive-light); color: var(--destructive); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }

/* Кнопка — единственное место, где живёт яркий 600-й: крупная заливка, белый
   текст на ней даёт 3,3:1 при пороге 3:1 для такого кегля. */
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); box-shadow: 0 2px 8px var(--primary-ring); }

.btn-danger { background: var(--destructive); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* Кнопка "Сообщить о проблеме" на странице локации:
   на десктопе — auto-ширина с увеличенным padding (выделяется);
   на мобильном — full-width (палец комфортно ложится). */
.btn-report-loc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
}
@media (max-width: 768px) {
  .btn-report-loc { width: 100%; }
}
/* Низ страниц-деталей не должен прятаться под мобильный tab-bar (height: ~66px).
   Используем 767px как остальной проект + .active + !important — иначе .content/.page
   и анимации перебивают. */
@media (max-width: 767px) {
  #page-location-detail.active,
  #page-equipment-detail.active,
  #page-task-detail.active,
  #page-task-details.active,
  #page-knowledge.active { padding-bottom: 120px !important; }
}

.btn-outline { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-muted); border-color: #d4d0cb; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* =====================================================
   EQUIPMENT
   ===================================================== */
.eq-group { margin-bottom: 4px; }
.eq-group:last-child { margin-bottom: 0; }

.eq-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.eq-group-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  padding: 0 6px;
}

.eq-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px 16px;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* ─── Equipment Card (DS 2026) ─── */
.eq-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-padding);
  padding-left: calc(var(--card-padding) + 6px);
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
  background: var(--bg-card);
  box-shadow: var(--shadow-1);
  position: relative;
}
.eq-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
  border-color: var(--border);
}
.eq-card:active { transform: translateY(0); }

.eq-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }

.eq-card-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.eq-card-icon svg { width: 20px; height: 20px; }

.eq-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.eq-card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
/* Значки «фото / метка / Агросигнал» (08.10.2026): у оборудования — рядом под
   подзаголовком; у техники на десктопе — в строке с названием, на телефоне —
   отдельным рядом, чтобы не прыгали между строкой с номером и следующей. */
.intake-icons { display: inline-flex; align-items: center; gap: 6px; }
.eq-card-icons { margin-top: 4px; }
@media (max-width: 768px) {
  .veh-name-line .intake-icons { flex-basis: 100%; margin-top: 2px; }
}

.eq-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.eq-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
.eq-status-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); cursor: pointer; transition: background .15s, border-color .15s; }
.eq-status-btn:hover { background: var(--bg-hover, #f8fafc); border-color: var(--green-700); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* Quick status sheet — bottom sheet на мобиле, центральная модалка на десктопе */
.qss-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9998; display: flex; align-items: flex-end; justify-content: center; }
.qss-sheet { background: var(--bg-card); border-radius: 16px 16px 0 0; width: 100%; max-width: 480px; padding: 8px 0 16px; animation: slideUp .2s ease; }
.qss-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 8px auto 12px; }
@media (min-width: 768px) {
  .qss-overlay { align-items: center; padding: 20px; }
  .qss-sheet { border-radius: 16px; max-width: 420px; padding: 16px 0; animation: fadeInUp .15s ease; box-shadow: 0 20px 50px rgba(0,0,0,.15); }
  .qss-handle { display: none; }
}
.eq-status-dot { width: 7px; height: 7px; border-radius: 50%; }
.eq-status-dot.active        { background: var(--success); }
.eq-status-dot.maintenance   { background: var(--warning); }
.eq-status-dot.broken        { background: var(--destructive); }
.eq-status-dot.decommissioned{ background: #a8a29e; }
.eq-status-dot.storage       { background: #0ea5e9; }   /* хранение — не поломка и не списание */

/* =====================================================
   FILTERS
   ===================================================== */
.filters-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  transition: all var(--transition);
}
.filter-chip:hover { border-color: var(--green-700); color: var(--green-700); }
.filter-chip.active { background: var(--primary-light); border-color: var(--green-700); color: var(--green-700); }

.filter-chip .chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.07);
  font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 9px; padding: 0 4px; margin-left: 2px;
}
.filter-chip.active .chip-count { background: var(--primary-ring); }

/* =====================================================
   MODAL
   ===================================================== */
/* ─── Modal (DS 2026) ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  /* backdrop-filter: blur(4px) убран — убивает производительность при вводе текста */
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-4);
  border: 1px solid var(--border);
  /* animation убрана — transform во время анимации создаёт compositor layer
     который замедляет input events */
  animation: modal-fade var(--duration-fast) ease-out;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-muted);
  border: none; cursor: pointer;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease);
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body {
  padding: 20px 24px 4px;
  overflow-y: auto;
  flex: 1;
}
.form-group   { margin-bottom: 16px; }
.form-label   {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input, .form-select, .form-textarea, .form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--duration-fast) var(--ease);
  outline: none;
  line-height: 1.5;
  /* box-shadow без transition — мгновенно, без repaint на каждый keystroke */
}
.form-input:focus, .form-select:focus,
.form-textarea:focus, .form-control:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-input:hover:not(:focus), .form-select:hover:not(:focus),
.form-textarea:hover:not(:focus), .form-control:hover:not(:focus) {
  border-color: #CBD5E1;
}
.form-textarea { min-height: 80px; resize: vertical; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-muted);
  flex-shrink: 0;
}


.task-item-row { display: flex; align-items: center; gap: 8px; }
.task-item-row input { flex: 1; }
.task-item-row .btn-icon { flex-shrink: 0; color: var(--text-muted); }
.task-item-row .btn-icon:hover { color: var(--destructive); }

/* =====================================================
   TASK ITEMS (checklist in detail)
   ===================================================== */
.task-items-detail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background .12s;
}
.task-items-detail-item:last-child { border-bottom: none; }
.task-items-detail-item:hover { background: var(--bg-muted); }
.task-items-detail-item.completed { opacity: .55; }
.task-items-detail-item.completed .item-title { text-decoration: line-through; }

.task-items-check {
  width: 19px; height: 19px;
  border-radius: 5px;
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .13s;
}
.task-items-check:hover { border-color: var(--green-700); }
.task-items-check.checked { background: var(--primary); border-color: var(--green-700); color: white; }
.task-items-transferred { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty svg { width: 44px; height: 44px; margin-bottom: 12px; opacity: .35; }
.empty-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.empty-text  { font-size: 13px; }

/* Скрыть пункты сайдбара которые дублируются в таббаре */
@media (max-width: 767px) {
  .hide-mobile-sidebar { display: none !important; }
}

/* =====================================================
   RESPONSIVE — mobile
   ===================================================== */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    z-index: 50;
    height: 100vh; height: 100dvh;
  }
  .sidebar-footer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-w); }
  .sidebar-collapse-btn { display: none; }

  .main {
    margin-left: 0 !important;
    height: calc(100vh - var(--header-h, 56px));
    height: calc(100dvh - var(--header-h, 56px));
    position: relative;
    overflow-y: auto;
    background: var(--bg-card);
  }
  /* Страницы скроллятся — padding-bottom чтобы контент не уходил за таббар */
  .page.active {
    min-height: 100%;
    background: var(--bg-card);
  }
  /* Отступ снизу — на всю страницу (кроме AI-чата), чтобы НИКАКОЙ контент,
     включая вложенные списки, не уходил под таб-бар. */
  .page.active:not(#page-ai-chat) {
    padding-bottom: calc(64px + max(4px, env(safe-area-inset-bottom, 0px) / 2));
  }
  /* AI Chat — position absolute, игнорирует padding от .main */
  #page-ai-chat.active {
    position: fixed;
    /* + env(safe-area-inset-top) — см. пояснение у второго такого же правила
       ниже по файлу (@media max-width:768px). Держим оба места согласованно,
       чтобы при удалении одного не вернулся заезд чата под шапку в PWA. */
    top: calc(var(--header-h, 56px) + env(safe-area-inset-top, 0px));
    left: 0; right: 0;
    bottom: 0;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  .btn-toggle {
    display: flex;
    width: 34px; height: 34px;
    align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
  }
  .btn-toggle:hover { background: var(--bg-muted); color: var(--text); }

  .content { padding: 10px; }
  .header  { padding: 0 12px; gap: 8px; }
  .header-title { font-size: 14px; }

  .mobile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 35; display: none;
  }
  .sidebar.mobile-open ~ .mobile-overlay { display: block; }

  /* Stats grid */
  .stats-grid {
    gap: 6px; padding: 0;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .stat-card { min-width: 0; padding: 10px 8px; flex-direction: column; align-items: center; gap: 4px; }
  .stat-card-value { font-size: 18px; }
  .stat-card-sub { font-size: 10px; }
  .stat-card-icon { display: none; }
  .stat-card-info { text-align: center; width: 100%; }

  /* Equipment */
  .eq-cards-grid { grid-template-columns: 1fr; gap: 8px; padding: 8px 12px; }
  .eq-card { padding: 12px; }
  .eq-group-header { padding: 8px 12px; font-size: 12px; }

  /* Task items */
  .task-item { padding: 10px 12px; gap: 8px; flex-wrap: wrap; align-items: flex-start; min-height: auto; }
  .task-priority-bar { width: 3px; align-self: stretch; height: auto; min-height: 32px; }
  .task-icon { width: 28px; height: 28px; min-width: 28px; margin-top: 2px; }
  .task-icon svg { width: 13px; height: 13px; }
  .task-info  { flex: 1; min-width: 0; }
  .task-title { font-size: 13px; white-space: normal; }
  .task-meta  { flex-wrap: wrap; gap: 3px; margin-top: 3px; }
  .task-meta-item { font-size: 11px; }
  .task-status-col { min-width: 80px; }
  .task-actions { width: auto; min-width: auto; }

  /* Tables */
  .data-table { font-size: 12px; }
  .eq-table-group { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { padding: 8px 6px; white-space: nowrap; }

  /* Detail */
  .detail-header { flex-direction: row; align-items: center; gap: 10px; padding: 12px; flex-wrap: wrap; }
  .detail-header-icon { width: 36px; height: 36px; }
  .detail-header-icon svg { width: 18px; height: 18px; }
  .detail-header-name { font-size: 16px; }
  .detail-header-sub  { flex-wrap: wrap; gap: 4px 10px; font-size: 11px; }
  /* 23.08.2026: на телефоне кнопка «Редактировать» (nowrap, ~140px) отжирала
     ширину у колонки с именем — «Глинский Никита Дмитриевич» вставало по слову
     в строку и обрезалось по краю. На мобильном оставляем только иконку. */
  .detail-header-post { font-size: 12px; }
  .detail-header-status { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .detail-header-status .btn-sm { font-size: 10px; padding: 4px 8px; }
  .detail-back { padding: 8px 12px !important; }
  .detail-back .btn { font-size: 12px; padding: 4px 10px; }

  /* Single column layout on mobile */
  .detail-grid    { grid-template-columns: 1fr !important; gap: 0 !important; display: flex !important; flex-direction: column !important; }
  /* На телефоне `display:flex !important` перебивал inline `display:none`, и на
     странице сотрудника форма редактирования показывалась ПОД показателями —
     руководитель, зашедший посмотреть цифры, листал мимо полей ввода
     (замечание владельца 18.08.2026). Скрытое обязано оставаться скрытым. */
  .detail-grid[style*="display:none"],
  .detail-grid[style*="display: none"] { display: none !important; }
  .detail-content { grid-template-columns: 1fr !important; }
  .detail-sidebar { margin-top: 0; order: -1; width: 100%; }
  .detail-side    { order: -1; width: 100%; }
  .detail-main    { order: 1; width: 100%; }
  /* Карточка оборудования и техники: на телефоне сразу под названием — фото,
     потом «Статистика ТО» и остальное (владелец 01.10.2026). Колонки
     растворяем (display:contents), чтобы фото из основной колонки встало
     выше боковой; прежний порядок колонок сохраняем через order детей. */
  #page-equipment-detail .detail-main,
  #page-equipment-detail .detail-sidebar { display: contents; }
  #page-equipment-detail .detail-sidebar > * { order: -1; }
  #page-equipment-detail .detail-main > * { order: 1; }
  #page-equipment-detail #eq-photos-section { order: -2; }
  /* Растворённые колонки отдают своих детей прямо в .detail-grid, а у него
     align-items: start — блоки сжимались по содержимому («Статистика ТО»,
     «QR / NFC», «Запчасти» в полэкрана). Раньше ширину держала колонка
     (width:100%); теперь тянем сами блоки (04.10.2026). */
  #page-equipment-detail .detail-grid { align-items: stretch; }
  #page-equipment-detail .detail-main > *,
  #page-equipment-detail .detail-sidebar > * { width: 100%; box-sizing: border-box; }
  /* Фото наверху — лентой в одну строку, иначе десяток снимков (ПТС, ОСАГО,
     шильды) уводил «Статистику ТО» на экран вниз. Листается вбок. */
  #eq-detail-photos .eq-photo-grid { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  #eq-detail-photos .eq-photo-grid > div { flex: 0 0 40%; scroll-snap-align: start; }

  /* Spec table */
  .spec-table td { padding: 8px 12px !important; font-size: 12px; }
  .spec-table td:first-child { min-width: 80px; width: 100px; font-size: 11px; white-space: normal; }
  .spec-table td:last-child   { font-size: 12px; word-break: break-word; }

  /* Mini stats */
  .mini-stats { grid-template-columns: 1fr 1fr !important; }
  .mini-stat  { padding: 10px 8px !important; }
  .mini-stat-value { font-size: 16px !important; }
  .mini-stat-label { font-size: 10px !important; }

  /* Timeline */
  .timeline-item { padding: 10px 12px 10px 24px; }
  .timeline-title { font-size: 13px; }
  .timeline-meta  { font-size: 10px; flex-wrap: wrap; }

  #eq-detail-parts { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #eq-detail-parts .data-table th, #eq-detail-parts .data-table td { padding: 6px 8px; font-size: 11px; }
  #eq-detail-qr img, #eq-detail-qr canvas { max-width: 120px !important; max-height: 120px !important; }

  .section { margin-bottom: 8px; border-radius: 8px; }
  .section-header { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }

  #eq-toolbar { width: 100%; flex-wrap: wrap; justify-content: flex-start; margin-left: 0 !important; }
  #eq-toolbar .btn-sm { font-size: 11px; padding: 5px 8px; }

  /* Раньше здесь в одну колонку складывались ВСЕ сетки раздела — и три цифры внутри
     карточки исполнителя вставали столбиком (владелец, 15.10.2026). Складываем только
     широкие раскладки «кольцо + показатели» и «половина/половина»; сетки auto-fill
     и так перестраиваются сами. */
  #page-analytics [style*="grid-template-columns:220px 1fr"],
  #page-analytics [style*="grid-template-columns: 220px 1fr"],
  #page-analytics [style*="grid-template-columns:1fr 1fr"],
  #page-analytics [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  #page-schedules .section-header > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  #page-inventory .section-header > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }

  #page-knowledge .section-header { flex-wrap: wrap; }
  #page-knowledge .section-header > div:last-child { width: 100%; display: flex; gap: 6px; }
  #kb-search { width: 100% !important; min-width: 0; flex: 1; }

  #page-personnel .section-header { flex-wrap: wrap; gap: 8px; }
  #btn-add-person { flex-shrink: 0; }

  #page-analytics .stats-grid { padding: 0 12px 12px !important; }

  #page-schedules > .section > div[style*="padding:0 16px"] { flex-wrap: wrap; padding: 0 12px 8px !important; }

  .section-header > div[style*="margin-left:auto"],
  .section-header > div[style*="margin-left: auto"] { margin-left: 0 !important; width: 100%; justify-content: flex-end; }

  .filters-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding-bottom: 4px !important; }
  .filter-chip { white-space: nowrap; flex-shrink: 0; font-size: 11px; }

  /* form-row — одна колонка на мобильном */
  .form-row { flex-direction: column; gap: 0; }

  .btn-sm { font-size: 11px; padding: 5px 10px; }
  .hide-mobile { display: none !important; }
  .hide-desktop { display: block !important; }
  button.hide-desktop { display: inline-flex !important; }
  #btn-new-task { padding: 6px 8px; }

  .person-card { padding: 12px; border-bottom: 1px solid var(--border-light); }
  .person-card:last-child { border-bottom: none; }
  .personnel-cards { padding: 0; }

  .calendar-grid { font-size: 11px; }
  .calendar-cell { min-height: 50px; padding: 2px; }


  .login-card { padding: 24px 20px 20px; }
}

/* =====================================================
   iOS PWA safe area
   ===================================================== */
@supports (padding-top: env(safe-area-inset-top)) {
  .sidebar { padding-top: env(safe-area-inset-top); }
  .header {
    padding-top: max(0px, env(safe-area-inset-top));
    height: calc(var(--header-h) + env(safe-area-inset-top));
  }
  /* СТРАХОВКА ОТ ШАПКИ ПОД ЧАСАМИ. С viewport-fit=cover приложение занимает
     весь экран, включая полосу статуса. На части Android env(safe-area-inset-top)
     при этом отдаёт НОЛЬ — отступа не добавляется, и содержимое шапки (заголовок,
     переключатель площадки) уезжает под часы: владелец видел от кнопки площадки
     только полоску. max() решает без вреда для устройств, которые отступ
     сообщают правильно: там побеждает их значение. Только телефоны — на
     установленном приложении для компьютера полоски статуса нет. */
  /* 23.10.2026: страховка включается не по display-mode, а классом
     pwa-top-fallback (public/js/pwa-top-inset.js) — только если окно правда
     лежит под полосой статуса. На Android 17 / Chrome 156 система рисует
     полосу сама, и безусловные 28px давали пустую зелёную полосу над шапкой. */
  html.pwa-top-fallback .header {
    padding-top: max(28px, env(safe-area-inset-top));
    height: calc(var(--header-h) + max(28px, env(safe-area-inset-top)));
  }
  /* В ОБОЛОЧКЕ отступ под часы НЕ НУЖЕН: страницу сдвигают вниз внешние поля
     WebView по высоте системных полос. Правило выше и остаётся только для
     установленной PWA — в оболочке display-mode всегда `browser`, и оно туда
     не попадает. Это тот редкий случай, когда завязка на display-mode
     НАМЕРЕННАЯ, а не забытая.

     Заплатка `html.app-shell` (гасила padding у .header и .sidebar) снята
     26.08.2026 как мёртвая: с версии приложения 0.3.4 оболочка забирает
     системные отступы себе (`WindowInsetsCompat.CONSUMED`), поэтому
     env(safe-area-inset-*) внутри страницы и так равен нулю — обнулять нечего.
     Сам класс `app-shell` в index.html оставлен как готовый крючок под
     правила, которые понадобятся именно в оболочке.
     ⚠️ На сборках СТАРШЕ 0.3.4 отступы не потреблены — там вернётся пустая
     полоса над шапкой. Лечится обновлением приложения. */

  .mobile-tabbar {
    /* подстраховка для старых браузеров без env() */
    padding-bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) / 2));
  }
}

/* ЗЕЛЁНАЯ ШАПКА «КАК СИСТЕМНЫЙ СТАТУС-БАР» — ОДИН БЛОК НА PWA И ОБОЛОЧКУ.

   Раньше эти правила висели на @media (display-mode: standalone). В WebView
   оболочки display-mode ВСЕГДА `browser`, поэтому блок молча не применялся:
   в PWA шапка зелёная, а в приложении на том же телефоне белая. Полдня искали
   причину в разметке оболочки, а дело было здесь.

   Признак ставится в index.html классом `standalone-ui` — и по
   matchMedia/navigator.standalone (установленная PWA), и по `AgroTOApp/`
   в User-Agent (оболочка). Медиа-копия блока снята 26.08.2026: две одинаковые
   простыни правил расходятся при первой же правке. Цена — на устройстве,
   которое с прошлого раза не было онлайн, в кэше может лежать старый
   index.html без класса, и до первой загрузки онлайн шапка будет белой.
   Это косметика: навигацию service worker отдаёт network-first.

   ⚠️ Селекторы только ПЛОСКИЕ. Вложенность вида
   `html.standalone-ui { .header { … } }` этот WebView игнорирует молча. */
html.standalone-ui .header {
  background: var(--primary-hover) !important;
  border-bottom: none !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.1) !important;
}

/* Текст заголовка */
html.standalone-ui .header-title,
html.standalone-ui #header-title { color: #fff !important; }

/* Все кнопки и иконки в шапке — белые */
html.standalone-ui .header button,
html.standalone-ui .header a,
html.standalone-ui #sidebar-toggle-btn,
html.standalone-ui #btn-header-qr,
html.standalone-ui #notif-bell-btn,
html.standalone-ui .header .btn-icon {
  color: rgba(255,255,255,.9) !important;
  border-color: rgba(255,255,255,.25) !important;
  background: transparent !important;
}
html.standalone-ui .header svg {
  stroke: rgba(255,255,255,.9) !important;
  color: rgba(255,255,255,.9) !important;
}

/* Бейдж уведомлений */
html.standalone-ui #notif-badge { border: 2px solid var(--primary-hover); }

/* SSE dot — белый когда онлайн, красный когда офлайн */
html.standalone-ui #sse-dot { background: rgba(255,255,255,.7) !important; box-shadow: 0 0 0 2px rgba(255,255,255,.25) !important; }

/* Кнопка «Новая заявка» — белая обводка */
html.standalone-ui #btn-new-task {
  background: rgba(255,255,255,.15) !important;
  border: 1.5px solid rgba(255,255,255,.4) !important;
  color: #fff !important;
}
html.standalone-ui #btn-new-task svg { stroke: #fff !important; }
html.standalone-ui #btn-new-task:hover {
  background: rgba(255,255,255,.25) !important;
}

/* Кнопка сворачивания бокового меню */
html.standalone-ui #sidebar-toggle-btn {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.2) !important;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d0cb; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a29e; }

/* =====================================================
   PAGE / TABS
   ===================================================== */
.page { display: none; }
.page.active {
  display: block;
  flex: 1;          /* заполняет оставшееся место в .main */
  min-height: 0;    /* без этого flex-item не сжимается и не скроллит */
  overflow-y: auto; /* скролл страниц на ПК */
  overflow-x: hidden;
}
/* AI Chat — отдельная логика скролла, не трогаем */
#page-ai-chat.active {
  overflow: hidden !important;
}
.hide-desktop { display: none; }


/* =====================================================
   LOGIN
   ===================================================== */
/* ── LOGIN — стиль АгроТО лендинга ─────────── */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #faf9f6;
  padding: 24px;
  font-family: var(--font);   /* был Onest — он остался фирменным шрифтом ЛЕНДИНГА */
  position: relative;
  overflow: hidden;
}
/* Декоративные круги фона */
.login-screen::before {
  content: '';
  position: fixed; top: -120px; right: -120px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,153,102,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.login-screen::after {
  content: '';
  position: fixed; bottom: -100px; left: -100px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,92,58,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  background: #ffffff;
  border: 1px solid #e6e0d5;
  border-radius: 20px;
  padding: 44px 40px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 8px 40px rgba(23,54,38,0.10), 0 1px 4px rgba(0,0,0,0.05);
  position: relative; z-index: 1;
}
.login-logo {
  width: auto; height: auto;
  background: none;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin: 0 auto 6px;
}
.login-logo-mark {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--green-800);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login-logo-mark svg { color: #fff; width: 20px; height: 20px; }
.login-logo-name {
  font-size: 22px; font-weight: 700;
  color: #151515; letter-spacing: -0.03em;
  line-height: 1;
}
.login-title    { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; color: #151515; letter-spacing: -0.03em; display: none; }
.login-subtitle { text-align: center; font-size: 13px; color: #767676; margin-bottom: 32px; }
.login-error    { color: #e53e3e; font-size: 13px; text-align: center; margin-bottom: 0; background: transparent; border-radius: 8px; }
.login-error:not(:empty) { padding: 10px 12px; margin-bottom: 12px; background: #fff5f5; border: 1px solid #fed7d7; }
/* Поля ввода в стиле лендинга */
.login-screen .form-input {
  background: #faf9f6;
  border: 1.5px solid #e6e0d5;
  border-radius: 10px;
  color: #151515;
  font-family: var(--font);
  font-size: 14px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-screen .form-input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(45,125,83,0.12);
  background: #fff;
  outline: none;
}
.login-screen .form-input::placeholder { color: #a0aec0; }
/* Кнопка Войти */
.login-screen .btn-primary {
  background: var(--green-800);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 13px;
  letter-spacing: -0.01em;
  transition: background 0.2s ease, transform 0.15s ease;
}
.login-screen .btn-primary:hover { background: #173626; transform: translateY(-1px); }
.login-screen .btn-primary:active { transform: translateY(0); }
/* Подпись внизу */
.login-hint {
  margin-top: 16px; text-align: center;
  font-size: 12px; color: #a0aec0;
  font-family: var(--font);
}
/* Ссылка на сайт внизу */
.login-site-link {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--font);
  font-size: 12px; color: #767676;
  text-decoration: none; z-index: 2;
  display: flex; align-items: center; gap: 5px;
}
.login-site-link:hover { color: var(--green-700); }

/* =====================================================
   SIDEBAR USER
   ===================================================== */
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  color: var(--text-sidebar);
  font-size: 13px; font-weight: 500;
  margin-bottom: 4px;
}
.sidebar-user svg { width: 17px; height: 17px; flex-shrink: 0; }

/* =====================================================
   DETAIL PAGE
   ===================================================== */
.detail-back { margin-bottom: 16px; }

/* ─── Detail Header (DS 2026) ─── */
.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: var(--shadow-1);
}

.detail-header-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.detail-header-icon svg { width: 28px; height: 28px; }

.detail-header-info { flex: 1; min-width: 0; }
.detail-header-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  /* Было 2 строки, и «Установка водоочистки…» упиралась в многоточие. У орг 3
     125 названий длиннее 40 знаков, самое длинное 82 — трёх строк хватает
     почти всем, а бегущая строка в ЗАГОЛОВКЕ выглядит нервно: место есть,
     проще перенести. */
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-header-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12.5px;
}
.detail-header-sub span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-header-sub svg { width: 12px; height: 12px; }

/* Должность отдельной строкой под чипами: раньше она стояла внутри
   .detail-header-sub рядом со статусом и ролью, и на узком экране
   «Начальник сервисной службы (молочное оборудование)» ломался по слову
   в строку. Своя строка на всю ширину колонки переносится нормально. */
.detail-header-post {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.detail-header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.detail-header-status .badge {
  font-size: 12px;
  padding: 0 12px;
  height: 26px;
}

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
  max-width: 1200px;
}
.detail-main { min-width: 0; }
.detail-back { margin-bottom: 12px; }
.detail-header { max-width: 1200px; }

/* Содержимое страницы сотрудника держим в той же колонке, что и шапка.
   Без этого шапка обрывалась на 1200px, а показатели и список задач ехали
   на всю ширину монитора — строки становились нечитаемо длинными. */
/* Ограничиваем по ширине только экраны, которые ЧИТАЮТ: страницу сотрудника
   и карточку участка. Сами дашборды остаются во всю ширину — это экраны
   наблюдения, там смотрят «сколько горит», и лишнее место работает на пользу.
   ВАЖНО: не класть эти правила в общий блок #page-dashboard .v4-shell — он
   покрывает и «Главный», и скелетон, и я так уже прижал главный экран,
   которого не трогал. */
#person-pane-stats { max-width: 1200px; }
#page-dashboard .v4-shell.drilldown { max-width: 1200px; }


/* ─── Spec table (DS 2026) ─── */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast) var(--ease);
}
.spec-table tr:last-child { border-bottom: none; }
.spec-table tr:hover { background: var(--bg-muted); }
.spec-table td { padding: 12px 20px; font-size: 13px; vertical-align: top; }
.spec-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  width: 160px;
  white-space: nowrap;
  font-size: 12px;
}
.spec-table td:last-child { font-weight: 500; color: var(--text); }

/* ─── Mini stats (DS 2026) ─── */
.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-light);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.mini-stat { background: var(--bg-card); padding: 18px; text-align: center; }
.mini-stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.mini-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Timeline */
.timeline-item { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border-light); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.timeline-info { flex: 1; min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.timeline-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.timeline-notes { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-header { flex-wrap: wrap; }
  .spec-table td:first-child { width: 130px; }
}

/* =====================================================
   CHECKLIST
   ===================================================== */
.checklist-progress-bar {
  height: 3px; background: var(--border-light);
  border-radius: 2px; margin: 0 18px 8px; overflow: hidden;
}
.checklist-progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 2px; transition: width .3s ease;
}
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background .13s;
}
.checklist-item:hover { background: var(--bg-muted); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item.checked { opacity: .55; }
.checklist-item.has-problem { background: #fef2f2 !important; border-left: 3px solid #ef4444; }
.checklist-item.has-problem:hover { background: #fee2e2 !important; }
.checklist-problem-btn {
  cursor: pointer; display:flex; align-items:center; padding:4px; border-radius:6px;
  color: var(--text-muted); background: none; border: none;
  transition: all .14s; flex-shrink: 0;
}
.checklist-problem-btn:hover { color: #ef4444; background: #fef2f2; }
.checklist-problem-btn.active { color: #ef4444; background: #fee2e2; }
.checklist-photo-area { padding: 0 0 4px 0; }
.checklist-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px; transition: all .13s;
}
.checklist-checkbox.checked { background: var(--primary); border-color: var(--green-700); color: #fff; }
.checklist-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.checklist-item.checked .checklist-title { text-decoration: line-through; }
.checklist-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.checklist-text { flex: 1; min-width: 0; }


/* =====================================================
   DATA TABLES
   ===================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  background: var(--bg-muted); padding: 8px 12px;
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
/* Зебра — чётные строки чуть темнее (порядок важен: zebra → hover → warning) */
/* Зебры нет намеренно: строки уже разделены линией, а полосатая заливка спорит
   с подсветкой выбранной строки. */
.data-table-row:hover { background: var(--bg-muted); }
.data-table-row.row-warning,
.data-table tbody tr.row-warning:nth-child(even) { background: #fef2f2; }
.data-table-row.row-warning:hover { background: #fee2e2; }
.data-table-row { cursor: pointer; transition: background .1s; }
.data-table-row td:first-child { font-weight: 500; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-dot.active        { background: var(--success); }
.status-dot.maintenance   { background: var(--warning); }
.status-dot.broken        { background: var(--destructive); }
.status-dot.decommissioned{ background: #a8a29e; }


/* =====================================================
   FORM ROW
   ===================================================== */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* =====================================================
   ANALYTICS
   ===================================================== */
@media (max-width: 900px) {
  #page-analytics > div[style*="grid-template-columns: 2fr"]    { grid-template-columns: 1fr !important; }
  #page-analytics > div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* =====================================================
   KNOWLEDGE BASE
   ===================================================== */
#article-content h3 { font-size: 16px; }
#article-content h4 { font-size: 14px; }
#article-content table { border-collapse: collapse; }
#article-content ul { padding-left: 20px; }
#article-content li { margin: 4px 0; }
#article-content code { background: var(--bg-muted); padding: 1px 6px; border-radius: 4px; font-family: monospace; font-size: 12px; }

/* =====================================================
   CHECKLIST PHOTOS
   ===================================================== */
.checklist-photo-btn { cursor:pointer; display:flex; align-items:center; padding:4px; border-radius:6px; color:var(--text-muted); transition:all .14s; }
.checklist-photo-btn:hover { color: var(--green-700); background:var(--bg-muted); }
.checklist-photos { display:flex; flex-wrap:wrap; gap:6px; padding:6px 0 2px 34px; }
.checklist-photo-thumb { position:relative; width:64px; height:64px; border-radius:8px; overflow:hidden; border:1px solid var(--border-light); cursor:pointer; transition:transform .14s; }
.checklist-photo-thumb:hover { transform:scale(1.05); }
.checklist-photo-thumb img { width:100%; height:100%; object-fit:cover; }
.checklist-photo-del { position:absolute; top:2px; right:2px; background:rgba(0,0,0,.55); color:#fff; border:none; border-radius:50%; width:18px; height:18px; font-size:10px; cursor:pointer; display:none; align-items:center; justify-content:center; }
.checklist-photo-thumb:hover .checklist-photo-del { display:flex; }

/* GPS подозрение — фото сделано не у оборудования */
.checklist-photo-thumb.gps-suspicious { border:2px solid #ef4444; box-shadow:0 0 0 2px rgba(239,68,68,0.18); }
.checklist-photo-thumb .gps-warn-badge {
  position:absolute; bottom:2px; left:2px;
  background:#ef4444; color:#fff;
  border-radius:6px; padding:1px 5px;
  font-size:11px; font-weight:700;
  line-height:1.3;
  box-shadow:0 1px 3px rgba(0,0,0,.25);
  pointer-events:auto; cursor:help;
}


/* =====================================================
   CALENDAR
   ===================================================== */
@media (max-width: 900px) {
  #page-dashboard > div[style*="grid-template-columns: 340px"] { grid-template-columns: 1fr !important; }
}

/* =====================================================
   MOBILE TAB BAR
   ===================================================== */
.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  /* Высота = контент 64px + половина safe-area (home indicator на iPhone).
     Полная safe-area (34px) даёт лишний воздух — оставляем ~12-16px. */
  height: calc(64px + max(4px, env(safe-area-inset-bottom, 0px) / 2));
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 40;
  padding: 0 4px;
  padding-bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) / 2));
  box-sizing: border-box;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  color: #9ca3af; text-decoration: none;
  font-size: 10px; font-weight: 500; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 0; flex: 1; text-align: center;
  position: relative;
  border: none; background: none;
  border-radius: 12px;
  transition: background .15s, color .15s;
}
/* Активная вкладка — зелёная подложка (как в Telegram) */
.tab-item.active {
  color: var(--green-700);
  background: none;
}
.tab-item.active svg { color: var(--green-700); }
.tab-item.active span { color: var(--green-700); font-weight: 700; }
.tab-item span {
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
  line-height: 1;
  font-size: 10px;
}
.tab-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.tab-item:active { opacity: .75; }
.tab-item-add {
  overflow: visible; background: none !important;
  /* Такая же доля ширины, как у остальных четырёх. С `flex:0 0 auto` кнопка
     занимала свои 48px, а четыре пункта делили ОСТАТОК — центры получались
     неравноудалёнными, и «Задачи» с «ИИ» зрительно липли к плюсу.
     Боковые поля обязаны совпадать с соседями: при `flex-basis:0` поровну
     делится СВОБОДНОЕ место, а padding прибавляется сверх доли — с `padding:0`
     ячейка выходила на 16px уже прочих и перекос оставался (8px из 17). */
  flex: 1 1 0;
  padding: 0 8px;
}
.tab-add-btn {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(45,125,83,.4);
  transition: transform .12s ease;
  flex-shrink: 0;
}
.tab-add-btn svg    { width: 24px; height: 24px; }
.tab-add-btn:active { transform: scale(.9); }

@media (max-width: 767px) {
  .mobile-tabbar { display: flex; }
  /* padding-bottom для страниц теперь через .page.active, не через .main */
  .main { padding-bottom: 0; }
  #btn-new-task { display: none !important; }
  body { overflow-x: hidden; max-width: 100vw; }
}

/* =====================================================
   REFERENCE TABLES
   ===================================================== */
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table th { text-align: left; padding: 10px 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.ref-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover { background: var(--bg-muted); }
/* Разворот ветки локаций: кликается всё название, а не стрелка 12×12.
   На телефоне попасть в маленькую стрелку пальцем невозможно. */
.loc-branch-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 6px 8px 6px 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  min-height: 36px;
}
.loc-branch-toggle:hover { color: var(--green-700); }
.loc-branch-toggle svg { flex: 0 0 auto; }
.loc-branch-count {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  background: var(--bg-secondary); border-radius: 10px; padding: 2px 8px; white-space: nowrap;
}

/* Колонка действий: кнопки в один ряд, ширина по содержимому */
.ref-table td:last-child { white-space: nowrap; width: 1%; }
.ref-table td:last-child .btn-icon { vertical-align: middle; }

@media (max-width: 767px) {
  /* На телефоне таблица справочников разворачивается в карточки: шапка прячется,
     каждая строка — блок, подписи колонок подставляются из data-label.
     Горизонтальный скролл при этом исчезает совсем. */
  /* Полоса вкладок справочников с 01.09 рисуется каноном (.sec-tabs) —
     прокрутка и неразрывность подписей там свои. Прежние правила целили в
     .filter-chip, которого в этой полосе больше нет. */
  #ref-content { overflow-x: hidden; }

  .ref-table, .ref-table tbody, .ref-table tr, .ref-table td { display: block; width: 100%; }
  .ref-table thead { display: none; }
  .ref-table tr {
    border: 1px solid var(--border-light); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 10px; background: var(--bg-card);
  }
  .ref-table tr:hover { background: var(--bg-card); }
  .ref-table td {
    border: none; padding: 4px 0; font-size: 13px;
    display: flex; gap: 8px; align-items: flex-start; justify-content: space-between;
    white-space: normal; word-break: break-word;
  }
  .ref-table td::before {
    content: attr(data-label); flex: 0 0 auto; max-width: 45%;
    color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px;
    padding-top: 2px;
  }
  .ref-table td:empty, .ref-table td[data-label='']::before { display: none; }
  /* Название — первой строкой, крупно и без подписи */
  .ref-table td:first-child { font-size: 15px; font-weight: 600; padding-bottom: 6px; }
  /* Раскрывашка на телефоне — во всю ширину строки, палец попадает гарантированно */
  .ref-table .loc-branch-toggle { width: 100%; justify-content: flex-start; min-height: 44px; }
  .ref-table .loc-branch-count { margin-left: auto; }
  .ref-table td:first-child::before { display: none; }
  /* Кнопки действий — в ряд по правому краю, не переносятся и не растягиваются.
     ШИРИНУ ЗАДАЁМ ЯВНО: десктопное `.ref-table td:last-child { width: 1% }`
     специфичнее общего `.ref-table td { width: 100% }` и переживает медиа-запрос —
     ячейка схлопывалась в ~3 px, ряд кнопок уезжал за левый край и срезался
     `#ref-content { overflow-x: hidden }`. На телефоне из четырёх кнопок
     оставалась видна одна. */
  .ref-table td:last-child {
    width: 100%; white-space: normal;
    justify-content: flex-end; padding-top: 10px; margin-top: 6px;
    border-top: 1px solid var(--border-light); gap: 8px; flex-wrap: wrap;
  }
  .ref-table td:last-child::before { display: none; }
  /* Палец в 28 px не попадает — на телефоне кнопки крупнее */
  .ref-table td:last-child .btn-icon { flex: 0 0 auto; width: 40px; height: 40px; }
  .ref-table td:last-child .btn-icon svg { width: 18px; height: 18px; }
}

/* =====================================================
   NOTIFICATION DROPDOWN
   ===================================================== */
@media (max-width: 767px) {
  .notif-dropdown-wrap {
    position: fixed !important; top: 60px !important;
    left: 12px !important; right: 12px !important;
    width: auto !important; max-height: 70vh !important; margin-top: 0 !important;
  }
}

/* =====================================================
   INVENTORY CHIPS
   ===================================================== */
#inventory-chips::-webkit-scrollbar { display: none; }
#inventory-chips { -ms-overflow-style: none; scrollbar-width: none; }

/* Task cursor hover */
.task-info[style*="cursor"] .task-title:hover { color: var(--green-700); }
.btn.btn-outline.btn-full { display: flex; align-items: center; gap: 8px; }
.eq-card { cursor: pointer; }
.task-item[style*="cursor"] .task-info:hover .task-title { color: var(--green-700); }

/* =====================================================
   TASK DETAIL — ACTION BUTTONS
   ===================================================== */
/* ─── Action Buttons (DS 2026) ─── */
.task-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  border: none;
  margin-bottom: 8px;
  text-decoration: none;
  letter-spacing: .01em;
}
.task-action-btn:last-child { margin-bottom: 0; }
.task-action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary — start/take */
.task-action-start {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(16,185,129,.25);
}
.task-action-start:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
  transform: translateY(-1px);
}

/* Success outline — complete */
.task-action-complete {
  background: var(--success-light);
  color: #173626;
  border: 1.5px solid #a8ddb8;
}
.task-action-complete:hover {
  background: #d6f0df;
  border-color: var(--green-700);
}

/* Ghost — edit/print */
.task-action-edit, .task-action-print {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.task-action-edit:hover, .task-action-print:hover {
  background: var(--border-light);
  color: var(--text);
}

/* Danger — cancel/delete */
.task-action-cancel, .task-action-delete {
  background: var(--destructive-light);
  color: #B91C1C;
  border: 1px solid #FECACA;
}
.task-action-cancel:hover, .task-action-delete:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}
.task-action-delete { margin-top: 4px; }

/* ─── Status Banners (DS 2026) ─── */
.task-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.task-status-banner.in-progress {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}
.task-status-banner.done {
  background: var(--success-light);
  border: 1px solid #a8ddb8;
  color: #173626;
  flex-direction: column;
  text-align: center;
  padding: 24px 20px;
  gap: 8px;
  border-radius: 12px;
}
.task-status-banner.done svg { width: 32px; height: 32px; }

/* Разделитель в блоке действий */
.task-actions-divider {
  height: 1px;
  background: var(--border-light);
  margin: 10px 0;
}

/* =====================================================
   EQUIPMENT CARDS — улучшенный hover
   ===================================================== */
.eq-card {
  position: relative;
  overflow: hidden;
}
/* eq-card stripe — задаётся через JS inline style */

/* =====================================================
   DETAIL HEADER — убираем скучный серый фон
   ===================================================== */
.detail-header {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-muted) 100%);
}

/* =====================================================
   SECTION с иконкой — чуть живее
   ===================================================== */
.section-header {
  background: var(--bg-card);
}
.section:first-child .section-header {
  border-radius: var(--radius) var(--radius) 0 0;
}

/* =====================================================
   STAT CARDS — акцентная полоска
   ===================================================== */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::after { opacity: 1; }
.stat-card.danger::after   { background: var(--destructive); }
.stat-card.warning::after  { background: var(--warning); }
.stat-card.info::after     { background: var(--info); }
.stat-card.success::after  { background: var(--success); }
.stat-card.purple::after   { background: var(--purple); }

/* =====================================================
   ПРИОРИТЕТНЫЙ БАР — чуть толще, красивее
   ===================================================== */
.task-priority-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 3px;
  flex-shrink: 0;
  min-height: 32px;
}

/* =====================================================
   HEADER кнопки — чуть живее
   ===================================================== */
.btn-primary {
  box-shadow: 0 1px 3px rgba(22,163,74,.2);
}
.btn-primary:hover {
  box-shadow: 0 3px 10px rgba(22,163,74,.35);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* =====================================================
   SECTION — первый section на странице без верхней тени
   ===================================================== */
.section + .section {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.section:first-of-type {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.section:only-of-type {
  border-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════
   OCC DASHBOARD v4 — Stripe/Linear style
   ═══════════════════════════════════════════════════ */
/* ── UNIFIED SHELL ── */
.v4-shell {
  background: #fff;
  border: 1px solid transparent;   /* как у .page-shell: границу держит цвет */
  border-radius: var(--ui-r-xl);
  margin: 16px 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.v4-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
}


/* ── GREETING ── */
/* v4-greeting removed — now v4-header */
.v4-greeting-text {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.4px;
}
.v4-greeting-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.v4-greeting-sub .occ-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  vertical-align: middle;
  margin-right: 1px;
  animation: v4-pulse 2s ease-in-out infinite;
}
@keyframes v4-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.v4-greeting-sub .occ-pulse.danger { background: #ef4444; }

/* ── KPI ROW — plain numbers ── */
.v4-kpi-row {
  display: flex;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.v4-kpi-item {
  flex: 1 1 150px;
  padding: 14px 16px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
  margin: 0;
}
.v4-kpi-item:first-child { padding-left: 16px; }
.v4-kpi-item:hover { background: var(--bg-muted); }
.v4-kpi-item.card-active {
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.v4-kpi-num {
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.v4-kpi-num.danger { color: #ef4444; }
.v4-kpi-num.warning { color: #f59e0b; }
.v4-kpi-num.purple { color: #8b5cf6; }
.v4-kpi-num.success { color: var(--green-700); }
.v4-kpi-num.muted { color: var(--text-muted); }
/* «Мои задачи» — фирменный зелёный: плитка про принадлежность, а не про
   тревогу, поэтому красный и оранжевый тут не годятся. */
.v4-kpi-num.primary { color: var(--green-700); }

/* Строка дополнительных плиток («Мои задачи», «Склад»). Делят ширину поровну:
   одна — во всю строку, две — пополам. Так седьмая плитка не висит обрубком
   на треть ряда, как было на АгроМилке. */
.v4-kpi-row-extra {
  padding-top: 0;
  border-top: none;
}
.v4-kpi-row-extra .v4-kpi-item {
  flex: 1 1 0 !important;
  border-left: none;
  text-align: center;
}
.v4-kpi-row-extra .v4-kpi-item + .v4-kpi-item {
  border-left: 1px solid var(--border-light);
}
.v4-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

/* ── MAIN GRID ── */
.v4-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  padding: 0;
  align-items: start;
}

/* ── SECTION LABEL ── */
.v4-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── BACK BTN ── */
.occ-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--green-700);
  background: var(--primary-light); border: none;
  border-radius: var(--ui-r); padding: 3px 8px;
  cursor: pointer; transition: all .15s;
  margin-left: auto;
}
.occ-back-btn:hover { background: #dcfce7; }

/* ── FEED ── */
.v4-feed {
  min-width: 0;
  padding: 16px 20px 20px;
  border-right: 1px solid var(--border-light);
}
.v4-feed-scroll {
  border: var(--ui-border);
  border-radius: var(--ui-r-lg);
  overflow: hidden;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  background: #fff;
}
.v4-feed-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── GROUP HEADER ── */
.v4-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  list-style: none;
  border-top: 1px solid var(--border-light);
}
.v4-group-header:first-child { border-top: none; }
.v4-group-header.group-overdue {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.v4-group-header.group-in_progress {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ede9fe;
}
.v4-group-header.group-today {
  background: #fffbeb;
  color: #92400e;
  border-color: #fef3c7;
}
.v4-group-header.group-upcoming {
  background: var(--bg-muted);
  color: var(--text-muted);
  border-color: var(--border-light);
}
.v4-group-header.group-completed {
  background: #eef8f2;
  color: #166534;
  border-color: #dcfce7;
}
.v4-group-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.v4-group-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--ui-r);
  background: rgba(0,0,0,.06);
}

/* ── TASK ROW ── */
.occ-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 16px;
  cursor: pointer;
  border: none;
  transition: background .08s;
  position: relative;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  flex-direction: row;
  animation: none;
}
.occ-card::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--occ-accent, #d1d5db);
}
.occ-card:hover { background: #f5f7fa; }
.occ-card + .occ-card {
  border-top: none;
}
/* Separator line between cards */
.v4-feed-list .occ-card + .occ-card::after {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: var(--border-light);
}
/* No separator after group header */
.v4-group-header + .occ-card::after { display: none; }

/* Priority accents */


/* status accent removed — type_color via inline style takes priority */


/* Critical bg */
.occ-card.priority-critical { background: #fffbfb; }
.occ-card.priority-critical:hover { background: #fef5f5; }

/* Card internals — now horizontal layout */
.occ-card-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.occ-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.occ-card-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .3px;
  text-transform: uppercase;
  align-self: flex-start;
}
.badge-occ-overdue  { background: #ef4444; color: #fff; }
.badge-occ-pending  { background: #f3f4f6; color: #6b7280; }
.badge-occ-progress { background: #8b5cf6; color: #fff; }
.badge-occ-today    { background: #f59e0b; color: #fff; }
.badge-occ-done     { background: #22c55e; color: #fff; }
/* «С опозданием» — приписка к «ВЫПОЛНЕНО», не замена ей: работа сделана,
   но не в срок. Янтарный, чтобы не спорить с красным «ПРОСРОЧЕНО». */
.badge-occ-late     { background: #fef3c7; color: #b45309; margin-left: 4px; white-space: nowrap; }
/* На узком экране плашка выталкивала за край дату выполнения. Ужимаем текст
   до «+N ДН.» — дата важнее слова, а смысл держит цвет и подсказка. */
@media (max-width: 640px) {
  .badge-occ-late { margin-left: 0; }
  .badge-occ-late .late-word { display: none; }
}

.occ-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.occ-card-meta-item {
  display: flex; align-items: center; gap: 3px;
}
.occ-card-meta-item svg { opacity: .5; flex-shrink: 0; }

.occ-card-deadline {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--ui-r);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.occ-card-deadline.overdue { background: #fef2f2; color: #dc2626; }
.occ-card-deadline.today   { background: #fffbeb; color: #b45309; }
.occ-card-deadline.soon    { background: #eef8f2; color: var(--green-700); }
.occ-card-deadline.future  { background: var(--bg-muted); color: var(--text-muted); }
.occ-card-deadline.done    { background: #eef8f2; color: var(--green-700); }

/* Вторая, приглушённая пилюля рядом с "Сегодня"/датой — крайний срок,
   когда он реально отличается от срока работы (подрядчик, weekend_grace). */
.occ-card-grace {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Action buttons on task cards */
.occ-action-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.occ-action-btn:hover { border-color: var(--green-700); color: var(--green-700); background: #eef8f2; }
.occ-action-done:hover { border-color: var(--green-700); color: var(--green-700); background: #eef8f2; }
.occ-card-mine { background: #eff6ff !important; }
.occ-card-mine:hover { background: #e8f1fd !important; }

/* Tasks page uses occ-card list inside .task-list */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list .occ-card + .occ-card::after {
  content: ''; position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px; background: var(--border-light);
}
.task-list .v4-group-header + .occ-card::after { display: none; }

/* Чужие задачи */


/* ── EMPTY STATE ── */
.occ-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}
.occ-empty-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: #eef8f2;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-700);
}
.occ-empty-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.occ-empty-sub { font-size: 12px; color: var(--text-muted); }

/* ── CALENDAR ── */
.v4-right {
  min-width: 0;
  padding: 16px 20px 20px;
}
.v4-cal-wrap {
  border: var(--ui-border);
  border-radius: var(--ui-r-lg);
  overflow: hidden;
  background: #fff;
}

/* ── RESPONSIVE ── */

@media (max-width: 767px) {
  .v4-shell { margin: 8px; border-radius: 10px; }
  .v4-header { padding: 12px 14px 10px; }
  .v4-greeting-text { font-size: 17px; }
  .v4-kpi-row {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 0;
  }
  .v4-kpi-item {
    flex: 0 0 33.33%;
    padding: 6px 10px;
    border-left: none;
  }
  .v4-kpi-item:nth-child(n+4) {
    border-top: 1px solid var(--border-light);
    margin-top: 6px;
    padding-top: 10px;
  }
  .v4-kpi-num { font-size: 22px; }
  .v4-grid {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }
  .v4-feed { padding: 12px; border-right: none; }
  .v4-right { padding: 12px; order: -1; border-bottom: 1px solid var(--border-light); }
  .v4-right { order: -1; }
  .v4-cal-wrap #calendar-widget { width: 100%; }
  .v4-cal-wrap #calendar-widget > div {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px !important;
  }
  .v4-cal-wrap table { width: 100% !important; table-layout: fixed !important; }
  .v4-feed-scroll { max-height: 60vh; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar { transform: translateX(-100%) !important; }
  .sidebar.mobile-open { transform: translateX(0) !important; }
  .main { margin-left: 0 !important; }
  .mobile-tabbar { display: flex !important; }
  .v4-shell { margin: 12px; }
  .v4-grid { grid-template-columns: 1fr 300px; gap: 0; padding: 0; }
  .v4-kpi-row { padding: 12px 16px; }
  .v4-header { padding: 14px 16px 10px; }
}


/* ── Calendar unification ── */
.v4-cal-wrap .btn-icon {
  width: 28px;
  height: 28px;
  border: var(--ui-border);
  border-radius: var(--ui-r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
  padding: 0;
}
.v4-cal-wrap .btn-icon:hover {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
}
.v4-cal-wrap .btn-icon svg { width: 14px; height: 14px; }

/* ─── GLOBAL 2026 UPGRADES ─── */

/* Заголовки страниц */
.header-title, #header-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
}

/* Все detail-header-name */
.detail-header-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
}

/* Название ЗАДАЧИ — целиком, без многоточия. Три строки хватало не всем:
   «Регулировка температуры охлаждения...» упиралась в обрез, а человеку надо
   понять, что именно за работа (замечание владельца 19.08.2026). Карточка
   оборудования уже показывает название полностью — приводим к ней. */
#page-task-detail .detail-header-name {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  overflow-wrap: anywhere;
}

/* Кнопки — мягче радиус */
.btn {
  border-radius: var(--ui-r) !important;
}
.btn-primary {
  box-shadow: 0 1px 3px rgba(22,163,74,.2);
}
.btn-primary:hover {
  box-shadow: 0 3px 10px rgba(22,163,74,.3);
  transform: translateY(-1px);
}

/* Модальные окна — новый стиль */
.modal-content, .modal-body {
  border-radius: var(--ui-r-xl) !important;
}

/* Входящие list items — subtle hover */
.task-item:hover { background: var(--bg-muted); }
.task-item:last-child { border-bottom: none; }

/* Бейджи — чуть мягче */
.badge {
  border-radius: var(--ui-r) !important;
  font-weight: 600 !important;
}

/* Detail grid header */
.detail-header {
  border-radius: var(--radius) !important;
}

/* Stat cards на других страницах — обновлённые */
.stat-card {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-1px);
}

/* Filter chips — мягче */
.filter-chip {
  border-radius: var(--ui-r) !important;
}

/* Form inputs — новый радиус */
.form-input, input[type="text"], input[type="tel"], input[type="email"],
input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  border-radius: var(--ui-r) !important;
}

/* Page content slide-in — убрана, вызывала layout thrashing */
/* .page.active > * { animation: page-in .2s ease-out; } */


/* Чужие задачи — полоска через --occ-accent (inline), чуть прозрачнее */
.occ-card.occ-card-other { opacity: .85; }
.occ-card.occ-card-other:hover { opacity: 1; background: #f5f7fa; }

/* Скрываем бейдж "Система работает" на мобиле */
@media (max-width: 767px) {
  .occ-status-dot { display: none; }
}

/* Приоритеты: только critical (красный) и normal (зелёный/серый) */
.occ-card.priority-high { background: #fff; }

/* ═══════════════════════════════════════════════════
   DESIGN SYSTEM 2026 — Component Tokens
   ═══════════════════════════════════════════════════ */

/* ── Status Chips (pills) ── */
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.chip-success  { background: var(--success-light);     color: #15803d; }
.chip-warning  { background: var(--warning-light);     color: #b45309; }
.chip-danger   { background: var(--destructive-light); color: #b91c1c; }
.chip-info     { background: var(--info-light);        color: #1d4ed8; }
.chip-muted    { background: var(--bg-muted);          color: var(--text-muted); }
.chip-purple   { background: var(--purple-light);      color: #6d28d9; }

/* Status-specific */
.chip-in-progress  { background: #EFF6FF; color: #1d4ed8; }


/* ── Updated section ── */
.section {
  box-shadow: none !important;
}
.section:hover {
  box-shadow: var(--shadow-2) !important;
}

/* ── Updated buttons ── */
.btn {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--ui-r) !important;
  transition: all var(--duration-fast) var(--ease);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: var(--ui-r) !important; }

/* Третье по счёту объявление кнопки — оно и выигрывает у того, что выше.
   Яркий 600-й ставится здесь: --primary теперь тёмный (см. :root). */
.btn-primary {
  background: var(--green-600);
  box-shadow: 0 1px 3px rgba(22,163,74,.25);
}
.btn-primary:hover {
  background: var(--green-700);
  box-shadow: 0 4px 12px rgba(22,163,74,.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-1); }

/* ── Updated task rows ── */
.task-item {
  min-height: var(--density-row, 64px) !important;
  padding: 0 18px !important;
  transition: background var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease) !important;
}
.task-item:hover {
  background: var(--bg-muted) !important;
}

/* ── KPI numbers ── */
.stat-card-value {
  font-family: var(--font-display) !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -.04em !important;
  line-height: 1 !important;
}

/* ── Smooth page transitions ── */
.page { transition: opacity var(--duration-fast) var(--ease); }
.page.active { animation: ds-fadein var(--duration-normal) var(--ease); }
@keyframes ds-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── Мобиль: скрываем в sidebar пункты которые есть в нижнем табе ─── */
@media (max-width: 767px) {
  .sidebar .nav-item[data-page="dashboard"],
  .sidebar .nav-item[data-page="tasks"],
  .sidebar .nav-item[data-page="emergencies"] {
    display: none !important;
  }
}

/* Searchable dropdown */
.search-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1.5px solid var(--primary); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 240px; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.search-dropdown .sd-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}
.search-dropdown .sd-item:last-child { border-bottom: none; }
.search-dropdown .sd-item:hover, .search-dropdown .sd-item.active {
  background: var(--primary-light); color: var(--primary-dark);
}
.search-dropdown .sd-item .sd-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.search-dropdown .sd-empty {
  padding: 12px; text-align: center; font-size: 12px; color: var(--text-muted);
}

/* ─── Tasks Calendar ─── */
.cal-grid-header { display:grid; grid-template-columns:repeat(7,1fr); margin-bottom:4px; }
.cal-grid        { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.cal-cell {
  min-height:64px; padding:6px; border-radius:8px;
  border:1px solid var(--border-light);
  transition:background var(--duration-fast) var(--ease);
  overflow:hidden;
}
.cal-cell:hover:not(.cal-cell-empty) { background:var(--bg-muted); }
.cal-cell-empty { border:none; background:transparent; }
.cal-day-num { font-size:12px; font-weight:600; line-height:1; }
@media (max-width:600px) {
  .cal-cell { min-height:44px; padding:4px; }
  .cal-day-num { font-size:11px; }
}



/* ═══════════════════════════════════════════════════
   PAGE LAYOUT — Tabler-inspired (2026)
   ═══════════════════════════════════════════════════ */

/* ── Page Shell — единый белый контейнер страницы ── */
.page-shell {
  background: #fff;
  border: 1px solid transparent;
  border-radius: var(--ui-r-xl);
  /* Отступ от краёв даёт РОДИТЕЛЬ (.content — 20px). Свои поля здесь
     складывались с ним, и страницы на page-shell отступали от левой панели на
     40px, а дашборд (он без shell) — на 20px. Из-за этого при переходе между
     разделами содержимое заметно прыгало вбок. */
  margin: 0;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
/* Сохраняем скруглённые углы у первого и последнего дочернего элемента */
.page-shell > *:first-child { border-radius: var(--ui-r-xl) var(--ui-r-xl) 0 0; overflow: hidden; }
.page-shell > *:last-child  { border-radius: 0 0 var(--ui-r-xl) var(--ui-r-xl); overflow: hidden; }

/* ── Page Header — заголовок страницы (Tabler style) ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
  min-height: 56px;
}
.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.page-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Page Filters Bar ── */
.page-filters {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.page-filters:empty { display: none; }

/* ── Page Body — область контента ── */
.page-body { }
.page-body .task-list { }

/* ── Страницы с таблицей — убираем лишние отступы ── */
.page-shell .data-table { border-radius: 0; }
.page-shell .filters-bar { padding: 10px 20px; border-bottom: 1px solid var(--border-light); }

/* Mobile */
@media (max-width: 767px) {
  .page-shell { margin: 8px; border-radius: 10px; }
  .page-header { padding: 12px 14px; min-height: 48px; }
  .page-title { font-size: 15px; }
  .page-header-actions { gap: 6px; }
  .page-filters { padding: 8px 12px; }
}

/* ── Page Filters — inputs/selects не растягиваются на всю ширину ── */
.page-filters .form-select,
.page-filters select {
  width: auto !important;
  min-width: 120px;
  max-width: 220px;
  flex-shrink: 0;
}
.page-filters .form-input,
.page-filters input[type="text"] {
  width: auto !important;
  min-width: 160px;
}

/* ── Inventory filters — горизонтальная строка фильтров ── */
/* НА ТЕЛЕФОНЕ ЭТА ПОЛОСА НАМЕРЕННО СТОИТ СТОЛБИКОМ (см. правило в конце файла).
   Канонное «одной строкой с прокруткой» здесь не работает: списки с поиском
   рисуют выпадающую панель абсолютно, а контейнер с overflow-x обрезает её —
   ровно та же грабля, что ловилась в «Электрохозяйстве» у полосы вкладок. */
.inv-filters-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
}
.inv-filters-row .form-select,
.inv-filters-row select {
  width: auto !important;
  min-width: 0;
  flex: 1 1 140px;
  max-width: 200px;
  height: 36px;
  font-size: 13px;
  text-overflow: ellipsis;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px !important;
  cursor: pointer;
}
.inv-filters-row .form-input {
  width: auto !important;
  min-width: 0;
  flex: 1 1 160px;
  max-width: 240px;
  height: 34px;
  font-size: 13px;
}
@media (max-width: 900px) {
  .inv-filters-row .form-select,
  .inv-filters-row select { flex: 1 1 120px; max-width: none; }
  .inv-filters-row .inv-search-wrap { flex: 1 1 100%; max-width: none; }
}
.inv-filters-row .inv-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.inv-filters-row .inv-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.inv-filters-row .inv-search-wrap input {
  padding-left: 32px !important;
  width: 100% !important;
}

/* ── Action buttons in tables (edit/delete) — красивее ── */
.ref-table .btn-icon,
.data-table .btn-icon,
.task-list .btn-icon {
  width: 28px; height: 28px;
  border-radius: var(--ui-r);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all .12s;
}
.ref-table .btn-icon:hover { border-color: var(--green-700); background: var(--primary-light); color: var(--green-700); }
.ref-table .btn-icon.danger:hover,
.ref-table .btn-icon[onclick*="delete"]:hover,
.ref-table .btn-icon[onclick*="Delete"]:hover { border-color: var(--destructive); background: var(--destructive-light); color: var(--destructive); }

/* Кнопка редактирования в таблице склада */
.data-table .btn.btn-outline.btn-sm {
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
}
.data-table .btn.btn-outline.btn-sm:hover {
  border-color: var(--green-700);
  color: var(--green-700);
  background: var(--primary-light);
}

/* ═══════════════════════════════════════════════════
   BEAUTIFUL SELECT — кастомная стрелка, чистый вид
   ═══════════════════════════════════════════════════ */
.inv-filters-row select,
.inv-filters-row .form-select,
.page-filters select,
.page-filters .form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--ui-r) !important;
  background-color: var(--bg-card) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-family: var(--font) !important;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  height: 34px !important;
  line-height: 1;
}
.inv-filters-row select:focus,
.inv-filters-row .form-select:focus,
.page-filters select:focus,
.page-filters .form-select:focus {
  border-color: var(--green-700) !important;
  box-shadow: 0 0 0 3px var(--primary-ring) !important;
  outline: none;
}
.inv-filters-row select:hover,
.page-filters select:hover {
  border-color: #CBD5E1 !important;
}

/* Опции в выпадающем — нативные, но хоть цвет */
.inv-filters-row select option,
.page-filters select option {
  font-size: 13px;
  padding: 6px 12px;
  color: var(--text);
  background: var(--bg-card);
}

/* ═══════════════════════════════════════════════════
   MOBILE — полный аудит всех page-shell страниц
   ═══════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* page-header mobile — кнопка под заголовком */
  .page-header {
    flex-wrap: wrap;
    gap: 0;
    padding-bottom: 12px;
  }
  .page-header-left { flex: 1 1 100%; min-width: 0; margin-bottom: 10px; }
  .page-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header-actions .btn {
    flex: 0 0 auto;
  }

  /* Аналитика — гриды в колонку */
  #page-analytics .page-shell > div[style*="grid-template-columns:2fr"],
  #page-analytics .page-shell > div[style*="grid-template-columns: 2fr"],
  #page-analytics .page-shell > div[style*="grid-template-columns:1fr 1fr"],
  #page-analytics .page-shell > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* KPI ряд аналитики */
  #analytics-kpi { padding: 12px !important; }
  #analytics-kpi .stat-card { min-width: 0; padding: 10px 8px; flex-direction: column; align-items: center; gap: 4px; }
  #analytics-kpi .stat-card-value { font-size: 18px !important; }

  /* Inventory KPI row */
  #inventory-summary { flex-wrap: wrap; }
  #inventory-summary .v4-kpi-item {
    flex: 1 1 45%;
    border-top: 1px solid var(--border-light);
    border-left: none !important;
  }
  #inventory-summary .v4-kpi-item:first-child,
  #inventory-summary .v4-kpi-item:nth-child(2) { border-top: none; }
  #inventory-summary .v4-kpi-item:nth-child(odd) { border-left: none !important; }
  #inventory-summary .v4-kpi-item:nth-child(even) { border-left: 1px solid var(--border-light) !important; }

  /* Inv filters — поиск на всю ширину, селекты по 2 в ряд */
  .inv-filters-row { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .inv-filters-row .inv-search-wrap { flex: 1 1 100%; max-width: none; }
  .inv-filters-row .form-select,
  .inv-filters-row select { flex: 1 1 calc(50% - 6px); max-width: none; }

  /* Таблица данных на мобиле — скролл */
  .page-shell .data-table { font-size: 11px; }
  .page-shell .data-table th,
  .page-shell .data-table td { padding: 8px 8px; white-space: nowrap; }
  .page-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Кнопки в таблице */
  .data-table .btn.btn-outline.btn-sm { font-size: 11px; padding: 0 6px; height: 26px; }

  /* Справочники */
  .ref-table { font-size: 12px; }
  .ref-table th, .ref-table td { padding: 8px 10px; }

  /* Мониторинг */
  .mon-health-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

  /* page-shell в модулях без отступа */
  #page-reports .page-shell,
  #page-audit .page-shell { margin: 8px; }

  /* Отчёты — фильтры в колонку */
  #page-reports .section-body > div[style*="flex-wrap"],
  #analytics-reports .section-body > div[style*="flex-wrap"] { flex-direction: column; }
  #page-reports .section-body input[type="date"],
  #analytics-reports .section-body input[type="date"] { width: 100% !important; }
  #page-reports .section-body select,
  #analytics-reports .section-body select { width: 100% !important; }

  /* Скрываем лишнее на мобиле в таблице склада */
  .data-table th:nth-child(3),
  .data-table td:nth-child(3) { display: none; } /* место хранения */
  .data-table th:nth-child(7),
  .data-table td:nth-child(7) { display: none; } /* цена */
}

@media (max-width: 480px) {
  .page-title { font-size: 14px; }
  .page-title svg { display: none; }
  .inv-filters-row .form-select,
  .inv-filters-row select { flex: 1 1 100%; }
}

/* Кнопки действий внутри occ-card (одобрить, заказано, изменить и т.п.) */
.occ-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ui-r);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .1s, border-color .1s;
}
.occ-action-btn:hover { background: var(--bg-muted); }

/* ── Кнопка закрытия модалок ── */
.modal-close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.modal-close-btn:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.modal-close-btn svg { display: block; }

/* ══════════════════════════════════════════════
   МОБИЛЬНЫЙ POLISH — occ-card задачи и закупки
   ══════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* page-shell — без отступов по бокам на мобиле */
  .page-shell {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Фильтры — горизонтальный скролл без переноса */
  #tasks-filters, .page-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px;
    gap: 6px;
    scrollbar-width: none;
  }
  #tasks-filters::-webkit-scrollbar,
  .page-filters::-webkit-scrollbar { display: none; }
  #tasks-filters .filter-chip,
  .page-filters .filter-chip { flex-shrink: 0; }

  /* occ-card — убираем лишнее, добавляем отступы между картами */
  .v4-feed-list .occ-card {
    padding: 10px 12px 10px 18px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  /* Левая полоска — чуть тоньше */
  .v4-feed-list .occ-card::before { left: 3px; top: 8px; bottom: 8px; }

  /* Разделитель между задачами */
  .v4-feed-list .occ-card + .occ-card::after {
    left: 0; right: 0;
  }

  /* Заголовок карты: бейдж + название в строку */
  .occ-card-inner { width: 100%; }
  .occ-card-title {
    white-space: normal !important;
    font-size: 13px;
    line-height: 1.35;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  /* Мета-строка — меньше шрифт, перенос */
  .occ-card-meta {
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 4px !important;
  }
  .occ-card-meta-item { font-size: 11px; }

  /* Бейдж статуса — правее за title */
  .occ-card-badge { font-size: 9px; padding: 2px 6px; }

  /* Дедлайн — не уходит за экран */
  .occ-card-deadline { font-size: 10px; flex-shrink: 0; }

  /* Кнопки задач (▶ ✓) — убираем из inline, ставим под контентом */
  .task-actions {
    display: flex !important;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
  }
  .task-actions .btn-icon {
    width: 32px; height: 32px;
  }

  /* Закупки — кнопки под карточкой */
  #purchases-list .occ-card {
    flex-wrap: wrap !important;
  }
  #purchases-list .occ-card > div:last-child {
    width: 100%;
    padding-left: 0 !important;
    padding-top: 8px;
    flex-wrap: wrap;
    gap: 6px;
  }
  #purchases-list .btn.btn-sm {
    flex: 1;
    justify-content: center;
    min-width: 80px;
  }

  /* Закупки summary — 2 в ряд */
  #purchases-summary > div { flex-wrap: wrap; padding: 0 0 8px !important; }
  #purchases-summary .section { flex: 1 1 calc(50% - 4px) !important; min-width: 0; padding: 10px 8px !important; }

  /* purchases-list — без отступов по бокам */
  #purchases-list, #purchases-summary { padding-left: 0 !important; padding-right: 0 !important; }
  #purchases-list .v4-feed-list {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
}

@media (max-width: 767px) {
  /* task-item мобильный layout */
  .task-item {
    flex-wrap: wrap !important;
    padding: 10px 10px 8px 10px !important;
    gap: 6px !important;
    align-items: flex-start !important;
    position: relative;
  }

  /* Иконка — меньше */
  .task-icon { width: 26px !important; height: 26px !important; min-width: 26px !important; margin-top: 1px; }

  /* task-info занимает всю ширину минус иконка */
  .task-info { flex: 1; min-width: 0; }

  /* Название — переносится */
  .task-title { white-space: normal !important; font-size: 13px; line-height: 1.35; }

  /* Статус-бейдж — перемещаем в мета-строку, скрываем отдельную колонку */
  .task-status-col {
    order: 10;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 32px;
    margin-top: 0;
    min-width: 0 !important;
  }

  /* Кнопки — под контентом справа */
  .task-actions {
    order: 11;
    width: 100%;
    display: flex !important;
    justify-content: flex-end;
    gap: 6px;
    padding-left: 32px;
    margin-top: 4px;
    min-width: 0 !important;
    width: auto !important;
  }
  .task-actions .btn-icon {
    width: 34px !important; height: 34px !important;
    border-radius: 8px !important;
    border: 1.5px solid var(--border) !important;
    background: var(--bg-card) !important;
  }
  .task-actions .btn-icon.success {
    border-color: #bbf7d0 !important;
    background: #eef8f2 !important;
  }
}

@media (max-width: 767px) {
  /* РАНЬШЕ блоки на телефоне растягивались во всю ширину без полей, скруглений
     и боковых рамок — при белом фоне приложения это читалось нормально.
     С серым полотном так нельзя: блоки слились в одну белую простыню, и между
     карточками пропал воздух. Возвращаем поля и скругление — серое полотно
     между блоками и есть разделитель. */
  .v4-shell {
    margin: 0 0 12px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .page-shell {
    box-shadow: none !important;
  }
  .section { margin-bottom: 12px; }
  /* Внутри блока на телефоне поля меньше, иначе плиткам не остаётся ширины. */
  .v4-kpi-row { padding: 12px; gap: 10px; }
  .v4-header { padding: 14px 14px 10px; }
}

@media (max-width: 767px) {
  /* Прячем тени карточек за пределами экрана */
  .main { overflow-x: hidden; }
  /* Явно убираем тени у всех карточек/секций на мобиле */
  .section, .v4-shell, .page-shell, .occ-card, .v4-feed-list {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
  }
}

@media (max-width: 767px) {
  /* Календарь дашборда — без рамки и тени на мобиле */
  .v4-cal-wrap {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
  /* Календарь и лента задач жили по РАЗНЫМ сеткам: календарь отступал от края
     на 23px, лента на 11px, а справа у ленты оставалась щель 21px против 11px
     слева. Отсюда ощущение, что карточка задачи «не во всю ширину и даже уже
     календаря» (замечание владельца 19.08.2026). Ставим оба блока на одну
     линию и во всю ширину экрана. */
  .v4-right {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .v4-feed { width: 100% !important; }
  .v4-feed-scroll, .v4-feed-list { width: 100% !important; }
  /* Табы дашборда — не переносятся */
  #dashboard-view-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 12px 16px 0 !important;
  }
  #dashboard-view-tabs::-webkit-scrollbar { display: none; }
  #dashboard-view-tabs .filter-chip { flex-shrink: 0; white-space: nowrap; }
  #dashboard-view-tabs .filter-chip svg { display: none; }
  /* Табы справочников переехали на канон (.sec-tabs) 01.09 — блок снят:
     он задавал свои поля и прокрутку поверх канонических и на телефоне
     сдвигал полосу относительно остальных разделов. */
  /* Убираем тени у всех виджетов внутри дашборда */
  #page-dashboard .section,
  #page-dashboard [style*="border-radius"],
  #page-dashboard [style*="box-shadow"] {
    box-shadow: none !important;
  }
}

@media (max-width: 767px) {
  /* Убираем WebKit-тени на pill-кнопках */
  .filter-chip {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -webkit-appearance: none !important;
  }
  .btn, .btn-sm, .btn-outline, .btn-primary {
    -webkit-appearance: none !important;
  }
}

@media (max-width: 767px) {
  /* v4-feed-scroll — без рамки, на всю ширину */
  .v4-feed-scroll {
    border: none !important;
    border-radius: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  .v4-feed {
    padding: 10px 0 16px !important;
    border-right: none !important;
  }
  .v4-section-label {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}




/* ===== DASHBOARD TABS ===== */
.dash-header-bar {
  display: flex;
  align-items: center;
  padding: 12px 20px 0;
}

/* Desktop: underline tabs */
.dash-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-tabs-wrap::-webkit-scrollbar { display: none; }

.dash-tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 2px solid var(--border);
}

.dash-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 42px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s;
  border-radius: 0;
  flex-shrink: 0;
}
.dash-tab:hover { color: var(--green-700); background: var(--bg-secondary); border-radius: 8px 8px 0 0; }
.dash-tab.active { color: var(--green-700); font-weight: 700; }
.dash-tab svg { flex-shrink: 0; width: 14px; height: 14px; }

.dash-tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  transition: left 0.25s cubic-bezier(.4,0,.2,1), width 0.25s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

/* Mobile: segment control (iOS style) */
@media (max-width: 640px) {
  .dash-header-bar {
    padding: 10px 12px 6px;
  }
  .dash-tabs-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dash-tabs-wrap::-webkit-scrollbar { display: none; }
  .dash-tabs {
    min-width: 100%;
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    background: var(--bg-secondary) !important;
    border-radius: 10px;
    border-bottom: none;
    padding: 3px;
    gap: 2px;
  }
  .dash-tab {
    flex: 1 1 auto;
    min-width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    height: 36px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 8px;
    white-space: nowrap;
    overflow: visible;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 1;
    min-width: 0;
  }
  .dash-tab svg { width: 12px; height: 12px; flex-shrink: 0; }
  .dash-tab:hover { background: none; color: var(--text); }
  .dash-tab.active {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 1px 6px rgba(45,125,83,.3);
  }
  .dash-tab.active svg { stroke: #fff; }
  .dash-tab-indicator { display: none !important; }
}


/* ===== SKELETON (универсальный) ===== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
.skel-box {
  background: var(--bg-secondary);
  border-radius: 6px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* ===== DASHBOARD SKELETON ===== */
@keyframes skel-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skel-line,
.skel-kpi,
.skel-task,
.skel-cal {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--border) 37%,
    var(--bg-secondary) 63%
  );
  background-size: 1200px 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.skel-kpi {
  height: 56px;
  flex: 1;
  min-width: 60px;
  border-radius: 10px;
}

.skel-task {
  height: 62px;
  width: 100%;
  border-radius: 10px;
  margin-bottom: 8px;
}

.skel-cal {
  height: 260px;
  width: 100%;
  border-radius: 12px;
}

/* Адаптив скелетона */
@media (max-width: 640px) {
  .skel-kpi  { height: 48px; }
  .skel-task { height: 56px; }
  .skel-cal  { height: 200px; }
}

/* ===== DASHBOARD CARD & TABS ===== */
#page-dashboard {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
#page-dashboard #dashboard-view-tabs {
  padding: 8px 0 6px !important;
  margin: 0 !important;
}
@media (max-width: 640px) {
  #dash-tab-specialists svg { display: inline !important; }
  #dash-tab-specialists { flex: 1 1 0 !important; }
  /* Все табы равной ширины на всю страницу */
  #page-dashboard .dash-tabs {
    border-radius: 0 !important;
    padding: 4px 4px !important;
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    gap: 3px !important;
    width: 100% !important;
  }
  #page-dashboard .dash-tab {
    border-radius: 20px !important;
    padding: 0 6px !important;
    font-size: 11.5px !important;
    height: 34px !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    letter-spacing: -0.2px !important;
    gap: 4px !important;
  }
  #page-dashboard .dash-tab.active {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
  }
  #page-dashboard .dash-tab svg {
    width: 12px !important; height: 12px !important;
    display: inline !important;
    flex-shrink: 0 !important;
  }
  #page-dashboard .dash-tab-indicator { display: none !important; }
}
/* Все три вида — одинаковый стиль карточки */
#page-dashboard #dash-view-main .v4-shell,
#page-dashboard #dash-skeleton .v4-shell,
#page-dashboard #dash-sections-grid .v4-shell,
#page-dashboard #dash-specialists-grid .v4-shell {
  margin: 0 0 12px !important;
  border-radius: 0 !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 3px rgba(15,23,42,.06) !important;
  overflow: hidden !important;
}
@media (max-width: 767px) {
  /* ВОТ ТА САМАЯ ОБВОДКА, которую видел владелец: поля 10px, скругление 16px,
     рамка и тень — и ТОЛЬКО у дашбордов, из-за чего они одни выглядели
     обрамлёнными, а остальные разделы шли во всю ширину. Приведено к общему
     виду: по горизонтали во всю ширину, разделяет только серый промежуток. */
  #page-dashboard #dash-view-main .v4-shell,
  #page-dashboard #dash-skeleton .v4-shell,
  #page-dashboard #dash-sections-grid .v4-shell,
  #page-dashboard #dash-specialists-grid .v4-shell {
    margin: 0 0 12px !important;
    border-radius: 0 !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
}

/* Drilldown карточка (Участки/Специалисты → клик на строку) — НЕ overflow:hidden,
   иначе длинный список задач обрезается и его не пролистать на iOS PWA */
#dash-sections-grid .v4-shell,
#dash-specialists-grid .v4-shell {
  overflow: visible !important;
}
#dash-sections-grid #sec-tasks-list,
#dash-specialists-grid #spec-tasks-list {
  overflow: visible !important;
  -webkit-overflow-scrolling: touch;
}

/* =====================================================
   MODAL BOTTOM SHEET — для всех устройств с таббаром
   (телефоны max-width:767px И планшеты 768-1024px)
   ===================================================== */
@media (max-width: 1024px) {
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal {
    max-width: 100% !important; width: 100% !important;
    margin: 0 !important; max-height: 94vh !important;
    border-radius: 20px 20px 0 0 !important;
    animation: slideUp .25s cubic-bezier(.32,0,.67,0) !important;
    border-bottom: none !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,.12) !important;
  }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .modal-header { padding: 8px 20px 12px !important; position: relative !important; }
  .modal-header::before {
    content: ''; display: block;
    width: 36px; height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin: 0 auto 10px;
  }
  .modal-title { font-size: 18px !important; font-weight: 700 !important; }
  .modal-close { width: 32px !important; height: 32px !important; border-radius: 50% !important; }

  .modal-body {
    padding: 8px 20px 12px !important;
    max-height: calc(94vh - 130px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  /* Inputs и footer — управляются через showModal() JS для динамических модалок,
     и через исходный CSS для статических (Новая задача и др.) */
}

/* ═══ Action Sheet ═══ */
.action-sheet-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.action-sheet-btn:hover, .action-sheet-btn:active {
  background: var(--bg-muted);
}
.action-sheet-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-sheet-text {
  flex: 1;
  min-width: 0;
}
.action-sheet-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.action-sheet-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ AI Chat ═══ */
#page-ai-chat { padding:0 !important; overflow:hidden; }
#page-ai-chat.active { display:flex !important; flex-direction:column; overflow:hidden; }

#ai-chat-shell {
  display:flex; flex-direction:column;
  flex:1; min-height:0; overflow:hidden;
  background:var(--bg-page);
}

/* Минимальный хедер */
#ai-chat-header {
  display:flex; align-items:center;
  padding:8px 16px;
  background:var(--bg-card);
  border-bottom:1px solid var(--border-light);
  flex-shrink:0; gap:8px;
}
#ai-chat-header-left { display:flex; align-items:center; gap:8px; }
#ai-chat-avatar {
  /* БЕЗ круглой подложки и БЕЗ фона: шапка и так светлая (--bg-card), а Тоша
     тёмно-зелёный — контраста хватает. Круглый фон тут пробовали 20.09: фигура
     шире кружка, ключ и рука вылезали за край и срезались. Персонаж
     показывается целиком, как нарисован. */
  width:30px; height:30px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
#ai-chat-avatar img { display:block; }
#ai-chat-header-title { font-size:14px; font-weight:700; color:var(--text); }

#ai-chat-scroll {
  flex:1; min-height:0; overflow-y:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  display:flex; flex-direction:column;
  /* 09.09.2026, решение владельца: фон чата Тоши — белый. Раньше область
     наследовала общий фон приложения (серая подложка трёх уровней, см.
     редизайн 29.08), и переписка визуально сливалась с остальными экранами.
     Пузыри ответов сами по себе светлые (--bg-card), поэтому на сером фоне
     контраст был почти нулевой. Задаём цвет здесь, у прокручиваемой области,
     а не у #ai-chat-messages: сообщения не растягиваются на всю высоту, и
     при коротком диалоге низ экрана оставался серым. */
  background:#fff;
}

#ai-chat-welcome-screen {
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  text-align:center; padding:24px 24px 16px; gap:10px;
}
#ai-chat-welcome-icon {
  width:60px; height:60px; border-radius:50%; background:var(--primary);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 20px rgba(34,197,94,.3); flex-shrink:0;
}
#ai-chat-welcome-title { font-size:20px; font-weight:800; color:var(--text); letter-spacing:-.3px; }
#ai-chat-welcome-sub { font-size:13px; color:var(--text-muted); line-height:1.6; max-width:280px; }

#ai-chat-messages { padding:12px 14px 8px; display:flex; flex-direction:column; gap:12px; }

#ai-chat-bottom {
  flex-shrink:0;
  background:var(--bg-card);
  border-top:1px solid var(--border-light);
  padding-top:4px;
  padding-bottom:calc(64px + env(safe-area-inset-bottom, 0px));
}

#ai-chat-quick-actions {
  display:flex; gap:6px; padding:8px 14px 6px;
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
#ai-chat-quick-actions::-webkit-scrollbar { display:none; }
.ai-quick-chip {
  display:inline-flex; align-items:center; gap:5px; padding:6px 12px;
  background:var(--bg-muted); border:1.5px solid var(--border);
  border-radius:20px; font-size:12px; font-weight:600; color:var(--text);
  cursor:pointer; white-space:nowrap; flex-shrink:0;
  transition:all .15s; -webkit-tap-highlight-color:transparent;
}
.ai-quick-chip:active { background:var(--primary); color:#fff; border-color: var(--green-700); }
.ai-quick-chip-red { border-color:#fca5a5; color:#dc2626; background:#fff5f5; }
.ai-quick-chip-red:active { background:#ef4444; color:#fff; border-color:#ef4444; }

/* Claude-style input box */
#ai-input-box {
  margin:4px 12px 10px;
  background:var(--bg-card);
  border:1.5px solid var(--border);
  border-radius:16px;
  box-shadow:0 2px 12px rgba(0,0,0,.08);
  transition:border-color .2s, box-shadow .2s;
}
#ai-input-box:focus-within {
  border-color: var(--green-700);
  box-shadow:0 2px 16px rgba(34,197,94,.12);
}
#ai-chat-input {
  display:block; width:100%; box-sizing:border-box;
  padding:12px 14px 6px;
  border:none; outline:none; resize:none;
  font-size:16px; font-family:inherit; line-height:1.45;
  background:transparent; color:var(--text);
  max-height:140px; overflow-y:hidden;
}
#ai-chat-input::placeholder { color:var(--text-muted); }
#ai-chat-input::-webkit-scrollbar { display:none; }
#ai-chat-input { scrollbar-width:none; -ms-overflow-style:none; }

#ai-input-actions {
  display:flex; align-items:center; justify-content:space-between;
  padding:2px 6px 8px;
}

/* Левая кнопка + */
#ai-plus-btn {
  width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; cursor:pointer;
  color:var(--text-muted);
  transition:all .2s; -webkit-tap-highlight-color:transparent;
  flex-shrink:0;
}
#ai-plus-btn:active { background:var(--bg-secondary); color: var(--green-700); transform:rotate(45deg); }

/* Универсальная иконка-кнопка (для совместимости) */
.ai-input-icon-btn {
  width:34px; height:34px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; cursor:pointer;
  color:var(--text-muted); transition:all .15s;
  -webkit-tap-highlight-color:transparent;
}
.ai-input-icon-btn:active { background:var(--bg-secondary); color:var(--text); }

/* Правая кнопка mic/send */
#ai-right-btn {
  width:42px; height:42px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:none; cursor:pointer; flex-shrink:0;
  transition:all .25s cubic-bezier(.34,1.56,.64,1);
  -webkit-tap-highlight-color:transparent;
}
.ai-right-btn-mic {
  background:none;
  color:var(--text-muted);
}
.ai-right-btn-mic:active { background:var(--bg-secondary); }
.ai-right-btn-send {
  background:var(--primary);
  color:#fff;
  box-shadow:0 2px 8px rgba(34,197,94,.35);
  transform:scale(1.05);
}
#ai-right-btn svg { width:22px; height:22px; }
#ai-plus-btn svg { width:22px; height:22px; }
.ai-right-btn-send:active { transform:scale(.93); }

/* Запись голоса */
#ai-right-btn.recording {
  background:#fef2f2 !important;
  color:#ef4444 !important;
  animation:micPulse 1s infinite;
}
@keyframes micPulse {
  0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)}
  50%{box-shadow:0 0 0 6px rgba(239,68,68,0)}
}

/* Полоса записи голоса (app-ai-voice-btn.js) */
#ai-voice-bar {
  display:none; align-items:center; gap:8px;
  padding:12px 14px 6px; min-height:24px; font-size:14px; color:var(--text);
}
#ai-voice-bar .avb-dot { width:10px; height:10px; border-radius:50%; background:#ef4444; flex-shrink:0; animation:avbBlink 1s infinite; }
#ai-voice-bar .avb-time { font-variant-numeric:tabular-nums; font-weight:600; min-width:34px; }
#ai-voice-bar .avb-hint { flex:1; color:var(--text-muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#ai-voice-bar .avb-cancel { border:none; background:none; color:var(--text-muted); font-size:13px; font-weight:600; padding:4px 6px; cursor:pointer; flex-shrink:0; }
#ai-voice-bar.avb-armed .avb-hint { color:#ef4444; font-weight:600; }
@keyframes avbBlink { 0%,100%{opacity:1} 50%{opacity:.3} }
#ai-right-btn { touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }

/* Plus action sheet */
#ai-plus-sheet-overlay {
  position:fixed; inset:0; z-index:700;
  background:rgba(0,0,0,.4);
  display:flex; align-items:flex-end; justify-content:center;
}
#ai-plus-sheet {
  background:var(--bg-card);
  border-radius:20px 20px 0 0;
  width:100%; max-width:480px;
  padding:0 0 calc(8px + env(safe-area-inset-bottom,0px));
  animation:slideUp .25s cubic-bezier(.32,.72,0,1);
}
.ai-plus-item {
  display:flex; align-items:center; gap:14px;
  padding:15px 20px;
  cursor:pointer; border:none; background:none;
  width:100%; text-align:left;
  font-size:15px; color:var(--text);
  -webkit-tap-highlight-color:transparent;
  transition:background .15s;
}
.ai-plus-item:active { background:var(--bg-secondary); }
.ai-plus-item-icon {
  width:42px; height:42px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; font-size:20px;
}
.ai-plus-item-label { font-weight:600; }
.ai-plus-item-sub { font-size:12px; color:var(--text-muted); margin-top:1px; }
.ai-plus-divider { height:1px; background:var(--border-light); margin:0 20px; }

/* На ПК Plus sheet — центрированная модалка */
@media (min-width: 769px) {
  #ai-plus-sheet-overlay { align-items: center; }
  #ai-plus-sheet {
    border-radius: 16px;
    max-width: 420px;
    padding: 8px 0 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: scaleIn .2s cubic-bezier(.32,.72,0,1);
  }
  #ai-plus-sheet > div:first-child { display: none; }
}
@keyframes scaleIn { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }

.ai-chat-msg { display:flex; flex-direction:column; gap:2px; animation:msgIn .2s ease; }
@keyframes msgIn { from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)} }
.ai-chat-msg-user { align-items:flex-end; }
.ai-chat-msg-ai   { align-items:flex-start; }
.ai-chat-bubble { max-width:88%; padding:11px 14px; border-radius:18px; font-size:14px; line-height:1.65; word-break:break-word; }
.ai-chat-bubble-user { background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.ai-chat-bubble-ai { background:var(--bg-card); color:var(--text); border:1px solid var(--border-light); border-bottom-left-radius:4px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.ai-chat-bubble-ai p { margin:0 0 6px; }
.ai-chat-bubble-ai p:last-child { margin-bottom:0; }
.ai-chat-bubble-ai strong { font-weight:700; }
.ai-chat-bubble-ai ul,.ai-chat-bubble-ai ol { margin:3px 0 6px 16px; padding:0; }
.ai-chat-bubble-ai li { margin:2px 0; }
.ai-chat-bubble-ai h2,.ai-chat-bubble-ai h3 { font-size:13px; font-weight:700; margin:6px 0 3px; }
.ai-chat-bubble-ai code { background:var(--bg-muted); padding:1px 5px; border-radius:4px; font-size:12px; font-family:monospace; }
.ai-chat-bubble-error { background:#fef2f2; border-color:#fca5a5; color:#991b1b; }
.ai-chat-time { font-size:10px; color:var(--text-muted); padding:0 4px; margin-top:1px; }

.ai-chat-typing { display:flex; align-items:center; gap:5px; padding:12px 16px; background:var(--bg-card); border:1px solid var(--border-light); border-radius:18px; border-bottom-left-radius:4px; width:fit-content; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.ai-chat-typing span { width:6px; height:6px; background:var(--text-muted); border-radius:50%; animation:aiDot .7s infinite alternate; }
.ai-chat-typing span:nth-child(2){animation-delay:.22s}
.ai-chat-typing span:nth-child(3){animation-delay:.44s}
@keyframes aiDot{0%{opacity:.2;transform:translateY(0)}100%{opacity:.7;transform:translateY(-3px)}}

/* Статус вместо трёх точек: «смотрю задачи и просрочки…».
   Пузырь тот же, поэтому переход из точек в текст не дёргает layout —
   меняется только содержимое. Точка-пульс слева заменяет анимацию троеточия. */
.ai-chat-typing.ai-chat-typing-status { gap:8px; max-width:min(78%,420px); }
.ai-chat-typing-status .ai-status-dot { width:6px; height:6px; flex:0 0 6px; background:var(--text-muted); border-radius:50%; animation:aiPulse 1.1s ease-in-out infinite; }
/* Ширина статуса. Базовый .ai-chat-typing — это flex с width:fit-content, а
   .ai-chat-bubble задаёт word-break:break-word. В такой связке текстовый
   флекс-элемент сжимается до МИНИМАЛЬНОЙ ширины содержимого, а break-word
   разрешает разрыв в любом месте — то есть до ОДНОЙ БУКВЫ, и подпись
   печаталась вертикальным столбиком. Лечим на самом тексте: nowrap делает
   min-content равным всей строке, ellipsis подстрахует длинную подпись. */
/* 04.10.2026: правило «.ai-chat-typing span» (точки печатания) задаёт КАЖДОМУ span
   6×6, фон и круг — текст статуса сжимался в серую точку, и вместо «читаю
   вопрос…» человек видел две точки. Сбрасываем это явно. */
.ai-chat-typing-status .ai-status-text { width:auto; height:auto; background:none; border-radius:0; flex:0 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; word-break:normal; overflow-wrap:normal; font-size:13px; line-height:1.35; color:var(--text-muted); animation:aiStatusIn .18s ease-out; }
@keyframes aiPulse{0%,100%{opacity:.25;transform:scale(.85)}50%{opacity:.8;transform:scale(1)}}
@keyframes aiStatusIn{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}

/* Предпросмотр генерации: текст печатается прямо в пузыре ответа.
   Разметка намеренно повторяет настоящий ответ (_renderOneMsg в app-ai-cards.js):
   тот же пузырь ai-chat-bubble-ai с БЛОЧНЫМ потомком внутри. Первая попытка
   положила текст в inline-span — пузырь тогда сжимался до минимальной ширины
   содержимого и печатал столбик по букве в строке.
   pre-wrap — модель шлёт переводы строк, разметку наведёт финальный рендер.
   word-break:normal перекрывает break-word из базового .ai-chat-bubble: тот
   разрешает разрыв в любом месте, из-за чего min-content равен одной букве.
   overflow-wrap:break-word переносит длинные слова так же, но на min-content
   не влияет. min-width — страховка: что бы ни случилось со схлопыванием,
   уже столбика не будет. */
#ai-preview .ai-chat-bubble { max-width:88%; min-width:min(180px,70%); word-break:normal; overflow-wrap:break-word; }
#ai-preview .ai-preview-text { margin:0; white-space:pre-wrap; }
#ai-preview .ai-preview-text::after { content:""; display:inline-block; width:2px; height:1em; margin-left:2px; vertical-align:-.15em; background:var(--text-muted); opacity:.7; animation:aiCaret 1s step-end infinite; }
@keyframes aiCaret{0%,50%{opacity:.7}51%,100%{opacity:0}}
@media (prefers-reduced-motion: reduce){
  .ai-chat-typing-status .ai-status-dot,
  #ai-preview .ai-preview-text::after,
  .ai-chat-typing-status .ai-status-text { animation:none; }
}

.ai-action-card { margin-top:6px; padding:9px 12px; background:var(--bg-muted); border:1px solid var(--border); border-radius:12px; font-size:13px; cursor:pointer; display:flex; align-items:center; gap:8px; -webkit-tap-highlight-color:transparent; }
.ai-action-card:active { background:var(--bg-secondary); }
.ai-action-card-icon { width:26px; height:26px; border-radius:7px; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

@media (max-width:768px) {
  /* Страница заканчивается ровно там, где начинается таббар (с учётом safe-area) */
  #page-ai-chat.active {
    position:fixed;
    /* + env(safe-area-inset-top): в PWA шапка ВЫШЕ на полосу статуса
       (см. блок «iOS PWA safe area»: height = --header-h + safe-area-inset-top).
       Без этой добавки страница чата заезжала под шапку ровно на высоту часов —
       от шапки чата торчали только ноги Тоши, заголовок не был виден вовсе
       (скриншот владельца из PWA, 20.09.2026). На обычном браузере env() = 0,
       и поведение не меняется. */
    top:calc(var(--header-h, 56px) + env(safe-area-inset-top, 0px));
    left:0; right:0;
    bottom:0;
    overflow:hidden !important; padding-bottom:0 !important;
  }
  /* Та же страховка, что у .header, для Android с viewport-fit=cover: там
     env(safe-area-inset-top) отдаёт НОЛЬ, и отступ не добавился бы. */
  html.pwa-top-fallback #page-ai-chat.active {
    top:calc(var(--header-h, 56px) + max(28px, env(safe-area-inset-top, 0px)));
  }
  #ai-chat-bottom { padding-top:0; }
  #ai-chat-quick-actions { padding:4px 12px 2px; }
  #ai-input-box { margin:2px 8px 4px; }
  #ai-chat-input { padding:9px 14px 4px; font-size:15px; }
  #ai-input-actions { padding:0 6px 4px; }
  #ai-plus-btn,#ai-right-btn { width:36px; height:36px; }
  .ai-chat-bubble { max-width:92%; }
  #ai-chat-messages { padding:10px 12px 6px; }
}


/* Кликабельные сущности в ответе Тоши: запчасти / оборудование / задачи / регламенты */
.ai-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  font-weight: 500;
  transition: opacity .15s;
}
.ai-link:hover  { opacity: 0.75; }
.ai-link:active { opacity: 0.6; }
.ai-part-link { color: var(--accent, #16a34a); }   /* запчасти — зелёный */
.ai-eq-link   { color: #2563eb; }                  /* оборудование — синий */
.ai-task-link { color: #d97706; }                  /* задачи — оранжевый */
.ai-reg-link  { color: #7c3aed; }                  /* регламенты — фиолетовый */

/* Подвкладки Техники жили здесь своим набором и своей высотой (37px против 38
   у прочих полос). С 31.08 раздел рисует их каноном (.sec-tabs), правила
   больше не нужны. */

/* === Отключаем нативный pull-to-refresh браузера (свой жест — в app-pulltorefresh.js) === */
html, body { overscroll-behavior-y: none; }
.main { overscroll-behavior-y: contain; }

/* ── Мини-апп MAX: своя системная шапка сверху — не дублируем инсет статус-бара ── */
html.in-max .header { padding-top: 0 !important; height: var(--header-h) !important; }
html.in-max .sidebar { padding-top: 0 !important; }


/* === Единый строчный список оборудования === */
.eq-rows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}
.eq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
}
.eq-row:hover { transform: none; }
.eq-row .eq-card-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eq-row-main { flex: 1; min-width: 0; }
.eq-row-right {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0; white-space: nowrap;
}
.eq-row-go { color: #cbd5e1; flex-shrink: 0; }
.eq-row-stripe {
  position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px;
}
.eq-row-cat {
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 20px;
  white-space: nowrap;
}
/* Колонка названия в шапке подгруппы. min-width задаём ЗДЕСЬ, а не инлайном:
   инлайновый min-width:0 перебивал мобильное правило по приоритету. */
.eq-sub-main { flex: 1; min-width: 0; }
.eq-subgroup { box-shadow: var(--shadow-1); }
.eq-subgroup-head:hover { background: var(--bg-hover, #f8fafc); }
/* чекбокс пакетного выбора — по центру строки */
.eq-row .eq-card-checkbox { top: 50%; left: 10px; transform: translateY(-50%); }
body.eq-select-mode .eq-row { padding-left: 40px; }
@media (max-width: 640px) {
  .eq-rows-list { padding: 8px 12px; }
  .eq-row { padding: 10px 12px 10px 14px; }
  .eq-row-cat { display: none; }
  .eq-row-right span:last-child { display: none; }

  /* НАЗВАНИЕ ОБОРУДОВАНИЯ ВИДНО ЦЕЛИКОМ. Замер 17.08 на 390px: из 70 строк
     8 резались многоточием, у «Котел автоматический пеллетный ZOTA Pellet S 1»
     за кадром оставалось 154px из 338. На телефоне переносим по словам —
     ровно так же, как давно сделано у задач (.task-title). */
  .eq-row .eq-card-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }

  /* ШАПКА ПОДГРУППЫ однотипных единиц мобильных правил не имела ВООБЩЕ:
     категория, бейджи и блок «2 шт / все 2 работают» держали ширину
     (flex-shrink:0 + nowrap), и колонке названия доставалось 0-75px из 339 —
     название рассыпалось по одному слову в строку. */
  .eq-subgroup-head { gap: 8px; padding: 10px 10px 10px 14px; }
  .eq-subgroup-head .eq-row-cat { display: none; }
  .eq-subgroup-head .eq-sub-main { min-width: 120px; }
  /* «4 шт · все 4 работают» — отдельной строкой под названием, а не колонкой
     справа: колонка в 92px при крупном тексте резалась («4 ш…», «работа…»,
     жалоба 29.09.2026 с телефона). Строка на всю ширину не режется ни при
     каком размере шрифта. */
  .eq-subgroup-head { flex-wrap: wrap; row-gap: 4px; }
  .eq-subgroup-head .eq-sub-chevron { order: 4; }
  .eq-subgroup-head .eq-sub-right {
    order: 5; flex: 1 0 100%; max-width: none; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
    text-align: left !important; padding-left: 52px;
  }
  .eq-subgroup-head .eq-sub-right > div:first-child { font-size: 12px !important; color: var(--text-secondary, #64748b); }
  .eq-subgroup-head .eq-sub-status {
    white-space: normal !important;
    font-size: 12px;
    line-height: 1.3;
  }
  .eq-subgroup-head .eq-sub-status > span { margin-left: 0 !important; margin-right: 8px; }
  .eq-subgroup-head .eq-card-title,
  .eq-subgroup-head .eq-card-subtitle { word-break: break-word; }
}

/* Бейдж подрядчика — регламенты и задачи, работы выполняет сторонняя организация */
.badge-contractor {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: middle;
}


/* Запчасти к оборудованию в карточке задачи (основная колонка).
   В правой колонке имена обрезались, а количество налезало на название склада. */
.task-part-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border-light);
  cursor: pointer; transition: background .1s;
}
.task-part-row:first-child { border-top: none; }
.task-part-row:hover { background: var(--bg-secondary); }
.task-part-mark { font-size: 14px; font-weight: 700; line-height: 20px; flex: 0 0 14px; }
.task-part-name { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }
.task-part-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-part-qty { font-size: 14px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; padding-left: 8px; }
.task-part-more {
  padding: 10px 14px; text-align: center; font-size: 13px;
  color: var(--green-700); cursor: pointer; border-top: 1px solid var(--border-light);
}
@media (max-width: 767px) {
  .task-part-row { padding: 12px 12px; }
  .task-part-name { font-size: 15px; }
}


/* ── Блок задач в карточке оборудования ──────────────────────────────────────
   Жалоба владельца: «все разделы одинаковые, всё сливается воедино». Задачи —
   единственный блок карточки, ради которого её открывают в поле, поэтому ему
   даём отличие: полоса основного цвета слева, слегка подкрашенная шапка и
   цветной значок. Остальные разделы не трогаем — иначе выделение перестанет
   что-либо значить. */
#eq-tasks-section {
  border-left: 3px solid var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
#eq-tasks-section > .section-header {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: 0 8px 0 0;
}
#eq-tasks-section > .section-header .section-title { color: var(--green-700); }
/* Кнопок в шапке стало две («+ Задача» и «Работа выполнена»), а правая колонка
   карточки оборудования узкая: шапка секции на ПК не переносилась, и кнопки
   уезжали за край блока. Разрешаем перенос — они падают на свою строку. */
#eq-tasks-section > .section-header { flex-wrap: wrap; }
#eq-tasks-section > .section-header > .section-title { flex: 1 1 auto; min-width: 0; }
#eq-tasks-section > .section-header > div:last-child { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
#eq-tasks-section > .section-header .btn-sm { white-space: nowrap; }
#eq-tasks-section > .section-header .section-title svg { color: var(--green-700); }
/* Счётчик активных задач — не серый, а цветной: ноль задач и три задачи должны
   отличаться с одного взгляда. */
#eq-tasks-count:not([style*="display: none"]) {
  background: var(--primary) !important;
  color: #fff !important;
}


/* Карточки задач сверх лимита группы на дашборде — скрыты до нажатия
   «Смотреть все N» (dashExpandGroup снимает этот класс). */
.occ-extra-hidden { display: none !important; }

/* ─── Присутствие в карточке задачи ────────────────────────────────────
   Список отметок по меткам: кто, когда, где, насколько близко. Первые три
   видны всегда, остальные под кнопкой — на ежедневном обходе за неделю их
   набирается много. На телефоне строки переносятся, а не режутся. */
.presence-list { display: flex; flex-direction: column; gap: 8px; }
.presence-item { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.presence-mark {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); color: var(--text-muted);
}
.presence-mark.is-pinned { background: #dcfce7; color: #15803d; }
.presence-body { min-width: 0; flex: 1; }
.presence-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.presence-title .presence-when { font-weight: 500; color: var(--text-secondary); }
.presence-meta {
  font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 1px;
  display: flex; flex-wrap: wrap; gap: 2px 8px;
}
.presence-meta .presence-far { color: #b45309; }
.presence-event { font-size: 11px; font-weight: 700; color: #15803d; text-transform: uppercase; letter-spacing: .3px; }
.presence-more {
  align-self: flex-start; background: none; border: none; padding: 2px 0;
  font-size: 12px; font-weight: 600; color: var(--green-700); cursor: pointer;
}
.presence-more:hover { text-decoration: underline; }
@media (max-width: 767px) {
  .presence-title { font-size: 12.5px; }
  .presence-meta  { font-size: 11.5px; gap: 1px 6px; }
  .presence-mark  { width: 20px; height: 20px; }
}


/* ─── КРУПНЫЙ ТЕКСТ ────────────────────────────────────────────────────────────
   Часть механиков в возрасте, мелкий шрифт в коровнике читать тяжело.
   Масштабируем всё приложение целиком (zoom), а не подменяем размеры шрифта:
   в разметке больше двух тысяч размеров прописано инлайном из JS, множитель
   в CSS накрыл бы только часть и вышел бы разнобой.
   По умолчанию класса нет и не меняется ничего. */
body.fs-large   { zoom: 1.15; }
body.fs-xlarge  { zoom: 1.3; }

/* ГЛАВНАЯ ЛОВУШКА ZOOM: единицы vh считаются от НЕМАСШТАБИРОВАННОГО окна.
   Контейнер высотой 100vh при zoom 1.3 отрисуется на треть выше экрана, а на
   .app стоит overflow:hidden — низ страницы становится недосягаем, до конца
   списка не долистать. Делим высоты на масштаб: после zoom выходит ровно экран. */
body.fs-large  .app { height: calc(100vh / 1.15); height: calc(100dvh / 1.15); }
body.fs-xlarge .app { height: calc(100vh / 1.3);  height: calc(100dvh / 1.3); }

@media (max-width: 900px) {
  body.fs-large  .main {
    height: calc((100vh  - var(--header-h, 56px)) / 1.15);
    height: calc((100dvh - var(--header-h, 56px)) / 1.15);
  }
  body.fs-xlarge .main {
    height: calc((100vh  - var(--header-h, 56px)) / 1.3);
    height: calc((100dvh - var(--header-h, 56px)) / 1.3);
  }
  body.fs-large  .sidebar { height: calc(100vh / 1.15); height: calc(100dvh / 1.15); }
  body.fs-xlarge .sidebar { height: calc(100vh / 1.3);  height: calc(100dvh / 1.3); }
}

/* ПАНЕЛЬ КОМПЕНСИРОВАТЬ НЕ НАДО — проверено на живом телефоне дважды.
   Прибитый к экрану элемент внутри масштабируемого блока уже считает 100%
   от viewport, делённого на масштаб: после отрисовки выходит ровно экран.
   Обе мои попытки «помочь» (сначала width без right:auto, потом с ним)
   делали панель УЖЕ экрана — та самая белая полоса справа.
   Оставляем исходные left:0 + right:0 из основного правила. */

/* Кнопки выбора размера в профиле не помещались в ряд и третья уезжала
   за край — раскладываем сеткой, она переносит сама. */
.fs-buttons { display: grid; grid-template-columns: 1fr; gap: 8px; }
.fs-buttons button { white-space: nowrap; }

/* Лента плиток в разделе «Техника» прокручивается вбок — полосу прокрутки
   прячем: на десктопе она отрезала нижний край цифр, на телефоне не нужна. */
/* Плитки раздела «Техника». На ПК они тянутся по ширине (flex задан инлайном
   в app-vehicles.js), на телефоне — лента с прокруткой вбок: пятью рядами
   вразнос они бы съели весь первый экран, и список ушёл бы за сгиб. */
@media (max-width: 767px) {
  .veh-tiles { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  .veh-tiles > div { flex: 0 0 auto !important; min-width: 132px !important; width: 132px; padding: 10px 12px !important; }
  .veh-tiles > div > div:first-child { font-size: 20px !important; }
}
.veh-tiles::-webkit-scrollbar { display: none; }

/* ─────────────────────────────────────────────────────────────
   ИИ-ассистент на широком экране: колонка чата, а не вся ширина.
   Поле ввода во всю ширину монитора неудобно читать и печатать —
   строка уезжает на метр вправо. Ограничиваем колонку и держим её
   по центру; лента сообщений и чипы выровнены по той же оси,
   иначе поле «по центру» смотрится съехавшим относительно чата.
   Мобильную вёрстку не трогаем — там ширина экрана и есть колонка.
   ───────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  #ai-input-box {
    margin-left: auto;
    margin-right: auto;
    width: min(760px, calc(100% - 28px));
  }
  #ai-chat-quick-actions {
    margin-left: auto;
    margin-right: auto;
    width: min(760px, calc(100% - 28px));
    padding-left: 0;
    padding-right: 0;
  }
  #ai-chat-messages {
    width: min(760px, calc(100% - 28px));
    margin-left: auto;
    margin-right: auto;
  }
}

/* ─────────────────────────────────────────────────────────────
   ЕДИНЫЙ ВЫПАДАЮЩИЙ СПИСОК (smart-select, app-select.js)
   Кнопка встаёт на место скрытого <select> и должна выглядеть как
   обычное поле формы — иначе в одной форме соседствовали бы два
   разных вида полей.
   ───────────────────────────────────────────────────────────── */

/* =====================================================
   ВОЗДУХ МЕЖДУ БЛОКАМИ НА ТЕЛЕФОНЕ
   Замечание владельца 29.08.2026: на телефоне карточки слиплись. Причина —
   прежняя договорённость «на узком экране блок во всю ширину, без полей и
   скруглений»: при белом фоне приложения это читалось нормально, а на сером
   полотне блоки слились в одну белую простыню.
   Правило стоит В КОНЦЕ ФАЙЛА намеренно: у .page-shell поля и скругление
   гасились более поздними правилами мобильного аудита, и точечная правка выше
   по файлу не срабатывала.
   ===================================================== */
@media (max-width: 767px) {
  /* УТОЧНЕНИЕ ВЛАДЕЛЬЦА: воздух нужен МЕЖДУ блоками, а не вокруг них. Рамка от
     края телефона до содержимого только съедает ширину — на 390px это заметно.
     Поэтому по горизонтали блоки идут во всю ширину, без полей и скруглений, а
     разделяет их серый промежуток по вертикали. */
  .content { padding: 10px 0 !important; }
  .page-shell {
    margin: 0 0 12px !important;
    border-radius: 0 !important;
  }
  .page-shell > *:first-child,
  .page-shell > *:last-child { border-radius: 0; }
  /* Между плитками внутри блока тоже нужен воздух, но меньший, чем между
     блоками: иначе плитки начинают спорить с самими блоками. */
  .stats-grid { gap: 10px; padding: 0 12px; }
}


/* =====================================================
   ПЛИТКИ НА ТЕЛЕФОНЕ — КОМПАКТНЫЕ, ПО ТРИ В РЯД
   Две крупные колонки давали рваную сетку 2×3 и пустоту внутри каждой плитки:
   шесть чисел занимали пол-экрана. Три узких читаются как сводка, а не как
   шесть отдельных карточек.
   ===================================================== */
@media (max-width: 767px) {
  .v4-kpi-item {
    flex: 1 1 92px;
    /* Без min-width:0 плитку распирает самое длинное слово подписи
       («Наименований»), и вместо трёх в ряд встают две. */
    min-width: 0;
    padding: 10px 10px 11px;
    border-left: none !important;   /* часть плиток ставит рамку инлайном */
  }
  .v4-kpi-label { overflow-wrap: anywhere; }
  .v4-kpi-num { font-size: 20px !important; }
  .v4-kpi-label { font-size: 11px; line-height: 1.25; }
  /* Фильтры склада: четыре одинаковых поля в столбик — стена. В два ряда
     занимают вдвое меньше и читаются как один блок отбора. */
  /* ПО ОДНОМУ В СТРОКУ. В два ряда панели выбора накладывались друг на друга:
     обёртка поиска рисует список абсолютно, и он перекрывал соседнее поле.
     Столбик длиннее, но им можно пользоваться. */
  .inv-filters-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  /* Поля растягиваем на всю ширину: обёртка поиска и сам select иначе
     держат свою ширину и болтаются слева, а строка выглядит недоделанной. */
  .inv-filters-row > * { min-width: 0; width: 100%; }
  .inv-filters-row [data-sa-wrap],
  .inv-filters-row .form-select,
  .inv-filters-row .form-input,
  .inv-filters-row .inv-search-wrap { width: 100% !important; box-sizing: border-box; }
}


/* Телефонный таббар: под ним раньше была видна серая полоса, ради этого .main и
   красили в белый. Закрываем точечно — сам таббар, а не всю рабочую область. */
@media (max-width: 767px) {
  .mobile-tabbar, .tabbar, .bottom-nav { background: var(--bg-card); }
}

/* =====================================================
   ДАШБОРД: ПОЛОСА ВКЛАДОК И ОДИНОКАЯ ПЛИТКА
   Серого не «слишком много» — он просто попадал не туда. На дашборде всё
   содержимое лежит в ОДНОМ белом блоке высотой в тысячу пикселей, поэтому серое
   полотно оставалось только полосой сверху, под вкладками, и выглядело
   случайным. В «Электрохозяйстве» блоков несколько, и серое читается как
   промежуток между ними.
   Здесь закрываем два видимых следствия: полосу вкладок убираем в свой белый
   блок, а одинокую плитку «Склад» перестаём растягивать во всю ширину.
   ===================================================== */
/* Полоса вкладок — ВЕРХ того же блока, а не отдельный блок: серая щель под ней
   и была «лишним серым». Скругление только сверху, зазора снизу нет. */
#page-dashboard #dashboard-view-tabs {
  background: var(--bg-card);
  border-radius: var(--ui-r-xl) var(--ui-r-xl) 0 0;
  padding: 6px 16px !important;
  margin: 0 !important;
}
#page-dashboard #dash-view-main > .v4-shell:first-child,
#page-dashboard #dash-skeleton > .v4-shell:first-child {
  border-radius: 0 0 var(--ui-r-xl) var(--ui-r-xl) !important;
}
/* Плитки дашборда на ПК стоят в ОДНУ строку: с basis 150px семь штук
   переносились на второй ряд и ломали сводку. */
@media (min-width: 768px) {
  .v4-kpi-item { flex: 1 1 0 !important; min-width: 0; }
}
/* Заголовки локаций в «Оборудовании» были залиты серым каждый — список выглядел
   полосатым. Оставляем белыми, разделяет линия. */
.eq-group-header { background: var(--bg-card) !important; }
@media (max-width: 767px) {
  #page-dashboard #dashboard-view-tabs {
    border-radius: 0;
    padding: 6px 12px !important;
  }
}
/* Добавочный ряд («Склад», «Мои задачи») делит ширину поровну между тем, что в
   нём есть: одна плитка — во всю ширину, две — по половине. Решение владельца;
   до этого плитка держала фиксированные 200px и ряд выглядел недозаполненным. */
#page-dashboard .v4-kpi-row-extra .v4-kpi-item {
  flex: 1 1 0 !important;
  min-width: 0;
}

/* =====================================================
   ДАШБОРД — ОДИН ЦЕЛЬНЫЙ БЛОК, КАК ОСТАЛЬНЫЕ РАЗДЕЛЫ
   Правило владельца: серое только вокруг раздела, внутри разделений нет. На
   дашборде содержимое лежало в НЕСКОЛЬКИХ .v4-shell со своими полями, и между
   ними проступали серые щели — в главном виде между сводкой и «Активными
   операциями», в остальных видах между каждой парой карточек.
   Теперь белый фон держит контейнер вида, а внутренние блоки его только
   заполняют: полей и скруглений у них нет, соседние разделяет линия.
   ===================================================== */
#page-dashboard #dash-view-main,
#page-dashboard #dash-view-sections,
#page-dashboard #dash-view-specialists,
#page-dashboard #dash-view-vehicles,
#page-dashboard #dash-skeleton {
  background: var(--bg-card);
  border-radius: 0 0 var(--ui-r-xl) var(--ui-r-xl);
  overflow: hidden;
}
#page-dashboard .v4-shell,
#page-dashboard #dash-view-main > .v4-shell:first-child,
#page-dashboard #dash-skeleton > .v4-shell:first-child,
#page-dashboard #dash-view-main .v4-shell,
#page-dashboard #dash-sections-grid .v4-shell,
#page-dashboard #dash-specialists-grid .v4-shell {
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
}
/* Соседние части внутри блока разделяет линия, а не серый зазор: линия не
   занимает места и не рвёт блок. */
#page-dashboard .v4-shell + .v4-shell,
#page-dashboard #dash-sections-grid > *:not(:first-child),
#page-dashboard #dash-specialists-grid > *:not(:first-child) {
  border-top: 1px solid var(--border-light) !important;
}
@media (max-width: 767px) {
  #page-dashboard #dash-view-main,
  #page-dashboard #dash-view-sections,
  #page-dashboard #dash-view-specialists,
  #page-dashboard #dash-view-vehicles,
  #page-dashboard #dash-skeleton { border-radius: 0; }
}

/* =====================================================
   ПОЛЯ ВНУТРИ ДАШБОРДОВ
   Раньше боковой отступ давали ПОЛЯ САМИХ БЛОКОВ (margin: 0 16px). Когда виды
   стали цельными и поля у блоков убрали, содержимое упёрлось в край: заголовки
   и таблицы «Участков», «Специалистов» и «Парка техники» начинались от самой
   кромки. Возвращаем отступ там, где он и должен быть — внутри содержимого.
   ===================================================== */
#page-dashboard [id^="dash-view-"] .v4-header,
#page-dashboard #dash-skeleton .v4-header { padding-left: 20px; padding-right: 20px; }

/* !important здесь обязателен: ячейкам таблиц дашборда padding задаётся ИНЛАЙНОМ
   прямо в шаблоне (padding:10px 0 10px 0), а инлайн бьёт любое правило без него.
   Без !important отступ молча не применялся — поймано замером, в коде правило
   выглядело рабочим. */
#page-dashboard table th:first-child,
#page-dashboard table td:first-child { padding-left: 20px !important; }
#page-dashboard table th:last-child,
#page-dashboard table td:last-child { padding-right: 20px !important; }

/* Строка предупреждений и полосы отбора над таблицей тоже шли от края. */
#page-dashboard [id^="dash-view-"] > div > .v4-kpi-row,
#page-dashboard [id^="dash-view-"] .sec-alert,
#page-dashboard [id^="dash-view-"] .dash-chips { padding-left: 20px; padding-right: 20px; }

@media (max-width: 767px) {
  #page-dashboard [id^="dash-view-"] .v4-header,
  #page-dashboard #dash-skeleton .v4-header { padding-left: 14px; padding-right: 14px; }
  #page-dashboard table th:first-child,
  #page-dashboard table td:first-child { padding-left: 14px !important; }
  #page-dashboard table th:last-child,
  #page-dashboard table td:last-child { padding-right: 14px !important; }
}

/* =====================================================
   НАСТРОЙКИ: НАЧАЛО РАЗДЕЛА ВИДНО
   Пять разделов подряд («Организация», «Реквизиты», «Планировщик ТО»,
   «Система», «Локальная сеть») отличались только жирностью строки, и на длинной
   странице терялось, где кончается один и начинается другой. Подчёркиваем
   заголовок так же, как в «Отчётах».
   ===================================================== */
.set-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-800);
}
.set-group-head:first-child { margin-top: 0; }

/* =====================================================
   СПРАВОЧНИКИ → ЛОКАЦИИ: ВИДНО, ГДЕ ВЕТКА И РАЗВЁРНУТА ЛИ ОНА
   На телефоне список превращается в ленту одинаковых строк, и понять, ветка
   это или вложенная локация, можно было только по отступу — которого на узком
   экране почти нет. Верхний уровень ставим на заливку, вложенные оставляем
   белыми; развёрнутая ветка подсвечивается зелёным.
   ===================================================== */
/* На ПК заливку кладём на ЯЧЕЙКИ (строка таблицы фон не держит),
   на телефоне — на саму строку: там она карточка, и заливка ячеек оставляла
   белым всё, что не попало в ячейку, — ряд кнопок и правое поле. */
@media (min-width: 768px) {
  .ref-table tr[data-loc-depth="0"] > td { background: var(--bg); font-weight: 600; }
  .ref-table tr:has(.loc-branch-toggle[data-collapsed="0"]) > td { background: var(--primary-light); }
}
@media (max-width: 767px) {
  .ref-table tr[data-loc-depth="0"] { background: var(--bg); }
  .ref-table tr:has(.loc-branch-toggle[data-collapsed="0"]) { background: var(--primary-light); }
  .ref-table tr[data-loc-depth] > td { background: transparent; }
}
.loc-branch-count {
  background: var(--bg-card);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-muted);
}
@media (max-width: 767px) {
  /* На телефоне отступ вложенности почти не виден — добавляем полосу слева. */
  .ref-table tr[data-loc-depth="1"] > td:first-child { box-shadow: inset 3px 0 0 var(--border); }
  .ref-table tr[data-loc-depth="2"] > td:first-child { box-shadow: inset 6px 0 0 var(--border); }
}

/* =====================================================
   СПРАВОЧНИКИ: КНОПКИ ДЕЙСТВИЙ В СТРОКУ, ОПИСАНИЕ УЖЕ
   Кнопки вставали столбиком и растягивали строку до 160px высотой. Причина не в
   ширине колонки (у неё уже width:1% и nowrap), а в самой кнопке: .btn-icon —
   display:flex, то есть блок, и nowrap на неё не действует. Выстраиваем их в
   ряд контейнером, а не переносом.
   ===================================================== */
/* Только на ПК: на телефоне строка разворачивается в карточку, и table-cell
   ломает всю раскладку — ячейки перестают быть блоками. */
@media (min-width: 768px) {
  .ref-table td:last-child { display: table-cell; text-align: right; }
}
.ref-table td:last-child .btn-icon {
  display: inline-flex;
  vertical-align: middle;
}
/* Описание занимало половину экрана и тянуло строки. Ограничиваем и отдаём
   место остальным колонкам. */
.ref-table td:nth-child(2) { max-width: 420px; }
@media (min-width: 768px) {
  .ref-table th:nth-child(2), .ref-table td:nth-child(2) { width: 34%; }
  .ref-table th:first-child,  .ref-table td:first-child  { width: 26%; }
}


/* Плитки «Закупок» собраны на классе .section, то есть белые, и внутри белого
   блока пропадали. Внутри блока плитка обязана быть на заливке. */
#page-purchases #purchases-summary .section {
  background: var(--bg);
  box-shadow: none;
}

/* Таблицы, лежащие прямо в блоке страницы: первая и последняя ячейки не должны
   упираться в край. Поймано сплошной проверкой на «Складе» и «Пользователях». */
/* Любая таблица внутри блока страницы: первая и последняя ячейки не упираются
   в край. Ограничение «прямой потомок» не сработало — таблицы лежат глубже. */
/* И .section тоже: «Склад» и часть экранов живут без .page-shell, блоком там
   служит .section. !important — потому что части ячеек padding задан инлайном
   в шаблонах, а инлайн бьёт обычное правило. */
.page-shell table th:first-child, .page-shell table td:first-child,
.section table th:first-child,    .section table td:first-child { padding-left: 20px !important; }
.page-shell table th:last-child,  .page-shell table td:last-child,
.section table th:last-child,     .section table td:last-child  { padding-right: 20px !important; }
/* Панель кнопок над деревом локаций тоже начиналась от кромки.
   Селектор считает от .page-shell, а с 01.09 первым её ребёнком стала шапка
   канона — поэтому целимся от блока содержимого, а не от вложенности. */
#page-references #ref-content > div > .btn-outline:first-child { margin-left: 20px; }

/* =====================================================
   СПРАВОЧНИКИ НА ТЕЛЕФОНЕ: КАРТОЧКА ЧИТАЕТСЯ СЛЕВА НАПРАВО
   Значения прижимались к правому краю, а название и вовсе улетало вправо:
   ячейка — flex со space-between, и распорка отступа вложенности (пустой span
   шириной depth×18px) работала как второй элемент, отталкивая текст. Длинное
   описание при этом выравнивалось по правому краю и читалось тяжело.
   ===================================================== */
@media (max-width: 767px) {
  .ref-table td { justify-content: flex-start; }
  .ref-table td::before { flex: 0 0 38%; }
  /* Распорка вложенности на телефоне не нужна: уровень показывает полоса слева. */
  .ref-table td:first-child > span[style*="width"] { display: none !important; }
  .ref-table td:last-child { justify-content: flex-start; }
}

/* =====================================================
   ФОРМА СОЗДАНИЯ РЕГЛАМЕНТА — РОВНАЯ СЕТКА НА ТЕЛЕФОНЕ
   =====================================================
   Форма собиралась по частям и к 30.08.2026 набрала три разных стиля
   подписей, одиннадцать коробок в рамках и ряд из двух полей, который на
   узком экране не расходился: подписи «Интервал (дней)» и «Дата первого
   запуска» переносились, а поля жались до 172px. Подписи сведены к
   системному .form-label в разметке, рамки заменены заливкой, остальное
   ниже. Правила лежат в КОНЦЕ файла намеренно: более поздние в этом файле
   уже гасили поля и скругления страниц.                                   */

/* ГРАБЛЯ auto-fill: с `minmax(0,1fr)` браузер нарезал список локаций на три
   сотни колонок по одному пикселю — нулевой минимум означает «влезет сколько
   угодно». Рабочая запись — `minmax(min(220px,100%),1fr)`: на телефоне одна
   колонка, на ПК столько, сколько поместится по 220px.                    */

/* Список локаций: строка не должна обрезаться посередине. Высоту задаём
   кратной строке, а не «примерно 200px», иначе внизу висит половина
   чекбокса и кажется, что список сломан. */
/* Высота КРАТНА строке, вертикальных полей у списка нет. С padding-bottom
   выходило хуже, чем без него: у прокручиваемого блока поле не отделяет
   содержимое, контент проходит сквозь него — и снизу выглядывала полоска
   следующего чекбокса, ровно на высоту поля. */
/* Шаг сетки жёсткий: на ПК колонка 220px, и длинное имя локации переносилось
   на вторую строку — ряд становился 48px, шаг сбивался и низ списка снова
   резал строку пополам. Ряд ровно 32px, длинное имя уходит в многоточие. */
.nsf-loc-list { grid-auto-rows: 32px; }
.nsf-loc-list > * { min-height: 32px; display: flex; align-items: center; overflow: hidden; }
.nsf-loc-list > * > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsf-loc-list { max-height: 192px; }   /* 6 строк */

@media (max-width: 767px) {
  /* Два поля в ряд на 390px дают 172px каждому — подпись переносится в две
     строки, а поле даты становится нечитаемым. Ставим в столбик. */
  .nsf-row { flex-direction: column; gap: 14px !important; }

  /* Четыре чипа переносились 3+1 и висели рваным хвостом. Сетка 2×2 ровная
     при любой длине подписи. */
  .nsf-itype { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
  .nsf-itype .filter-chip { width: 100%; justify-content: center; text-align: center; }

  /* Ровно пять строк — обрезка всегда приходится на границу строки. */
  .nsf-loc-list { max-height: 160px; }   /* 5 строк */

  /* Кнопки формы во всю ширину: на узком экране «Создать регламент»
     прижималась к правому краю, а слева оставалась пустота. */
  .nsf-footer { padding: 12px 14px !important; }
  .nsf-footer .btn { flex: 1 1 0; justify-content: center; }

  /* Поля блока на телефоне 14px — как во всех остальных разделах. */
  #schedule-create-mode .section-body { padding: 14px !important; }
  #schedule-create-mode .nsf-head { padding: 14px !important; }
}

/* ── «Ресурсы» ───────────────────────────────────────────────────────────
   Итог — часть содержимого раздела, а не шапки: 31.08 карточку вынесли из
   .page-filters, где она занимала 167px на ПК и 310px на телефоне и отжимала
   сами счётчики за нижний край экрана.
   Поля раздела задаются здесь, а не инлайном у каждого блока. */
#page-resources .page-body { padding: 14px 20px 20px; }
.res-total {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 12px;
}
.res-total-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 2px; }
.res-total-money { font-size: 24px; font-weight: 700; letter-spacing: -.02em;
  color: var(--green-700); font-variant-numeric: tabular-nums; }
.res-total-sum { min-width: 150px; }
.res-sep { width: 1px; height: 34px; background: var(--border); }
.res-total-chips { display: flex; align-items: center; gap: 14px; flex: 1; }
.res-chip-sep { width: 1px; height: 24px; background: var(--border); flex: none; }
.res-total-period { width: auto; font-size: 13px; padding: 6px 28px 6px 10px; }

@media (max-width: 767px) {
  #page-resources .page-body { padding: 12px 14px 18px; }
  /* НА ТЕЛЕФОНЕ — СВЕРХУ ВНИЗ, А НЕ ВБОК (02.09.2026).
     Прежняя раскладка держала всё одной строкой: сумма слева, типы справа.
     На 390px типы вставали столбиком у правого края, и «Итого» оказывалось
     посередине между ними — читалось так, будто 111 000 кВт·ч относятся к
     чему-то другому. Теперь порядок такой же, как человек читает: сначала
     итог, под ним разбивка по типам сеткой, ниже период во всю ширину. */
  .res-total { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .res-total .res-sep { display: none; }
  .res-total-sum { min-width: 0; }
  .res-total-money { font-size: 22px; }
  .res-total-chips {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 12px; flex: none; align-items: start;
  }
  /* Разделители между типами — приём широкой строки. В сетке каждый занимает
     СВОЮ ЯЧЕЙКУ: три типа превращались в пять элементов, сетка рвалась на три
     ряда, и карточка вырастала до 351px. На телефоне типы разделены сеткой,
     полоски не нужны. */
  .res-chip-sep { display: none; }
  /* Список периода превращается в свой виджет с обёрткой, поэтому ширину
     задаём и ему, и обёртке — иначе «30 дней» остаётся коротким огрызком. */
  .res-total-period,
  .res-total [data-sa-wrap] { width: 100% !important; }
}


/* ══════════════════════════════════════════════════════════════════
   ЕДИНАЯ ШАПКА РАЗДЕЛА — КАНОН (31.08.2026)

   Снята с «Электрохозяйства»: название раздела, отбор рядом с ним, кнопки
   справа, ниже — полоса вкладок. До этого шапки жили в двух наборах классов
   (.page-header в этом файле и .pw-head внутри app-power.js), и высота гуляла
   от 36 до 146px, а число кнопок — от нуля до четырёх.

   Правила, которые держит этот блок:
     1. заголовок = пункт меню, ничего больше;
     2. отбор — в шапке, и только там, где он в разделе правда нужен;
     3. кнопок не больше трёх (одна основная + две обычные), меню «⋯» нет;
     4. одна полоса вкладок одной высоты;
     5. фильтры — одной строкой с прокруткой.

   Поля задаёт сама шапка: контейнер раздела (.page-shell) их не имеет.
   ══════════════════════════════════════════════════════════════════ */
/* НА ПК — ОДНА СТРОКА: название слева, кнопки прижаты вправо. На телефоне
   (см. ниже) кнопки уходят на свою строку и делят её ширину поровну. */
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}
.sec-head-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}
.sec-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.sec-title svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.sec-head-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex-shrink: 0;
}
.sec-head-right > .sec-btn { flex: none; }

/* Кнопки одной высоты — 36px. btn-sm давал 32, btn — 38, и в одном ряду это
   было заметно. */
.sec-btn {
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Отбор в шапке ──
   Ширина фиксированная: общая обёртка поиска (attachSearchToSelect) тянет
   .form-input во всю ширину, и без этого «Все локации» разъезжались на
   пол-экрана. box-sizing явный — сложение полей уже съедало высоту. */
.sec-sel-wrap { flex: none; display: flex; align-items: center; gap: 8px; }
.sec-head [data-sa-wrap] { width: 230px; flex: none; }
.sec-sel, .sec-head [data-sa-wrap] .form-input {
  width: 230px;
  height: 36px;
  box-sizing: border-box;
  padding: 0 30px 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  border: 1px solid transparent;
  color: var(--green-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  text-overflow: ellipsis;
}
.sec-sel:focus, .sec-head [data-sa-wrap] .form-input:focus {
  outline: none;
  background-color: var(--bg-card);
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Меню «⋯» отсюда убрано 31.08: спрятанная кнопка — это кнопка, которую
   ищут. В шапке три кнопки, всё лишнее живёт в самом разделе. */

/* ── Полоса вкладок ──
   Подчёркивание активной — внутренней тенью, а не рамкой: рамка в 2px при
   margin-bottom:-1px вылезала из строки и порождала вертикальную полосу
   прокрутки внутри карточки (ловилось в «Электрохозяйстве»). */
.sec-tabs {
  display: flex; gap: 24px;
  border-bottom: 1px solid var(--border);
  margin: 12px 20px 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab {
  background: none; border: none; padding: 10px 0 12px;
  font-size: 13.5px; color: var(--text-muted); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color var(--duration-fast) var(--ease);
}
.sec-tab:hover { color: var(--text); }
.sec-tab-on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--green-600); }

/* ── Фильтры — одна строка с прокруткой ── */
.sec-filters {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px 0;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sec-filters::-webkit-scrollbar { display: none; }
.sec-filters:empty { display: none; }

/* ── ТЕЛЕФОН ──
   Название сверху, под ним отбор (он есть только в «Электрохозяйстве») и
   строка кнопок. Кнопки делят ширину ПОРОВНУ — две по половине, три по трети:
   иначе длинная подпись забирала место у соседей и ряд расползался. Подписи
   не сокращаем; если подпись со значком не влезает, значок снимает
   fitSectionButtons() в app-ui.js — читается надпись, а не квадрат. */
@media (max-width: 767px) {
  .sec-head { padding: 12px 14px 0; gap: 9px; flex-direction: column; align-items: stretch; }
  .sec-title { font-size: 17px; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
  .sec-sel-wrap, .sec-head [data-sa-wrap] { width: 100%; flex-basis: 100%; }
  .sec-sel-wrap .sec-sel, .sec-head [data-sa-wrap] .form-input { width: 100%; }
  .sec-head-right { margin-left: 0; width: 100%; }
  .sec-head-right > .sec-btn {
    flex: 1 1 0; min-width: 0; justify-content: center;
    padding: 0 10px; overflow: hidden;
  }
  /* ОДНА кнопка не растягивается на весь экран: делить поровну есть смысл с
     двух, а одинокая «+ Запчасть» во всю ширину выглядела тяжело. */
  .sec-head-right > .sec-btn:only-child { flex: 0 0 auto; padding: 0 15px; }
  .sec-btn-noicon svg { display: none; }
  /* Последняя ступень подгонки: поля и кегль поджаты, чтобы подпись влезла
     целиком. Ставится сразу всему ряду — разнокалиберные кнопки хуже. */
  .sec-btn-tight { padding: 0 7px !important; font-size: 12.5px; letter-spacing: -.01em; }
  .sec-tabs { margin: 10px 14px 0; gap: 18px; }
  .sec-filters { padding: 10px 14px 0; }
}


/* ── ЧЕК-ЛИСТ ЗАПУСКА (16.09.2026) ─────────────────────────────────────────
   Внутри белого блока дашборда: отделён линией, шаги — плитки на заливке --bg
   (правило трёх уровней фона). Рамок и теней нет. */
.lc-box { padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.lc-head { display: flex; align-items: center; gap: 12px; }
.lc-title-wrap { flex: 1; min-width: 0; cursor: pointer; }
.lc-title { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }
.lc-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.lc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lc-bar { height: 6px; border-radius: 3px; background: var(--bg); margin: 12px 0; overflow: hidden; }
.lc-bar-fill { height: 100%; background: var(--green-600); border-radius: 3px; transition: width .3s; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.lc-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--bg); border-radius: var(--radius); min-width: 0; }
.lc-step.is-done .lc-step-title { color: var(--text-muted); }
.lc-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-muted); flex-shrink: 0; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.lc-mark-done { background: var(--green-600); border-color: var(--green-600); }
.lc-body { flex: 1; min-width: 0; }
.lc-step-title { font-size: 14px; font-weight: 600; color: var(--text); }
.lc-count { font-weight: 500; color: var(--text-muted); }
.lc-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lc-go { flex-shrink: 0; align-self: center; }
.lc-done { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lc-grid + .lc-done { padding-top: 12px; border-top: 1px solid var(--border-light); }
.lc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; background: var(--bg); border-radius: 999px;
  font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.lc-chip .lc-mark { width: 18px; height: 18px; margin: 0; }
@media (max-width: 768px) {
  .lc-box { padding: 12px 14px; }
  .lc-step .lc-go { padding: 6px 10px; }
  /* На телефоне подсказка под названием шага раздувала карточку до половины экрана. */
  .lc-step .lc-hint { display: none; }
  .lc-step { align-items: center; padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   МОДУЛЬ «ВНЕДРЕНИЕ» (29.09.2026) — обход с телефона.
   По канону: серое полотно → белые блоки во всю ширину на телефоне,
   без рамок и теней; зелёный #16A34A только под крупную заливку.
   Кнопки крупные (≥48px): работают в перчатках и на ходу.
   ═══════════════════════════════════════════════════════════════════ */
.ik { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; padding-bottom: 96px; }
.ik-block { background: var(--bg-card, #fff); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ik-block-flush { padding: 0; gap: 0; overflow: hidden; }
.ik-cap { padding: 14px 16px 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ik-cap-in { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ik-empty { padding: 14px 16px; color: var(--text-muted); font-size: 14px; line-height: 1.45; }
.ik-hint { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.ik-warn { background: #FEF3C7; color: #78350F; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.ik-bar { background: #FEF3C7; color: #78350F; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.4; }
.ik-bar-bad { background: #FEE2E2; color: #7F1D1D; }
.ik-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.ik-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ik-stat { background: var(--bg, #F7F8FA); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ik-stat b { display: block; font-size: 22px; line-height: 1.1; }
.ik-stat span { font-size: 12px; color: var(--text-muted); }
.ik-row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--canvas); color: var(--text); text-decoration: none; min-height: 64px; }
.ik-row-ph { width: 52px; height: 52px; border-radius: 10px; background: #DCE3EA; flex-shrink: 0; }
.ik-row-img .ik-thumb { pointer-events: none; }
.ik-row-b { flex: 1; min-width: 0; }
.ik-row-t { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ik-row-s { font-size: 13px; color: var(--text-muted); }
.ik-row2 { display: flex; gap: 8px; }
.ik-row2 > * { flex: 1; }
.ik-pill { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ik-pill-ok { background: #DCFCE7; color: #166534; }
.ik-pill-warn { background: #FEF3C7; color: #92400E; }
.ik-pill-bad { background: #FEE2E2; color: #991B1B; }
.ik-pill-blue { background: #DBEAFE; color: #1D4ED8; }
.ik-pill-grey { background: #F3F4F6; color: #4B5563; }
.ik-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid #D1D5DB; background: var(--bg-card, #fff); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.ik-btn-primary { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.ik-btn-ghost { border-color: transparent; background: var(--bg, #F7F8FA); }
.ik-btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; flex-shrink: 0; }
.ik-btn-lg { min-height: 56px; font-size: 16px; }
/* Контроль запущенных регламентов (03.10.2026) */
.ik-ctl-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; background: #cbd5e1; align-self: center; }
.ik-ctl-ok { background: #22c55e; }
.ik-ctl-warn { background: #f59e0b; }
.ik-ctl-bad { background: #ef4444; }
.ik-ctl-sum { padding: 0 16px 10px; }
.ik-stat-bad b { color: #b42318; }
.ik-ctl-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ik-ctl-reason { font-size: 14px; margin-top: 4px; }
/* Запуск регламентов: календарь нагрузки на 4 недели (03.10.2026) */
.ik-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ik-cal-h { font-size: 11px; color: var(--text-muted); text-align: center; padding-bottom: 2px; }
.ik-cal-c { min-height: 46px; border-radius: 8px; border: 1px solid var(--canvas, #eef0f3); background: var(--bg-card, #fff); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; padding: 2px; cursor: pointer; color: var(--text); }
.ik-cal-c span { font-size: 11px; color: var(--text-muted); }
.ik-cal-c b { font-size: 12px; font-weight: 700; white-space: nowrap; }
.ik-cal-x { border: 0; background: none; cursor: default; }
.ik-cal-we { background: var(--bg, #F7F8FA); }
.ik-cal-has { background: #eef6f1; border-color: #cfe5d7; }
.ik-cal-over { background: #fdecec; border-color: #f2b8b8; }
.ik-cal-over b { color: #b42318; }
.ik-cal-on { box-shadow: inset 0 0 0 2px var(--green-600, #2e7d4f); }
.ik-cal-det { background: var(--bg, #F7F8FA); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.ik-cal-dr { display: flex; justify-content: space-between; font-size: 14px; }
.ik-cal-dr-over { color: #b42318; font-weight: 600; }
.ik-pick-dis { opacity: .55; cursor: default; }
.ik-row-col { flex-direction: column; align-items: stretch; }
.ik-lp { display: flex; flex-direction: column; gap: 2px; padding-left: 2px; }
.ik-lp > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-muted); }
.ik-lp b { font-weight: 600; color: var(--text); white-space: nowrap; }
.ik-lrs { display: flex; flex-direction: column; }
.ik-lr { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--canvas, #eef0f3); font-size: 14px; color: var(--text); text-decoration: none; }
.ik-lr b { font-weight: 600; white-space: nowrap; color: var(--text-muted); }
/* Согласование регламента — экран поверх приложения (02.10.2026) */
.rr-ov { position: fixed; inset: 0; z-index: 99990; background: var(--bg, #F7F8FA); }
body.rr-open { overflow: hidden; }
.rr-page { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; max-width: 720px; margin: 0 auto; padding: 0 12px 120px; }
.rr-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 0 10px; background: var(--bg, #F7F8FA); }
.rr-head-t { font-size: 17px; font-weight: 700; }
.rr-x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card, #fff); font-size: 22px; cursor: pointer; color: var(--text); }
.rr-block { background: var(--bg-card, #fff); border-radius: 12px; padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.rr-flush { padding: 0; gap: 0; overflow: hidden; }
.rr-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.rr-cap { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.rr-val { font-size: 16px; font-weight: 600; }
.rr-hint { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.rr-lbl { font-size: 13px; color: var(--text-muted); }
.rr-in { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px; background: var(--bg-card, #fff); color: var(--text); }
.rr-item { padding: 10px 0; border-top: 1px solid var(--canvas, #eef0f3); display: flex; flex-direction: column; gap: 8px; }
.rr-item:first-of-type { border-top: 0; }
.rr-item-t { font-size: 15px; line-height: 1.4; }
.rr-okfix { display: flex; gap: 8px; }
.rr-b { flex: 1; min-height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card, #fff); font: inherit; font-size: 15px; cursor: pointer; color: var(--text); }
.rr-on-ok { background: #e7f5ec; border-color: #86c79a; color: #1b6b3a; font-weight: 600; }
.rr-on-fix { background: #fff4e5; border-color: #f0b35c; color: #8a4b00; font-weight: 600; }
.rr-eq { font-size: 14px; padding: 2px 0; }
.rr-eq span { color: var(--text-muted); }
.rr-link { align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--green-700, #1e5c3a); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.rr-row { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-top: 1px solid var(--canvas, #eef0f3); color: var(--text); text-decoration: none; }
.rr-row:first-child { border-top: 0; }
.rr-row span { font-size: 13px; color: var(--text-muted); }
.rr-foot { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg-card, #fff); border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rr-go { width: 100%; max-width: 696px; min-height: 50px; border-radius: 12px; border: 0; background: var(--green-600, #2e7d4f); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.rr-go-fix { background: #c2700e; }
/* Итог согласования в карточке черновика */
.ik-rv { font-size: 13px; margin: -4px 0 6px 30px; }
.ik-rv-ok { color: #1b6b3a; }
.ik-rv-fix { color: #8a4b00; font-weight: 600; }
.ik-rv-box { font-size: 14px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; background: var(--bg, #F7F8FA); }
.ik-rv-box-ok { background: #e7f5ec; }
.ik-rv-box-fix { background: #fff4e5; }
/* Внедрение — шаги и регламенты (30.09.2026) */
.ik-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.ik-steps-i { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ik-steps-i b { width: 20px; height: 20px; border-radius: 999px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--green-600); color: #fff; }
.ik-steps-soon { color: var(--text-muted); }
.ik-steps-soon b { background: var(--bg, #F7F8FA); color: var(--text-muted); border: 1px solid #D1D5DB; }
.ik-steps-sep { color: var(--text-muted); }
.ik-steps-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--bg, #F7F8FA); color: var(--text); text-decoration: none; }
.ik-steps-go { font-size: 22px; color: var(--text-muted); }
.ik-reg-st { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ik-reg-side { display: flex; gap: 8px; padding: 0 16px; }
.ik-reg-side > * { flex: 1; }
.ik-cl { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--canvas); }
.ik-cl .ik-num { margin-top: 11px; flex-shrink: 0; }
.ik-cl-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ik-cl-d { min-height: 40px; font-size: 14px; color: var(--text-muted); }
.ik-cl-act { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; }
.ik-cl-act .ik-link { text-decoration: none; font-size: 16px; padding: 4px 6px; color: var(--text-muted); }
.ik-q-del { align-self: flex-start; font-size: 13px; color: var(--text-muted); }
.ik-x { background: none; border: 0; font-size: 16px; color: var(--text-muted); padding: 10px; cursor: pointer; flex-shrink: 0; }
.ik-eq-more { display: block; padding: 10px 16px; font-size: 14px; }
.ik-eq-add { padding: 12px 16px; border-top: 1px solid var(--canvas); display: flex; }
.ik-eq-add .ik-btn { flex: 1; }
.ik-pick-box { max-width: 480px; max-height: 86vh; text-align: left; align-items: stretch; padding: 20px 16px; }
.ik-pick-box .ik-cap { padding: 4px 0 0; }
.ik-pick-list { overflow-y: auto; flex: 1; min-height: 120px; margin: 0 -16px; }
.ik-pick { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--canvas); cursor: pointer; }
.ik-pick input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--green-600); }
.ik-pick .ik-row-t, .ik-pick .ik-row-s { display: block; }
.ik-pick-on { background: var(--bg, #F7F8FA); }
.ik-finish .ik-btn { color: var(--text-muted); }
.ik-finish-done { text-align: center; font-size: 13px; color: var(--text-muted); padding: 4px 0; }
.ik-finish-done a { color: inherit; text-decoration: underline; }
.ik-foot { position: sticky; bottom: 0; background: var(--bg-card, #fff); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 12px 12px 0 0; display: flex; gap: 8px; z-index: 5; }
.ik-foot > * { flex: 1; }
.ik-foot-2 > :last-child { flex: 2; }
.ik-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0; }
.ik-back { font-size: 30px; line-height: 1; color: var(--text); text-decoration: none; padding: 4px 10px; }
.ik-head-t { flex: 1; font-size: 18px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ik-head-act { background: none; border: 0; color: #B91C1C; font: inherit; font-size: 14px; padding: 10px; cursor: pointer; }
.ik-step { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.ik-num { width: 24px; height: 24px; border-radius: 999px; background: var(--green-600); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ik-input { width: 100%; box-sizing: border-box; min-height: 46px; border: 1px solid #D1D5DB; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--bg-card, #fff); color: var(--text); }
.ik-ta { padding: 10px 12px; min-height: 64px; resize: vertical; }
.ik-shots { display: flex; gap: 8px; flex-wrap: wrap; }
.ik-thumb { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #DCE3EA; flex-shrink: 0; cursor: pointer; }
.ik-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ik-thumb-dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 999px; background: #F59E0B; box-shadow: 0 0 0 2px #fff; }
.ik-thumb-err { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ik-add-shot { width: 84px; height: 84px; border-radius: 10px; border: 1px dashed #9CA3AF; background: var(--bg, #F7F8FA); color: var(--text-muted); font-size: 28px; cursor: pointer; }
.ik-add-sm { width: 72px; height: 72px; }
.ik-add-gal { display: inline-flex; align-items: center; justify-content: center; }
.ik-chip-gal { display: inline-flex; align-items: center; justify-content: center; padding-left: 10px; padding-right: 10px; }
.ik-role { display: flex; flex-direction: column; gap: 6px; }
.ik-role-h { font-size: 13px; font-weight: 600; }
.ik-need { font-weight: 400; color: #B45309; }
.ik-chip { align-self: flex-start; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D1D5DB; background: var(--bg-card, #fff); font: inherit; font-size: 14px; cursor: pointer; }
.ik-tag { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 12px; border: 0; text-align: left; font: inherit; width: 100%; box-sizing: border-box; }
.ik-tag > div { flex: 1; min-width: 0; }
.ik-tag-t { font-size: 15px; font-weight: 600; }
.ik-tag-s { font-size: 12px; line-height: 1.4; word-break: break-all; }
.ik-tag-ok { background: #DCFCE7; color: #14532D; }
.ik-tag-warn { background: #FEF3C7; color: #78350F; }
.ik-tag-bad { background: #FEE2E2; color: #7F1D1D; }
.ik-tag-none { background: var(--bg, #F7F8FA); color: var(--text-muted); }
.ik-tag-new { background: var(--bg, #F7F8FA); color: var(--primary); cursor: pointer; min-height: 64px; }
.ik-tag-new small { color: var(--text-muted); }
.ik-walk-head { background: var(--green-800, #166534); color: #fff; border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.ik-walk-ph { width: 64px; height: 64px; border-radius: 12px; background: rgba(255,255,255,.18); flex-shrink: 0; }
.ik-walk-b { flex: 1; min-width: 0; }
.ik-walk-cap { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.ik-walk-t { font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.ik-walk-s { font-size: 12px; opacity: .85; }
.ik-walk-sw { color: #fff; background: rgba(255,255,255,.16); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; text-decoration: none; flex-shrink: 0; }
.ik-guard { background: #FEF3C7; }
.ik-guard-t { font-size: 16px; font-weight: 700; color: #78350F; }
.ik-photo-view { position: fixed; inset: 0; z-index: 99990; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.ik-photo-view img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.ik-photo-bar { display: flex; gap: 8px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: #fff; font-size: 14px; }
.ik-photo-bar span { flex: 1; }
.ik-nfc-ov { position: fixed; inset: 0; z-index: 99995; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ik-nfc-box { background: var(--bg-card, #fff); border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 340px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ik-nfc-spin { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--green-600); border-top-color: transparent; animation: spin .8s linear infinite; }
.ik-nfc-t { font-size: 17px; font-weight: 700; }
.ik-nfc-s { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .ik { gap: 12px; }
  .ik-block, .ik-walk-head, .ik-bar { border-radius: 0; }
  .ik-block { padding: 14px; }
  .ik-head { padding: 0 4px; }
}
.ik-row-add { color: var(--primary); font-weight: 600; font-size: 15px; min-height: 52px; }
.ik-ai { border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 4px; }
.ik-ai-wait { background: var(--bg, #F7F8FA); color: var(--text-muted); }
.ik-ai-bad { background: #FEE2E2; color: #7F1D1D; }
.ik-ai-ok { background: #EFF6FF; color: #1E3A8A; }
.ik-ai-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ik-ai-kind { font-size: 11px; background: #DBEAFE; border-radius: 6px; padding: 1px 6px; }
.ik-ai-comps { display: flex; flex-direction: column; gap: 2px; }
.ik-ai-comp span { color: #1D4ED8; }
.ik-ai-extra, .ik-ai-note { color: #334155; font-size: 12px; }
.ik-ai-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; background: #DBEAFE; color: #1D4ED8; border-radius: 6px; padding: 1px 5px; margin-left: 4px; text-transform: none; }
.ik-q { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--canvas); }
.ik-q-done .ik-q-t { color: var(--text-muted); }
.ik-q-t { font-size: 15px; font-weight: 600; }
.ik-q-where { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.ik-q-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.ik-q-opt { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D1D5DB; background: var(--bg-card, #fff); font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.ik-q-opt-on { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.ik-q-num { display: flex; gap: 8px; align-items: center; }
.ik-q-num span { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.ik-q-act { display: flex; gap: 16px; font-size: 13px; color: var(--primary); }
.ik-q-act .ik-link { text-decoration: none; min-height: 32px; }
.ik-q-tag { font-size: 11px; font-weight: 600; background: #F3F4F6; color: #4B5563; border-radius: 6px; padding: 1px 6px; }
.ik-q-tag-unk { background: #FEF3C7; color: #92400E; }
.ik-row-btn { width: 100%; background: none; border: 0; border-top: 1px solid var(--canvas); font: inherit; text-align: left; cursor: pointer; }
.ik-fleet-link { text-decoration: none; color: var(--text); gap: 4px; }
/* Главная «Внедрения» — плитки разделов, вкладки разделов (04.10.2026). */
.ik-tiles { display: flex; flex-direction: column; }
.ik-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); border-top: 1px solid var(--border-light); }
.ik-tile:first-child { border-top: none; }
.ik-tile:active { background: var(--bg, #F7F8FA); }
.ik-tile-ic { flex: 0 0 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 22px; border-radius: 10px; background: var(--bg, #F7F8FA); }
.ik-tile-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ik-tile-t { font-weight: 700; font-size: 16px; }
.ik-tile-s { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.ik-tile-warn .ik-tile-ic { background: #fef3c7; }
.ik-tile-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--border-light); overflow: hidden; }
.ik-tile-bar i { display: block; height: 100%; background: var(--primary, #1A6B52); }
.ik-help { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #EFF6FF; color: #1E3A5F; font-size: 14px; line-height: 1.45; }
.ik-help-t { font-weight: 700; margin-bottom: 6px; }
.ik-help-ol { margin: 0 0 6px; padding-left: 20px; }
.ik-help-ol li { margin: 2px 0; }
.ik-help .ik-link { font-size: 13px; color: #1D4ED8; }
.ik-help-off { background: none; padding: 0 2px; margin-bottom: 8px; }
.ik-tile-start { box-shadow: 0 0 0 2px var(--green-600, #16a34a) inset; }
.ik-tile-go { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green-700, #15803d); margin-bottom: 2px; }
@media (prefers-color-scheme: dark) { .ik-help { background: #172554; color: #DBEAFE; } .ik-help .ik-link { color: #93C5FD; } }
.ik-reg-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ik-reg-save .ik-hint { margin: 0; }
.ik-reg-save { position: sticky; bottom: 76px; z-index: 4; box-shadow: 0 -1px 0 var(--canvas); }
.ik-reg-dirty { color: #92400E; font-weight: 600; }
.ik-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 10px; background: var(--bg, #F7F8FA); }
.ik-tab { flex: 1 1 0; text-align: center; padding: 8px 6px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.ik-tab-on { background: var(--bg-card, #fff); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ik-pick-list { max-height: 55vh; overflow-y: auto; margin: 8px 0; text-align: left; }
.ik-fleet-link b { color: var(--primary); font-size: 16px; }
.ik-fleet-link span { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.ik-diff { font-size: 14px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; }
.ik-diff-new { background: #F0FDF4; color: #14532D; }
.ik-diff-diff { background: #FEF3C7; color: #78350F; }
.ik-choice { gap: 12px; }
.ik-choice .ik-btn { width: 100%; }
.ik-bar-ok { background: #DCFCE7; color: #14532D; }
.ik-rv { border-top: 1px solid var(--canvas); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ik-rv-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.ik-rv-main input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--green-600); }
.ik-rv-b { display: flex; flex-direction: column; min-width: 0; }
.ik-rv-wait .ik-row-t { color: var(--text-muted); }
.ik-rv-open { font-size: 13px; color: var(--primary); text-decoration: none; padding: 8px 4px; }
.ik-rv-diffs { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding-left: 34px; }
.ik-rv-diff { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: #FEF3C7; color: #78350F; border-radius: 8px; padding: 8px 10px; }
.ik-btn[disabled] { opacity: .55; cursor: default; }
.ik-rv-cand { background: var(--bg, #F7F8FA); color: var(--text); }
.ik-rv-cand input { margin-top: 2px; }
/* «Внедрение»: главная кнопка «Завести снятое в систему» и статусы (30.09.2026) */
.ik-cta { gap: 8px; }
.ik-cta .ik-btn-lg { width: 100%; text-align: center; text-decoration: none; }
.ik-cta-st { display: flex; flex-wrap: wrap; gap: 6px; }
.ik-ai-again { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--primary); min-height: 32px; }
/* Плитка «Внедрение» на дашборде */
.dash-intake { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(45,125,83,.12), rgba(45,125,83,.04)); border: 1px solid rgba(45,125,83,.25); cursor: pointer; color: var(--text); }
.dash-intake-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-intake-b { flex: 1; min-width: 0; }
.dash-intake-t { font-weight: 600; font-size: 15px; }
.dash-intake-s { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.dash-intake-go { font-size: 22px; color: var(--primary); }

/* Действия в строках «Характеристик» (07.10.2026): были зелёным словом
   «привязать / указать / обновить» — по опросу никто не понял, что это можно
   нажать. Теперь кнопка, прижатая к правому краю строки. */
.eq-row-val { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.eq-row-val > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.eq-row-act { flex-shrink: 0; margin-left: auto; height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }

/* =====================================================
   Нижняя панель «Сохранить / Отмена» (app-save-bar.js, 09.10.2026)
   ===================================================== */
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  /* Скрытая — не отображается вовсе. Сдвиг за край (translateY) во встроенном браузере
     приложения на Android оставлял панель видимой внизу экрана (живой случай 09.10.2026). */
  display: none;
}
.save-bar.show { display: block; animation: save-bar-in .18s ease; }
@keyframes save-bar-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.save-bar-inner {
  display: flex; align-items: center; gap: 8px;
  margin: 0 auto; max-width: 720px;
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  background: var(--bg-card, #fff); border-top: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 -6px 20px rgba(0,0,0,.08);
}
.save-bar-hint { flex: 1; font-size: 13px; color: var(--text-muted); min-width: 0; }
.save-bar-inner .btn { min-width: 110px; height: 42px; }
@media (min-width: 1025px) {
  .save-bar-inner { border: 1px solid var(--border, #e5e7eb); border-radius: 14px; margin-bottom: 16px; }
  body.has-save-bar .content { padding-bottom: 90px; }
}
@media (max-width: 1024px) {
  /* над нижним меню */
  .save-bar { bottom: calc(64px + max(4px, env(safe-area-inset-bottom, 0px) / 2)); }
  .save-bar-inner { padding-bottom: 10px; }
  .save-bar-hint { display: none; }
  .save-bar-inner .btn { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
  body.has-save-bar .page.active { padding-bottom: 150px !important; }
}
.save-bar-ask { position: fixed; inset: 0; z-index: 99990; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.save-bar-ask-box { background: var(--bg-card, #fff); border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.save-bar-ask-t { font-size: 16px; font-weight: 700; }
.save-bar-ask-h { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.save-bar-ask .btn-link { background: none; border: none; color: var(--text-muted); height: 38px; cursor: pointer; font-size: 14px; }

/* Передача дел при увольнении (app-person-handover.js, 09.10.2026) */
.ho-box { max-width: 420px; }
.ho-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.ho-box { max-height: 88vh; overflow-y: auto; }
.ho-sec { border-top: 1px solid var(--border-light, #eef0f2); padding-top: 10px; margin-top: 2px; display: flex; flex-direction: column; gap: 6px; }
.ho-opt { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.ho-opt:has(input:checked) { background: var(--bg-muted, #f4f6f8); }
.ho-opt input { margin-top: 3px; flex-shrink: 0; accent-color: var(--green-700, #2d7d53); }
.ho-opt span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ho-opt small, .ho-hint { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.ho-to { padding: 0 8px 4px 36px; display: flex; flex-direction: column; gap: 4px; }


/* Склейка дублей и перенос документа (app-equipment-merge.js, 12.10.2026) */
.mg-box { max-width: 460px; max-height: calc(100vh - 40px); text-align: left; align-items: stretch; }
.mg-box .ik-nfc-t, .mg-box > .ik-link { text-align: center; }
.mg-list { overflow-y: auto; max-height: 50vh; margin: 0 -24px; border-bottom: 1px solid var(--canvas); }
.mg-list .ik-row { min-height: 56px; padding: 8px 24px; }
.mg-cap { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: 10px 24px 4px; }
.mg-why { color: var(--green-700); font-weight: 600; }
.mg-bad { color: var(--destructive); }
.mg-empty { padding: 16px 24px; text-align: center; }
.mg-pair { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.mg-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mg-card span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green-700); }
.mg-card-dup span { color: var(--text-muted); }
.mg-card b { font-size: 15px; }
.mg-card i { font-style: normal; font-size: 13px; color: var(--text-muted); }
.mg-arrow { text-align: center; color: var(--text-muted); }
@media (max-width: 480px) { .mg-list { margin: 0 -16px; } .mg-list .ik-row, .mg-cap { padding-left: 16px; padding-right: 16px; } }
.mg-fill { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; text-align: left; cursor: pointer; }
.mg-fill input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.mg-fill-s { text-align: left; margin-top: -6px; }
.ik-cap-acts { float: right; font-weight: 400; text-transform: none; letter-spacing: 0; }
.ik-cap-acts .ik-link { font-size: 13px; padding: 0 4px; }
.ik-pad { padding: 2px 16px 8px 44px; }

/* «Управление» в меню — свёрнутый блок (15.10.2026), логика в app-nav-manage.js.
   Кнопка выглядит как заголовок группы, но ловится пальцем: 40px высоты. */
.nav-group-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  font-family: inherit; min-height: 40px; border-radius: var(--radius-sm);
}
.nav-group-toggle .nav-label { font: inherit; }
.nav-group-toggle:hover { color: rgba(255,255,255,.55); }
.nav-group-toggle:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: -2px; }
.nav-group-chev { margin-left: auto; transition: transform var(--transition); }
.nav-group-toggle[aria-expanded="true"] .nav-group-chev { transform: rotate(180deg); }
.nav-manage { display: none; }
.nav-manage.open { display: block; }
/* Узкое меню — одни значки: сворачивать нечего, показываем все пункты. */
.sidebar.collapsed .nav-manage { display: block; }

/* Отчёты для выгрузки на вкладках «Аналитики» (15.10.2026), см. app-analytics-reports.js. */
.an-rep-head { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 22px 0 10px; }
.an-rep-head:first-child { margin-top: 6px; }
#analytics-reports .section { margin-bottom: 14px; }

/* «Аналитика»: переключатель «Показатели | Отчёты» и карточки выгрузки (15.10.2026). */
.an-view { display: inline-flex; gap: 2px; background: var(--bg-muted); border-radius: 10px; padding: 3px; margin: 4px 0 14px; }
.an-view button { font: inherit; font-size: 13px; border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; color: var(--text-secondary); cursor: pointer; min-height: 36px; }
.an-view button.on { background: var(--bg-card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.an-view button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
#analytics-reports .section-header { flex-direction: column; align-items: flex-start; gap: 2px; }
@media (max-width: 640px) {
  .an-view { display: flex; margin: 4px 14px 12px; }
  .an-view button { flex: 1; min-height: 40px; }
  #analytics-body .sec-tabs .sec-tab svg { display: none; }
  /* «Задачи и команда»: таблица загрузки помещается в экран без прокрутки вбок. */
  #analytics-tab-content .an-team { padding: 12px 0 !important; gap: 12px !important; }
  #analytics-tab-content .an-team .section-body { padding-left: 10px !important; padding-right: 10px !important; }
  .an-heat { border-spacing: 2px !important; table-layout: fixed; }
  .an-heat th:first-child, .an-heat td:first-child { width: 31%; min-width: 0 !important; padding: 4px 4px 4px 0 !important; }
  .an-heat td:first-child div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .an-heat th { padding: 4px 0 !important; font-size: 10px !important; }
  .an-heat td { padding: 8px 0 !important; font-size: 11px !important; }
  #analytics-reports { padding: 0 14px 16px; }
  #analytics-reports .section { border: 1px solid var(--border-light) !important; border-radius: 12px !important; overflow: hidden; margin-bottom: 12px !important; }
  #analytics-reports .section-header { padding: 12px 14px !important; }
  #analytics-reports .section-body { padding: 14px !important; flex-direction: column; align-items: stretch !important; gap: 14px !important; }
  #analytics-reports .section-body > div[style*="flex-wrap"] { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; }
  #analytics-reports .section-body > div[style*="flex-wrap"] > div:has(select),
  #analytics-reports .section-body > div[style*="flex-wrap"] > div:has(> div[id]),
  #analytics-reports .section-body > div[style*="flex-wrap"] > label { grid-column: 1 / -1; }
  #analytics-reports .section-body > div > div[style*="width"] { width: auto !important; }
  #analytics-reports input:not([type="checkbox"]), #analytics-reports select { width: 100% !important; max-width: none !important; min-height: 44px; }
  #analytics-reports .section-body > div[style*="display:flex;gap:8px"] { display: flex !important; }
  #analytics-reports .section-body > div[style*="display:flex;gap:8px"] > .btn { flex: 1; justify-content: center; min-height: 44px; }
}

/* Плитки «Вид» локации (справочник, 23.10.2026) — app-location-kind.js */
.loc-kind-tiles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.loc-kind-tile { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 6px;
  border:1px solid var(--border); border-radius:10px; background:var(--bg-primary); color:var(--text-secondary);
  cursor:pointer; font:inherit; text-align:center; }
.loc-kind-tile .loc-kind-title { font-size:13px; font-weight:600; color:var(--text-primary); }
.loc-kind-tile .loc-kind-hint { font-size:11px; color:var(--text-muted); line-height:1.2; }
.loc-kind-tile.on { border-color:var(--primary); background:var(--primary-light, rgba(22,101,52,.08)); color:var(--primary); }
.loc-kind-tile.on .loc-kind-title { color:var(--primary); }

/* Справочник → Локации, новый вид (23.10.2026) — app-ref-locations.js */
.rl-toolbar { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.rl-search { flex:1; position:relative; }
.rl-search svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.rl-search .form-input { padding-left:32px; }
.rl-list { display:flex; flex-direction:column; gap:2px; }
.rl-site { display:flex; align-items:center; gap:4px; border-radius:12px; padding:4px 4px 4px 8px; margin-top:6px; }
.rl-site-site { background:var(--primary-light); color:var(--primary); }
.rl-site-garage { background:var(--blue-100, #dbeafe); color:var(--blue-700, #1d4ed8); }
.rl-site-head { flex:1; display:flex; align-items:center; gap:8px; background:none; border:0; padding:8px 4px; text-align:left; color:inherit; font:inherit; cursor:pointer; min-width:0; }
.rl-site-head:disabled { cursor:default; }
.rl-site-text { display:flex; flex-direction:column; min-width:0; }
.rl-site-name { font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rl-site-sub { font-size:12px; opacity:.85; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rl-row { display:flex; align-items:center; gap:4px; border-bottom:1px solid var(--border); padding-right:4px; }
.rl-row-main { flex:1; display:flex; align-items:center; gap:8px; background:none; border:0; padding:9px 4px; text-align:left; color:var(--text-primary); font:inherit; font-size:14px; cursor:pointer; min-width:0; }
.rl-row-main:disabled { cursor:default; }
.rl-row-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rl-row-name.rl-empty { color:var(--text-muted); }
.rl-row-count { font-size:12px; color:var(--text-secondary); white-space:nowrap; }
.rl-pin { color:var(--primary); display:inline-flex; }
.rl-chev { flex:none; transition:transform .12s; color:var(--text-muted); }
.rl-site .rl-chev { color:inherit; }
.open > .rl-row-main .rl-chev, .open > .rl-site-head .rl-chev { transform:rotate(90deg); }
.rl-menu-btn { flex:none; width:36px; height:36px; border:0; background:none; border-radius:8px; color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.rl-site .rl-menu-btn { color:inherit; }
.rl-menu-btn:hover { background:rgba(0,0,0,.06); }
.rl-pop { position:absolute; z-index:1200; background:var(--bg-card, #fff); border:1px solid var(--border); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.14); min-width:220px; padding:6px; }
/* На телефоне — лист снизу поверх всего (и над нижней панелью), с затемнением. */
.rl-pop.sheet { position:fixed; left:8px; right:8px; bottom:calc(8px + env(safe-area-inset-bottom, 0px)); min-width:0; z-index:2100; box-shadow:0 -4px 30px rgba(0,0,0,.25); }
.rl-pop-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:2090; }
.rl-pop-title { font-size:12px; color:var(--text-muted); padding:6px 10px 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rl-pop-item { display:flex; align-items:center; gap:10px; width:100%; border:0; background:none; padding:11px 10px; border-radius:8px; font:inherit; font-size:15px; color:var(--text-primary); text-align:left; cursor:pointer; }
.rl-pop-item:hover { background:var(--bg-secondary); }
.rl-pop-item.danger { color:var(--destructive); }
.rl-pop-ico { width:20px; text-align:center; }

/* Площадка/гараж в списке оборудования (23.10.2026) — app-eq-site-head.js */
.eq-group-site { margin-top:8px; }
.eq-site-head { display:flex; align-items:center; gap:10px; padding:10px 12px !important; border-radius:12px; cursor:pointer; user-select:none; }
.eq-site-site { background:var(--primary-light) !important; color:var(--primary); border:1px solid var(--primary-light); }
.eq-site-garage { background:var(--blue-100, #dbeafe) !important; color:var(--blue-700, #1d4ed8); border:1px solid var(--blue-100, #dbeafe); }
.eq-site-ico { display:flex; flex:none; }
.eq-site-text { display:flex; flex-direction:column; min-width:0; }
.eq-site-name { font-size:16px; font-weight:700; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.eq-site-sub { font-size:12px; opacity:.85; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.eq-site-text { flex:1; }
.eq-site-bad { color:var(--destructive); font-weight:600; opacity:1; }
.eq-group-site > .eq-rows-list { padding-top:4px; }

/* Гаражи в «Технике» (23.10.2026) — app-veh-garages.js */
.veh-garages { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:10px; padding:0 20px; margin:4px 0 8px; }
.veh-garage { display:flex; align-items:center; gap:12px; text-align:left; padding:12px 14px; min-height:72px; box-sizing:border-box;
  position:relative; border:1px solid var(--border); border-radius:12px; background:var(--bg-card); color:var(--text-primary);
  font:inherit; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,.04); transition:border-color .15s, background .15s; }
.veh-garage:hover { border-color:var(--primary, #1A6B52); }
/* Прямая полоска сбоку — как у карточек и строк везде в приложении (.occ-card::before) */
.veh-garage::before { content:''; position:absolute; left:4px; top:8px; bottom:8px; width:3px; border-radius:2px; background:var(--primary, #1A6B52); }
.veh-garage-ic { flex:0 0 40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--primary-light, #ECF7EF); color:var(--primary, #1A6B52); }
.veh-garage-ic svg { width:22px; height:22px; }
.veh-garage-b { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.veh-garage-name { font-size:15px; font-weight:700; line-height:1.25; }
.veh-garage-sub { font-size:12.5px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.veh-garage-sub i { font-style:normal; color:#B45309; }
.veh-garage-att { font-size:12px; color:#B45309; font-weight:600; }
.veh-garage-n { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; line-height:1; }
.veh-garage-n b { font-size:24px; font-weight:800; }
.veh-garage-n small { font-size:11px; color:var(--text-muted); margin-top:3px; }
.veh-garage.on { border-color:var(--primary, #1A6B52); border-width:2px; background:var(--primary-light, #ECF7EF); padding:11px 13px; }
.veh-garage.on::before { left:3px; top:7px; bottom:7px; }
.veh-garages-note { font-size:12px; color:var(--text-muted); padding:0 20px; margin:0 0 10px; }

/* «Чего не хватает» у машины во Внедрении (23.10.2026) — app-intake-veh-needs.js */
.ik-needs .ik-need { padding:8px 0; border-top:1px solid var(--border); }
.ik-needs .ik-need:first-of-type { border-top:0; }
.ik-need-t { font-weight:600; font-size:15px; }
.ik-need-done .ik-need-t { color:var(--primary); }
.ik-need-h { font-size:12px; color:var(--text-muted); margin:2px 0 6px; }
.ik-need-b { display:flex; gap:6px; flex-wrap:wrap; }
.ik-btn.ik-btn-sm { padding:7px 12px; font-size:13px; min-height:36px; }
.ik-row-s.ik-row-s-wrap { white-space:normal; overflow:visible; text-overflow:clip; }

/* Выбор и удаление во Внедрении (23.10.2026) — app-intake-select.js */
.ik-cap { display:flex; align-items:center; gap:8px; }
.ik-cap-act { margin-left:auto; border:0; background:none; color:var(--primary); font:inherit; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; padding:4px 0; cursor:pointer; }
.ik-row.ik-row-sel { width:100%; text-align:left; background:none; border:0; font:inherit; color:inherit; cursor:pointer; }
.ik-row.ik-row-sel.on { background:var(--primary-light); }
.ik-check { flex:none; width:24px; height:24px; border-radius:6px; border:2px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; color:#fff; margin-right:4px; }
.ik-check.on { background:var(--primary); border-color:var(--primary); }
.ik-btn.ik-btn-danger { background:var(--destructive, #dc2626); border-color:var(--destructive, #dc2626); color:#fff; }
.ik-btn.ik-btn-danger:disabled { background:var(--bg-secondary); border-color:var(--border); color:var(--text-muted); }

/* Вид документа у кадра (Внедрение → пакет документов, 23.10.2026) */
.ik-doc-frames { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.ik-doc-frame { display:inline-flex; align-items:center; gap:4px; }
.ik-doc-type { font:inherit; font-size:12px; padding:2px 4px; border:1px solid var(--border); border-radius:6px; background:var(--bg-card, #fff); max-width:170px; }
.ik-doc-acts { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; width:100%; }
/* «Уже в карточке» у заведённой машины во «Внедрении» (23.10.2026) */
.ik-have-f { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; margin:6px 0 10px; font-size:14px; }
.ik-have-f dt { color:var(--text-muted); }
.ik-have-f dd { margin:0; font-weight:600; word-break:break-word; }
.ik-have-phs { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:8px; }
.ik-have-ph { width:64px; height:64px; padding:0; border:0; border-radius:10px; overflow:hidden; cursor:pointer; background:var(--bg-muted, #F3F4F6); }
.ik-have-ph img { width:100%; height:100%; object-fit:cover; display:block; }
.ik-have-more { font-size:13px; color:var(--text-muted); padding:0 6px; }
.ik-have-docs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.ik-have-doc { min-height:34px; padding:0 12px; border-radius:999px; border:1px solid var(--border, #D1D5DB); background:var(--bg-card, #fff); font:inherit; font-size:13px; cursor:pointer; }
.ik-row-off { opacity:.45; }
.ik-hint-pad { padding:0 16px 8px; }
/* «Выбрать» — заметной кнопкой (владелец 23.10.2026: «её не видно») */
.ik-cap-act.ik-cap-sel { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--primary); border-radius:999px; padding:5px 12px; background:var(--bg-card, #fff); }
.ik-cap-act.ik-cap-sel:hover { background:var(--primary-light); }
.ik-cap-box { width:12px; height:12px; border:1.5px solid var(--primary); border-radius:3px; }
/* Машины регламента по счётчику — у каждой своё последнее ТО (app-schedule-units.js, 23.10.2026) */
.su-list { display:flex; flex-direction:column; }
.su-row { display:block; width:100%; text-align:left; background:none; border:0; border-top:1px solid var(--border-light, #EEF0F2); padding:10px 16px; font:inherit; color:inherit; cursor:pointer; }
div.su-row { cursor:default; }
.su-row:hover { background:var(--bg-secondary, #F8FAF9); }
.su-row-edit, .su-row-edit:hover { background:var(--primary-light, #ECF7EF); cursor:default; }
.su-row-h { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.su-name { font-weight:600; font-size:14px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.su-gov { font-weight:400; color:var(--text-muted); margin-left:4px; }
.su-last { font-size:13px; margin-top:2px; }
.su-sub { font-size:12px; color:var(--text-muted); margin-top:1px; }
.su-pill { flex:none; font-size:12px; font-weight:600; padding:2px 9px; border-radius:999px; white-space:nowrap; }
.su-ok { background:#ECFDF3; color:#15803D; } .su-amber { background:#FEF3C7; color:#B45309; } .su-red { background:#FEE2E2; color:#B91C1C; }
.su-blue { background:#E0F2FE; color:#0369A1; } .su-grey { background:var(--bg-secondary, #F3F4F6); color:var(--text-muted); }
.su-form { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.su-form label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--text-muted); }
.su-form input { font:inherit; font-size:15px; padding:8px 10px; border:1px solid var(--border, #D1D5DB); border-radius:8px; background:var(--bg-card, #fff); color:var(--text); }
.su-form-b { grid-column:1 / -1; display:flex; gap:8px; justify-content:flex-end; }
.su-hint { font-size:12px; color:var(--text-muted); }
.su-form .su-hint { grid-column:1 / -1; }
.su-pad { padding:0 16px 8px; }
@media (max-width: 420px) { .su-form { grid-template-columns:1fr; } }
/* «Объединить копии регламентов» (app-schedule-merge.js, 23.10.2026) */
.smg-banner { display:flex; flex-direction:column; gap:3px; width:calc(100% - 32px); margin:8px 16px; padding:12px 14px; text-align:left; font:inherit; color:inherit;
  background:#FFFBEB; border:1px solid #FDE68A; border-radius:12px; cursor:pointer; }
.smg-banner b { font-size:14px; color:#92400E; }
.smg-banner span { font-size:13px; color:var(--text-muted); }
.smg-banner .smg-go { color:#B45309; font-weight:600; }
.smg-hint { font-size:13px; color:var(--text-muted); margin-bottom:10px; }
.smg-row { display:flex; gap:10px; align-items:flex-start; padding:9px 0; border-top:1px solid var(--border-light, #EEF0F2); cursor:pointer; }
.smg-row input { margin-top:3px; width:18px; height:18px; flex:none; }
.smg-t { font-weight:600; font-size:14px; }
.smg-n { font-weight:500; font-size:12px; color:#B45309; margin-left:4px; }
.smg-s { font-size:12px; color:var(--text-muted); margin-top:2px; }
/* Раздел «Техника» по макету 23.10.2026 (app-veh-layout.js): поиск, сводка без нулей, баннер, вкладки внизу */
.veh-search { position:relative; display:flex; align-items:center; margin:4px 20px 10px; }
.veh-search svg { position:absolute; left:12px; color:var(--text-muted); pointer-events:none; }
.veh-search input { width:100%; box-sizing:border-box; font:inherit; font-size:15px; padding:11px 38px 11px 38px; border:1px solid var(--border, #D1D5DB);
  border-radius:12px; background:var(--bg-card, #fff); color:var(--text); }
.veh-search input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light, #ECF7EF); }
.veh-search input::-webkit-search-cancel-button { display:none; }
.veh-search-x { display:none; position:absolute; right:6px; width:30px; height:30px; border:0; background:none; font-size:20px; color:var(--text-muted); cursor:pointer; }
.veh-search.has-q .veh-search-x { display:block; }
.veh-sum { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:0 20px; margin:2px 0 12px; }
.veh-sum-all { font-size:14px; font-weight:600; color:var(--text); margin-right:2px; }
.veh-sum-ok { font-size:13px; color:var(--green-700); font-weight:600; }
.veh-sum-i { font:inherit; font-size:13px; padding:4px 10px; border-radius:999px; border:1px solid transparent; cursor:pointer; }
.veh-sum-i b { font-weight:700; }
.veh-sum-i.t-red { background:#FEF2F2; color:#B91C1C; } .veh-sum-i.t-amber { background:#FFFBEB; color:#B45309; } .veh-sum-i.t-grey { background:var(--bg-secondary, #F3F4F6); color:var(--text-secondary); }
.veh-sum-i.on { border-color:currentColor; }
.veh-banner { margin:0 20px 14px; padding:12px 14px; border-radius:12px; background:#FFFBEB; border:1px solid #FDE68A; }
.veh-banner-t { font-weight:600; font-size:14px; color:#92400E; }
.veh-banner-s { font-size:13px; color:var(--text-secondary); margin-top:2px; }
.veh-banner-b { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.veh-plan-h { padding:4px 20px 10px; font-size:13px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
/* Вкладки внизу (владелец 23.10.2026): активная — плоская полоска сверху, не плашка; четыре влезают на 360px */
.veh-tabs { display:flex; gap:0; padding:0; margin:12px 20px; border-radius:14px; background:var(--bg-card, #fff); border:1px solid var(--border, #E5E7EB);
  box-shadow:0 4px 18px rgba(0,0,0,.08); position:sticky; bottom:12px; z-index:30; overflow:hidden; }
.veh-tab { flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; gap:3px; padding:8px 2px 7px; border:0; border-top:3px solid transparent; background:none; font:inherit;
  font-size:11px; font-weight:600; color:var(--text-muted); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.veh-tab span { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.veh-tab.on { border-top-color:var(--primary, #16A34A); color:var(--green-700, #15803D); }
@media (min-width: 768px) {
  .veh-tab { flex-direction:row; justify-content:center; gap:6px; font-size:13px; padding:10px 8px 9px; }
}
@media (max-width: 767px) {
  /* над общей панелью приложения */
  .veh-tabs { position:fixed; left:8px; right:8px; margin:0; bottom:calc(64px + max(4px, env(safe-area-inset-bottom, 0px) / 2) + 8px); }
  #page-vehicles .page-body { padding-bottom:72px; }
  .veh-search { margin:4px 16px 10px; }
  .veh-sum { padding:0 16px; }
  .veh-garages, .veh-garages-note { padding:0 16px; }
  .veh-garages { grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px; }
  .veh-garage { flex-direction:column; align-items:stretch; gap:4px; padding:10px 10px 10px 14px; min-height:64px; }
  .veh-garage-n { flex-direction:row; align-items:baseline; gap:4px; order:2; }
  .veh-garage-n small { margin-top:0; }
  .veh-garage.on { padding:9px 9px 9px 13px; }
  .veh-garage-ic, .veh-garage-lg { display:none; }
  .veh-garage-name { font-size:14px; }
  .veh-garage-sub, .veh-garage-att { font-size:11.5px; white-space:normal; }
  .veh-garage-n b { font-size:20px; }
  .veh-banner { margin:0 16px 14px; }
}
#page-vehicles:not(.active) .veh-tabs { display:none; }
/* Справочники — общий вид списка, как у «Локаций» (app-ref-list.js, 23.10.2026) */
.rf-row { display:flex; align-items:center; border-top:1px solid var(--border-light, #EEF0F2); }
.rf-list .rf-row:first-child { border-top:0; }
.rf-main { flex:1; min-width:0; display:flex; align-items:center; gap:10px; padding:11px 12px; background:none; border:0; font:inherit; color:inherit; text-align:left; cursor:pointer; }
.rf-main[tabindex="-1"] { cursor:default; }
.rf-main:hover { background:var(--bg-secondary, #F8FAF9); }
.rf-dot { flex:none; width:12px; height:12px; border-radius:4px; }
.rf-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.rf-name { font-weight:600; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rf-sub { font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rf-count { flex:none; font-size:12px; color:var(--text-muted); white-space:nowrap; }
.rf-badge { font-size:11px; font-weight:600; color:#7C3AED; background:#F5F3FF; padding:1px 7px; border-radius:999px; margin-left:4px; }
.rf-muted .rf-name, .rf-muted .rf-sub { opacity:.55; }
.rf-chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.rf-note { padding:12px 4px; font-size:12px; color:var(--text-muted); }
/* Окна — одна шапка у всех (23.10.2026): заголовок слева, крестик в сером кружке.
   На телефоне «ручка» сверху стояла в одной строке с заголовком и сдвигала его к центру. */
.modal-close-btn { background: var(--bg-muted); }
.modal-header h3 { margin: 0; text-align: left; }
@media (max-width: 1024px) {
  .modal-header { flex-wrap: wrap !important; }
  .modal-header::before { flex: 0 0 100%; width: auto !important; height: 4px; margin: 0 0 10px !important; border-radius: 0 !important;
    background: linear-gradient(#e5e7eb, #e5e7eb) center / 36px 4px no-repeat !important; }
  .modal-header h3, .modal-header .modal-title { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 44px); text-align: left; font-size: 18px; font-weight: 700; }
}

/* ── «Внедрение»: редизайн по макету (23.10.2026) ── */
.ik-menu-btn { margin-left:auto; width:36px; height:36px; border:0; border-radius:10px; background:none; color:var(--text); font-size:22px; line-height:1; cursor:pointer; flex-shrink:0; }
.ik-menu-btn:active, .ik-menu-btn:hover { background:var(--bg, #F7F8FA); }
.ik-menu-pop { position:absolute; z-index:10000; min-width:220px; max-width:calc(100vw - 16px); background:var(--bg-card, #fff); border-radius:12px; box-shadow:0 8px 28px rgba(0,0,0,.18); padding:6px 0; display:flex; flex-direction:column; }
.ik-menu-it { text-align:left; border:0; background:none; font:inherit; font-size:15px; color:var(--text); padding:12px 16px; cursor:pointer; }
.ik-menu-it:hover, .ik-menu-it:active { background:var(--bg, #F7F8FA); }
.ik-menu-it:disabled { color:var(--text-muted); opacity:.55; cursor:default; }
.ik-menu-danger { color:#B91C1C; }
.ik-undo { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(160px + env(safe-area-inset-bottom)); z-index:10001; display:flex; align-items:center; gap:14px; max-width:calc(100vw - 32px); background:#1F2937; color:#fff; border-radius:12px; padding:12px 16px; font-size:14px; box-shadow:0 6px 20px rgba(0,0,0,.25); }
.ik-undo-b { border:0; background:none; color:#86EFAC; font:inherit; font-weight:700; cursor:pointer; padding:4px 0; white-space:nowrap; }
.ik-search { margin:0; }
.ik-fchips { display:flex; flex-wrap:wrap; gap:6px; }
.ik-fchip { border:1px solid var(--border-light, #E5E7EB); background:var(--bg-card, #fff); color:var(--text); border-radius:999px; padding:6px 12px; font:inherit; font-size:13px; cursor:pointer; }
.ik-fchip.on { background:var(--primary, #1A6B52); border-color:var(--primary, #1A6B52); color:#fff; }
.ik-sel-head { display:flex; align-items:center; justify-content:space-between; font-size:16px; }
.ik-seg { display:flex; background:var(--bg, #F3F4F6); border-radius:10px; padding:3px; gap:3px; }
.ik-seg-b { flex:1 1 0; border:0; background:none; border-radius:8px; padding:8px 6px; font:inherit; font-size:13px; color:var(--text-muted); cursor:pointer; }
.ik-seg-b.on { background:var(--bg-card, #fff); color:var(--text); font-weight:600; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.ik-seg-b:disabled { opacity:.5; cursor:default; }
.ik-pill.ik-pill-sm { font-size:11px; padding:2px 7px; vertical-align:1px; }
.ik-row-need { white-space:normal; color:#92400E; }
.ik-row-need.ik-row-full { color:var(--text-muted); }
.ik-inbox { flex-direction:row; align-items:center; gap:14px; text-decoration:none; color:var(--text); }
.ik-inbox-n { font-size:34px; font-weight:800; color:var(--primary, #1A6B52); line-height:1; min-width:48px; text-align:center; }
.ik-inbox-go { color:var(--primary, #1A6B52); font-weight:600; }
.ik-step { display:flex; align-items:center; gap:12px; padding:12px 16px; text-decoration:none; color:var(--text); border-top:1px solid var(--border-light); }
.ik-step:active { background:var(--bg, #F7F8FA); }
.ik-step.ik-step-done { opacity:.6; }
.ik-step.ik-step-start { box-shadow:0 0 0 2px var(--green-600, #16a34a) inset; border-radius:10px; }
.ik-step-n { min-width:28px; height:24px; padding:0 8px; border-radius:999px; background:#FEF3C7; color:#92400E; font-size:13px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.ik-step-n.ik-step-ok { background:#DCFCE7; color:#166534; }
.ik-step-n.ik-step-none { background:var(--bg, #F3F4F6); color:var(--text-muted); }
.ik-done-r { display:flex; align-items:center; gap:12px; }
.ik-row[hidden], .ik-row-btn[hidden] { display:none !important; }
.ik-undo > span { white-space:nowrap; }
