/* ColdAisle — modern dark operations UI */
:root {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #1a2332;
  --surface-3: #243044;
  --border: #2a3648;
  --text: #e5eef7;
  --muted: #8b9bb0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: #1e3a5f;
  --success: #22c55e;
  --success-dim: #14532d;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-w: 260px;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #93c5fd; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: grid; place-items: center; font-size: 1.1rem;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { color: var(--muted); font-size: .75rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .5rem .75rem; }
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; border-radius: 8px;
  color: var(--muted); margin-bottom: 1px; font-size: .9rem;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: #93c5fd; font-weight: 600; }
.nav-item.nav-sub {
  padding-left: 2.15rem;
  font-size: .82rem;
  min-height: 2rem;
  opacity: .9;
}
.nav-item.nav-sub .nav-icon { width: 0; margin: 0; }
.nav-icon { width: 1.25rem; text-align: center; opacity: .9; flex-shrink: 0; }

.nav-group { margin: .15rem 0 .35rem; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: .4rem .75rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 8px;
}
.nav-group-toggle:hover { color: var(--text); background: var(--surface-2); }
.nav-group.has-active > .nav-group-toggle { color: #93c5fd; }
.nav-group-chevron {
  width: .55rem; height: .55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .22s ease;
  opacity: .7;
}
.nav-group.is-open > .nav-group-toggle .nav-group-chevron {
  transform: rotate(45deg);
}
.nav-group-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
}
.nav-group.is-open > .nav-group-body { grid-template-rows: 1fr; }
.nav-group-body-inner { overflow: hidden; min-height: 0; }

.help-tip-btn {
  flex-shrink: 0;
  width: 1.55rem; height: 1.55rem;
  margin-left: .15rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.help-tip-btn:hover,
.help-tip-btn[aria-expanded="true"] {
  color: #93c5fd;
  border-color: var(--accent);
  background: var(--accent-dim);
}
.help-drawer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.help-drawer:not([hidden]) { pointer-events: auto; }
.help-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 12, 20, .45);
  opacity: 0;
  transition: opacity .2s ease;
}
.help-drawer.is-open .help-drawer-backdrop { opacity: 1; }
.help-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(26rem, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.help-drawer.is-open .help-drawer-panel { transform: translateX(0); }
.help-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.help-drawer-header h2 { margin: 0; font-size: 1.05rem; }
.help-drawer-body { padding: 1rem 1.15rem 1.5rem; overflow-y: auto; flex: 1; }
.help-drawer-body h3 { font-size: .85rem; margin: 1rem 0 .4rem; }
.help-drawer-body > :first-child { margin-top: 0; }
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .5rem;
}
.user-chip { display: flex; align-items: center; gap: .65rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-3); display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
}
.user-chip strong { display: block; font-size: .85rem; }
.user-chip small { color: var(--muted); font-size: .75rem; }

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 36%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

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

.topbar-find {
  margin: 0 .25rem 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: var(--muted);
}
.topbar-find kbd,
.sidebar-find kbd,
.gs-palette-hint kbd {
  font-family: var(--mono);
  font-size: .7rem;
  line-height: 1;
  padding: .18rem .35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
}
.sidebar-find {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: .35rem .75rem .15rem;
  padding: .45rem .65rem;
  width: calc(100% - 1.5rem);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  text-align: left;
}
.sidebar-find:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, .45);
}
.sidebar-collapsed .sidebar-find-label,
.sidebar-collapsed .sidebar-find kbd { display: none; }
.sidebar-collapsed .sidebar-find {
  width: auto;
  margin: .35rem auto;
  padding: .45rem;
  justify-content: center;
}
.sidebar-collapsed .sidebar-find::before { content: '⌕'; font-size: 1.1rem; color: var(--text); }
body.gs-palette-open { overflow: hidden; }
.gs-palette {
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 2rem;
}
.gs-palette.is-open {
  display: flex;
}
.gs-palette[hidden] {
  display: none !important;
}
.gs-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .62);
}
.gs-palette-card {
  position: relative;
  width: min(36rem, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
  padding: .75rem .75rem .5rem;
}
.gs-palette-head {
  position: absolute;
  top: .35rem;
  right: .4rem;
  z-index: 1;
}
.gs-palette-head .modal-close {
  pointer-events: auto;
}
.gs-palette-input {
  width: 100%;
  font-size: 1.05rem;
  padding: .65rem .8rem;
}
.gs-palette-hint {
  margin: .45rem .15rem .25rem;
  font-size: .75rem;
  color: var(--muted);
}
.gs-palette-results {
  position: static;
  max-height: min(55vh, 24rem);
  overflow: auto;
  margin-top: .35rem;
  border-top: 1px solid var(--border);
  box-shadow: none;
  background: transparent;
}
.topbar-search-panel {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + .35rem);
  max-height: min(70vh, 28rem);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  z-index: 50;
  padding: .35rem 0;
}
.gs-group { padding: .15rem 0 .35rem; }
.gs-group + .gs-group { border-top: 1px solid var(--border); }
.gs-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .35rem .85rem .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.gs-group-head a { font-weight: 600; text-transform: none; letter-spacing: 0; font-size: .75rem; }
.gs-hit {
  display: block;
  padding: .4rem .85rem;
  color: var(--text);
  text-decoration: none;
}
.gs-hit:hover,
.gs-hit.is-active { background: var(--accent-dim); color: #e2e8f0; }
.gs-hit strong { display: block; font-size: .88rem; font-weight: 600; }
.gs-hit span { display: block; font-size: .75rem; color: var(--muted); }
.gs-empty, .gs-hint {
  padding: .7rem .9rem;
  font-size: .85rem;
  color: var(--muted);
}
.list-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.list-search-form .form-control { width: 18rem; max-width: 100%; }
.list-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: .65rem .85rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .85rem;
  color: var(--muted);
}
.list-pager-meta,
.list-pager-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .55rem;
}
.list-pager-per a,
.list-pager-per strong { margin: 0 .15rem; }
.list-pager-page {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 .35rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.list-pager-page.is-active {
  background: var(--accent-dim);
  color: #dbeafe;
  font-weight: 700;
}
.list-pager-page:hover { background: var(--surface-3); }
.list-pager-ellipsis { color: var(--muted); padding: 0 .15rem; }
.card-body.flush > .list-pager { border-top: 1px solid var(--border); }
.list-pager-standalone {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 1rem;
}
@media (max-width: 900px) {
  .page-title { max-width: 28%; }
  .topbar-search { max-width: none; }
  .topbar-search-kbd { display: none; }
  .topbar-search-input { padding-right: .65rem; }
}
@media (max-width: 640px) {
  .page-title { display: none; }
  .list-search-form .form-control { width: 100%; }
}
.notif-badge {
  background: var(--danger); color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; padding: 0 .4rem;
}
.content { padding: 1.25rem 1.5rem 2rem; flex: 1; }

/* Users: presence */
.user-online-badge {
  margin-left: .35rem;
  vertical-align: middle;
  font-size: .7rem;
  letter-spacing: .02em;
}

/* Nested optional block inside a settings card (e.g. SMB backup) */
.settings-details {
  margin-top: 1.15rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border, #334155);
}
.settings-details-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  user-select: none;
}
.settings-details-summary::-webkit-details-marker { display: none; }
.settings-details-summary::before {
  content: '';
  width: .45rem;
  height: .45rem;
  border-right: 2px solid var(--muted, #94a3b8);
  border-bottom: 2px solid var(--muted, #94a3b8);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.settings-details[open] > .settings-details-summary::before {
  transform: rotate(45deg);
  margin-top: .15rem;
}
.settings-details-body {
  margin-top: .85rem;
}

/* Settings: collapsible section cards */
.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  margin: 0 0 .85rem;
  padding: .5rem .7rem;
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: var(--settings-sticky-top, 3.55rem);
  z-index: 28;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.settings-toolbar-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}
.settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  flex: 1 1 16rem;
  min-width: 0;
}
.settings-jump-chip {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}
.settings-jump-chip:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, .45);
  background: var(--accent-dim);
}
.settings-jump-chip.is-active {
  color: #dbeafe;
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, .7);
  box-shadow: inset 3px 0 0 0 var(--accent);
}
.settings-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-left: auto;
}
.settings-sections > .card {
  transition: box-shadow .15s ease;
  scroll-margin-top: var(--settings-scroll-pad, 8.5rem);
}
@media (max-width: 800px) {
  .settings-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch;
  }
}

