/* ============================================================
   Fathom IPS — Control Room Dashboard
   Dark industrial theme, desktop-first, 1920x1080 target
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:       #0a0e17;
  --bg-panel:      #0d1220;
  --bg-surface:    #111827;
  --bg-elevated:   #161f30;
  --bg-hover:      #1a2540;
  --bg-active:     #1e2d4a;

  --border:        #1e2d45;
  --border-bright: #2a3d5c;

  --text-primary:  #d4ddf0;
  --text-secondary:#7a90b3;
  --text-muted:    #4a5a78;
  --text-dim:      #2e3d58;

  --cyan:          #00d4aa;
  --cyan-dim:      #007a62;
  --cyan-glow:     rgba(0,212,170,0.15);

  --amber:         #ffaa00;
  --amber-dim:     #7a5200;
  --amber-glow:    rgba(255,170,0,0.15);

  --red:           #ff4444;
  --red-dim:       #7a1c1c;
  --red-glow:      rgba(255,68,68,0.15);

  --green:         #44ff88;
  --green-dim:     #1a6638;
  --green-glow:    rgba(68,255,136,0.15);

  --blue:          #4488ff;
  --blue-dim:      #1c3a7a;
  --blue-glow:     rgba(68,136,255,0.15);

  --orange:        #ff8844;
  --orange-dim:    #7a3a1c;

  --purple:        #aa66ff;
  --purple-dim:    #4a2a7a;

  --severity-critical: var(--red);
  --severity-high:     var(--orange);
  --severity-medium:   var(--amber);
  --severity-low:      var(--blue);
  --severity-info:     var(--text-secondary);

  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'Consolas', 'Cascadia Code', 'SF Mono', 'Fira Code', monospace;

  --sidebar-w: 220px;
  --topbar-h:  52px;
  --radius:    4px;
  --radius-lg: 8px;

  --transition: 120ms ease;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition), min-width var(--transition);
  z-index: 100;
}

#sidebar.collapsed {
  width: 52px;
  min-width: 52px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.brand-icon {
  color: var(--cyan);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity var(--transition);
}

#sidebar.collapsed .brand-text,
#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-badge,
#sidebar.collapsed .sidebar-footer .status-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan);
  white-space: nowrap;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

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

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  position: relative;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--cyan);
  border-left-color: var(--cyan);
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  transition: opacity var(--transition);
  overflow: hidden;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge:empty { display: none; }

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

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--green);
  letter-spacing: 0.08em;
}

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

#topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.topbar-center {
  flex: 1;
  text-align: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
  justify-content: flex-end;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: var(--radius);
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.topbar-breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.appliance-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  font-weight: 600;
}

.ntp-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.ntp-icon { color: var(--text-muted); font-size: 13px; }

.ntp-time { color: var(--text-primary); letter-spacing: 0.05em; }

.ntp-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--green-dim);
  color: var(--green);
}

.ntp-status.unsync {
  background: var(--amber-dim);
  color: var(--amber);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.user-icon { color: var(--cyan); }

/* ── Main Content ─────────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: var(--bg-base);
}

#content.content-map {
  padding: 12px 14px 16px;
}

#content::-webkit-scrollbar { width: 6px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Page Structure ───────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.network-map-page .page-header {
  margin-bottom: 12px;
}

.network-map-page .page-actions {
  justify-content: space-between;
  width: min(100%, 1120px);
  gap: 12px;
}

.network-map-body {
  min-height: calc(100vh - 170px);
}

/* ── Grid Layouts ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* ── Panel ────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.panel-action {
  font-size: 11px;
  color: var(--cyan);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.panel-action:hover { text-decoration: underline; }

.panel-body {
  padding: 16px;
}

.panel-body-flush { padding: 0; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.cyan::before   { background: var(--cyan); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.red::before    { background: var(--red); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.stat-value.cyan   { color: var(--cyan); }
.stat-value.green  { color: var(--green); }
.stat-value.amber  { color: var(--amber); }
.stat-value.red    { color: var(--red); }

.stat-delta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stat-delta.up   { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ── Pulse Dots ───────────────────────────────────────────── */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.pulse-live {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(68,255,136,0.6);
  animation: pulse-live 2s infinite;
}

.pulse-warn {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255,170,0,0.6);
  animation: pulse-warn 2s infinite;
}

.pulse-dead {
  background: var(--text-dim);
  border: 1px solid var(--border);
}

.pulse-alert {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255,68,68,0.6);
  animation: pulse-alert 1s infinite;
}

@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(68,255,136,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(68,255,136,0); }
  100% { box-shadow: 0 0 0 0 rgba(68,255,136,0); }
}

