/* ════════════════════════════════════════════════
   АЗС Платформа — Стили
   Этап 1: Каркас
════════════════════════════════════════════════ */

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #111827;
  --sidebar-text: #9ca3af;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(79,140,247,0.15);
  --accent: #4f8cf7;
  --accent-dark: #3b7de8;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

/* ── Темна тема ──────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --shadow:       0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --sidebar-bg:   #0a0f1e;
  --sidebar-text: #64748b;
  --sidebar-hover:  rgba(255,255,255,0.05);
  --sidebar-active: rgba(79,140,247,0.2);
}

[data-theme="dark"] .card           { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .form-control   { background: #0f172a; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .modal          { background: var(--surface); color: var(--text); }
[data-theme="dark"] .modal-header   { border-color: var(--border); }
[data-theme="dark"] .modal-footer   { border-color: var(--border); background: var(--surface); }
[data-theme="dark"] .topbar         { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .section-header { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .req-card       { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .req-card:hover { background: #263348; }
[data-theme="dark"] .req-card.selected { background: #1e3a5f; }
[data-theme="dark"] .stat-card      { background: var(--surface); }
[data-theme="dark"] .st-row         { border-color: var(--border); }
[data-theme="dark"] .st-row:hover   { background: #263348; }
[data-theme="dark"] .modal-tab-content { background: var(--surface); }
[data-theme="dark"] .modal-tabs     { background: #0f172a; border-color: var(--border); }
[data-theme="dark"] .modal-tab.active { background: var(--surface); }
[data-theme="dark"] .modal-tab      { color: var(--text-muted); }
[data-theme="dark"] select.form-control option { background: #1e293b; }
[data-theme="dark"] .login-box      { background: #1e293b; }
[data-theme="dark"] .login-box label { color: var(--text); }
[data-theme="dark"] .dropdown-menu  { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .ac-item:hover  { background: #263348; }
[data-theme="dark"] .station-modal-grid { background: var(--surface); }
[data-theme="dark"] .prk-row        { border-color: var(--border); background: #0f172a; }
[data-theme="dark"] .wo-table th    { background: #0f172a; }
[data-theme="dark"] .wo-table td    { border-color: var(--border); }
[data-theme="dark"] .repair-cat-block { background: #0f172a; border-color: var(--border); }

/* Плавний перехід теми */
body, .card, .modal, .topbar, .req-card, .form-control, .stat-card {
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition);
  overflow: hidden;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.lumion-logo-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,92,43,0.45));
}

.lumion-logo-svg.login-svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(255,92,43,0.35));
}

.logo-text {
  color: #e5e7eb;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.logo-text strong { color: #ffffff; }

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-divider {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.25);
  padding: 14px 16px 4px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 6px;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; font-size: 13.5px; }
.nav-item:hover { background: var(--sidebar-hover); color: #e5e7eb; }
.nav-item.active { background: var(--sidebar-active); color: var(--accent); }
.nav-item.active i { color: var(--accent); }

.badge {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px 16px 12px;
}

/* ── Перемикач теми ─────────────────────────────── */
.theme-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
  justify-content: center;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.theme-switch input { opacity: 0; width: 0; height: 0; }

.theme-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.3s;
}