/* Ticketing (ITSM) vendor picker */
.itsm-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .35rem 0 .15rem;
}
.itsm-pick {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
}
.itsm-pick:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, .45);
  background: var(--accent-dim);
}
.itsm-pick.is-active {
  color: #dbeafe;
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, .7);
  box-shadow: inset 3px 0 0 0 var(--accent);
}
.itsm-section {
  grid-column: 1 / -1;
  margin: .35rem 0 .55rem;
  padding: .35rem .75rem .55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
}
.itsm-section > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: .88rem;
  color: #93c5fd;
  padding: .35rem 0;
}
.itsm-section[open] > summary {
  margin-bottom: .45rem;
}
.settings-sections > .card.is-collapsed {
  /* tighter gap when closed */
}
.settings-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  width: 100%;
}
.settings-card-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.settings-card-toggle:hover .settings-card-title,
.settings-card-toggle:focus-visible .settings-card-title {
  color: var(--accent, #38bdf8);
}
.settings-card-toggle:focus-visible {
  outline: 2px solid var(--accent, #38bdf8);
  outline-offset: 3px;
  border-radius: 6px;
}
.settings-card-chevron {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  position: relative;
}
.settings-card-chevron::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: .4rem;
  height: .4rem;
  border-right: 2px solid var(--muted, #94a3b8);
  border-bottom: 2px solid var(--muted, #94a3b8);
  transform: translate(-50%, -65%) rotate(45deg);
  transition: transform .15s ease;
}
.card.is-expanded .settings-card-chevron::before {
  transform: translate(-50%, -35%) rotate(225deg);
}
.settings-card-title {
  min-width: 0;
}
.settings-card-title h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.25;
}
/* Match existing card-header h2 sizing when title is inside the button */
.card-header .settings-card-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
}
.settings-card-extras {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}
.card.is-collapsed > .card-body {
  display: none;
}

/* Dashboard 3D loads after first paint */
.panel-3d.dash-3d-loading {
  position: relative;
  min-height: 280px;
}
.panel-3d.dash-3d-loading::after {
  content: 'Loading 3D view…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted, #94a3b8);
  font-size: .9rem;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
  z-index: 1;
}
.app-footer {
  padding: .75rem 1.5rem; color: var(--muted); font-size: .8rem;
  border-top: 1px solid var(--border);
}
.app-footer a,
.app-footer .footer-link-btn {
  color: #38bdf8;
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.app-footer a:hover,
.app-footer .footer-link-btn:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* About ColdAisle card (footer) */
.about-coldaisle-panel {
  width: min(420px, 100%);
}
.about-coldaisle-body {
  padding-top: 1.1rem;
}
.about-coldaisle-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .85rem;
}
.about-coldaisle-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.about-coldaisle-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.about-coldaisle-tag {
  color: var(--muted);
  font-size: .82rem;
}
.about-coldaisle-blurb {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.about-coldaisle-meta {
  display: grid;
  gap: .65rem .85rem;
  margin: 0 0 1.1rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.about-coldaisle-meta > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: .5rem;
  align-items: baseline;
  font-size: .88rem;
}
.about-coldaisle-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.about-coldaisle-meta dd {
  margin: 0;
  word-break: break-word;
}
.about-coldaisle-meta code {
  font-size: .9em;
  color: #93c5fd;
}
.about-coldaisle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

/* Dev-only request timing (debug.request_timer / COLDAISLE_DEBUG) */
.dev-request-timer {
  display: inline;
  margin-left: .15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: #fbbf24;
  white-space: normal;
}
.dev-request-timer .dev-timer-hot { color: #f87171; font-weight: 600; }
.dev-request-timer .dev-timer-ok { color: #4ade80; }

.snmp-enable-cmd-wrap {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.snmp-enable-cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.35;
  resize: vertical;
  background: rgba(2, 6, 23, 0.55);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface-3); border-color: var(--border); }
.btn-warning { background: #b45309; color: #fef3c7; border-color: #d97706; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: #7f1d1d; color: #fecaca; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-icon { padding: .4rem .55rem; }

/* Forms */
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: .35rem; font-weight: 500; font-size: .88rem; }
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
/* Fixed 3-column layout (PDU add/edit modal and similar dense forms) */
.form-grid.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .form-grid.form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .form-grid.form-grid-3 {
    grid-template-columns: 1fr;
  }
}
.form-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Cards & metrics */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.metric-card .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.metric-card .value { font-size: 1.75rem; font-weight: 700; margin-top: .2rem; line-height: 1.2; }
.metric-card .sub { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.metric-card.accent { border-color: #2563eb66; background: linear-gradient(160deg, #1e3a5f44, var(--surface)); }
.metric-card.success { border-color: #22c55e44; }
.metric-card.warning { border-color: #f59e0b44; }
.metric-card.danger { border-color: #ef444444; }
.exec-chart { width: 100%; height: auto; display: block; }
.catalog-card { display: flex; flex-direction: column; }
.catalog-card .value { font-size: 1rem; }
.catalog-card.is-on { border-color: #2563eb88; }
.catalog-picks { display: flex; gap: .85rem; margin-top: .65rem; }
.catalog-picks a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #93c5fd;
  text-decoration: none;
}
.catalog-picks a:hover { color: #dbeafe; }
.catalog-picks a.is-on { color: #f8fafc; }
.report-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}
.report-mode-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.report-mode-switch a {
  padding: .4rem .95rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
}
.report-mode-switch a.is-on { background: #2563eb; color: #fff; }
.report-mode-switch a:hover:not(.is-on) { color: #e5eef7; }
.report-mode-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
table.data.inventory-full { width: max-content; min-width: 100%; }
table.data.inventory-full th,
table.data.inventory-full td { white-space: nowrap; vertical-align: top; }
table.data.inventory-full td.inv-wrap {
  white-space: normal;
  min-width: 14rem;
  max-width: 24rem;
}
.exec-chart-frame {
  background:
    radial-gradient(900px 220px at 15% 0%, rgba(56, 189, 248, .1), transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, .35), transparent 70%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .35rem .5rem .15rem;
}
.metric-unit { font-size: .85rem; font-weight: 600; color: var(--muted); }

/* Power dashboard */
.power-metrics .metric-card .value { font-size: 1.55rem; }
.power-capacity-banner { margin-bottom: 1.25rem; }
.power-capacity-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  gap: 1rem;
  align-items: center;
}
.power-capacity-meta { display: flex; flex-direction: column; gap: .15rem; }
.power-dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .9fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}
.power-dash-side { display: flex; flex-direction: column; gap: 1rem; }
.power-dash-side .card { margin-bottom: 0; }
.zone-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
  padding: 1rem;
}
.zone-card {
  display: block;
  border: 1px solid var(--border);
  border-left: 3px solid var(--zone-color, var(--accent));
  border-radius: 10px;
  padding: .85rem .9rem;
  background: var(--surface-2);
  color: inherit;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.zone-card:hover {
  border-color: var(--zone-color, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  color: inherit;
}
.zone-card-top {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin-bottom: .65rem;
}
.zone-swatch {
  width: 12px; height: 12px; border-radius: 3px; margin-top: .35rem;
  flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3);
}
.zone-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zone-card-title strong { font-size: .95rem; }
.zone-card-title span { font-size: .75rem; }
.zone-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem .75rem;
  margin-bottom: .55rem;
}
.zcm-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.zcm-val { font-size: .9rem; font-weight: 600; }
.zone-card-util { font-size: .75rem; margin-top: .35rem; }
.util-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.util-bar-lg { height: 10px; }
.util-bar-fill { height: 100%; border-radius: 99px; transition: width .3s ease; }
.util-bar-fill.util-success { background: linear-gradient(90deg, #15803d, #22c55e); }
.util-bar-fill.util-accent { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.util-bar-fill.util-warning { background: linear-gradient(90deg, #b45309, #f59e0b); }
.util-bar-fill.util-danger { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.util-bar-label { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.feed-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.feed-pill {
  text-align: center;
  padding: .75rem .5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.feed-pill .fp-count { display: block; font-size: 1.4rem; font-weight: 700; }
.feed-pill .fp-label { font-size: .75rem; color: var(--muted); }
.feed-pill.feed-a { border-color: #ef444466; }
.feed-pill.feed-b { border-color: #3b82f666; }
.feed-pill.feed-dual { border-color: #a855f766; }
.attn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.attn-list li {
  display: flex; align-items: center; gap: .55rem;
  font-size: .88rem; color: var(--muted);
}
.attn-list li span {
  display: inline-grid; place-items: center;
  min-width: 1.75rem; height: 1.75rem; padding: 0 .35rem;
  border-radius: 6px; font-weight: 700; font-size: .85rem;
  background: var(--surface-3); color: var(--text);
}
.attn-list li.attn-warn span { background: #713f12; color: #fde68a; }
.attn-list li.attn-danger span { background: #7f1d1d; color: #fca5a5; }
.power-quick-actions { display: flex; flex-direction: column; gap: .5rem; }
.btn-block { width: 100%; justify-content: center; text-align: center; }
/* Power history charts */
.power-history-wide { margin-bottom: 1.25rem; }
.power-history-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
}
.power-chart {
  position: relative;
  min-height: 100px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15,23,42,.55), rgba(15,23,42,.15));
  border: 1px solid var(--border);
  overflow: hidden;
}
.power-chart-lg { min-height: 200px; }
.power-chart-sm { min-height: 96px; }
.power-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .55rem .85rem 0;
  gap: .75rem;
}
.power-chart-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}
.power-chart-now {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.power-chart-svg { display: block; width: 100%; }
.power-chart .pc-grid { stroke: rgba(148,163,184,.12); stroke-width: 1; }
.power-chart .pc-axis {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}
.power-chart .pc-line {
  filter: drop-shadow(0 0 6px rgba(56,189,248,.35));
}
.power-chart-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}
.power-chart-loading .power-chart-empty { opacity: .7; }
/* Metric not provided by this PDU model / SNMP map */
.power-chart-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: inherit;
  padding: 1.75rem 1.25rem;
  text-align: center;
  gap: .35rem;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 12px,
      rgba(148, 163, 184, 0.04) 12px,
      rgba(148, 163, 184, 0.04) 24px
    );
}
.power-chart-unsupported-title {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}
.power-chart-unsupported-sub {
  font-size: .82rem;
  color: var(--muted);
  max-width: 28rem;
  line-height: 1.4;
}
.metric-card-unsupported .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.metric-card-unsupported .value .metric-unit {
  display: none;
}
.power-chart-outage-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  vertical-align: middle;
  text-transform: none;
}
.power-chart-phase-legend {
  margin-left: .45rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.power-chart-phase-legend i {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 2px;
  margin: 0 .2rem 0 .35rem;
  vertical-align: middle;
}
.power-outage-summary {
  font-size: .88rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.power-outage-summary[hidden] { display: none !important; }
.zone-card .power-chart-sm {
  margin-top: .55rem;
  border-radius: 8px;
  min-height: 72px;
}
.zone-card .power-chart-head { padding: .35rem .5rem 0; }
.zone-card .power-chart-now { font-size: .9rem; }
.zone-card .power-chart-label { font-size: .65rem; }

/* Zone list history cards (Phase 2) */
.zone-cards-history {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.zone-card-static {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: default;
}
.zone-card-static .zone-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.zone-card-static .zone-card-link:hover .zone-card-title strong {
  color: var(--accent, #38bdf8);
}
.zone-card-charts {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .55rem;
  padding-top: .15rem;
}
.zone-card-charts .power-chart-sm {
  margin-top: 0;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); background: var(--surface-2); }
@media (max-width: 1000px) {
  .power-dash-grid { grid-template-columns: 1fr; }
  .power-capacity-body { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1.25rem; overflow: hidden;
}
/* Section heading row — subtle accent wash so sections are easy to spot while scrolling */
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.15rem;
  flex-wrap: wrap;
  background:
    linear-gradient(
      90deg,
      rgba(59, 130, 246, 0.16) 0%,
      rgba(59, 130, 246, 0.08) 42%,
      rgba(30, 58, 95, 0.22) 100%
    ),
    var(--surface-2);
  border-bottom: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: inset 3px 0 0 0 var(--accent);
}
.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: .01em;
}
.card-body { padding: 1.15rem; }
.card-body.flush { padding: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data,
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data th, table.data td,
table.table th, table.table td {
  padding: .7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th,
table.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
table.data tr:hover td,
table.table tbody tr:hover td {
  background: var(--surface-2);
}
table.data .actions,
table.table .actions {
  white-space: nowrap;
}
table.table-sm th,
table.table-sm td {
  padding: .45rem .7rem;
  font-size: .86rem;
}

/* Env sensors list — readable columns, real host names */
.env-sensors-table-wrap {
  overflow-x: auto;
}
table.table-env-sensors {
  min-width: 720px;
  table-layout: fixed;
}
table.table-env-sensors th,
table.table-env-sensors td {
  padding: .85rem 1.1rem;
  line-height: 1.35;
}
table.table-env-sensors .col-name { width: 24%; }
table.table-env-sensors .col-kind { width: 10%; }
table.table-env-sensors .col-host { width: 22%; }
table.table-env-sensors .col-place { width: 16%; }
table.table-env-sensors .col-value { width: 18%; }
table.table-env-sensors .col-status { width: 10%; text-align: center; }
table.table-env-sensors .col-status .badge {
  min-width: 2.5rem;
}
table.table-env-sensors .env-sensor-sub {
  font-size: .75rem;
  margin-top: .2rem;
  line-height: 1.25;
  word-break: break-word;
}
table.table-env-sensors .env-sensor-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
table.table-env-sensors .env-sensor-rh {
  font-weight: 500;
  margin-left: .15rem;
}
table.table-env-sensors .col-host a {
  font-weight: 500;
  color: var(--accent, #38bdf8);
  text-decoration: none;
}
table.table-env-sensors .col-host a:hover {
  text-decoration: underline;
}
table.table-env-sensors .col-name a {
  color: var(--accent, #38bdf8);
  text-decoration: none;
}
table.table-env-sensors .col-name a:hover {
  text-decoration: underline;
}

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: .75rem; border: 1px solid transparent; }
.alert-success, .alert.alert-success { background: #14532d44; border-color: #22c55e; color: #bbf7d0; }
.alert-error, .alert.alert-error, .alert-danger { background: #7f1d1d44; border-color: #ef4444; color: #fecaca; }
.alert-warning { background: #713f1244; border-color: #f59e0b; color: #fde68a; }
.alert-info { background: #1e3a5f44; border-color: #3b82f6; color: #bfdbfe; }

/* Badges */
.badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; background: var(--surface-3); color: var(--muted);
}
.badge-success { background: #14532d; color: #86efac; }
.badge-warning { background: #713f12; color: #fde68a; }
.badge-danger { background: #7f1d1d; color: #fca5a5; }
.badge-info { background: #1e3a5f; color: #93c5fd; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(ellipse at 30% 20%, #1e3a5f55, transparent 50%),
              radial-gradient(ellipse at 70% 80%, #4c1d9555, transparent 45%),
              var(--bg);
  padding: 1rem;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 2rem;
  box-shadow: 0 25px 60px rgba(0,0,0,.45);
}
.login-card h1 { margin: 0 0 .25rem; font-size: 1.5rem; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }
.login-divider {
  display: flex; align-items: center; gap: .75rem; color: var(--muted);
  font-size: .8rem; margin: 1.25rem 0;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Dashboard layout */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.panel-3d {
  height: 420px; background: #0a0f18; border-radius: 0 0 var(--radius) var(--radius);
  position: relative; overflow: hidden;
}
.panel-3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* Floor planner */
.planner-toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.nudge-controls {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.planner-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  /* Fixed viewport height so the center pane can scroll vertically (pan) */
  height: calc(100vh - 200px);
  min-height: 480px;
  max-height: 900px;
  align-items: stretch;
}
@media (max-width: 1000px) {
  .planner-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .planner-stage {
    height: min(70vh, 640px) !important;
  }
}
.planner-palette, .planner-props {
  background: var(--surface); border-right: 1px solid var(--border); padding: 1rem;
  overflow-y: auto;
  min-height: 0; /* allow grid children to shrink for overflow */
}
.planner-props { border-right: none; border-left: 1px solid var(--border); }
.palette-item {
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px;
  padding: .75rem; margin-bottom: .5rem; cursor: grab; text-align: center; font-size: .85rem;
  user-select: none;
}
.palette-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.palette-item.selected,
.palette-item.dragging {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}
.palette-list-compact .palette-item {
  padding: .4rem .45rem;
  font-size: .8rem;
}
.palette-item.pdu-preset .rack-icon,
.palette-item.pdu-unplaced .rack-icon {
  border-radius: 3px;
  border: 1px dashed #f59e0b;
}
.palette-item.pdu-unplaced {
  border-left: 3px solid #f59e0b;
}
.palette-list {
  max-height: 28vh;
  overflow-y: auto;
  padding-right: .15rem;
}
.palette-list-compact {
  max-height: 18vh;
}
.palette-item .rack-icon {
  width: 40px; height: 56px; margin: 0 auto .4rem;
  background: linear-gradient(180deg, #475569, #1e293b);
  border: 2px solid #64748b; border-radius: 3px;
  pointer-events: none;
}
.palette-item.airflow-preset {
  cursor: pointer;
  border-style: solid;
}
.palette-item.airflow-preset .airflow-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto .3rem;
  background: #38bdf8;
  border: 2px dashed #e0f2fe;
}
.palette-item.airflow-preset .airflow-icon.return {
  background: #fb923c;
  border-color: #ffedd5;
}
.palette-item.airflow-preset .airflow-icon.slot {
  width: 46px;
  height: 16px;
  border-radius: 8px;
}
.palette-item .palette-title {
  font-weight: 600;
  font-size: .8rem;
  line-height: 1.25;
}
.palette-item .palette-meta {
  display: block;
  font-size: .7rem;
  margin-top: .15rem;
}
.planner-stage {
  background: #0a0f18;
  min-height: 0;
  height: 100%;
  overflow: hidden; /* pan scrolls the inner wrap, not the stage */
  position: relative;
  display: flex;
  flex-direction: column;
}
.planner-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: auto; /* both axes — required for vertical pan */
  background:
    linear-gradient(rgba(59,130,246,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.06) 1px, transparent 1px),
    #0a0f18;
  background-size: 40px 40px;
  cursor: grab;
  overscroll-behavior: contain;
}
/* Do not force canvas to stretch — bitmap size is set in JS for correct hit-testing */
#planner-canvas {
  display: block;
  max-width: none;
  /* Keep natural pixel size from JS so wrap can scroll when canvas > viewport */
  vertical-align: top;
  cursor: grab;
  touch-action: none; /* allow custom pan/drag without browser scrolling the page */
}
#planner-canvas:active {
  cursor: grabbing;
}
#view3d {
  width: 100%; height: 100%; min-height: 560px; display: block;
}

/* Adjacent-rack snap arrow pad (cabinet properties) */
.adj-snap-pad {
  display: grid;
  grid-template-columns: repeat(3, 2.25rem);
  grid-template-rows: repeat(3, 2.25rem);
  gap: .25rem;
  justify-content: start;
  align-items: center;
  justify-items: center;
}
.adj-snap-pad .btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  line-height: 1;
}
.adj-snap-pad .adj-snap:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Rack elevation view (legacy strip) */
.rack-elevation {
  display: flex; flex-direction: column-reverse;
  border: 2px solid #64748b; border-radius: 4px; background: #0f172a;
  width: 280px; margin: 0 auto;
}
.rack-u {
  display: flex; align-items: center; min-height: 18px;
  border-top: 1px solid #1e293b; font-size: .7rem; position: relative;
}
.rack-u .u-label {
  width: 28px; text-align: center; color: var(--muted); flex-shrink: 0;
  border-right: 1px solid #1e293b; font-family: var(--mono);
}
.rack-u .u-slot {
  flex: 1; min-height: 16px; padding: 1px 4px;
}
.rack-u.occupied .u-slot {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #fff; font-weight: 600; cursor: pointer;
}
.rack-u.occupied.server .u-slot { background: linear-gradient(90deg, #1e40af, #3b82f6); }
.rack-u.occupied.switch .u-slot { background: linear-gradient(90deg, #065f46, #10b981); }
.rack-u.occupied.pdu .u-slot { background: linear-gradient(90deg, #7c2d12, #f97316); }
.rack-u.occupied.storage .u-slot { background: linear-gradient(90deg, #581c87, #a855f7); }
.rack-u.empty .u-slot:hover { background: #1e293b; outline: 1px dashed var(--accent); cursor: pointer; }

/* Cabinet detail: Front | Rear | Properties (3 columns) */
.rack-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}
.rack-col .card-body { padding: .85rem 1rem 1.1rem; }
.rack-props-col { min-width: 0; }
.rack-prop-list {
  margin: 0 0 0.5rem;
  display: grid;
  gap: .45rem;
}
.rack-prop-list > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: .5rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .35rem;
}
.rack-prop-list dt { color: var(--muted); margin: 0; font-weight: 500; }
.rack-prop-list dd { margin: 0; }

/* EIA-310 rack face: bay aspect = 19" / (U × 1.75") */
.rack-face-title {
  text-align: center;
  font-weight: 600;
  margin-bottom: .55rem;
  letter-spacing: .02em;
}
.rack-face-title small {
  display: block;
  font-weight: 500;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .15rem;
}
.rack-elevation-v2 {
  display: flex;
  align-items: stretch;
  width: 100%;
  /* --units, --rail-in (19), --rack-h-in (U*1.75) set inline */
  --units: 42;
  --rail-in: 19;
  --rack-h-in: 73.5;
}
.rack-u-rail {
  flex: 0 0 1.65rem;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  border: 2px solid #64748b;
  border-right: none;
  border-radius: 4px 0 0 4px;
  overflow: hidden;
  /* Match bay height via same aspect chain: rail height follows bay */
  align-self: stretch;
}
.rack-u-rail-tick {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-family: var(--mono);
  color: var(--muted);
  border-bottom: 1px solid #1e293b;
  box-sizing: border-box;
  min-height: 0;
}
.rack-bay {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  /* Fixed EIA ratio — not driven by image sizes */
  width: 100%;
  aspect-ratio: var(--rail-in) / var(--rack-h-in);
  height: auto;
  border: 2px solid #64748b;
  border-radius: 0 4px 4px 0;
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent calc(100% / var(--units) - 1px),
      #1e293b calc(100% / var(--units) - 1px),
      #1e293b calc(100% / var(--units))
    ),
    #0f172a;
  box-sizing: border-box;
  overflow: hidden;
}

/* ========== Row View (front aisle strip) ==========
   Cabinets side-by-side, height fits viewport, horizontal pan.
   Must override .rack-elevation-v2 / .rack-bay width:100% rules. */
.row-view-shell {
  margin-bottom: 1rem;
  overflow: hidden;
}
.row-view-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  padding: .75rem 1rem 1.1rem;
  max-height: calc(100dvh - 14.5rem);
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}
.row-view-viewport.is-panning {
  cursor: grabbing;
}
.row-view-viewport::-webkit-scrollbar { height: 10px; }
.row-view-viewport::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 99px;
}
.row-view-strip {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-end;
  gap: .65rem;
  width: max-content !important;
  max-width: none !important;
  min-height: 0;
  --max-units: 42;
  --row-rack-h: min(62vh, calc(100dvh - 16.5rem));
  --u-px: calc(var(--row-rack-h) / var(--max-units));
}
.row-view-cab {
  flex: 0 0 auto !important;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
}
.row-view-cab-head {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-height: 2.2rem;
  width: max-content;
  max-width: 10rem;
}
.row-view-cab-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .35rem;
  width: max-content;
  max-width: 10rem;
}
/* Height-first scale: shared U pixel size across the row */
.row-view-elevation.rack-elevation-v2 {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  height: calc(var(--u-px) * var(--units)) !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
}
.row-view-elevation .rack-u-rail {
  flex: 0 0 1.15rem !important;
  width: 1.15rem !important;
  height: 100% !important;
  align-self: stretch;
}
.row-view-elevation .rack-u-rail-tick {
  font-size: .48rem;
  line-height: 1;
}
.row-view-elevation .rack-u-rail-tick.tick-muted {
  border-bottom-color: #0f172a;
  color: transparent;
}
.row-view-elevation .rack-bay {
  /* width from height × EIA ratio (19 / (U×1.75)) */
  height: 100% !important;
  width: calc(var(--u-px) * var(--units) * var(--rail-in) / var(--rack-h-in)) !important;
  flex: 0 0 auto !important;
  max-width: none !important;
  min-width: 0 !important;
  aspect-ratio: unset !important;
}
.row-view-elevation .rack-device-name { font-size: .55rem; }
.row-view-elevation .rack-device-u { font-size: .48rem; }
.row-view-elevation .rack-device-meta { padding: 1px 2px 2px; }
@media (max-height: 700px) {
  .row-view-strip {
    --row-rack-h: min(52vh, calc(100dvh - 13rem));
  }
}
.rack-empty-slot {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  box-sizing: border-box;
}
.rack-empty-slot:hover {
  background: rgba(59, 130, 246, 0.12);
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
  cursor: pointer;
}
/* Device block: width = full 19" bay; height = device U / total U */
.rack-device {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: block;
  overflow: hidden; /* hard clip to U span */
  box-sizing: border-box;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  background: linear-gradient(180deg, #1e293b, #0f172a);
  color: #e2e8f0;
  text-decoration: none;
  cursor: pointer;
}
.rack-device:hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 3;
}
/* Department ownership outline (color from --dept-color) */
.rack-device.has-dept-color {
  box-shadow:
    inset 0 0 0 2px var(--dept-color, transparent),
    inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}
.rack-device.has-dept-color:hover {
  outline-color: var(--dept-color, var(--accent));
}
/* Edge-to-edge fill of the 19" × N-U slot (cover = fill without letterbox; may crop) */
.rack-device-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  background: #0b1220;
}
.rack-device-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2px 4px 3px;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.85));
  pointer-events: none;
}
.rack-device-name {
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rack-device-u {
  font-size: .58rem;
  opacity: .9;
  font-family: var(--mono);
}
/* Soft health edge on elevation devices (not a chunky outline box) */
.rack-device.rack-device-health-ok {
  box-shadow: inset 3px 0 0 0 rgba(34, 197, 94, 0.9);
}
.rack-device.rack-device-health-warn {
  box-shadow: inset 3px 0 0 0 rgba(234, 179, 8, 0.95), 0 0 12px rgba(234, 179, 8, 0.25);
}
.rack-device.rack-device-health-crit {
  box-shadow: inset 3px 0 0 0 rgba(239, 68, 68, 0.95), 0 0 14px rgba(239, 68, 68, 0.3);
}
.rack-device.type-server { background: linear-gradient(90deg, #1e3a8a, #1d4ed8); }
.rack-device.type-network_switch,
.rack-device.type-switch { background: linear-gradient(90deg, #064e3b, #059669); }
.rack-device.type-pdu { background: linear-gradient(90deg, #7c2d12, #ea580c); }
.rack-device.type-storage_array,
.rack-device.type-storage { background: linear-gradient(90deg, #4c1d95, #7c3aed); }
.rack-device.type-chassis { background: linear-gradient(90deg, #334155, #64748b); }
.rack-device.type-router { background: linear-gradient(90deg, #0e7490, #06b6d4); }
.rack-device.type-patch_panel { background: linear-gradient(90deg, #854d0e, #ca8a04); }

/* Cable plant: device-then-port picker (do not dump every site port into one select) */
.cable-end-picker {
  display: grid;
  gap: .4rem;
}
.cable-end-picker input[type="search"] {
  font-size: .88rem;
}

/* Cabinet / chassis: parent row + nested child (blade/module) rows */
.cabinet-device-table .cabinet-device-parent.has-children > td {
  border-bottom-color: transparent;
}
.cabinet-device-table .cabinet-device-child td {
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.88rem;
  color: var(--text, #e2e8f0);
}
.cabinet-device-table .cabinet-device-child td:first-child {
  padding-left: 1.35rem;
}
.cabinet-device-table .cabinet-device-slot {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
}
.cabinet-device-table .cabinet-device-child a {
  font-weight: 500;
}
button.rack-device.rack-pdu-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  left: 0;
  right: 0;
  padding: 0;
}
button.rack-device.rack-pdu-btn:hover {
  filter: brightness(1.08);
  outline: 1px solid rgba(251, 146, 60, 0.8);
}

/* PDU boxes in cabinet properties */
.pdu-box-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.pdu-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  width: 100%;
  text-align: left;
  padding: .55rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 45, 18, 0.35), rgba(234, 88, 12, 0.18));
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pdu-box:hover {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}
.pdu-box-name {
  font-weight: 650;
  font-size: .92rem;
  flex: 1 1 auto;
}
.pdu-box-meta {
  font-size: .75rem;
  color: var(--muted);
  width: 100%;
}
.pdu-box-badge { margin-left: auto; }
.pdu-outlets-heading {
  margin: 1.25rem 0 .5rem;
  font-size: 1rem;
}
.pdu-outlets-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pdu-outlets-table .form-control-sm {
  min-width: 0;
  font-size: .8rem;
  padding: .25rem .4rem;
}

/* Modal overlay */
body.modal-open { overflow: hidden; }
/* Legacy bare .modal (cooling/env pages) — same shell as .modal-overlay */
.modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal[hidden] { display: none !important; }
.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: pointer;
}
.modal .modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
  overflow: hidden;
}
.modal .modal-dialog.modal-lg { width: min(920px, 100%); }
.modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal .modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal .modal-body {
  padding: 1rem 1.15rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal-overlay[hidden],
.modal-overlay[hidden=""],
.modal-overlay[style*="display: none"] {
  display: none !important;
}
/* When open script sets display:flex + removes hidden */
.modal-overlay:not([hidden]) {
  display: flex;
}
.modal-panel {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
}
.modal-panel-wide { width: min(920px, 100%); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: .15rem .4rem;
  border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }
.modal-body {
  padding: 1rem 1.15rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1.15rem;
  border-top: 1px solid var(--border);
}

/* Translucent glass modal (cabinet audit certification) */
.modal-overlay-glass {
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-panel-glass {
  width: min(480px, 100%);
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.modal-panel-glass .modal-header,
.modal-panel-glass .modal-footer {
  border-color: rgba(148, 163, 184, 0.22);
  background: transparent;
}
.modal-panel-glass-wide {
  width: min(780px, 100%);
}

/* SNMP discover results */
.snmp-discover-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .5rem .75rem;
  margin-bottom: 1rem;
  font-size: .85rem;
}
.snmp-discover-meta dt {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0;
}
.snmp-discover-meta dd {
  margin: .1rem 0 0;
  word-break: break-word;
}
.snmp-oid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.snmp-oid-table th,
.snmp-oid-table td {
  padding: .35rem .45rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
  vertical-align: top;
}
.snmp-oid-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.snmp-oid-table code {
  font-size: .75rem;
  word-break: break-all;
}
.snmp-candidates {
  margin: 1rem 0 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .65rem .55rem;
  background: var(--surface-2);
}
.snmp-candidates > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: .88rem;
  color: #93c5fd;
}
.snmp-candidates .snmp-cand-help {
  font-size: .75rem;
  color: var(--muted);
  margin: .4rem 0 .45rem;
}
.snmp-cand-filter { margin-bottom: .4rem; }
.snmp-cand-table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
}
.snmp-map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.snmp-map-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .5rem;
  align-items: center;
  font-size: .85rem;
}
.snmp-map-list input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
}
.snmp-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  user-select: none;
  font-size: .9rem;
  padding: .35rem .65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
}
.snmp-toggle:hover { border-color: rgba(56, 189, 248, 0.45); }
.snmp-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

/* Multi-line settings toggle (e.g. Testing mode) — switch left, copy right, no overlap */
.settings-testing-mode-box {
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(113, 63, 18, 0.15);
}
.settings-toggle-stack {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
  width: 100%;
}
.settings-toggle-control {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-top: .15rem; /* optically center switch with title line */
}
.settings-toggle-control input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  clip: rect(0, 0, 0, 0);
}
.settings-toggle-control input:checked + .snmp-switch {
  background: rgba(34, 197, 94, 0.75);
}
.settings-toggle-control input:checked + .snmp-switch::after {
  transform: translateX(1.1rem);
}
.settings-toggle-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.settings-toggle-title {
  display: block;
  font-size: .95rem;
  line-height: 1.35;
  color: var(--text, #e2e8f0);
}
.settings-toggle-help {
  display: block;
  font-weight: 400;
  font-size: .78rem;
  line-height: 1.4;
  white-space: normal;
}
.snmp-switch {
  position: relative;
  width: 2.4rem;
  height: 1.3rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.55);
  flex-shrink: 0;
  transition: background .15s ease;
}
.snmp-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.3rem - 4px);
  height: calc(1.3rem - 4px);
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: transform .15s ease;
}
.snmp-toggle input:checked + .snmp-switch {
  background: rgba(34, 197, 94, 0.75);
}
.snmp-toggle input:checked + .snmp-switch::after {
  transform: translateX(1.1rem);
}
.snmp-toggle input:disabled + .snmp-switch {
  opacity: .45;
}
.snmp-toggle input:disabled ~ .snmp-toggle-label {
  opacity: .55;
}
.icmp-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  white-space: nowrap;
}
.icmp-status-up {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(22, 101, 52, 0.35);
  color: #86efac;
}
.icmp-status-down {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.4);
  color: #fca5a5;
}
.icmp-status-degraded {
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(113, 63, 18, 0.4);
  color: #fde047;
}
.icmp-status-unknown,
.icmp-status-off {
  color: #94a3b8;
}
.snmp-toggle-label {
  font-size: .85rem;
  white-space: nowrap;
}
.snmp-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .75rem;
}
.snmp-poll-stats {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35rem;
}
.cab-audit-certify {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.1);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.35;
}
.cab-audit-certify input {
  margin-top: .2rem;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: #38bdf8;
}
.cab-audit-fresh {
  color: #4ade80 !important;
  font-weight: 600;
}
.row-view-cab-foot {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.form-control-sm {
  font-size: .82rem;
  padding: .3rem .45rem;
  height: auto;
  min-height: 1.9rem;
}

/* Generic app modal (Users page, etc.) */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.app-modal[hidden] { display: none !important; }
.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(3px);
}
.app-modal-panel {
  position: relative;
  width: min(34rem, 100%);
  max-height: min(90vh, 44rem);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  color: #e5eef7;
}
.app-modal-panel-wide {
  width: min(42rem, 100%);
}
.app-modal-panel-xl {
  width: min(56rem, 100%);
  max-height: min(92vh, 52rem);
}
/* Compact property summary (PDU detail, etc.) */
.pdu-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .65rem 1.1rem;
  margin: 0;
}
.pdu-summary-grid > div {
  min-width: 0;
}
.pdu-summary-grid dt {
  margin: 0;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted, #94a3b8);
  font-weight: 600;
}
.pdu-summary-grid dd {
  margin: .15rem 0 0;
  font-size: .92rem;
  color: inherit;
  word-break: break-word;
}
.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.app-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f8fafc;
}
.app-modal-body {
  padding: 1.1rem 1.15rem 1.25rem;
  overflow-y: auto;
}
.app-modal-body .form-grid {
  margin: 0;
}
.app-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .35rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* LDAPS test result modal */
.ldaps-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ldaps-modal[hidden] { display: none !important; }
.ldaps-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(2px);
}
.ldaps-modal-panel {
  position: relative;
  width: min(32rem, 100%);
  max-height: min(85vh, 40rem);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.ldaps-modal-panel.ldaps-pass {
  background: rgba(20, 83, 45, 0.88);
  border-color: rgba(74, 222, 128, 0.45);
}
.ldaps-modal-panel.ldaps-fail {
  background: rgba(127, 29, 29, 0.88);
  border-color: rgba(248, 113, 113, 0.45);
}
.ldaps-modal-panel.ldaps-pending {
  background: rgba(30, 41, 59, 0.92);
}
.ldaps-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ldaps-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #f8fafc;
}
.ldaps-modal-body {
  padding: 1rem;
  overflow-y: auto;
  color: #f1f5f9;
  font-size: .92rem;
}
.ldaps-modal-body .ldaps-summary {
  font-weight: 600;
  margin: 0 0 .75rem;
  font-size: 1rem;
}
.ldaps-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.ldaps-steps li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: .5rem .65rem;
  padding: .55rem .65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.ldaps-steps .ldaps-ico {
  font-weight: 700;
  line-height: 1.3;
}
.ldaps-steps .ldaps-ok .ldaps-ico { color: #86efac; }
.ldaps-steps .ldaps-bad .ldaps-ico { color: #fca5a5; }
.ldaps-steps .ldaps-name { font-weight: 600; color: #fff; }
.ldaps-steps .ldaps-detail {
  grid-column: 2;
  font-size: .82rem;
  color: rgba(248, 250, 252, 0.85);
  word-break: break-word;
}
.ldaps-modal-foot {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
}

/* Settings connection-test loading (SMTP / LDAPS) */
.settings-test-loading {
  text-align: center;
  padding: .5rem 0 .25rem;
}
.settings-test-spinner {
  width: 2.35rem;
  height: 2.35rem;
  margin: .35rem auto 1rem;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.28);
  border-top-color: #93c5fd;
  animation: settings-test-spin 0.75s linear infinite;
}
.settings-test-sub {
  margin: 0;
  font-size: .82rem;
  color: rgba(226, 232, 240, 0.78);
}
@keyframes settings-test-spin {
  to { transform: rotate(360deg); }
}

/* Live site restore — blocking progress modal */
.restore-working-modal {
  z-index: 2600;
}
.restore-working-panel {
  width: min(26rem, 100%);
  max-height: none;
  pointer-events: auto;
  user-select: none;
}
.restore-working-body {
  text-align: center;
  padding: 1.25rem 1.25rem 1.5rem;
}
.restore-working-visual {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  margin: .25rem auto 1.15rem;
}
.restore-working-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.22);
  border-top-color: #93c5fd;
  border-right-color: #60a5fa;
  animation: restore-working-spin 0.9s linear infinite;
}
.restore-working-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.35));
  animation: restore-working-pulse 1.6s ease-in-out infinite;
}
.restore-working-phase {
  margin: 0 0 .45rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: #f8fafc;
  min-height: 1.4em;
}
.restore-working-sub {
  margin: 0 0 1rem;
  font-size: .82rem;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.45;
}
.restore-working-bar {
  height: 7px;
  margin: 0 auto .85rem;
  max-width: 18rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.restore-working-bar-fill {
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  animation: restore-working-indeterminate 1.35s ease-in-out infinite;
}
.restore-working-elapsed {
  margin: 0;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: rgba(148, 163, 184, 0.95);
}
body.restore-working-open {
  overflow: hidden;
}
body.restore-working-open .ldaps-modal:not(.restore-working-modal) {
  pointer-events: none;
}
@keyframes restore-working-spin {
  to { transform: rotate(360deg); }
}
@keyframes restore-working-pulse {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes restore-working-indeterminate {
  0% { transform: translateX(-120%); width: 35%; }
  50% { width: 55%; }
  100% { transform: translateX(280%); width: 35%; }
}

/* Settings → Updates: GitHub zip → this site */
.ca-upd-panel { width: min(28rem, calc(100vw - 1.5rem)); }
.ca-upd-body { text-align: center; padding: 1rem 1.15rem 1.35rem; }
.ca-upd-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  margin: .25rem auto 1.1rem;
  min-height: 5.5rem;
}
.ca-upd-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  min-width: 4.2rem;
}
.ca-upd-node-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.78);
}
.ca-upd-gh {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .04em;
  color: #f8fafc;
  background: linear-gradient(160deg, #334155 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.ca-upd-app {
  position: relative;
  width: 3.15rem;
  height: 3.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ca-upd-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.22);
  border-top-color: #38bdf8;
  border-right-color: #7dd3fc;
}
.ca-upd-core {
  font-weight: 800;
  font-size: .78rem;
  color: #e0f2fe;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}
.ca-upd-lane {
  position: relative;
  flex: 1;
  height: 2.6rem;
  min-width: 6.5rem;
  max-width: 10rem;
  overflow: hidden;
}
.ca-upd-lane::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(125, 211, 252, 0.28) 0 7px,
    transparent 7px 14px
  );
}
.ca-upd-pkt {
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -0.7rem;
  padding: .12rem .38rem;
  border-radius: 4px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0f172a;
  background: #7dd3fc;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
  opacity: 0;
}
.ca-upd-pkt-2 { background: #86efac; }
.ca-upd-pkt-3 { background: #fde68a; }
.ca-upd-pkt-4 { background: #c4b5fd; }
.ca-upd-anim-running .ca-upd-ring {
  animation: restore-working-spin 0.9s linear infinite;
}
.ca-upd-anim-running .ca-upd-lane::before {
  animation: od-xfer-dash 0.75s linear infinite;
}
.ca-upd-anim-running .ca-upd-pkt {
  animation: ca-upd-fly 2.2s ease-in-out infinite;
}
.ca-upd-anim-running .ca-upd-pkt-2 { animation-delay: .45s; }
.ca-upd-anim-running .ca-upd-pkt-3 { animation-delay: .9s; }
.ca-upd-anim-running .ca-upd-pkt-4 { animation-delay: 1.35s; }
.ca-upd-status {
  margin: 0 0 .4rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: #f8fafc;
  min-height: 1.4em;
}
.ca-upd-detail {
  margin: 0;
  font-size: .82rem;
  line-height: 1.45;
}
@keyframes ca-upd-fly {
  0% { left: 0; opacity: 0; transform: translateY(0) scale(0.85); }
  12% { opacity: 1; }
  50% { transform: translateY(-5px) scale(1); }
  88% { opacity: 1; }
  100% { left: calc(100% - 2.2rem); opacity: 0; transform: translateY(0) scale(0.9); }
}
table.data tr[hidden] { display: none !important; }

/* OpenDCIM migration — file-transfer activity indicator (not a progress %) */
.od-xfer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  margin: 1rem 0 .35rem;
  padding: .85rem 1rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.od-xfer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 22rem;
  min-height: 4.5rem;
}
.od-xfer-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 4.5rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.od-xfer-folder {
  width: 2.75rem;
  height: 2.15rem;
  position: relative;
  border-radius: 0 6px 6px 6px;
  background: linear-gradient(160deg, #64748b 0%, #334155 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}
.od-xfer-folder::before {
  content: '';
  position: absolute;
  left: 0;
  top: -0.35rem;
  width: 1.15rem;
  height: 0.4rem;
  border-radius: 3px 3px 0 0;
  background: #94a3b8;
}
.od-xfer-folder.od-xfer-src {
  background: linear-gradient(160deg, #38bdf8 0%, #0369a1 100%);
}
.od-xfer-folder.od-xfer-src::before {
  background: #7dd3fc;
}
.od-xfer-folder.od-xfer-dst {
  background: linear-gradient(160deg, #34d399 0%, #047857 100%);
}
.od-xfer-folder.od-xfer-dst::before {
  background: #6ee7b7;
}
.od-xfer-lane {
  position: relative;
  flex: 1;
  height: 2.5rem;
  min-width: 5.5rem;
  max-width: 9rem;
  overflow: hidden;
}
.od-xfer-lane::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.15) 0 6px,
    transparent 6px 12px
  );
  animation: od-xfer-dash 0.8s linear infinite;
}
.od-xfer-file {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.15rem;
  height: 1.4rem;
  margin-top: -0.7rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: od-xfer-fly 1.6s ease-in-out infinite;
  opacity: 0;
}
.od-xfer-file::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  border-style: solid;
  border-width: 0 7px 7px 0;
  border-color: transparent #94a3b8 transparent transparent;
}
.od-xfer-file:nth-child(2) {
  animation-delay: 0.55s;
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 100%);
}
.od-xfer-file:nth-child(3) {
  animation-delay: 1.1s;
  background: linear-gradient(180deg, #d1fae5 0%, #6ee7b7 100%);
}
.od-xfer-status {
  margin: 0;
  font-size: .88rem;
  color: #e2e8f0;
  text-align: center;
  min-height: 1.25rem;
}
.od-xfer-pulse {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: rgba(148, 163, 184, 0.95);
}
.od-xfer-pulse::before {
  content: '';
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55);
  animation: od-xfer-pulse 1.4s ease-out infinite;
}
@keyframes od-xfer-fly {
  0% {
    left: 0;
    opacity: 0;
    transform: translateY(0) scale(0.85);
  }
  12% { opacity: 1; }
  50% {
    transform: translateY(-4px) scale(1);
  }
  88% { opacity: 1; }
  100% {
    left: calc(100% - 1.15rem);
    opacity: 0;
    transform: translateY(0) scale(0.9);
  }
}
@keyframes od-xfer-dash {
  to { background-position: 12px 0; }
}
@keyframes od-xfer-pulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
/* When log updates, briefly flash the transfer stage */
.od-xfer.od-xfer-active .od-xfer-stage {
  animation: od-xfer-glow 0.6s ease-out;
}
@keyframes od-xfer-glow {
  0% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

/* —— SNMP poll activity overlay (device ↔ ColdAisle GET packets) —— */
.spoll-overlay {
  z-index: 3600;
}
.spoll-panel {
  width: min(28rem, 94vw);
  max-width: 28rem;
}
.spoll-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding-top: .25rem;
}
.spoll-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  width: 100%;
  min-height: 5.5rem;
  padding: .85rem 0.5rem 0.35rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.spoll-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  min-width: 4.25rem;
}
.spoll-node-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
  max-width: 6.5rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Device / PDU body with status LEDs + radio rings */
.spoll-device {
  position: relative;
  width: 3.1rem;
  height: 3.6rem;
  border-radius: 7px;
  background: linear-gradient(165deg, #475569 0%, #1e293b 55%, #0f172a 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.spoll-led {
  position: absolute;
  left: .45rem;
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.spoll-led-1 { top: .55rem; }
.spoll-led-2 { top: 1.2rem; }
.spoll-led-3 { top: 1.85rem; }
.spoll-anim-running .spoll-led-1 {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: spoll-led-blink 1.4s ease-in-out infinite;
}
.spoll-anim-running .spoll-led-2 {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
  animation: spoll-led-blink 1.4s ease-in-out infinite .25s;
}
.spoll-anim-running .spoll-led-3 {
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.55);
  animation: spoll-led-blink 1.4s ease-in-out infinite .5s;
}
.spoll-antenna {
  position: absolute;
  right: -.15rem;
  top: 50%;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: -.7rem;
  pointer-events: none;
}
.spoll-antenna i {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(56, 189, 248, 0.15);
  border-radius: 50%;
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(45deg) scale(0.35);
  opacity: 0;
}
.spoll-anim-running .spoll-antenna i {
  animation: spoll-ring 1.8s ease-out infinite;
}
.spoll-anim-running .spoll-antenna i:nth-child(2) { animation-delay: .45s; }
.spoll-anim-running .spoll-antenna i:nth-child(3) { animation-delay: .9s; }
/* Packet lane */
.spoll-lane {
  position: relative;
  flex: 1;
  height: 3.2rem;
  min-width: 5.5rem;
  max-width: 10rem;
  overflow: hidden;
}
.spoll-lane::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.35) 0 7px,
    transparent 7px 14px
  );
  opacity: .55;
}
.spoll-anim-running .spoll-lane::before {
  animation: spoll-dash 0.7s linear infinite;
}
.spoll-pkt {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  padding: .12rem .35rem;
  border-radius: 4px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0f172a;
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 100%);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
  opacity: 0;
  white-space: nowrap;
}
.spoll-anim-running .spoll-pkt {
  animation: spoll-fly 2.4s ease-in-out infinite;
}
.spoll-pkt-2 {
  background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%);
  animation-delay: .45s !important;
}
.spoll-pkt-3 {
  background: linear-gradient(180deg, #d1fae5 0%, #6ee7b7 100%);
  animation-delay: .9s !important;
}
.spoll-pkt-4 {
  background: linear-gradient(180deg, #ffedd5 0%, #fdba74 100%);
  animation-delay: 1.35s !important;
}
.spoll-pkt-5 {
  background: linear-gradient(180deg, #ede9fe 0%, #c4b5fd 100%);
  animation-delay: 1.8s !important;
}
/* ColdAisle sink */
.spoll-app {
  position: relative;
  width: 3.1rem;
  height: 3.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spoll-app-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35);
}
.spoll-anim-running .spoll-app-ring {
  animation: spoll-app-pulse 1.6s ease-out infinite;
}
.spoll-app-core {
  position: relative;
  z-index: 1;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #ecfdf5;
  background: linear-gradient(160deg, #34d399 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.45);
  border: 1px solid rgba(167, 243, 208, 0.35);
}
.spoll-status {
  margin: .15rem 0 0;
  font-size: .95rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  min-height: 1.4rem;
}
.spoll-detail {
  margin: 0;
  font-size: .8rem;
  text-align: center;
  max-width: 24rem;
  line-height: 1.4;
}
.spoll-state-ok .spoll-status { color: #6ee7b7; }
.spoll-state-err .spoll-status { color: #fca5a5; }
.spoll-state-timeout .spoll-status { color: #fcd34d; }
.spoll-state-ok .spoll-led-1,
.spoll-state-ok .spoll-led-2,
.spoll-state-ok .spoll-led-3 {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.65);
  animation: none;
}
.spoll-state-err .spoll-led-1,
.spoll-state-timeout .spoll-led-1 {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.65);
  animation: none;
}
.spoll-state-err .spoll-led-2,
.spoll-state-err .spoll-led-3,
.spoll-state-timeout .spoll-led-2,
.spoll-state-timeout .spoll-led-3 {
  background: #64748b;
  animation: none;
  box-shadow: none;
}
@keyframes spoll-fly {
  0% {
    left: 0;
    opacity: 0;
    transform: translateY(-50%) scale(0.85);
  }
  10% { opacity: 1; }
  50% {
    transform: translateY(calc(-50% - 5px)) scale(1);
  }
  88% { opacity: 1; }
  100% {
    left: calc(100% - 2.4rem);
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
  }
}
@keyframes spoll-dash {
  to { background-position: 14px 0; }
}
@keyframes spoll-ring {
  0% {
    transform: rotate(45deg) scale(0.3);
    opacity: 0.7;
  }
  100% {
    transform: rotate(45deg) scale(1.15);
    opacity: 0;
  }
}
@keyframes spoll-led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes spoll-app-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); transform: scale(1); }
}

/* Searchable timezone combobox (Settings, Sites, setup, …) */
.tz-combobox {
  position: relative;
  max-width: 28rem;
  width: 100%;
}
.tz-combobox-list {
  /* position/size set in JS (fixed) so lists are not clipped by modals */
  position: fixed;
  z-index: 4000;
  margin: 0;
  padding: .25rem 0;
  list-style: none;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--surface, #111827);
  border: 1px solid var(--border, #2a3648);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.tz-combobox-list li {
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text, #e5eef7);
}
.tz-combobox-list li:hover,
.tz-combobox-list li[aria-selected="true"] {
  background: rgba(59, 130, 246, .2);
  color: #fff;
}
.tz-combobox-list li.tz-empty {
  cursor: default;
  color: var(--muted, #94a3b8);
  font-size: .85rem;
}
.tz-combobox-list li.tz-empty:hover {
  background: transparent;
  color: var(--muted, #94a3b8);
}
.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

@media (max-width: 1100px) {
  .rack-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rack-props-col {
    grid-column: 1 / -1;
  }
}
@media (max-width: 700px) {
  .rack-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Split panels */
.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}
.split-2 > * { min-width: 0; max-width: 100%; }
@media (max-width: 900px) { .split-2 { grid-template-columns: 1fr; } }

/* Empty state */
.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
}
.empty-state h3 { color: var(--text); margin-bottom: .5rem; }

/* Mobile sidebar */
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
}
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-area { margin-left: 0; }

/* In-page jump strip (device / PDU detail) */
.page-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 0 0 1rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: var(--page-jump-top, 3.55rem);
  z-index: 26;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.page-jump-chip {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.page-jump-chip:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, .45);
  background: var(--accent-dim);
}
.page-jump-chip.is-active {
  color: #dbeafe;
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, .7);
  box-shadow: inset 3px 0 0 0 var(--accent);
}
.page-jump-target {
  scroll-margin-top: var(--page-jump-scroll-pad, 7.5rem);
}
@media (max-width: 800px) {
  .page-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Device detail view */
.device-view-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.device-view-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}
body:has(.page-jump) .device-view-left {
  top: calc(var(--page-jump-top, 3.55rem) + var(--page-jump-height, 2.8rem) + .4rem);
}
.device-img-card .card-header h2 { font-size: .9rem; }
.device-img-body {
  padding: .75rem !important;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a101c;
}
.device-face-img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.device-img-placeholder {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: 2rem 1rem;
  line-height: 1.45;
}
.device-view-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.view-pane .card-header h2 { font-size: .95rem; }
.view-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .55rem .9rem;
}
.view-dl > div {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.view-dl > div.full { grid-column: 1 / -1; }
.view-dl dt {
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.view-dl dd {
  margin: 0;
  font-size: .92rem;
  word-break: break-word;
}
.view-dl .text-muted-dd { color: var(--muted); }
.view-derived {
  font-size: .68rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  opacity: .85;
}
.view-notes-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-height: 280px;
  overflow-y: auto;
}
.view-notes-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .7rem;
  background: var(--surface-2);
}
.view-note-meta {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .3rem;
}
.view-note-text {
  font-size: .9rem;
  white-space: pre-wrap;
  line-height: 1.4;
}
.view-legacy-notes {
  white-space: pre-wrap;
  font-size: .85rem;
  margin: .5rem 0 0;
  color: var(--muted);
}
.view-add-note {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
tr.row-empty td { color: var(--muted); font-style: italic; }
.dept-swatch {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.2);
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.dept-swatch.sm { width: .85rem; height: .85rem; border-radius: 3px; }
.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
}
@media (max-width: 960px) {
  .device-view-grid { grid-template-columns: 1fr; }
  .device-view-left { position: static; flex-direction: row; flex-wrap: wrap; }
  .device-img-card { flex: 1 1 220px; }
}

/* Feature cards muted when off (SNMP schedule, Scheduled polling list, etc.)
   Must override .card-header’s blue accent wash — opacity alone is too subtle. */
.settings-feature-card.settings-feature-inactive {
  border-color: rgba(100, 116, 139, 0.35);
  background: rgba(15, 23, 42, 0.55);
}
.settings-feature-card.settings-feature-inactive .card-header {
  background:
    linear-gradient(
      90deg,
      rgba(71, 85, 105, 0.35) 0%,
      rgba(51, 65, 85, 0.28) 50%,
      rgba(30, 41, 59, 0.4) 100%
    ),
    var(--surface-2, #0f172a);
  border-bottom-color: rgba(100, 116, 139, 0.35);
  box-shadow: inset 3px 0 0 0 rgba(100, 116, 139, 0.55);
}
.settings-feature-card.settings-feature-inactive .card-header h2,
.settings-feature-card.settings-feature-inactive .card-header h3 {
  color: #94a3b8;
}
.settings-feature-card.settings-feature-inactive .card-body,
.settings-feature-card.settings-feature-inactive .card-body.flush {
  color: #94a3b8;
}
.settings-feature-card.settings-feature-inactive .text-muted {
  color: #64748b !important;
}
.settings-feature-card.settings-feature-inactive table.data {
  opacity: 0.78;
}
.settings-feature-card.settings-feature-inactive table.data th {
  color: #94a3b8;
}
.settings-feature-card.settings-feature-inactive .badge-success {
  background: #334155;
  color: #cbd5e1;
}
.settings-feature-card.settings-feature-inactive .badge-info {
  background: #334155;
  color: #94a3b8;
}
.settings-feature-card.settings-feature-inactive .btn-primary {
  background: #475569;
  border-color: #64748b;
  color: #e2e8f0;
}
.settings-feature-card.settings-feature-inactive a:not(.btn) {
  color: #94a3b8;
}
.settings-feature-card.settings-feature-active {
  /* default .card look */
}
.settings-feature-card .snmp-schedule-status-detail {
  color: var(--muted, #94a3b8);
}
.settings-feature-card.settings-feature-active .snmp-schedule-status-detail {
  color: var(--text, #e2e8f0);
}

/* ── Alerts hub (Settings) ── */
.alerts-hub-section {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.45), rgba(30, 41, 59, 0.25));
}
.alerts-hub-section + .alerts-hub-section {
  margin-top: .85rem;
}
.alerts-hub-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .55rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}
.alerts-hub-future {
  opacity: .85;
  border-style: dashed;
}
.alerts-cat-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.alerts-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
  font-size: .8rem;
  cursor: pointer;
  user-select: none;
}
.alerts-cat-chip:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
}

/* Row view health frame */
.row-view-cab-health-warn .row-view-elevation,
.row-view-cab-health-crit .row-view-elevation {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.45), 0 0 18px rgba(234, 179, 8, 0.18);
}
.row-view-cab-health-crit .row-view-elevation {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.55), 0 0 22px rgba(239, 68, 68, 0.22);
}
.row-view-cab-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
}

/* ── Health pulse (modern status — lists, cabinets, 3D prep) ── */
.health-pulse {
  --hp-color: #64748b;
  --hp-glow: rgba(100, 116, 139, 0.45);
  position: relative;
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--hp-color);
  box-shadow: 0 0 0 0 var(--hp-glow);
  flex-shrink: 0;
  vertical-align: middle;
}
.health-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--hp-color);
  opacity: .35;
}
.health-pulse-ok {
  --hp-color: #22c55e;
  --hp-glow: rgba(34, 197, 94, 0.55);
}
.health-pulse-warn {
  --hp-color: #eab308;
  --hp-glow: rgba(234, 179, 8, 0.5);
  animation: health-pulse-breathe 2.2s ease-in-out infinite;
}
.health-pulse-crit,
.health-pulse-down {
  --hp-color: #ef4444;
  --hp-glow: rgba(239, 68, 68, 0.55);
  animation: health-pulse-breathe 1.35s ease-in-out infinite;
}
.health-pulse-info {
  --hp-color: #38bdf8;
  --hp-glow: rgba(56, 189, 248, 0.45);
}
.health-pulse-off,
.health-pulse-unknown {
  --hp-color: #64748b;
  --hp-glow: transparent;
  opacity: .7;
}
@keyframes health-pulse-breathe {
  0%, 100% { box-shadow: 0 0 0 0 var(--hp-glow); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px transparent; transform: scale(1.08); }
}
.health-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  padding: .15rem .55rem .15rem .4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.4);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #cbd5e1;
  white-space: nowrap;
}
.health-chip-ok {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
  background: rgba(22, 101, 52, 0.18);
}
.health-chip-warn {
  border-color: rgba(234, 179, 8, 0.4);
  color: #fde047;
  background: rgba(113, 63, 18, 0.25);
}
.health-chip-crit,
.health-chip-down {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.28);
}
.health-chip-off,
.health-chip-unknown {
  color: #94a3b8;
}
.health-chip .health-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Row / table accent bar for critical rows */
tr.health-row-down > td:first-child,
tr.health-row-crit > td:first-child {
  box-shadow: inset 3px 0 0 #ef4444;
}
tr.health-row-warn > td:first-child {
  box-shadow: inset 3px 0 0 #eab308;
}