@keyframes pulse-warn {
  0%   { box-shadow: 0 0 0 0 rgba(255,170,0,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(255,170,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,170,0,0); }
}

@keyframes pulse-alert {
  0%   { box-shadow: 0 0 0 0 rgba(255,68,68,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(255,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,68,68,0); }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-primary:hover { background: rgba(0,212,170,0.2); }

.btn-danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255,68,68,0.2); }

.btn-warning {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
}
.btn-warning:hover { background: rgba(255,170,0,0.2); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-bright);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-muted); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 2px 7px; font-size: 10px; }

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

/* ── Tags & Badges ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.tag-cyan    { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,212,170,0.3); }
.tag-green   { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(68,255,136,0.3); }
.tag-amber   { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(255,170,0,0.3); }
.tag-red     { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(255,68,68,0.3); }
.tag-blue    { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(68,136,255,0.3); }
.tag-purple  { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(170,102,255,0.3); }
.tag-gray    { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.tag-orange  { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(255,136,68,0.3); }

/* Severity tags */
.sev-critical { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(255,68,68,0.4); }
.sev-high     { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(255,136,68,0.4); }
.sev-medium   { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(255,170,0,0.4); }
.sev-low      { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(68,136,255,0.4); }
.sev-info     { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Tables ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { color: var(--text-secondary); }
.data-table th.sorted-asc::after  { content: ' ▲'; color: var(--cyan); }
.data-table th.sorted-desc::after { content: ' ▼'; color: var(--cyan); }

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-hover); }

.data-table tr.clickable { cursor: pointer; }
.data-table tr.selected td { background: var(--bg-active); }

.mono { font-family: var(--font-mono); font-size: 12px; }

/* ── Form Controls ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select option { background: var(--bg-panel); color: var(--text-primary); }

.form-textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); }

.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-input-wrap .form-input {
  padding-left: 32px;
}

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--cyan-dim);
  border-color: var(--cyan);
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left var(--transition), background var(--transition);
}

.toggle input:checked + .toggle-track::after {
  left: 20px;
  background: var(--cyan);
}

/* ── Timeline / Events ────────────────────────────────────── */
.event-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
}

.event-feed::-webkit-scrollbar { width: 4px; }
.event-feed::-webkit-scrollbar-track { background: transparent; }
.event-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.event-item:last-child { border-bottom: none; }
.event-item:hover { background: var(--bg-hover); }

.event-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 75px;
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.event-body {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}

.event-source {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Alert Items ──────────────────────────────────────────── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--bg-hover); }
.alert-item.acknowledged { opacity: 0.5; }

.alert-sev-bar {
  width: 3px;
  border-radius: 2px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 40px;
}

.alert-sev-bar.critical { background: var(--red); }
.alert-sev-bar.high     { background: var(--orange); }
.alert-sev-bar.medium   { background: var(--amber); }
.alert-sev-bar.low      { background: var(--blue); }
.alert-sev-bar.info     { background: var(--text-muted); }

.alert-content { flex: 1; }

.alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.alert-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-meta span { display: flex; align-items: center; gap: 4px; }

.alert-actions { display: flex; align-items: flex-start; gap: 6px; flex-shrink: 0; }

/* ── Progress / Meter ─────────────────────────────────────── */
.meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.meter-bar {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.meter-fill.cyan   { background: var(--cyan); }
.meter-fill.green  { background: var(--green); }
.meter-fill.amber  { background: var(--amber); }
.meter-fill.red    { background: var(--red); }

/* ── Flow Rate Indicators ─────────────────────────────────── */
.flow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.flow-row:last-child { border-bottom: none; }

.flow-tier {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  width: 50px;
  flex-shrink: 0;
}

.flow-tier.iron   { color: var(--orange); }
.flow-tier.bronze { color: var(--amber); }
.flow-tier.silver { color: var(--text-secondary); }

.flow-bar-wrap { flex: 1; }

.flow-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  width: 90px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Operations Overview ─────────────────────────────────── */
.ops-empty {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text-secondary);
}

.ops-issue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ops-issue-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-bright);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0));
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ops-issue-card.critical { border-left-color: var(--red); background: linear-gradient(180deg, rgba(255,68,68,0.08), rgba(255,68,68,0.02)); }
.ops-issue-card.warn { border-left-color: var(--amber); background: linear-gradient(180deg, rgba(255,170,0,0.08), rgba(255,170,0,0.02)); }
.ops-issue-card.info { border-left-color: var(--cyan); background: linear-gradient(180deg, rgba(0,212,170,0.08), rgba(0,212,170,0.02)); }
.ops-issue-card.healthy { border-left-color: var(--green); }