.theme-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.theme-switch input:checked + .theme-slider { background: #818cf8; }
.theme-switch input:checked + .theme-slider::before { transform: translateX(16px); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4f8cf7, #7c5cf7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name { color: #e5e7eb; font-size: 13px; font-weight: 500; }
.user-role { color: var(--sidebar-text); font-size: 11px; }

/* ── Main wrap ────────────────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.topbar-actions { display: flex; gap: 8px; }

/* ── Content ────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.section { display: none; }
.section.active { display: block; }

/* ── Stat grid ──────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}

.stat-card.blue  { border-color: #4f8cf7; }
.stat-card.green { border-color: #22c55e; }
.stat-card.orange{ border-color: #f97316; }
.stat-card.purple{ border-color: #a855f7; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card.blue   .stat-icon { background: #eff6ff; color: #4f8cf7; }
.stat-card.green  .stat-icon { background: #f0fdf4; color: #22c55e; }
.stat-card.orange .stat-icon { background: #fff7ed; color: #f97316; }
.stat-card.purple .stat-icon { background: #faf5ff; color: #a855f7; }

.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ── Dashboard grid ─────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13.5px;
}

.card-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.text-muted { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* ── Empty state ────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.empty-state.small { padding: 24px 16px; }
.empty-state i { font-size: 32px; opacity: 0.3; }
.empty-state p { font-weight: 500; color: #374151; }
.empty-state small { font-size: 11px; }

/* ── Toolbar ────────────────────────────────────── */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 220px;
}
.search-box i { color: var(--text-muted); }
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  width: 100%;
  color: var(--text);
}

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.toolbar-right { display: flex; gap: 8px; }