/* Live toast host */
#toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
#toast-host .ca-toast {
  pointer-events: auto;
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .75rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
  font-size: .85rem;
  line-height: 1.35;
  animation: ca-toast-in .28s ease-out;
}
#toast-host .ca-toast.ca-toast-out {
  animation: ca-toast-out .25s ease-in forwards;
}
#toast-host .ca-toast-title {
  font-weight: 650;
  margin: 0 0 .15rem;
}
#toast-host .ca-toast-msg {
  margin: 0;
  color: #94a3b8;
  font-size: .78rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#toast-host .ca-toast-info { border-left: 3px solid #38bdf8; }
#toast-host .ca-toast-success { border-left: 3px solid #22c55e; }
#toast-host .ca-toast-warning { border-left: 3px solid #eab308; }
#toast-host .ca-toast-error,
#toast-host .ca-toast-danger { border-left: 3px solid #ef4444; }
#toast-host .ca-toast-cleared { border-left: 3px solid #22c55e; }
#toast-host .ca-toast-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
#toast-host .ca-toast-cleared-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  vertical-align: middle;
}
#toast-host .ca-toast-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .15rem;
}
#toast-host .ca-toast-close:hover { color: #e2e8f0; }
@keyframes ca-toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ca-toast-out {
  to { opacity: 0; transform: translateY(8px) scale(.96); }
}