.ops-issue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ops-issue-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ops-issue-meta,
.ops-issue-evidence,
.ops-area-meta,
.ops-localization-meta,
.ops-summary-note {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.ops-issue-body,
.ops-area-summary,
.ops-localization-text,
.ops-callout-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.ops-issue-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-check-item {
  position: relative;
  padding-left: 16px;
  color: var(--text-secondary);
  font-size: 12px;
}

.ops-check-item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.ops-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ops-summary-card {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px;
}

.ops-summary-label,
.ops-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.ops-summary-value {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.ops-summary-callout {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ops-outage-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 68, 68, 0.34);
  background: linear-gradient(180deg, rgba(255, 68, 68, 0.14), rgba(255, 68, 68, 0.04));
}

.ops-outage-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.ops-outage-text {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.ops-outage-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.ops-area-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ops-area-card {
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-bright);
  background: var(--bg-surface);
  color: inherit;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.ops-area-card:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
}

.ops-area-card.critical { border-top-color: var(--red); }
.ops-area-card.warn { border-top-color: var(--amber); }
.ops-area-card.info { border-top-color: var(--cyan); }
.ops-area-card.healthy { border-top-color: var(--green); }

.ops-area-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ops-area-name,
.ops-localization-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.ops-area-issue {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ops-localization-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ops-localization-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ops-localization-card.critical { border-left-color: var(--red); }
.ops-localization-card.healthy { border-left-color: var(--green); }
.ops-localization-card.info { border-left-color: var(--cyan); }

.ops-detail-headline {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.ops-detail-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ops-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ops-detail-metric {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-detail-metric-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.ops-detail-metric-value {
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.ops-detail-callout {
  margin-top: 14px;
  padding: 12px;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: rgba(255,170,0,0.08);
  color: var(--text-primary);
  line-height: 1.5;
}

.ops-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ops-detail-note {
  margin-top: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 13px;
}

/* ── Network Map ──────────────────────────────────────────── */
#network-map-svg {
  width: 100%;
  min-height: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius);
  cursor: grab;
  display: block;
}

#network-map-svg:active { cursor: grabbing; }

.map-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.map-canvas {
  flex: 1;
  overflow: auto;
  background: var(--bg-surface);
  padding: 16px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.map-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.map-inferred-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 170, 0.32);
  background: rgba(0, 212, 170, 0.12);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-inference-note {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(74, 90, 120, 0.34);
  background: rgba(11, 19, 34, 0.78);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.map-inference-note strong {
  color: var(--text-primary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* SVG node/edge styles */
.node-circle {
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.15s;
}

.node-circle:hover { opacity: 0.85; filter: brightness(1.2); }

.node-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-primary);
  pointer-events: none;
  text-anchor: middle;
}

.node-label-inline {
  font-size: 11px;
  dominant-baseline: middle;
}

.node-sublabel {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: rgba(181, 194, 219, 0.76);
  pointer-events: none;
  text-anchor: middle;
}

.map-column-band {
  backdrop-filter: blur(6px);
}

.edge-line {
  stroke-width: 1.5;
  stroke-opacity: 0.5;
  fill: none;
}

.edge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
}

.map-mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
}

.floorplan-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.3fr) 120px 120px auto;
  gap: 12px;
  align-items: end;
}

.floorplan-create-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.floorplan-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.floorplan-field-sm {
  max-width: 120px;
}

.floorplan-field-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.floorplan-form-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.floorplan-empty-wrap {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floorplan-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  width: 100%;
}

.floorplan-action-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.floorplan-action-cluster-right {
  margin-left: auto;
}

.floorplan-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.floorplan-inline-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floorplan-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(74, 90, 120, 0.7);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.86);
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floorplan-inline-toggle input {
  accent-color: var(--cyan);
}

.floorplan-map-select {
  min-width: min(420px, 60vw);
}

.floorplan-map-display-select {
  min-width: 160px;
}

.floorplan-shell {
  display: grid;
  grid-template-columns: clamp(260px, 18vw, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.floorplan-sidebar,
.floorplan-stage {
  min-width: 0;
}

.floorplan-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floorplan-panel {
  overflow: hidden;
}

.floorplan-search-wrap {
  margin-bottom: 12px;
}

.floorplan-geo-panel {
  margin-top: 0;
}

.floorplan-area-panel {
  margin-bottom: 0;
}

.floorplan-geo-panel-draft {
  margin-top: 0;
}

.floorplan-geo-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.floorplan-draft-image-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 90, 120, 0.6);
  border-radius: 10px;
  background: rgba(14, 22, 38, 0.72);
  color: var(--text-secondary);
  font-size: 12px;
}

.floorplan-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.floorplan-checkbox input {
  accent-color: var(--blue);
}

.floorplan-geo-hint {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.floorplan-geo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.floorplan-tray-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 390px);
  overflow: auto;
  padding-right: 4px;
}