/* ── Requests layout ────────────────────────────── */
.requests-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 220px);
}
.requests-list { overflow-y: auto; }
#map {
  height: calc(100% - 95px);
  min-height: 300px;
  background: #e8f0fe;
}
.map-card { display: flex; flex-direction: column; }
.map-legend {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 11.5px;
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-item.new i { color: #3b82f6; }
.legend-item.progress i { color: #f97316; }
.legend-item.done i { color: #22c55e; }

.map-controls { display: flex; gap: 4px; }

/* ── Data table ─────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--accent); }
.data-table tbody tr:hover { background: #f9fafb; }
.data-table .empty-row td { padding: 0; border: none; }

/* ── Stations layout ────────────────────────────── */
.stations-layout {
  display: grid;
  grid-template-columns: 220px 1fr 200px;
  gap: 16px;
  height: calc(100vh - 160px);
}

.networks-panel, .stations-panel, .equip-types-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.networks-list, .stations-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.network-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
}
.network-item:hover { background: var(--bg); }
.network-item.active { background: #eff6ff; color: var(--accent); }
.network-item .network-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.station-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.station-card:hover { border-color: var(--accent); }

.equip-types-list {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}
.equip-type-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.equip-type-item:hover { background: var(--bg); color: var(--text); }
.equip-type-item i { width: 16px; text-align: center; color: var(--accent); }

/* ── Lighting layout ────────────────────────────── */
.lighting-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
}

.lighting-info-card .lighting-summary { padding: 16px; }
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.summary-item:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); }
.summary-value { font-weight: 600; }

.tabs { display: flex; gap: 2px; }
.tab {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── Equipment tabs ─────────────────────────────── */
.equip-category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.equip-category-tabs .tab { display: flex; align-items: center; gap: 5px; }

/* ── Storage layout ─────────────────────────────── */
.storage-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: calc(100vh - 160px);
}

.storage-providers-card, .storage-files-card { display: flex; flex-direction: column; }

.providers-list { padding: 8px; }
.provider-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.provider-item:hover { border-color: var(--accent); }
.provider-item.connected { border-color: #22c55e; }
.provider-icon { font-size: 20px; width: 36px; text-align: center; }
.provider-name { font-weight: 500; font-size: 13px; }
.provider-status {
  font-size: 11px;
  margin-top: 2px;
}
.provider-item.connected .provider-status { color: #22c55e; }
.provider-item:not(.connected) .provider-status { color: var(--text-muted); }

.file-path-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Modules grid ───────────────────────────────── */
.modules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.module-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}
.module-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}
.module-name { font-weight: 600; font-size: 14px; }
.module-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 4px;
}
.module-badge.core { background: #eff6ff; color: var(--accent); }
.module-badge.addon { background: #f0fdf4; color: #22c55e; }
.module-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 480px;
  max-width: 96vw;
  max-height: 90vh;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  resize: horizontal;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; }
.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Form elements in modal */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { min-height: 80px; resize: vertical; }

.modal-info {
  background: #eff6ff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #1d4ed8;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* ── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1f2937;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: slideIn 0.2s ease;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid #f97316; }

@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Sidebar collapsed ──────────────────────────── */
.sidebar.collapsed { width: 58px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .badge,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 20px 0; }
.sidebar.collapsed .nav-item { justify-content: center; margin: 1px 6px; padding: 9px 0; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

/* ── Network item extras ────────────────────────── */
.net-count {
  font-size: 11px;
  background: #f3f4f6;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  margin-right: 2px;
}
.net-actions {
  display: none;
  gap: 2px;
}
.network-item:hover .net-actions { display: flex; }

.btn-icon-xs {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-icon-xs:hover { background: var(--bg); color: var(--accent); }
.btn-icon-xs.danger:hover { color: #ef4444; background: #fef2f2; }

/* ── Station card ────────────────────────────────── */
.station-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.station-number {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active       { background: #22c55e; }
.status-dot.inactive     { background: #9ca3af; }
.status-dot.construction { background: #f97316; }

.station-address {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.meta-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--text-muted);
  font-family: monospace;
}

/* ── Station modal ──────────────────────────────── */
.station-modal-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

/* ── PRK panel ───────────────────────────────────── */
.prk-list { min-height: 60px; margin-bottom: 10px; }
.prk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.prk-row i.fa-gas-pump { color: #10b981; width: 16px; }
.prk-serial { font-weight: 600; min-width: 40px; }
.prk-model  { flex: 1; color: var(--text-muted); font-size: 12px; }
.prk-guns   { font-size: 12px; color: #6b7280; white-space: nowrap; }
.prk-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.form-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.form-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ── Station equipment panel ─────────────────────── */
.equip-panel-header {
  padding: 8px 0 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.st-equip-list {
  min-height: 60px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.st-equip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.st-equip-row i { color: var(--accent); width: 16px; text-align: center; }
.eq-type  { font-weight: 500; flex: 1; }
.eq-model { color: var(--text-muted); font-size: 12px; }
.eq-qty   { color: var(--text-muted); font-size: 11px; }

.equip-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.equip-add-row .form-control { font-size: 12px; padding: 6px 8px; }

/* ── Import ──────────────────────────────────────── */
.import-summary {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 12px;
}
.import-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

/* ── Modal tabs (station form) ───────────────────── */
.modal-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.modal-tab {
  padding: 7px 16px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ── Request cards ───────────────────────────────── */
.req-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.req-card:hover { background: #f9fafb; }
.req-card:last-child { border-bottom: none; }
.req-card-top { display: flex; gap: 6px; margin-bottom: 5px; }
.req-type-badge, .req-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.req-title { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.req-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.req-date { margin-left: auto; }

/* ── Request modal ───────────────────────────────── */
.req-modal-grid { display: grid; grid-template-columns: 1fr 200px; gap: 20px; }
.req-header-badges { display: flex; gap: 8px; margin-bottom: 4px; }
.req-station-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 13px;
}
.req-modal-side { padding-top: 4px; }
.req-info-block { background: #f9fafb; border-radius: 8px; overflow: hidden; }
.req-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.req-info-row:last-child { border-bottom: none; }
.req-info-row span { color: var(--text-muted); }

/* ── Danger btn ──────────────────────────────────── */
.danger-outline {
  color: #ef4444;
  border-color: #fca5a5;
}
.danger-outline:hover { background: #fef2f2; border-color: #ef4444; }

/* ── Google Maps no-key placeholder ─────────────── */
.map-no-key {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  background: #f8faff;
}
.map-no-key i { font-size: 36px; color: #4285f4; }
.map-no-key p { margin: 0; font-size: 14px; }

/* ── Request selection ───────────────────────────── */
.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.selection-bar > span { flex: 1; }
.sel-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.req-card { position: relative; }
.req-checkbox {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  z-index: 1;
}
.req-checkbox input { width: 16px; height: 16px; cursor: pointer; }
.req-card.selected { border-color: var(--accent); background: #f0f6ff; }

/* ── Work order assignee row ─────────────────────── */
.wo-assignee-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.wo-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
}
.wo-link-text {
  flex: 1;
  color: var(--accent);
  word-break: break-all;
  font-size: 12px;
}

/* ── Work order table (modal + print) ───────────── */
.wo-header { font-size: 12.5px; margin-bottom: 10px; color: var(--text-muted); }
.wo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wo-table th, .wo-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
}
.wo-table th { background: #f9fafb; font-weight: 600; font-size: 12px; }
.wo-table tr:hover td { background: #f0f6ff; }

/* ── Autocomplete station search ────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: #f0f6ff; }
.ac-net  { font-size: 11px; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.ac-num  { font-weight: 600; color: var(--text-dark); white-space: nowrap; }
.ac-addr { color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-terminal { font-size: 11px; color: #6b7280; white-space: nowrap; }
.ac-empty { padding: 10px 14px; color: var(--text-muted); font-size: 13px; }

/* ── Stela info block ────────────────────────────── */
.stela-info-block {
  background: #f0f6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px 6px;
  margin-bottom: 12px;
}
.stela-info-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Settings / Repair categories ───────────────── */
.settings-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.settings-add-panel .card-body { padding: 16px; }
.repair-categories-grid { display: flex; flex-direction: column; gap: 0; }
.repair-cat-block {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.repair-cat-block:last-child { border-bottom: none; }
.repair-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}
.repair-cat-header i { color: var(--accent); width: 16px; text-align: center; }
.work-types-list { padding-left: 24px; }
.work-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.work-type-add {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.work-type-add .form-control { flex: 1; height: 30px; font-size: 12px; }

/* ── Login Screen ───────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px 32px;
  width: 360px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 28px;
  color: var(--text);
}
.login-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.btn-login {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  height: 42px;
  font-size: 15px;
}

/* ── Sidebar logout button ───────────────────────── */
.sidebar-logout {
  margin-left: auto;
  opacity: 0.6;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logout:hover { opacity: 1; color: #f87171; }

/* ── Viewer mode: hide admin-only elements ────────── */
body.viewer-mode .admin-only { display: none !important; }

/* ── Users list in settings ──────────────────────── */
.users-list { padding: 0 16px 4px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.user-row-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.user-row-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.user-row-login { font-size: 11px; color: var(--text-muted); }
.user-role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.user-role-badge.admin   { background: #ede9fe; color: #7c3aed; }
.user-role-badge.viewer  { background: #e0f2fe; color: #0369a1; }

/* ── Admin panel ────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-user-row:hover td { background: rgba(79,140,247,0.04); }
.admin-user-row.admin-row td { background: rgba(124,58,237,0.03); }
.admin-login {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.role-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.role-badge.admin  { background: #ede9fe; color: #7c3aed; }
.role-badge.viewer { background: #e0f2fe; color: #0369a1; }
.perm-chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0369a1;
  margin: 2px 2px 2px 0;
}
.perm-all  { font-size: 12px; color: #7c3aed; font-weight: 600; }
.perm-none { font-size: 12px; color: #9ca3af; }
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

/* Permissions editor in modal */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.perm-group { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.perm-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.perm-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 3px 0;
}
.perm-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }

[data-theme="dark"] .perm-chip  { background: #1e3a5f; color: #7dd3fc; }
[data-theme="dark"] .role-badge.admin  { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .role-badge.viewer { background: #0c2a4a; color: #7dd3fc; }
[data-theme="dark"] .admin-table th { background: var(--surface); }
[data-theme="dark"] .perm-group { background: #0f172a; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .requests-layout { grid-template-columns: 1fr; }
  .stations-layout { grid-template-columns: 1fr; }
  #map { height: 260px; }
}

@media (max-width: 768px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .lighting-layout { grid-template-columns: 1fr; }
  .storage-layout { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