/* Utility */
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-0 { margin-top: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.app-footer a { color: var(--accent, #38bdf8); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }


/* SNMP last-poll age badges (G-A5) */
.snmp-age {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.snmp-age-ok { color: var(--success, #34d399); }
.snmp-age-warn { color: var(--warning, #fbbf24); }
.snmp-age-danger { color: var(--danger, #f87171); }
.snmp-age-never { color: var(--text-muted, #94a3b8); font-weight: 500; }
.snmp-age-na { color: var(--text-muted, #64748b); font-weight: 400; }

/* First-login setup wizard */
.setup-wizard-overlay {
  z-index: 9000;
  align-items: center;
  padding: 1.25rem 1rem;
}
.setup-wizard-panel {
  width: min(42rem, 100%);
  max-height: min(92vh, 44rem);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.setup-wizard-head {
  padding: 1.05rem 1.25rem .85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.setup-wizard-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .7rem;
}
.setup-wizard-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.setup-wizard-kicker {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 600;
}
.setup-wizard-head h2 {
  margin: .1rem 0 0;
  font-size: 1.25rem;
  font-weight: 650;
}
.setup-wizard-track {
  display: flex;
  gap: 4px;
  margin-top: .85rem;
}
.setup-wizard-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.22);
}
.setup-wizard-dot.is-done { background: #34d399; }
.setup-wizard-dot.is-current { background: #60a5fa; }
.setup-wizard-dot.is-skipped { background: #64748b; }
.setup-wizard-meta {
  display: flex;
  justify-content: space-between;
  margin-top: .4rem;
  font-size: .75rem;
  color: #94a3b8;
}
.setup-wizard-body {
  padding: 1.05rem 1.25rem 1.15rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.setup-wizard-blurb {
  margin: 0 0 1rem;
  color: rgba(226, 232, 240, 0.88);
  line-height: 1.5;
  font-size: .95rem;
}
.setup-wizard-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem .85rem;
}
.setup-wizard-field { display: flex; flex-direction: column; gap: .3rem; }
.setup-wizard-field.is-full { grid-column: 1 / -1; }
.setup-wizard-field label {
  font-size: .8rem;
  font-weight: 600;
  color: #cbd5e1;
}
.setup-wizard-field .hint {
  font-size: .75rem;
  color: #94a3b8;
}
.setup-wizard-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.setup-wizard-check input { margin-top: .2rem; }
.setup-wizard-guides details {
  margin-top: .85rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.35);
  padding: .55rem .8rem;
}
.setup-wizard-guides summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
  color: #93c5fd;
}
.setup-wizard-guides pre {
  white-space: pre-wrap;
  margin: .5rem 0 0;
  font-family: inherit;
  font-size: .82rem;
  color: #cbd5e1;
  line-height: 1.45;
}
.setup-wizard-test {
  margin-top: .9rem;
  padding: .75rem .85rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.setup-wizard-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .5rem;
}
.setup-wizard-result {
  font-size: .82rem;
  line-height: 1.4;
}
.setup-wizard-result.is-ok { color: #86efac; }
.setup-wizard-result.is-bad { color: #fca5a5; }
.setup-wizard-result ul {
  margin: .35rem 0 0;
  padding-left: 1.1rem;
  color: #cbd5e1;
}
.setup-wizard-next {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.setup-wizard-next-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.setup-wizard-next-item.is-primary {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 58, 95, 0.55);
}
.setup-wizard-next-copy {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.setup-wizard-next-copy strong { color: #f8fafc; font-size: .9rem; }
.setup-wizard-next-copy span { color: #94a3b8; font-size: .78rem; line-height: 1.4; }
.setup-wizard-next-item .btn { flex-shrink: 0; white-space: nowrap; }
/* Guided site tour */
.site-tour {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
}
.site-tour[hidden] { display: none !important; }
.site-tour-dim {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.48);
  pointer-events: none;
}
.site-tour-hole {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(2, 8, 20, 0.52), 0 0 0 2px #60a5fa, 0 0 24px rgba(96, 165, 250, 0.45);
  pointer-events: none;
  transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
}
.site-tour-lit {
  position: relative;
  z-index: 9501;
  border-radius: 8px;
  pointer-events: auto;
}
.site-tour-flag {
  position: fixed;
  width: min(26rem, calc(100vw - 24px));
  pointer-events: auto;
  z-index: 9502;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}
.site-tour-flag.is-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.site-tour-pole {
  width: 4px;
  height: 22px;
  margin: 0 0 0 1.4rem;
  background: linear-gradient(#f87171, #ef4444);
  border-radius: 2px 2px 0 0;
}
.site-tour-flag.is-center .site-tour-pole { display: none; }
.site-tour-card {
  background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 12px;
  padding: .9rem 1rem 1rem;
  color: #e2e8f0;
}
.site-tour-kicker {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 700;
  margin-bottom: .25rem;
}
.site-tour-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 0 0 .65rem;
}
.site-tour-chapter {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .18rem .45rem;
  border-radius: 999px;
  cursor: pointer;
}
.site-tour-chapter:hover { border-color: #60a5fa; color: #fff; }
.site-tour-chapter.is-current {
  background: rgba(37, 99, 235, 0.45);
  border-color: #60a5fa;
  color: #fff;
}
.site-tour-wait {
  margin: -.35rem 0 .75rem;
  padding: .4rem .55rem;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: .8rem;
  line-height: 1.4;
}
.site-tour-card h3 {
  margin: 0 0 .45rem;
  font-size: 1.08rem;
  color: #fff;
}
.site-tour-card p {
  margin: 0 0 .85rem;
  font-size: .88rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.9);
}
.site-tour-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.site-tour-spacer { flex: 1; }
body.site-tour-open { overflow: hidden; }

.dash-quests {
  margin: 0 0 1rem;
  padding: .85rem 1rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(30, 58, 95, 0.45), rgba(15, 23, 42, 0.55));
}
.dash-quests-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem 1rem;
  margin-bottom: .7rem;
}
.dash-quests-head strong { color: #e2e8f0; }
.dash-quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .55rem;
}
.dash-quest {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  text-decoration: none;
}
.dash-quest:hover { border-color: #60a5fa; }
.dash-quest span { color: #94a3b8; font-size: .8rem; line-height: 1.4; }
.dash-quest em { font-style: normal; color: #93c5fd; font-size: .8rem; font-weight: 600; }

.cab-audit-diff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.cab-audit-diff-list li {
  padding: .4rem .55rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: .85rem;
}
.cab-audit-diff-list li.is-added { border-color: rgba(52, 211, 153, 0.35); }
.cab-audit-diff-list li.is-removed { border-color: rgba(248, 113, 113, 0.4); }
.cab-audit-diff-list li.is-moved { border-color: rgba(251, 191, 36, 0.35); }
.cab-audit-diff-list .text-muted { display: block; font-size: .78rem; margin-top: .15rem; }

.setup-wizard-unit-preview {
  margin: .75rem 0 0;
  padding: .55rem .7rem;
  border-radius: 8px;
  background: rgba(30, 58, 95, 0.45);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #dbeafe;
  font-size: .85rem;
  line-height: 1.4;
}
.setup-wizard-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.15rem .95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.35);
}
.setup-wizard-foot .spacer { flex: 1; }
.setup-wizard-error {
  margin: 0 1.25rem .25rem;
  color: #fca5a5;
  font-size: .85rem;
}
.setup-wizard-save-hint {
  font-size: .72rem;
  color: #64748b;
  width: 100%;
}
@media (max-width: 640px) {
  .setup-wizard-fields { grid-template-columns: 1fr; }
}

/* In-app documentation (operator how-tos + API) */
.docs-page { max-width: 920px; }
.docs-page .docs-intro { align-items: flex-start; gap: .75rem; }
.docs-page .card { scroll-margin-top: 5.5rem; }
.docs-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  justify-content: flex-end;
  max-width: 28rem;
}
.docs-toc-label {
  margin: .75rem 0 .25rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.docs-toc-label:first-child { margin-top: 0; }
.docs-toc-list {
  margin: 0 0 .35rem;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 1.5rem;
}
.docs-toc-list li { break-inside: avoid; margin: .2rem 0; }
.docs-prose > p:first-child,
.docs-prose > ul:first-child { margin-top: 0; }
.docs-prose h3.docs-h3 {
  margin: 1.35rem 0 .4rem;
  font-size: .95rem;
  font-weight: 650;
  color: #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.docs-prose h3.docs-h3:first-child { margin-top: 0; }
.docs-method {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .12rem .4rem;
  border-radius: 4px;
  background: var(--success-dim);
  color: #86efac;
}
.docs-method-write {
  background: #3f2a12;
  color: #fdba74;
}
.docs-path { margin: 0 0 .55rem; }
.docs-path code { font-size: .82rem; }
.docs-pre-wrap {
  position: relative;
  margin: .5rem 0 1rem;
}
.docs-pre {
  margin: 0;
  padding: .75rem .9rem 2.4rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.45;
  background: #0a1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}
.docs-pre-wrap .docs-copy {
  position: absolute;
  right: .45rem;
  bottom: .45rem;
}
@media (max-width: 720px) {
  .docs-toc-list { columns: 1; }
}

/* Firewall detail charts */
.fw-charts { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.fw-chart-note { margin: 0; }
.fw-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.fw-vpn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.fw-vpn-row-one { grid-template-columns: 1fr; }
.fw-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: 0 0 1rem;
}
.fw-template {
  text-align: left;
  background: rgba(15, 23, 42, .45);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: .75rem .9rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.fw-template strong { display: block; margin-bottom: .25rem; }
.fw-template span { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.fw-template.is-selected {
  border-color: #38bdf8;
  box-shadow: inset 0 0 0 1px #38bdf8;
}
.fw-fmc-title {
  margin: .4rem 0 .35rem;
  font-size: 1rem;
}
.fw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  padding: .15rem .85rem .55rem;
  font-size: .75rem;
  color: var(--muted);
}
.fw-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.fw-legend i {
  width: .55rem; height: .55rem; border-radius: 50%; display: inline-block;
}
.fw-if-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.fw-if-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .85rem .65rem;
}
.fw-if-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  margin-bottom: .45rem;
}
.fw-if-head span { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.fw-util-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: .4rem;
  align-items: center;
  margin-top: .28rem;
  font-size: .78rem;
}
.fw-util-k { color: var(--muted); }
.fw-util-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fw-util-bar {
  height: 8px;
  background: rgba(51, 65, 85, .65);
  border-radius: 999px;
  overflow: hidden;
}
.fw-util-bar > i { display: block; height: 100%; border-radius: 999px; max-width: 100%; }
.fw-util-bar.in > i { background: linear-gradient(90deg, #22d3ee, #38bdf8); }
.fw-util-bar.out > i { background: linear-gradient(90deg, #fb923c, #f97316); }
.fw-util-bar.hot > i { background: linear-gradient(90deg, #fbbf24, #f87171); }
.fw-if-rates {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: 0 0 .45rem;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.fw-if-spans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.fw-if-span { min-height: 0; }
.fw-plot { position: relative; }
.fw-speck-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.fw-speck-runner {
  position: absolute;
  left: 0;
  width: 100%;
  height: 0;
  animation-name: fwSpeckIn;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
}
.fw-speck-runner.out { animation-name: fwSpeckOut; }
.fw-speck-runner > i {
  position: absolute;
  left: 0;
  width: 2px;
  height: 2px;
  margin-top: -1px;
  border-radius: 50%;
  opacity: 0.55;
}
@keyframes fwSpeckIn {
  from { transform: translateX(-3%); }
  to { transform: translateX(103%); }
}
@keyframes fwSpeckOut {
  from { transform: translateX(103%); }
  to { transform: translateX(-3%); }
}
@media (prefers-reduced-motion: reduce) {
  .fw-speck-layer { display: none; }
}
.fw-if-spark { margin-top: .35rem; }
.fw-if-spark .pc-axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.fw-if-spark .pc-grid { stroke: rgba(148, 163, 184, .18); stroke-width: 1; }
.fw-if-card .fw-legend { padding: .2rem 0 0; }
.fw-chart-foot {
  margin: 0;
  padding: 0 .85rem .6rem;
  color: var(--muted);
  font-size: .75rem;
}
.fw-if-fault { color: #fca5a5; }
.fw-if-toggle-label { font-weight: 650; }
.fw-if-toggle-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.fw-if-switch { margin: .2rem 0; }
.fw-if-switch-name { font-size: .92rem; }
.dash-fw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
}
.dash-fw-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  background: var(--surface-2);
  min-width: 0;
}
.dash-fw-name { font-weight: 650; }
.dash-fw-links { margin-top: .45rem; font-size: .82rem; }
.dash-fw-links > div {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  margin-top: .28rem;
}
fieldset.card-body { padding: 1.15rem; }
@media (max-width: 800px) {
  .fw-chart-grid, .fw-vpn-row, .fw-templates { grid-template-columns: 1fr; }
  .fw-if-spans { grid-template-columns: 1fr; }
}