.floorplan-area-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.floorplan-area-card {
  padding: 12px 14px;
  border: 1px solid rgba(74, 90, 120, 0.7);
  border-left: 4px solid var(--floorplan-area-status);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, 0.92);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.floorplan-area-card.empty {
  opacity: 0.72;
}

.floorplan-area-card:hover {
  border-color: rgba(68, 136, 255, 0.4);
  transform: translateY(-1px);
}

.floorplan-area-card.focused {
  border-color: rgba(0, 212, 170, 0.52);
  box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.18);
  background: rgba(10, 19, 34, 0.96);
}

.floorplan-area-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.floorplan-area-card-title {
  font-weight: 700;
  color: var(--text-primary);
}

.floorplan-area-card-count {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.floorplan-area-card-meta {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.floorplan-area-card-issue {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.floorplan-inline-empty {
  padding: 24px 12px;
}

.floorplan-asset-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  cursor: grab;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.floorplan-asset-card:hover {
  border-color: rgba(68, 136, 255, 0.4);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.floorplan-asset-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.floorplan-asset-status {
  width: 8px;
  height: 42px;
  border-radius: 999px;
}

.floorplan-asset-copy {
  min-width: 0;
}

.floorplan-asset-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floorplan-asset-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floorplan-asset-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(68, 136, 255, 0.12);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.floorplan-stage-panel {
  min-height: calc(100vh - 170px);
  display: flex;
  flex-direction: column;
}

.floorplan-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  flex-wrap: wrap;
  width: 100%;
}

.floorplan-stage-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 280px;
}

.floorplan-stage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.floorplan-stage-stat {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 90, 120, 0.5);
  background: rgba(17, 24, 39, 0.72);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.floorplan-stage-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  flex-wrap: wrap;
}

.floorplan-stage-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(74, 90, 120, 0.36);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.3), rgba(17, 24, 39, 0.12));
}

.floorplan-stage-note {
  max-width: 440px;
  line-height: 1.5;
  color: var(--text-muted);
  font-size: 11px;
}

.floorplan-stage-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.floorplan-board-wrap {
  padding: 10px;
  overflow: hidden;
  flex: 1 1 auto;
  background:
    radial-gradient(circle at top left, rgba(68, 136, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%),
    var(--bg-panel);
}

.floorplan-board {
  position: relative;
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(74, 90, 120, 0.8);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(74, 90, 120, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(74, 90, 120, 0.14) 1px, transparent 1px),
    var(--bg-surface);
  background-size: 24px 24px, 24px 24px, auto;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: grab;
  user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
}

.floorplan-board.panning {
  cursor: grabbing;
}

.floorplan-board-scene {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.floorplan-board.dragover {
  border-color: rgba(0, 212, 170, 0.8);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.16);
}

.floorplan-board-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.floorplan-board-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(74, 90, 120, 0.6);
  background: rgba(8, 15, 28, 0.82);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(8px);
}

.floorplan-board-control,
.floorplan-board-zoom {
  border: 1px solid rgba(74, 90, 120, 0.56);
  background: rgba(17, 24, 39, 0.92);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floorplan-board-control {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.floorplan-board-zoom {
  min-width: 58px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(8px);
}

.floorplan-board-control:hover,
.floorplan-board-zoom:hover {
  border-color: rgba(68, 136, 255, 0.5);
  color: var(--cyan);
}

.floorplan-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.floorplan-base-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #0b1220;
  overflow: hidden;
}

.floorplan-base-tile {
  position: absolute;
  display: block;
  object-fit: fill;
  user-select: none;
}

.floorplan-base-layer-google_satellite {
  filter: saturate(1.04) contrast(1.02);
}

.floorplan-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  background: linear-gradient(180deg, rgba(74, 90, 120, 0.14), rgba(15, 23, 42, 0.3));
  z-index: 0;
}

.floorplan-geo-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.floorplan-geo-raster {
  position: absolute;
  display: block;
  object-fit: fill;
  opacity: 0.94;
  transform-origin: center;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(8, 15, 28, 0.18);
}

.floorplan-area-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.floorplan-geo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.floorplan-geo-shape {
  vector-effect: non-scaling-stroke;
}

.floorplan-geo-line,
.floorplan-geo-polygon {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floorplan-geo-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.floorplan-geo-marker::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.16);
}

.floorplan-geo-marker-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 15, 28, 0.84);
  border: 1px solid rgba(74, 90, 120, 0.54);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.floorplan-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.floorplan-area-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 0;
  max-width: min(160px, 18vw);
  padding: 6px 8px;
  border: 1px solid rgba(74, 90, 120, 0.72);
  border-radius: 14px;
  background: rgba(8, 15, 28, 0.78);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.22);
  border-left: 4px solid var(--floorplan-area-status);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.floorplan-area-badge-ops {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  max-width: none;
  justify-content: center;
  align-items: center;
  gap: 0;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.32);
}

.floorplan-area-badge.empty {
  opacity: 0.76;
}

.floorplan-area-badge:hover {
  border-color: rgba(68, 136, 255, 0.4);
  transform: translate(-50%, -50%) translateY(-1px);
}

.floorplan-area-badge.focused {
  background: rgba(8, 15, 28, 0.94);
  border-color: rgba(0, 212, 170, 0.52);
  box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.18), 0 10px 20px rgba(2, 6, 23, 0.26);
}

.floorplan-area-badge-name {
  display: block;
  min-width: 0;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floorplan-area-badge-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.floorplan-area-badge-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.floorplan-area-badge-summary {
  display: block;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floorplan-area-badge-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.floorplan-area-badge-ops .floorplan-area-badge-count {
  position: absolute;
  right: -3px;
  bottom: -2px;
  min-width: 18px;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.28);
}

.floorplan-area-badge-count-red {
  background: rgba(255, 68, 68, 0.18);
  color: #ffd1d1;
}

.floorplan-area-badge-count-amber {
  background: rgba(255, 170, 0, 0.18);
  color: #ffe7bf;
}

.floorplan-area-badge-count-cyan {
  background: rgba(0, 212, 170, 0.18);
  color: #c5fff0;
}

.floorplan-area-badge-count-green {
  background: rgba(64, 224, 128, 0.16);
  color: #d7ffe7;
}

.floorplan-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 110px;
  max-width: 148px;
  padding: 6px 8px;
  border: 1px solid rgba(74, 90, 120, 0.72);
  border-radius: 14px;
  background: rgba(8, 15, 28, 0.88);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.28);
  cursor: grab;
  z-index: 2;
  pointer-events: auto;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.floorplan-node-ops {
  cursor: pointer;
}

.floorplan-node-exploded {
  min-width: 98px;
  max-width: 132px;
  padding: 5px 7px;
  box-shadow: 0 18px 28px rgba(2, 6, 23, 0.42);
}

.floorplan-node-exploded .floorplan-node-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 9px;
}

.floorplan-node-exploded .floorplan-node-name {
  font-size: 9px;
}

.panel-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ops-farm-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ops-farm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ops-farm-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ops-farm-kicker {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ops-farm-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.ops-farm-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.floorplan-board-wrap-ops {
  padding: 0;
  border-radius: 18px;
}

.floorplan-board-ops {
  min-height: 420px;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 170, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(8, 15, 28, 0.06), rgba(8, 15, 28, 0.18)),
    var(--bg-surface);
}

.ops-farm-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.ops-farm-focus {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(74, 90, 120, 0.56);
  background: linear-gradient(180deg, rgba(74, 90, 120, 0.12), rgba(15, 23, 42, 0.2));
}

.ops-farm-focus-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.ops-farm-focus-text {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.ops-farm-focus-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.ops-focus-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.ops-focus-asset-card {
  padding: 12px 14px;
  border: 1px solid rgba(74, 90, 120, 0.56);
  border-radius: 14px;
  background: rgba(10, 17, 30, 0.9);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.ops-focus-asset-card:hover {
  border-color: rgba(68, 136, 255, 0.44);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.24);
}

.ops-focus-asset-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ops-focus-asset-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex: 0 0 28px;
}

.ops-focus-asset-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ops-focus-asset-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ops-focus-asset-meta {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.ops-focus-asset-detail {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.floorplan-node:hover {
  border-color: rgba(68, 136, 255, 0.5);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.46);
}

.floorplan-node.dragging {
  cursor: grabbing;
  z-index: 4;
}

.floorplan-node.saving {
  opacity: 0.7;
}

.floorplan-node::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--floorplan-status);
  border-radius: 18px;
  opacity: 0.8;
  pointer-events: none;
}

.floorplan-node-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--floorplan-zone);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.floorplan-node-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.floorplan-node-name {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floorplan-node-meta {
  display: none;
}

.floorplan-drop-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(8, 15, 28, 0.78);
  border: 1px solid rgba(74, 90, 120, 0.5);
  color: var(--text-secondary);
  font-size: 11px;
  backdrop-filter: blur(8px);
  z-index: 4;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .floorplan-create-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .floorplan-form-actions {
    justify-content: flex-start;
  }

  .floorplan-stage-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  #content.content-map {
    padding: 12px;
  }

  .ops-farm-toolbar,
  .ops-farm-focus {
    flex-direction: column;
    align-items: stretch;
  }

  .ops-farm-toolbar-actions,
  .ops-farm-focus-meta {
    justify-content: flex-start;
  }

  .floorplan-shell {
    grid-template-columns: 1fr;
  }

  .floorplan-stage-note {
    max-width: none;
  }

  .floorplan-tray-list {
    max-height: 280px;
  }

  .floorplan-geo-form {
    grid-template-columns: 1fr 1fr;
  }

  .floorplan-map-select {
    min-width: 0;
    width: 100%;
  }

  .floorplan-stage-footer {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .panel-header-actions {
    display: none;
  }

  .floorplan-area-badge-ops {
    max-width: min(190px, 48vw);
  }

  .floorplan-board-ops {
    min-height: 340px;
  }

  .floorplan-create-form,
  .floorplan-geo-form {
    grid-template-columns: 1fr;
  }

  .floorplan-inline-field {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .floorplan-inline-toggle {
    width: 100%;
    justify-content: center;
  }

  .floorplan-map-display-select {
    min-width: 0;
    width: 100%;
  }
}

/* ── Tree View (Hierarchy) ────────────────────────────────── */
.tree-node {
  padding: 0;
}

.tree-node-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.tree-node-row:hover { background: var(--bg-hover); }

.tree-toggle {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
  border-radius: 2px;
  transition: transform var(--transition);
}

.tree-toggle.open { transform: rotate(90deg); }

.tree-children {
  padding-left: 20px;
  border-left: 1px solid var(--border);
  margin-left: 18px;
  overflow: hidden;
}

.tree-children.collapsed { display: none; }

.tree-node-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.tree-node-meta {
  display: flex;
  gap: 10px;
  margin-left: auto;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.tree-node-type {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ── Mesh Peer Table ──────────────────────────────────────── */
.link-quality {
  display: flex;
  align-items: center;
  gap: 3px;
}

.lq-bar {
  width: 4px;
  height: 12px;
  border-radius: 1px;
  background: var(--border);
}

.lq-bar.active { background: var(--cyan); }

/* ── Forensic Workbench ───────────────────────────────────── */
.workbench-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.workbench-result {
  padding: 16px;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.snapshot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.snapshot-card-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.snapshot-card-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.settings-row-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-row-control { flex-shrink: 0; }

/* ── Mode Badge ───────────────────────────────────────────── */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-badge.learning {
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  color: var(--blue);
}

.mode-badge.operating {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: var(--green);
}

/* ── Detail View ──────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

.detail-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-key  { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.detail-val  { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); word-break: break-all; }

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.empty-text { font-size: 13px; }

/* ── Loading Skeleton ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toast-in 0.2s ease;
  max-width: 320px;
}

.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
.toast.warn    { border-color: var(--amber); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Asset Detail Back Button ─────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);
}

.back-link:hover { color: var(--cyan); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 52px; }
  #sidebar { width: 52px; min-width: 52px; }
  .brand-text, .nav-label, .nav-badge, .sidebar-footer .status-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
  .grid-2, .grid-2-1, .grid-1-2, .grid-3 { grid-template-columns: 1fr; }
  .ops-summary-grid { grid-template-columns: 1fr; }
  .ops-detail-metrics { grid-template-columns: 1fr; }
  .ops-outage-banner { flex-direction: column; }
  .ops-outage-meta { white-space: normal; }
}

@media (max-width: 600px) {
  #content { padding: 12px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .appliance-name { display: none; }
  .ops-area-board { grid-template-columns: 1fr; }
  .ops-issue-head,
  .ops-area-top { flex-direction: column; }
  .ops-issue-actions { width: 100%; }
  .ops-issue-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Miscellaneous Utility ────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.text-mono { font-family: var(--font-mono); }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-select { user-select: none; }

/* ================================================================
   Setup Wizard
   ================================================================ */

/* ── Full-screen backdrop ─────────────────────────────────── */
.wizard-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
  overflow-y: auto;
}

/* ── Card ─────────────────────────────────────────────────── */
.wizard-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,170,0.06);
  overflow: hidden;
  animation: wizard-card-in 0.3s ease;
}

@keyframes wizard-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card header ──────────────────────────────────────────── */
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.wizard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wizard-brand-icon {
  color: var(--cyan);
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 12px var(--cyan-dim);
}

.wizard-brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.wizard-step-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── Progress bar & step dots ─────────────────────────────── */
.wizard-progress {
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.wizard-progress-track {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-dim));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.wizard-step-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: default;
  flex-shrink: 0;
}

.wizard-dot.active {
  border-color: var(--cyan);
  background: rgba(0,212,170,0.12);
  color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,212,170,0.3);
}

.wizard-dot.done {
  border-color: var(--green);
  background: rgba(68,255,136,0.1);
  color: var(--green);
}

/* ── Body ─────────────────────────────────────────────────── */
.wizard-body {
  padding: 28px 24px 20px;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.wizard-body::-webkit-scrollbar { width: 4px; }
.wizard-body::-webkit-scrollbar-track { background: transparent; }
.wizard-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Footer ───────────────────────────────────────────────── */
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  gap: 12px;
}

/* ── Welcome step ─────────────────────────────────────────── */
.wizard-step-welcome {
  text-align: center;
  padding: 8px 0;
}

.wizard-welcome-icon {
  font-size: 48px;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(0,212,170,0.4);
  margin-bottom: 16px;
  line-height: 1;
}

.wizard-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.wizard-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 24px;
}

.wizard-sysinfo {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: left;
  margin-bottom: 20px;
}

.wizard-sysinfo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.wizard-sysinfo-row:last-child { border-bottom: none; }

.wizard-sysinfo-label {
  color: var(--text-muted);
  width: 140px;
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-sysinfo-value {
  color: var(--text-primary);
}

.wizard-sysinfo-iface {
  padding-left: 8px;
}

.wizard-sysinfo-ifname {
  color: var(--cyan);
  min-width: 80px;
}

.wizard-sysinfo-ifmac {
  flex: 1;
  font-size: 11px;
}

.wizard-sysinfo-ifstatus {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wizard-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Form steps ───────────────────────────────────────────── */
.wizard-step-form {
  max-width: 560px;
}

.wizard-step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.wizard-step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.wizard-field {
  margin-bottom: 20px;
}

.wizard-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}

.wizard-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.wizard-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.wizard-input:focus {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.12);
}

.wizard-input-sm {
  width: 120px;
}

.wizard-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Password strength ────────────────────────────────────── */
.wizard-strength-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.wizard-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.wizard-strength-label {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
  min-height: 16px;
  letter-spacing: 0.04em;
}

/* ── Network mode toggle ──────────────────────────────────── */
.wizard-toggle-group {
  display: flex;
  gap: 12px;
}

.wizard-toggle-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: left;
}

.wizard-toggle-btn:hover {
  border-color: var(--border-bright);
  background: var(--bg-elevated);
}

.wizard-toggle-btn.active {
  border-color: var(--cyan);
  background: rgba(0,212,170,0.06);
}

.wizard-toggle-icon {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
}

.wizard-toggle-btn.active .wizard-toggle-icon { color: var(--cyan); }

.wizard-toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.wizard-toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Interface table ──────────────────────────────────────── */
.wizard-iface-table {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
}

.wizard-iface-header,
.wizard-iface-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.7fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.wizard-iface-header {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

.wizard-iface-row {
  border-bottom: 1px solid var(--border);
}

.wizard-iface-row:last-child { border-bottom: none; }

.wizard-iface-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-style: italic;
  padding: 16px 12px;
  text-align: center;
}

/* ── Interface status dot ─────────────────────────────────── */
.wizard-dot-inline {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}

.wizard-dot-inline.up      { background: var(--green); box-shadow: 0 0 4px var(--green); }
.wizard-dot-inline.down    { background: var(--text-dim); }

/* ── Select (interface role) ──────────────────────────────── */
.wizard-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  height: 28px;
  outline: none;
  cursor: pointer;
  width: 100%;
  transition: border-color var(--transition);
}

.wizard-select:focus { border-color: var(--cyan-dim); }

/* ── Capture mode radio cards ─────────────────────────────── */
.wizard-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.wizard-radio-card:hover { border-color: var(--border-bright); }

.wizard-radio-card.active {
  border-color: var(--cyan);
  background: rgba(0,212,170,0.06);
}

.wizard-radio-card input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--cyan);
  flex-shrink: 0;
}

.wizard-radio-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.wizard-radio-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Review summary ───────────────────────────────────────── */
.wizard-review {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.wizard-review-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.wizard-review-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.wizard-review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.wizard-review-row:last-child { border-bottom: none; }

.wizard-review-row span:first-child { color: var(--text-secondary); }
.wizard-review-row span:last-child  { color: var(--text-primary); }

/* ── Buttons ──────────────────────────────────────────────── */
.wizard-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  height: 38px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

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

.wizard-btn-primary {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--bg-base);
  color: #fff;
}

.wizard-btn-primary:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg-base);
  box-shadow: 0 0 12px rgba(0,212,170,0.3);
}

.wizard-btn-apply {
  background: var(--green-dim);
  border-color: var(--green);
  color: #fff;
}

.wizard-btn-apply:hover:not(:disabled) {
  background: var(--green);
  color: var(--bg-base);
  box-shadow: 0 0 12px rgba(68,255,136,0.3);
}

.wizard-btn-ghost {
  background: transparent;
  border-color: var(--border-bright);
  color: var(--text-secondary);
}

.wizard-btn-ghost:hover:not(:disabled) {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ── Error banner ─────────────────────────────────────────── */
.wizard-error-banner {
  background: rgba(255,68,68,0.1);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 12px;
  padding: 9px 14px;
  margin: 0 24px 12px;
  display: none;
}

/* ── Apply status ─────────────────────────────────────────── */
.wizard-applying {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

.wizard-error-box {
  background: rgba(255,68,68,0.08);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 12px;
  padding: 12px 16px;
  margin-top: 8px;
}

/* ── Success state ────────────────────────────────────────── */
.wizard-success {
  text-align: center;
  padding: 20px;
}

.wizard-success-icon {
  font-size: 40px;
  color: var(--green);
  text-shadow: 0 0 20px rgba(68,255,136,0.4);
  margin-bottom: 12px;
}

.wizard-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.wizard-success-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.wizard-success-desc code {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 12px;
}

/* ── TOML fallback ────────────────────────────────────────── */
.wizard-toml-fallback {
  background: var(--bg-surface);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 8px;
}

.wizard-toml-fallback-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 6px;
}

.wizard-toml-fallback-title code {
  font-family: var(--font-mono);
  font-size: 12px;
}

.wizard-toml-fallback-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.wizard-toml-textarea {
  width: 100%;
  height: 220px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
  display: block;
}

/* ── Login Screen ────────────────────────────────────────── */
.login-backdrop {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 170, 0.08), transparent 32%),
    radial-gradient(circle at bottom right, rgba(68, 136, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #08101c 0%, #070c15 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 28px;
}
.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 380px);
  gap: 20px;
  align-items: stretch;
}
.login-ops-panel,
.login-card {
  background: rgba(10, 17, 30, 0.94);
  border: 1px solid rgba(44, 64, 96, 0.9);
  border-radius: 16px;
}
.login-ops-panel {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: inset 0 1px 0 rgba(133, 160, 202, 0.06);
}
.login-kicker {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.login-ops-title {
  max-width: 14ch;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 700;
  color: var(--text-primary);
}
.login-ops-copy {
  max-width: 64ch;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.login-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.login-ops-metric {
  min-height: 84px;
  padding: 14px 15px;
  background: linear-gradient(180deg, rgba(15, 24, 41, 0.92), rgba(9, 15, 27, 0.96));
  border: 1px solid rgba(37, 54, 84, 0.95);
  border-radius: 12px;
}
.login-ops-label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.login-ops-value {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.login-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-status-pill {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  box-shadow: 0 0 0 4px rgba(122, 144, 179, 0.12);
}
.login-status-pill.info {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(68, 136, 255, 0.14);
}
.login-status-pill.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(68, 255, 136, 0.14);
}
.login-status-pill.warn {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 170, 0, 0.14);
}
.login-status-pill.critical {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 68, 68, 0.14);
}
.login-ops-note {
  margin-top: auto;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(11, 19, 34, 0.96), rgba(8, 13, 24, 0.96));
  border: 1px solid rgba(36, 53, 82, 0.95);
  border-radius: 12px;
}
.login-ops-note-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.login-ops-checks {
  display: grid;
  gap: 10px;
}
.login-ops-check {
  position: relative;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.login-ops-check::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.14);
}
.login-card {
  padding: 34px 30px 28px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  align-self: center;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.login-brand-icon {
  font-size: 32px;
}
.login-brand-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}
.login-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.login-card-copy {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.login-message {
  color: var(--amber);
  font-size: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.18);
  border-radius: 10px;
}
.login-field {
  margin-bottom: 16px;
}
.login-field label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.login-field .form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
}
.login-btn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}
.login-card-foot {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.login-error {
  color: var(--red, #ff4444);
  font-size: 12px;
  margin-top: 12px;
  min-height: 18px;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-ops-title {
    max-width: 18ch;
    font-size: 30px;
  }
}

@media (max-width: 640px) {
  .login-backdrop {
    padding: 16px;
  }
  .login-ops-panel,
  .login-card {
    border-radius: 14px;
  }
  .login-ops-panel {
    padding: 22px 20px;
  }
  .login-card {
    padding: 24px 20px 22px;
  }
  .login-ops-title {
    font-size: 24px;
  }
  .login-ops-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Logout button ───────────────────────────────────────── */
.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  transition: color 0.15s, border-color 0.15s;
}
.btn-logout:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

/* ── Responsive (wizard) ─────────────────────────────────── */
@media (max-width: 600px) {
  .wizard-backdrop { padding: 12px; align-items: flex-start; }
  .wizard-body { max-height: none; }
  .wizard-toggle-group { flex-direction: column; }
  .wizard-iface-header,
  .wizard-iface-row { grid-template-columns: 1fr 1fr; }
  .wizard-iface-header span:nth-child(2),
  .wizard-iface-row span:nth-child(2) { display: none; }
}
