:root {
  --bg0: #060a12;
  --bg1: #0b1220;
  --bg2: #101a2e;
  --bg3: #162238;
  --bg4: #1c2c48;
  --line: rgba(148, 163, 184, 0.12);
  --line2: rgba(148, 163, 184, 0.2);
  --text: #eef3fb;
  --muted: #93a4bd;
  --dim: #64748b;
  --primary: #6366f1;
  --primary2: #818cf8;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --violet: #a78bfa;
  --glow: 0 0 40px rgba(99, 102, 241, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 272px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --glass: linear-gradient(145deg, rgba(28, 44, 72, 0.72), rgba(16, 26, 46, 0.88));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 0% -10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(34, 211, 238, 0.1), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(167, 139, 250, 0.08), transparent 50%),
    var(--bg0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); text-decoration: none; }
::selection { background: rgba(99, 102, 241, 0.45); }

/* Boot */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
}
.boot-orb {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: var(--glow);
  animation: pulse 1.4s ease infinite;
}
.boot-text { font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; }
.boot-sub { color: var(--muted); font-size: 0.9rem; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none !important; }
}

.login-hero {
  position: relative;
  overflow: hidden;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(99, 102, 241, 0.18), transparent 45%),
    linear-gradient(20deg, rgba(34, 211, 238, 0.08), transparent 40%),
    var(--bg1);
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -30% 20%;
  height: 70%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 60%);
  pointer-events: none;
}
.hero-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  width: fit-content;
  overflow: hidden;
  color: #e0e7ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background:
    linear-gradient(120deg, rgba(99, 102, 241, 0.28), rgba(34, 211, 238, 0.14) 55%, rgba(167, 139, 250, 0.2));
  border: 1px solid rgba(129, 140, 248, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 24px rgba(99, 102, 241, 0.22),
    0 0 32px rgba(34, 211, 238, 0.12);
  backdrop-filter: blur(10px);
}
.hero-badge::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.14) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: badgeShine 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes badgeShine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}
.hero-badge-ico {
  width: 26px; height: 26px; border-radius: 999px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.45), rgba(34, 211, 238, 0.25));
  border: 1px solid rgba(199, 210, 254, 0.45);
  color: #a5f3fc;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
}
.hero-badge-ico svg {
  width: 14px; height: 14px;
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.55));
}
.hero-badge-text {
  background: linear-gradient(90deg, #e0e7ff, #a5f3fc 55%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-badge-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: badgePulse 1.8s ease-out infinite;
  flex-shrink: 0;
}
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 14ch;
  margin-top: 24px;
}
.hero-title span {
  background: linear-gradient(90deg, var(--cyan), var(--primary2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc { margin-top: 16px; color: var(--muted); max-width: 42ch; font-size: 1.02rem; }
.hero-features {
  display: grid; gap: 12px; margin-top: 36px; max-width: 440px;
}
.hero-feat {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: blur(10px);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.hero-feat:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.4);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}
.hero-feat .ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.28), rgba(34, 211, 238, 0.12));
  border: 1px solid rgba(129, 140, 248, 0.35);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 20px rgba(99, 102, 241, 0.18);
  font-size: 1rem;
  overflow: hidden;
}
.hero-feat .ico::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent 55%);
  pointer-events: none;
}
.hero-feat .ico svg {
  width: 28px; height: 28px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.35));
}
.hero-feat .ico-multi {
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.32), rgba(34, 211, 238, 0.12));
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 22px rgba(167, 139, 250, 0.22),
    0 0 28px rgba(167, 139, 250, 0.12);
}
.hero-feat .ico-multi svg {
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.45));
}
.hero-feat .ico-netops {
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.22), rgba(99, 102, 241, 0.18));
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 22px rgba(34, 211, 238, 0.18),
    0 0 28px rgba(52, 211, 153, 0.12);
}
.hero-feat .ico-netops svg {
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.45));
}
.hero-feat .ico-jump {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.14));
  border-color: rgba(129, 140, 248, 0.45);
}
.hero-feat:hover .ico {
  animation: icoPop 0.45s ease;
}
@keyframes icoPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.hero-feat strong { display: block; font-size: 0.95rem; letter-spacing: -0.01em; }
.hero-feat span { color: var(--muted); font-size: 0.82rem; margin-top: 2px; display: block; }

/* Login hero brand footer — original layout (logo SVG + name + status, one row) */
.hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 6px 18px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}
.hero-brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; flex-shrink: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.1) 0%, transparent 50%),
    linear-gradient(145deg, rgba(99, 102, 241, 0.42), rgba(14, 165, 233, 0.22));
  border: 1px solid rgba(129, 140, 248, 0.5);
  box-shadow:
    0 0 0 1px rgba(165, 243, 252, 0.12) inset,
    0 0 16px rgba(99, 102, 241, 0.35),
    0 0 20px rgba(34, 211, 238, 0.12);
}
.hero-brand-mark svg {
  width: 20px; height: 20px;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.4));
}
.hero-brand-text {
  display: flex; flex-direction: column; gap: 0; min-width: 0;
}
.hero-brand-text strong {
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #e2e8f0, #a5f3fc 60%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}
.hero-brand-text span {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.hero-brand-meta {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  color: #86efac;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.hero-brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: badgePulse 1.8s ease-out infinite;
}

.login-panel {
  display: grid; place-items: center;
  padding: 32px 24px;
  background: rgba(6, 10, 18, 0.4);
}
.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--line2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #818cf8 20%, #22d3ee 55%, #34d399 85%, transparent);
  opacity: 0.9;
}
.login-card-head {
  margin-bottom: 22px;
}
.login-card-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 8px;
}
.login-card h1 {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #f8fafc, #a5f3fc 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.login-card .sub { color: var(--muted); margin: 6px 0 24px; font-size: 0.92rem; }
.login-form .form-group { margin-bottom: 16px; }
.login-form .form-control {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(6, 10, 18, 0.72);
}
.login-submit {
  margin-top: 6px;
  letter-spacing: 0.02em;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
}
.login-submit:hover {
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.22);
}
.login-card-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}
#login-error:not(:empty) {
  margin-bottom: 14px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  background: rgba(6, 10, 18, 0.65);
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  color: var(--text);
  transition: 0.15s border-color, 0.15s box-shadow;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.form-control:disabled,
.form-control[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  background: rgba(6, 10, 18, 0.4);
}
/* Select: match input height/look (dark theme) */
select.form-control {
  background-color: rgba(6, 10, 18, 0.65);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2393a4bd' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  height: 44px;
  line-height: 1.25;
  cursor: pointer;
}
select.form-control option {
  background: #0f172a;
  color: #eef3fb;
}
textarea.form-control { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 0.82rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 16px; font-weight: 600; cursor: pointer;
  transition: background 0.05s linear, border-color 0.05s linear, color 0.05s linear, filter 0.05s linear;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #0ea5e9);
  color: white; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line2); color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-danger {
  background: rgba(251, 113, 133, 0.12);
  color: #fda4af; border: 1px solid rgba(251, 113, 133, 0.3);
}
.btn-success {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3);
}
.btn-ssh {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(34, 211, 238, 0.15));
  color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35);
}
.btn-telnet {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 113, 133, 0.1));
  color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.35);
}
.btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 18px; font-size: 0.98rem; }

/* Page / toolbar actions — compact & proportional (IPAM, RADIUS, Backup, etc.) */
.page-hero > .btn,
.page-hero > .flex .btn,
.page-hero .flex.gap-2 .btn,
.toolbar > .btn,
.toolbar .btn-primary,
.toolbar .btn-secondary {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 6px;
  font-weight: 600;
  min-height: 32px;
}
.page-hero > .btn.btn-primary,
.page-hero > .flex .btn-primary,
.toolbar > .btn-primary {
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.28);
}
.page-hero .btn-icon,
.toolbar .btn-icon {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 0.95rem;
}

.alert {
  padding: 11px 13px; border-radius: var(--radius-sm);
  margin-bottom: 14px; font-size: 0.9rem;
}
.alert-error { background: rgba(251,113,133,0.12); color: #fecdd3; border: 1px solid rgba(251,113,133,0.28); }
.alert-success { background: rgba(52,211,153,0.12); color: #a7f3d0; border: 1px solid rgba(52,211,153,0.28); }
.alert-info { background: rgba(99,102,241,0.12); color: #c7d2fe; border: 1px solid rgba(99,102,241,0.28); }

.login-hint {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--dim); line-height: 1.75;
}
.login-hint code {
  font-family: var(--mono); font-size: 0.74rem;
  background: rgba(0,0,0,0.35); color: var(--cyan);
  padding: 1px 6px; border-radius: 5px;
}

/* Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.22s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  /* solid bg — no backdrop-filter (blur kills scroll FPS) */
  background: #0b1220;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
  transition: opacity 0.18s ease, border-color 0.18s ease;
  overscroll-behavior: contain;
}
.app-shell.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
  overflow: hidden;
}
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  flex-shrink: 0; font-size: 1rem;
  display: inline-grid; place-items: center;
}
.btn-xs {
  padding: 2px 6px; font-size: 0.72rem; border-radius: 6px; min-width: 26px;
}
/* Match topbar height so logo row aligns with right-side header */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  height: 48px;
  padding: 0 14px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
/* Jump Access brand tile — richer indigo → violet → cyan */
.logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18) 0%, transparent 42%),
    linear-gradient(135deg, #818cf8 0%, #6366f1 42%, #0ea5e9 100%);
  display: grid;
  place-items: center;
  color: #f8fafc;
  box-shadow:
    0 0 0 1px rgba(165, 243, 252, 0.22) inset,
    0 4px 14px rgba(99, 102, 241, 0.45),
    0 0 18px rgba(34, 211, 238, 0.18);
  flex-shrink: 0;
}
.logo svg {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.25));
}
.sidebar-brand h2 {
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
.sidebar-brand span {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.15;
  display: block;
}
.sidebar-brand .brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.nav-section {
  padding: 16px 18px 6px;
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--dim); font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: calc(100% - 16px); margin: 2px 8px;
  padding: 11px 12px; border-radius: 11px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; text-align: left;
  font-weight: 500; font-size: 0.92rem;
  transition: none; /* instant highlight */
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.22), rgba(99,102,241,0.06));
  border-color: rgba(129,140,248,0.25);
  color: #c7d2fe;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.08);
}
.nav-item .icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  font-size: 0.85rem;
}
.nav-item.active .icon {
  background: linear-gradient(135deg, rgba(99,102,241,0.45), rgba(34,211,238,0.25));
}

.sidebar-footer {
  margin-top: auto; padding: 14px;
  border-top: 1px solid var(--line);
}
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center; font-weight: 700; font-size: 0.82rem;
}
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .meta strong { display: block; font-size: 0.88rem; }
.user-chip .meta span {
  display: block; font-size: 0.72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main { min-width: 0; display: flex; flex-direction: column; }
/* Compact app top bar — same height as .sidebar-brand (48px); never wrap */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px;
  min-height: 48px;
  height: 48px;
  box-sizing: border-box;
  /* solid sticky bar — blur on sticky = janky page scroll */
  background: #060a12;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  overflow: hidden;
}
.topbar-left {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.topbar-left > div:last-child {
  min-width: 0;
  overflow: hidden;
}
.topbar h1 {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .subtitle {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 1px;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(420px, 48%);
  justify-content: flex-end;
}
.topbar-actions .btn-sm {
  padding: 5px 10px;
  font-size: 0.76rem;
  flex-shrink: 0;
}
.topbar #btn-toggle-sidebar {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Multi-tenant company switcher (top-right) — single line, ellipsis long names */
.tenant-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  max-width: 100%;
  padding: 4px 8px 4px 5px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(99, 102, 241, 0.16), rgba(34, 211, 238, 0.06) 55%, rgba(15, 23, 42, 0.65));
  border: 1px solid rgba(129, 140, 248, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 4px 14px rgba(99, 102, 241, 0.12);
  transition: border-color 0.05s linear, box-shadow 0.05s linear;
  overflow: hidden;
}
.tenant-switch:hover {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 6px 16px rgba(34, 211, 238, 0.12);
}
.tenant-switch.is-flash {
  animation: tenantFlash 0.45s ease;
}
@keyframes tenantFlash {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.55); }
  100% { box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12); }
}
.tenant-switch.is-locked {
  opacity: 0.92;
}
.tenant-switch.is-locked .tenant-switch-chevron {
  opacity: 0.35;
}
.tenant-switch-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  color: #a5f3fc;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.28), rgba(34, 211, 238, 0.14));
  border: 1px solid rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.16);
}
.tenant-switch-ico svg {
  width: 14px; height: 14px;
  filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.35));
}
.tenant-switch-body {
  display: flex; flex-direction: column; gap: 0;
  min-width: 0;
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}
.tenant-switch-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a5b4fc;
  line-height: 1;
  margin-bottom: 1px;
  pointer-events: none;
  white-space: nowrap;
}
.tenant-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 2px 0 0;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tenant-select:disabled {
  cursor: default;
  opacity: 0.95;
  color: var(--text);
}
.tenant-select option {
  background: #0f172a;
  color: #e2e8f0;
}
.tenant-switch-chevron {
  color: var(--cyan);
  font-size: 0.68rem;
  opacity: 0.85;
  flex-shrink: 0;
  pointer-events: none;
  margin-left: 1px;
}

/* Top bar stays same size on all pages (including Jump) for visual consistency */

.content {
  padding: 24px 28px 40px;
  flex: 1;
  min-height: 0;
  /* isolate paint so page scroll doesn't re-blur sidebar/topbar chrome */
  contain: layout style;
}
/* Soft page transition — avoid hard flash when switching menus */
#content {
  transition: opacity 0.12s ease;
}
#content.is-page-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Jump Access: lock page to viewport — maximize terminal canvas */
.main:has(#jump-workspace) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.main:has(#jump-workspace) .content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 8px;
  gap: 8px;
}
.main:has(#jump-workspace) .page-hero {
  flex-shrink: 0;
  margin-bottom: 0 !important;
}

/* Slim Jump toolbar (replaces bulky page-hero) */
.jump-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 6px 4px 2px;
  min-height: 36px;
}
.jump-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.jump-toolbar-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(99,102,241,0.35), rgba(34,211,238,0.18));
  border: 1px solid rgba(129,140,248,0.35);
  box-shadow: 0 0 18px rgba(99,102,241,0.2);
}
.jump-toolbar-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.jump-toolbar-text strong {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.jump-toolbar-text .dim {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jump-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.jump-toolbar-actions .btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

/* Backup device link + history panel */
.bak-device-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
}
.bak-device-link:hover strong {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bak-device-link:hover .muted { color: var(--muted); }
.bak-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.bak-date-chip {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  transition: 0.12s border-color, 0.12s background, 0.12s box-shadow;
  overflow: hidden;
}
.bak-date-chip:hover {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.1);
}
.bak-date-chip.active {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.15);
}
.bak-date-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 28px 8px 12px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.bak-date-when {
  font-size: 0.82rem;
  font-weight: 700;
}
.bak-date-meta {
  font-size: 0.68rem;
  color: var(--dim);
}
.bak-date-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: 0.12s background, 0.12s color;
}
.bak-date-x:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}
.bak-date-chip:not(:hover) .bak-date-x {
  opacity: 0.55;
}
.bak-date-chip:hover .bak-date-x {
  opacity: 1;
}
.bak-hist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}
.bak-hist-toolbar .btn-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Inventory detail */
.inv-detail-card .card-body { padding: 8px 4px; }
.inv-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 700px) {
  .inv-detail-grid { grid-template-columns: 1fr; }
}
.inv-detail-row {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.inv-detail-label {
  flex: 0 0 120px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.inv-detail-value {
  flex: 1;
  font-size: 0.9rem;
  word-break: break-word;
}

/* Monitor history */
.probe-spark-wrap {
  position: relative;
}
.probe-spark {
  display: block;
  width: 100%;
  height: 72px;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  cursor: crosshair;
  touch-action: none;
}
.probe-spark .probe-bar {
  transition: none;
}
.probe-spark .probe-bar.is-hot {
  fill: #a7f3d0 !important;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 0.6;
}
.probe-spark .probe-bar-down.is-hot {
  fill: #fda4af !important;
}
.probe-spark-tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.96);
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.35;
}
.probe-spark-tip.hidden { display: none; }
.probe-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.probe-tip-status {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.probe-tip-status.is-up { color: #6ee7b7; }
.probe-tip-status.is-down { color: #fda4af; }
.probe-tip-rtt {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.82rem;
}
.probe-tip-when {
  color: var(--text);
  font-size: 0.78rem;
}
.probe-tip-meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
  word-break: break-word;
}
button.linkish {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}
button.linkish:hover { text-decoration: underline; }

/* IPAM classification chips */
.ipam-class-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  align-items: center;
}
.ipam-class-chip {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.14s border-color, 0.14s color, 0.14s background;
}
.ipam-class-chip:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--text);
}
.ipam-class-chip.active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  font-weight: 600;
}
.ipam-class-chip .dim { opacity: 0.7; }
.ipam-group-badge {
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.ipam-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* IPAM free space */
.ipam-free-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.ipam-free-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.1), rgba(10, 14, 26, 0.6));
  color: inherit;
  text-align: left;
  width: 100%;
}
button.ipam-free-range-btn {
  cursor: pointer;
  transition: 0.14s border-color, 0.14s transform, 0.14s box-shadow;
}
button.ipam-free-range-btn:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(52, 211, 153, 0.12);
}
button.ipam-free-range-btn:disabled {
  opacity: 0.75;
  cursor: default;
}
.ipam-free-cidr {
  font-weight: 700;
  font-size: 0.92rem;
  color: #6ee7b7;
  letter-spacing: -0.01em;
}
.ipam-free-meta { line-height: 1.3; }
.ipam-free-ips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}
.ipam-free-ip {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.ipam-free-ip:hover:not(:disabled) {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
}
.ipam-free-ip:disabled { opacity: 0.6; cursor: default; }
.ipam-cidr-range {
  margin-top: 2px;
  line-height: 1.25;
}

/* Cards & stats (legacy + dashboard) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  position: relative; overflow: hidden;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  opacity: 0.75;
}
.stat-card .label { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.stat-card .value {
  font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px;
}
.stat-card .hint { font-size: 0.72rem; color: var(--dim); margin-top: 4px; }
.stat-card.cyan .value { color: var(--cyan); }
.stat-card.green .value { color: var(--emerald); }
.stat-card.amber .value { color: var(--amber); }
.stat-card.purple .value { color: var(--violet); }
.stat-card.rose .value { color: var(--rose); }

/* ---------- Dashboard (eye-catching) ---------- */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px 20px;
  align-items: center;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background:
    radial-gradient(1200px 400px at -10% -40%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(900px 360px at 110% 120%, rgba(34, 211, 238, 0.18), transparent 50%),
    linear-gradient(145deg, rgba(18, 26, 48, 0.95), rgba(8, 12, 24, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}
/* Command-center backdrop — strong, full-bleed, no layout height */
.dash-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
/* Soft decorative layers (look restored; no continuous motion for scroll FPS) */
.dash-hero-bg .dash-hero-grid {
  filter: blur(1.5px);
}
.dash-hero-bg .dash-hero-grid-fine {
  filter: blur(1.2px);
}
.dash-hero-bg .dash-hero-mesh {
  filter: blur(2.4px);
}
.dash-hero-bg .dash-hero-radar,
.dash-hero-bg .dash-hero-scan {
  filter: blur(1.8px);
}
.dash-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.7;
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.14) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, #000 0%, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 55%, transparent 100%);
}
.dash-hero-grid-fine {
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.1) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: radial-gradient(ellipse 90% 100% at 60% 50%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 90% 100% at 60% 50%, #000 10%, transparent 70%);
}
.dash-hero-scan {
  position: absolute;
  left: 0; right: 0;
  height: 48%;
  /* static band (was animated top: -48%→110%) — keeps the glow look without scroll jank */
  top: 18%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.08) 42%,
    rgba(167, 139, 250, 0.14) 50%,
    rgba(34, 211, 238, 0.08) 58%,
    transparent 100%
  );
  animation: none;
  mix-blend-mode: screen;
  opacity: 0.9;
}
.dash-hero-radar {
  position: absolute;
  right: 8%;
  top: 50%;
  width: min(42vw, 220px);
  height: min(42vw, 220px);
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow:
    0 0 0 12px rgba(34, 211, 238, 0.04),
    0 0 0 28px rgba(99, 102, 241, 0.04),
    inset 0 0 40px rgba(34, 211, 238, 0.08);
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(34, 211, 238, 0.06) 0deg 2deg,
      transparent 2deg 18deg
    );
  animation: none;
  opacity: 0.75;
}
.dash-hero-radar::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px dashed rgba(129, 140, 248, 0.35);
}
.dash-hero-mesh {
  position: absolute;
  inset: -8% -4%;
  width: 108%;
  height: 116%;
  opacity: 0.72;
}
.dash-hero-mesh .hero-mesh-links path {
  stroke-dasharray: 10 8;
  animation: none;
}
.dash-hero-mesh .hero-mesh-links.soft path {
  stroke-dasharray: 4 12;
  opacity: 0.7;
  animation: none;
}
.dash-hero-mesh .hero-mesh-nodes circle:not(.pulse) {
  fill: #a5f3fc;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.95));
}
.dash-hero-mesh .hero-mesh-nodes .pulse {
  fill: none;
  stroke: rgba(103, 232, 249, 0.55);
  stroke-width: 1.4;
  transform-origin: center;
  transform-box: fill-box;
  /* static halo (was pulsing) */
  opacity: 0.45;
  transform: scale(1.85);
  animation: none;
}
.dash-hero-mesh .hero-mesh-nodes .pulse.d2 { stroke: rgba(103, 232, 249, 0.5); }
.dash-hero-mesh .hero-mesh-nodes .pulse.d3 { stroke: rgba(167, 139, 250, 0.55); }
.dash-hero-mesh .hero-mesh-nodes .pulse.d4 { stroke: rgba(103, 232, 249, 0.45); }
/* HUD corner brackets */
.dash-hero-hud {
  position: absolute;
  inset: 10px 12px;
}
.dash-hero-hud .hud-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(34, 211, 238, 0.45);
}
.dash-hero-hud .hud-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.dash-hero-hud .hud-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-color: rgba(167,139,250,0.45); }
.dash-hero-hud .hud-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-color: rgba(52,211,153,0.4); }
.dash-hero-hud .hud-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }
/* Stronger read-zone behind text; mesh still shows through (blurred) */
.dash-hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 12, 24, 0.55) 0%, rgba(8, 12, 24, 0.28) 28%, rgba(8, 12, 24, 0.08) 48%, transparent 62%),
    linear-gradient(180deg, transparent 55%, rgba(8, 12, 24, 0.3) 100%);
}
@keyframes heroScan {
  0% { top: -50%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 110%; opacity: 0; }
}
@keyframes heroFlow {
  to { stroke-dashoffset: -40; }
}
@keyframes heroNodePulse {
  0% { opacity: 0.8; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(2.6); }
}
@keyframes heroRadar {
  to { transform: translateY(-50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-hero-scan,
  .dash-hero-radar,
  .dash-hero-mesh .hero-mesh-links path,
  .dash-hero-mesh .hero-mesh-nodes .pulse {
    animation: none !important;
  }
}
@media (max-width: 640px) {
  .dash-hero-mesh { opacity: 0.7; }
  .dash-hero-radar { width: 140px; height: 140px; opacity: 0.5; }
}
.dash-hero-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
  filter: blur(8px); pointer-events: none;
  top: -80px; right: 18%;
  z-index: 0;
  animation: none; /* static glow — same look, no pulse thrash */
  opacity: 0.85;
}
.dash-hero-glow-2 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(34,211,238,0.28), transparent 70%);
  top: auto; bottom: -90px; right: -40px; left: auto;
  animation: none;
  opacity: 0.9;
}
@keyframes dashPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}
.dash-hero-main {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; min-width: 0;
  justify-content: center;
  gap: 0;
  text-shadow: 0 1px 14px rgba(8, 12, 24, 0.75);
}
.dash-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #6ee7b7; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 8px;
  width: fit-content;
}
.dash-hero-title {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -0.03em; line-height: 1.2; margin: 0;
}
.dash-hero-title span {
  background: linear-gradient(90deg, #c7d2fe, #67e8f9 55%, #a5b4fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-hero-sub {
  margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 48ch;
}
.dash-hero-sub strong { color: var(--text); }
.dash-hero-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.dash-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(8, 12, 24, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.78rem; color: var(--text); font-weight: 600;
  text-shadow: none;
  background: rgba(8, 12, 22, 0.75);
}
.dash-pill i { font-style: normal; color: var(--cyan); opacity: 0.9; }

.dash-hero-side {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: flex-end;
  min-width: 0;
}
.dash-ring-card {
  width: min(100%, 180px);
  padding: 18px 16px;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(18, 28, 48, 0.92), rgba(5, 8, 16, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 12px 28px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column; align-items: center; gap: 0;
  flex-shrink: 0;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.05s linear;
}
.dash-ring-card:hover {
  border-color: rgba(52, 211, 153, 0.35);
}
@media (max-width: 960px) {
  .dash-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(160px, 220px);
    align-items: center;
  }
  .dash-hero-side { justify-content: center; }
}
@media (max-width: 640px) {
  .dash-hero {
    grid-template-columns: 1fr;
  }
  .dash-hero-side {
    justify-content: center;
    width: 100%;
  }
  .dash-ring-card {
    margin: 0 auto;
  }
}
.dash-ring {
  --pct: 0;
  --ring: #22d3ee;
  width: 128px; height: 128px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), rgba(148,163,184,0.15) 0);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.15);
}
.dash-ring-inner {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(160deg, #121a2e, #0a101c);
  border: 1px solid rgba(148,163,184,0.12);
  display: grid; place-content: center; text-align: center;
}
.dash-ring-inner small {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.dash-ring-inner strong {
  font-size: 1.45rem; letter-spacing: -0.03em; line-height: 1;
  background: linear-gradient(180deg, #e2e8f0, #67e8f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-ring-inner span { font-size: 0.68rem; color: var(--muted); margin-top: 4px; }
.dash-ring-meta {
  width: 100%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.dash-ring-meta > div {
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(148,163,184,0.1);
  display: flex; flex-direction: column; gap: 2px;
}
.dash-ring-meta span { font-size: 0.68rem; }
.dash-ring-meta strong { font-size: 0.95rem; }

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
}
.dash-kpi {
  position: relative; overflow: hidden; text-align: left;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(20, 28, 48, 0.9), rgba(10, 14, 26, 0.95));
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  cursor: pointer; color: inherit;
  transition: border-color 0.05s linear, background 0.05s linear;
  animation: dashIn 0.28s ease both;
  animation-delay: var(--delay, 0ms);
}
@keyframes dashIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dash-kpi:hover {
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.14);
}
/* Backup fail card: hover → stronger red warning */
.dash-kpi.tone-rose:hover {
  border-color: rgba(251, 113, 133, 0.85);
  background: linear-gradient(165deg, rgba(80, 20, 36, 0.95), rgba(30, 10, 16, 0.98));
  box-shadow:
    0 0 0 1px rgba(251, 113, 133, 0.35),
    0 18px 44px rgba(244, 63, 94, 0.35);
}
.dash-kpi.tone-rose:hover .dash-kpi-value {
  color: #fecdd3;
}
.dash-kpi.tone-rose:hover .dash-kpi-warn {
  color: #fda4af;
  text-shadow: 0 0 12px rgba(251, 113, 133, 0.65);
}
.dash-kpi.tone-rose:hover .dash-kpi-ico {
  background: rgba(251, 113, 133, 0.28);
  border-color: rgba(251, 113, 133, 0.65);
  color: #fecdd3;
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.35);
}
.dash-kpi-shine {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.05) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: none;
  pointer-events: none;
  opacity: 0;
}
.dash-kpi:hover .dash-kpi-shine { opacity: 0; }
.dash-kpi-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.dash-kpi-ico {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.25);
  font-size: 0.85rem;
}
.dash-kpi-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  letter-spacing: 0.02em;
}
.dash-kpi-value {
  font-size: 1.85rem; font-weight: 800; letter-spacing: -0.04em;
  line-height: 1.1;
}
.dash-kpi-hint { margin-top: 6px; font-size: 0.72rem; color: var(--dim); }
.dash-kpi-warn {
  color: #fb7185;
  font-weight: 700;
}
.dash-kpi.tone-rose {
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow: 0 12px 32px rgba(251, 113, 133, 0.12);
}
.dash-kpi.tone-rose .dash-kpi-hint { color: rgba(253, 164, 175, 0.9); }
.dash-kpi.tone-cyan .dash-kpi-value { color: #67e8f9; }
.dash-kpi.tone-cyan .dash-kpi-ico { background: rgba(34,211,238,0.12); border-color: rgba(34,211,238,0.28); color: #67e8f9; }
.dash-kpi.tone-green .dash-kpi-value { color: #6ee7b7; }
.dash-kpi.tone-green .dash-kpi-ico { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.28); color: #6ee7b7; }
.dash-kpi.tone-amber .dash-kpi-value { color: #fcd34d; }
.dash-kpi.tone-amber .dash-kpi-ico { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.28); color: #fcd34d; }
.dash-kpi.tone-purple .dash-kpi-value,
.dash-kpi.tone-violet .dash-kpi-value { color: #c4b5fd; }
.dash-kpi.tone-purple .dash-kpi-ico,
.dash-kpi.tone-violet .dash-kpi-ico { background: rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.28); color: #c4b5fd; }
.dash-kpi.tone-rose .dash-kpi-value { color: #fda4af; }
.dash-kpi.tone-rose .dash-kpi-ico { background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.28); color: #fda4af; }

.dash-quick {
  display: grid;
  /* Fill the row whatever the card count. A fixed 4 columns left a visible
     empty slot once the Monitoring shortcut was removed. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .dash-quick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-quick { grid-template-columns: 1fr; }
}
.dash-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(24, 34, 58, 0.85), rgba(10, 14, 26, 0.95));
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.05s linear, background 0.05s linear;
}
.dash-quick-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 10px 26px rgba(34, 211, 238, 0.1);
}
.dash-quick-ico {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  align-self: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.35), rgba(34,211,238,0.2));
  border: 1px solid rgba(129,140,248,0.3);
  font-size: 1.05rem;
  line-height: 1;
  margin: 0;
  color: var(--text);
}
.dash-quick-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.dash-quick-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.dash-quick-desc {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
  margin: 0;
}
.dash-quick-arrow {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--dim);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}
.dash-quick-card:hover .dash-quick-arrow { color: var(--cyan); transform: translateX(3px); }

.dash-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .dash-panels { grid-template-columns: 1fr; }
}
.dash-panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.95), rgba(9, 13, 24, 0.98));
  box-shadow: 0 14px 36px rgba(0,0,0,0.22);
  overflow: hidden;
  min-height: 280px;
  display: flex; flex-direction: column;
}
.dash-panel-wide { grid-column: 1 / -1; min-height: auto; }
.dash-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.dash-panel-head h3 {
  margin: 0; font-size: 0.98rem; letter-spacing: -0.02em;
}
.dash-panel-head p { margin: 3px 0 0; }
.dash-sev { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.dash-sev-row {
  display: grid;
  grid-template-columns: 92px 1fr 58px;
  gap: 10px; align-items: center;
}
.dash-sev-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; text-transform: capitalize; color: var(--muted); font-weight: 600;
}
.dash-sev-dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.dash-sev-track {
  height: 9px; border-radius: 999px;
  background: rgba(0,0,0,0.35);
  overflow: hidden; border: 1px solid rgba(148,163,184,0.08);
}
.dash-sev-track > i {
  display: block; height: 100%; border-radius: 999px;
  box-shadow: 0 0 12px rgba(255,255,255,0.08);
}
.dash-sev-nums {
  text-align: right; font-family: var(--mono); font-size: 0.75rem;
  display: flex; flex-direction: column; line-height: 1.15;
}
.dash-sev-nums strong { color: var(--text); }
.dash-sev-nums span { color: var(--dim); font-size: 0.68rem; }

.dash-feed {
  padding: 6px 10px 12px;
  display: flex; flex-direction: column;
  flex: 1; overflow: auto; max-height: 340px;
}
.dash-feed-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  transition: background 0.12s ease;
}
.dash-feed-item:hover { background: rgba(255,255,255,0.03); }
.dash-feed-avatar {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(129,140,248,0.25);
  color: #c7d2fe;
}
.dash-feed-avatar.ok {
  background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.3); color: #6ee7b7;
}
.dash-feed-avatar.bad {
  background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.3); color: #fda4af;
}
.dash-feed-avatar.warn {
  background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); color: #fcd34d;
}
.dash-feed-avatar.info {
  background: rgba(34,211,238,0.1); border-color: rgba(34,211,238,0.28); color: #67e8f9;
}
.dash-feed-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dash-table { padding: 0 8px 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Nav backdrop (mobile drawer) */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 6, 16, 0.55);
  backdrop-filter: blur(3px);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.app-shell.nav-open .nav-backdrop {
  display: block;
  opacity: 1;
}

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-header h3 { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; }
.card-header .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 16px; }

.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.toolbar .form-control {
  width: auto;
  min-width: 160px;
  padding: 7px 11px;
  font-size: 0.86rem;
  min-height: 32px;
}
.spacer { flex: 1; }

/* Device / Jump cards */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.device-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  transition: border-color 0.05s linear, background 0.05s linear;
}
.device-card:hover {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.device-card .top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.device-card h3 { font-size: 1.05rem; letter-spacing: -0.02em; }
.device-card .host {
  font-family: var(--mono); font-size: 0.82rem; color: var(--cyan); margin-top: 4px;
}
.device-card .meta-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0;
}
.device-card .actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  overscroll-behavior: contain;
  contain: content;
  -webkit-overflow-scrolling: touch;
}
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th {
  text-align: left; padding: 11px 12px;
  color: var(--muted); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 1px solid var(--line); font-weight: 700;
  white-space: nowrap;
}
table.data td {
  padding: 12px; border-bottom: 1px solid rgba(148,163,184,0.08); vertical-align: middle;
}
table.data tr { cursor: default; transition: none; }
table.data tbody tr:hover td { background: rgba(99, 102, 241, 0.06); }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: rgba(99, 102, 241, 0.1); }

/* Action buttons (Edit / Hapus) — aligned, same size */
table.data td.td-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: right;
  padding-right: 14px;
}
table.data td.td-actions .btn-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
table.data td.td-actions .btn-sm {
  min-width: 68px;
  height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
  line-height: 1;
  box-sizing: border-box;
}
table.data td.td-actions .btn-slot {
  display: inline-block;
  min-width: 68px;
  height: 30px;
}
table.data td.td-actions .btn-ip-del,
table.data td.td-actions .btn-sm.btn-ip-del {
  min-width: 30px;
  width: 30px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--muted);
}
table.data td.td-actions .btn-ip-del:hover {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.12);
}

/* Circuit form — Local/Remote IP rows (no double-box cells) */
.ip-links-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}
table.ip-links-table {
  margin: 0;
}
table.ip-links-table th,
table.ip-links-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  padding: 8px 10px;
}
table.ip-links-table thead th {
  background: rgba(255, 255, 255, 0.02);
}
table.ip-links-table tbody tr:last-child td {
  border-bottom: none;
}
table.ip-links-table .form-control {
  width: 100%;
  min-width: 0;
}
table.ip-links-table th.th-actions,
table.ip-links-table td.td-actions {
  width: 36px;
  padding-left: 4px;
  padding-right: 8px;
}

/* Users table — proportional fixed layout */
#user-table {
  table-layout: fixed;
  width: 100%;
}
#user-table th,
#user-table td {
  padding: 11px 12px;
  vertical-align: middle;
  overflow: hidden;
}
/* Superadmin: User | Email | Company | Role | Status | Actions */
#user-table.has-company .th-user,
#user-table.has-company .td-user { width: 16%; }
#user-table.has-company .th-email,
#user-table.has-company .td-email { width: 20%; }
#user-table.has-company .th-company,
#user-table.has-company .td-company { width: 24%; }
#user-table.has-company .th-role,
#user-table.has-company .td-role { width: 14%; }
#user-table.has-company .th-status,
#user-table.has-company .td-status { width: 12%; }
#user-table.has-company .th-actions,
#user-table.has-company .td-actions { width: 14%; }
/* Tenant admin (no company col) */
#user-table:not(.has-company) .th-user,
#user-table:not(.has-company) .td-user { width: 22%; }
#user-table:not(.has-company) .th-email,
#user-table:not(.has-company) .td-email { width: 28%; }
#user-table:not(.has-company) .th-role,
#user-table:not(.has-company) .td-role { width: 18%; }
#user-table:not(.has-company) .th-status,
#user-table:not(.has-company) .td-status { width: 16%; }
#user-table:not(.has-company) .th-actions,
#user-table:not(.has-company) .td-actions { width: 16%; }

.user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.user-cell-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.user-cell-name {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.user-cell-sub {
  font-size: 0.75rem;
  color: var(--dim);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-chip {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  box-sizing: border-box;
}
.company-chip:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.16);
}
#user-table .td-role,
#user-table .td-status {
  white-space: nowrap;
}
#user-table .td-role .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
#user-table .td-actions {
  text-align: right;
  overflow: visible;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-success { background: rgba(52,211,153,0.14); color: #6ee7b7; }
.badge-danger { background: rgba(251,113,133,0.14); color: #fda4af; }
.badge-warning { background: rgba(251,191,36,0.14); color: #fcd34d; }
.badge-info { background: rgba(99,102,241,0.16); color: #c7d2fe; }
.badge-muted { background: rgba(148,163,184,0.12); color: var(--muted); }

/* RADIUS shared secret cell */
.secret-cell {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 240px;
}
.secret-cell .secret-val {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-cell .secret-val[data-masked="0"] {
  color: var(--cyan);
  max-width: 160px;
}
.icon-action {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.12s color, 0.12s background;
}
.icon-action svg {
  width: 15px;
  height: 15px;
  display: block;
}
.icon-action:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.icon-action.is-on {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}
.icon-action-inline {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-left: 4px;
}
.icon-action-inline svg {
  width: 13px;
  height: 13px;
}
.secret-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.secret-input-row .form-control {
  flex: 1;
  min-width: 0;
}
.secret-cur-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.badge-purple { background: rgba(167,139,250,0.16); color: #ddd6fe; }
.badge-cyan { background: rgba(34,211,238,0.14); color: #67e8f9; }

.mono { font-family: var(--mono); font-size: 0.82rem; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.text-sm { font-size: 0.82rem; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex { display: flex; } .items-center { align-items: center; }
.wrap { flex-wrap: wrap; } .hidden { display: none !important; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 0.9rem;
}
.breadcrumb a, .breadcrumb button {
  background: none; border: none; color: var(--cyan); cursor: pointer; font-weight: 600;
}
.breadcrumb .sep { color: var(--dim); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* Subnet cards for IPAM */
.subnet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.subnet-card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.05s linear, background 0.05s linear;
}
.subnet-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.subnet-card h3 { font-size: 1rem; }
.subnet-card .cidr {
  font-family: var(--mono); color: var(--cyan); font-size: 0.9rem; margin-top: 4px;
}
.usage-bar {
  height: 7px; background: rgba(0,0,0,0.35); border-radius: 999px; overflow: hidden; margin-top: 12px;
}
.usage-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 999px;
}

/* Company cards */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.company-card {
  padding: 0;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.05s linear, box-shadow 0.05s linear;
}
.company-card:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.24);
}
.company-card .banner {
  height: 72px;
  background:
    linear-gradient(135deg, rgba(99,102,241,0.45), rgba(34,211,238,0.25)),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 0h20v20H0V0zm20 20h20v20H20V20z'/%3E%3C/g%3E%3C/svg%3E");
}
.company-card .body { padding: 16px 18px 18px; }
.company-card h3 { font-size: 1.08rem; letter-spacing: -0.02em; }
.company-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0;
}
.company-metrics .m {
  padding: 10px; border-radius: 10px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line);
}
.company-metrics .m span { display: block; font-size: 0.72rem; color: var(--muted); }
.company-metrics .m strong { font-size: 1.15rem; }

/* Terminal */
.term-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: calc(100vh - 160px);
}
@media (max-width: 1000px) {
  .term-layout { grid-template-columns: 1fr; }
}
.term-panel {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #05080f;
  overflow: hidden;
  min-height: 480px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.term-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #121a2c, #0c1322);
  border-bottom: 1px solid var(--line);
}
.term-toolbar .dots { display: flex; gap: 6px; }
.term-toolbar .dots i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
}
.term-toolbar .dots i:nth-child(1) { background: #fb7185; }
.term-toolbar .dots i:nth-child(2) { background: #fbbf24; }
.term-toolbar .dots i:nth-child(3) { background: #34d399; }
.term-title {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}
/* Legacy term-body (non-jump) — jump uses .term-pane .term-body overrides */
.term-body {
  flex: 1; padding: 8px; min-height: 0;
}
.term-body .xterm { height: 100%; width: 100%; }
.term-body .xterm-viewport { overflow-y: scroll !important; }

.connect-form .form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.protocol-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.protocol-toggle button {
  padding: 12px; border-radius: 10px;
  border: 1px solid var(--line2); background: rgba(0,0,0,0.25);
  cursor: pointer; font-weight: 700; color: var(--muted);
}
.protocol-toggle button.active-ssh {
  border-color: rgba(52,211,153,0.5);
  background: rgba(52,211,153,0.12); color: #6ee7b7;
}
.protocol-toggle button.active-telnet {
  border-color: rgba(251,191,36,0.5);
  background: rgba(251,191,36,0.12); color: #fcd34d;
}

/* Feed / severity */
.sev-bars { display: flex; flex-direction: column; gap: 10px; }
.sev-row {
  display: grid; grid-template-columns: 80px 1fr 36px; gap: 10px;
  align-items: center; font-size: 0.85rem;
}
.sev-bar { height: 8px; background: rgba(0,0,0,0.35); border-radius: 999px; overflow: hidden; }
.sev-bar > i { display: block; height: 100%; border-radius: 999px; }
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: grid; grid-template-columns: 10px 1fr; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid rgba(148,163,184,0.08);
}
.feed-item:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--primary); }
.dot.success { background: var(--emerald); }
.dot.warning { background: var(--amber); }
.dot.danger { background: var(--rose); }
.dot.info { background: var(--cyan); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(2, 6, 16, 0.78);
  /* no backdrop-filter — blur under modal makes inner scroll lag hard */
}
.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal.wide { width: min(860px, 100%); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.modal-footer .footer-spacer { flex: 1 1 auto; min-width: 8px; }
.modal-footer .btn-danger { margin-right: 0; }
/* Nested confirm sits above any open modal */
.modal-confirm-backdrop {
  z-index: 120;
  background: rgba(4, 8, 16, 0.72);
}
.modal-confirm {
  width: min(420px, 100%);
}
.icon-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.25rem; line-height: 1;
  padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }

pre.config {
  background: #05080f; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px;
  overflow: auto; max-height: 420px;
  font-family: var(--mono); font-size: 0.8rem; color: #a5f3fc; line-height: 1.55;
}

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px; flex-wrap: wrap;
}
.tab {
  background: transparent; border: none; color: var(--muted);
  padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.tab.active { color: #c7d2fe; border-bottom-color: var(--primary); }
.tab:hover { color: var(--text); }

.perm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px; max-height: 260px; overflow: auto; padding: 4px;
}
.perm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: rgba(0,0,0,0.25);
  border: 1px solid var(--line); border-radius: 8px; font-size: 0.8rem; cursor: pointer;
}
.perm-item input { accent-color: var(--primary); }

/* Roles table — +N expands permissions inline on the same page */
.td-role-perms { min-width: 200px; max-width: 520px; }
.role-perm-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.role-perm-count-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.role-perm-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.role-perm-toggle:hover { color: #a5b4fc; }
.role-perm-preview,
.role-perm-full {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.role-perm-preview.hidden,
.role-perm-full.hidden { display: none !important; }
button.role-perm-more {
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  line-height: 1.2;
}
button.role-perm-more:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
}

/* Delete device — keep backup vs wipe backup */
.del-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.del-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.del-choice:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.1);
}
.del-choice.selected {
  border-color: rgba(129, 140, 248, 0.7);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.16), transparent 60%), rgba(12, 14, 32, 0.55);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.18);
}
.del-choice-danger:hover {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.1);
}
.del-choice-danger.selected {
  border-color: rgba(251, 113, 133, 0.65);
  background: linear-gradient(160deg, rgba(251, 113, 133, 0.14), transparent 60%), rgba(28, 10, 14, 0.55);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.16);
}
.del-choice strong { font-size: 0.92rem; }
.modal-footer .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toast-host {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 260px; max-width: 380px;
  padding: 12px 14px; border-radius: 12px;
  background: #121a2c; border: 1px solid var(--line2);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow); font-size: 0.88rem;
  animation: rise 0.2s ease;
}
.toast.ok { border-left-color: var(--emerald); }
.toast.err { border-left-color: var(--rose); }
.toast.warn { border-left-color: #f59e0b; }

.page-hero {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-hero .kicker {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--primary2); font-weight: 700; margin-bottom: 2px;
}
.page-hero .muted.text-sm {
  font-size: 0.82rem;
}
.page-hero .flex {
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: var(--emerald); box-shadow: 0 0 8px var(--emerald);
  margin-right: 6px;
}
.status-dot.off { background: var(--dim); box-shadow: none; }
.status-dot.busy { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* Jump Access — professional workspace (roomy terminal) */
.jump-workspace {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
@media (max-width: 1100px) {
  .jump-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 28vh) 1fr;
  }
}
.jump-sidebar {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  min-width: 0;
}
.jump-search {
  position: relative;
}
.jump-search input {
  width: 100%; padding: 8px 10px 8px 32px; font-size: 0.82rem;
}
.jump-search .search-ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--dim); font-size: 0.85rem; pointer-events: none;
}
.jump-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 2px;
  min-height: 0;
}
.jump-list.compact .jump-item {
  padding: 6px 8px;
  border-radius: 8px;
  min-height: 32px;
}
.jump-group {
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  overflow: hidden;
}
.jump-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: rgba(99, 102, 241, 0.08);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  border-bottom: 1px solid transparent;
}
.jump-group:not(.collapsed) .jump-group-head {
  border-bottom-color: rgba(255,255,255,0.05);
}
.jump-group-head:hover {
  background: rgba(99, 102, 241, 0.14);
}
.jump-group-chevron {
  color: var(--cyan);
  font-size: 0.72rem;
  width: 12px;
  flex-shrink: 0;
}
.jump-group-name {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #c7d2fe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jump-group-count {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--dim);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.jump-group-edit {
  opacity: 0.45;
  font-size: 0.78rem;
  padding: 0 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.jump-group-head:hover .jump-group-edit { opacity: 0.9; }
.jump-group-edit:hover {
  background: rgba(255,255,255,0.08);
  color: var(--cyan);
}
.jump-group-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}
.jump-group-empty {
  padding: 8px 10px;
}
.jump-item {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.jump-item:hover {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(99, 102, 241, 0.08);
}
.jump-item.active {
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(145deg, rgba(99,102,241,0.2), rgba(16,26,46,0.85));
}
.jump-item.has-session .name-only::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  margin-right: 6px;
  vertical-align: middle;
}
.jump-item .name-only {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.jump-item .btn-xs {
  opacity: 0;
  flex-shrink: 0;
}
.jump-item:hover .btn-xs,
.jump-item.active .btn-xs { opacity: 0.9; }
.jump-item .name-actions {
  display: flex; gap: 2px; flex-shrink: 0;
}
.jump-item .row1 {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.jump-item h4 { font-size: 0.98rem; letter-spacing: -0.02em; }
.jump-item .ip { font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); margin-top: 3px; }
.jump-item .creds {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.jump-item .quick {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}
.jump-selected-panel {
  margin-top: 4px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.jump-selected-panel .meta-line {
  font-size: 0.72rem; color: var(--muted); margin-top: 3px;
  font-family: var(--mono);
}
.jump-selected-panel .actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.jump-selected-panel strong { font-size: 0.88rem; }

/* Protocol choice cards (add/edit device) */
.proto-label {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin-bottom: 10px !important;
  letter-spacing: 0.02em;
}
.proto-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.proto-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 2px solid var(--line2);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04), transparent 50%),
    rgba(0,0,0,0.32);
  cursor: pointer;
  transition: 0.18s transform, 0.18s border-color, 0.18s background, 0.18s box-shadow;
  user-select: none;
  overflow: hidden;
}
.proto-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: 0.18s opacity;
  pointer-events: none;
}
.proto-card.proto-ssh::before {
  background: radial-gradient(circle at 80% 0%, rgba(52,211,153,0.25), transparent 55%);
}
.proto-card.proto-telnet::before {
  background: radial-gradient(circle at 80% 0%, rgba(251,191,36,0.25), transparent 55%);
}
.proto-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.proto-card .proto-icon {
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 4px;
  filter: grayscale(0.2);
}
.proto-card .proto-title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  z-index: 1;
}
.proto-card .proto-sub {
  font-size: 0.78rem;
  color: var(--muted);
  z-index: 1;
}
.proto-card .proto-check {
  display: none;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}
.proto-card:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.5);
}
.proto-card.selected {
  transform: translateY(-2px);
}
.proto-card.selected::before { opacity: 1; }
.proto-card.selected .proto-check { display: inline-block; }
.proto-card.selected .proto-icon { filter: none; }

.proto-card.proto-ssh.selected {
  border-color: rgba(52, 211, 153, 0.75);
  box-shadow: 0 10px 32px rgba(16, 185, 129, 0.22), 0 0 0 1px rgba(52, 211, 153, 0.25);
  background:
    linear-gradient(160deg, rgba(52,211,153,0.16), transparent 55%),
    rgba(6, 20, 16, 0.55);
}
.proto-card.proto-ssh.selected .proto-title,
.proto-card.proto-ssh.selected .proto-check { color: #6ee7b7; }

.proto-card.proto-telnet.selected {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 10px 32px rgba(245, 158, 11, 0.22), 0 0 0 1px rgba(251, 191, 36, 0.25);
  background:
    linear-gradient(160deg, rgba(251,191,36,0.16), transparent 55%),
    rgba(24, 18, 6, 0.55);
}
.proto-card.proto-telnet.selected .proto-title,
.proto-card.proto-telnet.selected .proto-check { color: #fcd34d; }

.proto-card.proto-read::before {
  background: radial-gradient(circle at 80% 0%, rgba(99,102,241,0.28), transparent 55%);
}
.proto-card.proto-read.selected {
  border-color: rgba(129, 140, 248, 0.75);
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(129, 140, 248, 0.25);
  background:
    linear-gradient(160deg, rgba(99,102,241,0.18), transparent 55%),
    rgba(12, 14, 32, 0.55);
}
.proto-card.proto-read.selected .proto-title,
.proto-card.proto-read.selected .proto-check { color: #c7d2fe; }

#port-ssh-wrap, #port-telnet-wrap {
  animation: fadePort 0.18s ease;
}
@keyframes fadePort {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.btn-connect {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; border: none;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
}
.btn-connect:hover:not(:disabled) { filter: brightness(1.08); }
.btn-connect:disabled {
  background: rgba(100,116,139,0.25); color: var(--dim); box-shadow: none;
}

.jump-main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(14, 20, 36, 0.92), rgba(6, 10, 18, 0.96));
  overflow: hidden;
  box-shadow:
    0 18px 48px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Tabs + slim session status in one chrome strip */
.jump-chrome {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(18, 24, 40, 0.98), rgba(10, 14, 24, 0.95));
  border-bottom: 1px solid var(--line);
}
.jump-tabs {
  display: flex; align-items: stretch; gap: 3px;
  padding: 5px 8px 0;
  overflow-x: auto;
  min-height: 0;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.jump-tabs:empty {
  display: none; /* no placeholder row when no sessions */
}
.jump-tabs-empty {
  display: none;
}
.jump-tab {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 180px;
  padding: 5px 7px 6px 9px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.12s background, 0.12s color, 0.12s border-color;
}
.jump-tab:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}
.jump-tab.active {
  background: linear-gradient(180deg, rgba(99,102,241,0.28), rgba(12,19,34,0.98));
  border-color: rgba(129,140,248,0.28);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--cyan);
}
.jump-tab-label {
  overflow: hidden; text-overflow: ellipsis; max-width: 100px;
}
.jump-tab-proto {
  font-family: var(--mono); font-size: 0.62rem;
  color: var(--dim); letter-spacing: 0.02em;
}
.jump-tab.active .jump-tab-proto { color: var(--cyan); }
.jump-tab-close {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 5px;
  font-size: 0.9rem; line-height: 1;
  color: var(--dim);
}
/* Same geometry as the close affordance, but this one is not destructive. */
.jump-tab-dup {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 5px;
  font-size: 0.8rem; line-height: 1;
  color: var(--dim);
}
.jump-tab-dup:hover {
  background: rgba(34, 211, 238, 0.18);
  color: var(--cyan);
}
.jump-tab-close:hover {
  background: rgba(251, 113, 133, 0.2);
  color: #fda4af;
}

/* Slim session bar — one row under tabs */
.session-bar,
.session-bar-slim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px 6px;
  background: transparent;
  border-bottom: none;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: 34px;
}
.session-bar .target {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
}
.session-bar .target-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(34,211,238,0.25));
  display: grid; place-items: center; font-size: 0.85rem; flex-shrink: 0;
}
.target-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
  box-shadow: none;
  transition: 0.15s background, 0.15s box-shadow;
}
.target-live.on {
  background: var(--emerald);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}
.target-live.busy {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
  animation: jumpPulse 1.1s ease-in-out infinite;
}
@keyframes jumpPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.target-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}
.session-bar .target strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-bar .target span,
.target-text span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}
.session-actions .badge {
  font-size: 0.65rem;
  padding: 2px 7px;
}
.session-actions .btn-sm {
  padding: 3px 9px;
  font-size: 0.72rem;
}

.term-shell {
  background: #05080f;
  overflow: hidden;
  display: flex; flex-direction: column;
  flex: 1 1 auto;
  min-height: 0; /* critical: allow flex child to shrink to viewport */
  position: relative;
  /* subtle inner vignette — still roomy */
  box-shadow: inset 0 0 80px rgba(0,0,0,0.25);
}
.term-panes {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  height: 100%;
}
.term-pane {
  display: none;
  position: absolute; inset: 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.term-pane.active { display: flex; }
.term-pane .term-body,
.term-shell .term-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: 0;
  /* Must stay hidden so xterm owns scrolling — not the outer page */
  overflow: hidden !important;
  box-sizing: border-box;
}
/* Fill pane; do NOT force .xterm-screen height (that kills scrollback) */
.term-body .xterm {
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
  width: 100% !important;
  padding: 4px 6px !important;
  box-sizing: border-box !important;
}
/* Scrollback lives here — allow wheel / touch scroll */
.term-body .xterm-viewport {
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
}
/* Selection + clipboard UX — don't set user-select on viewport (breaks drag-scroll) */
.term-body .xterm {
  cursor: text;
}
.term-body .xterm .xterm-selection div {
  background-color: rgba(99, 102, 241, 0.4) !important;
}
.jump-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  z-index: 1;
}

.empty-jump {
  flex: 1; display: grid; place-items: center; text-align: center;
  padding: 40px 24px; color: var(--muted);
}
.empty-jump .big {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(34,211,238,0.15));
  display: grid; place-items: center; font-size: 1.8rem;
  border: 1px solid var(--line);
}
.empty-jump h3 { color: var(--text); margin-bottom: 8px; font-size: 1.15rem; }

.cred-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: rgba(52,211,153,0.12); color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.25);
}
.cred-pill.missing {
  background: rgba(251,191,36,0.12); color: #fcd34d;
  border-color: rgba(251,191,36,0.25);
}

/* IPAM hierarchy */
.master-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.05s linear, background 0.05s linear;
  position: relative;
  overflow: hidden;
}
.master-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--cyan));
}
.master-card:hover {
  border-color: rgba(129,140,248,0.4);
  box-shadow: 0 10px 28px rgba(0,0,0,0.24);
}
.master-card .tag-master {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary2);
}
.child-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.05s linear, background 0.05s linear;
}
.child-card:hover {
  border-color: rgba(34,211,238,0.4);
}
.child-card .vlan-chip {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(167,139,250,0.15); color: #ddd6fe;
  border: 1px solid rgba(167,139,250,0.3);
}
.tree-hint {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
  font-size: 0.86rem; color: var(--muted); margin-bottom: 16px;
}
.form-hint { font-size: 0.75rem; color: var(--dim); margin-top: 4px; }

/* Simple pick cards (no icons) — role / access level */
.pick-choice {
  display: grid;
  gap: 10px;
}
.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 2px solid var(--line2);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: border-color 0.05s linear, background 0.05s linear;
  user-select: none;
  text-align: left;
}
.pick-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pick-card .pick-title {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.pick-card .pick-sub {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.pick-card:hover {
  border-color: rgba(129, 140, 248, 0.45);
}
.pick-card.selected {
  /* selected state via border/bg only — no lift lag */
}

/* Distinct highlight colors per access level */
.pick-card.tone-a.selected {
  border-color: rgba(251, 191, 36, 0.7);
  background: linear-gradient(160deg, rgba(251,191,36,0.14), transparent 60%), rgba(24,18,6,0.5);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.18);
}
.pick-card.tone-a.selected .pick-title { color: #fcd34d; }

.pick-card.tone-b.selected {
  border-color: rgba(52, 211, 153, 0.7);
  background: linear-gradient(160deg, rgba(52,211,153,0.14), transparent 60%), rgba(6,20,16,0.5);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18);
}
.pick-card.tone-b.selected .pick-title { color: #6ee7b7; }

.pick-card.tone-c.selected {
  border-color: rgba(129, 140, 248, 0.7);
  background: linear-gradient(160deg, rgba(99,102,241,0.16), transparent 60%), rgba(12,14,32,0.5);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}
.pick-card.tone-c.selected .pick-title { color: #c7d2fe; }

.pick-card.tone-d.selected {
  border-color: rgba(34, 211, 238, 0.65);
  background: linear-gradient(160deg, rgba(34,211,238,0.12), transparent 60%), rgba(6,18,24,0.5);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.16);
}
.pick-card.tone-d.selected .pick-title { color: #67e8f9; }

/* Prefix length chips (flexible subnetting) */
.prefix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.prefix-chip {
  border: 1px solid var(--line2);
  background: rgba(0,0,0,0.28);
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  transition: 0.12s;
}
.prefix-chip:hover {
  border-color: rgba(129,140,248,0.5);
  color: var(--text);
}
.prefix-chip.active {
  border-color: rgba(34,211,238,0.55);
  background: rgba(34,211,238,0.12);
  color: #67e8f9;
}

table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: rgba(99, 102, 241, 0.1); }

.vlan-chip {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(167,139,250,0.15); color: #ddd6fe;
  border: 1px solid rgba(167,139,250,0.3);
  display: inline-block;
}

/* ============================================================
   RESPONSIVE — tablet, iPad & mobile
   html.is-compact is set by JS for reliable iPad detection
   (covers landscape + "Request Desktop Website")
   ============================================================ */

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Shared compact-shell rules (iPad / tablet / phone) */
html.is-compact .app-shell,
html.is-compact .app-shell.sidebar-collapsed {
  grid-template-columns: 1fr !important;
  min-height: 100vh;
  min-height: 100dvh;
}

html.is-compact .sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(var(--sidebar), 88vw) !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh;
  z-index: 60;
  -webkit-transform: translate3d(-105%, 0, 0);
  transform: translate3d(-105%, 0, 0);
  -webkit-transition: -webkit-transform 0.22s ease, box-shadow 0.22s ease;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  opacity: 1 !important;
  pointer-events: auto !important;
  border-right: 1px solid var(--line2) !important;
  box-shadow: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* avoid sticky+backdrop bugs on iOS Safari */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: #0b1220;
}

html.is-compact .app-shell.sidebar-collapsed .sidebar {
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow: auto !important;
}

html.is-compact .app-shell.nav-open .sidebar {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.55);
}

html.is-compact .nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(2, 6, 16, 0.55);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.is-compact .app-shell.nav-open .nav-backdrop {
  display: block;
}

html.is-compact .topbar {
  padding: 0 10px;
  gap: 8px;
  /* Keep one row on iPad — wrapping made company jump below & stretched the bar */
  flex-wrap: nowrap;
  min-height: 48px;
  height: 48px;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 20;
}
html.is-compact .sidebar-brand {
  min-height: 48px;
  height: 48px;
  padding: 0 12px;
}
html.is-compact .topbar h1 { font-size: 0.95rem; }
html.is-compact .topbar .subtitle {
  font-size: 0.68rem;
  display: none; /* free space for company name on tablet */
}
html.is-compact .topbar-actions {
  width: auto;
  max-width: min(300px, 52%);
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
}
html.is-compact .tenant-switch {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
html.is-compact .tenant-switch-label {
  display: none; /* one-line company select */
}
html.is-compact .tenant-switch-ico {
  width: 24px;
  height: 24px;
}
html.is-compact .tenant-select {
  font-size: 0.74rem;
}
html.is-compact .content {
  padding: 14px 14px 28px;
  overflow-x: hidden;
}

/* Grids denser on tablet */
html.is-compact .grid-2,
html.is-compact .grid-3 {
  grid-template-columns: 1fr !important;
}
html.is-compact .dash-kpi-grid,
html.is-compact .dash-stat-grid,
html.is-compact .stats {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}
/* Keep greeting + IP ring side-by-side on tablet/iPad (not bottom-right dump) */
html.is-compact .dash-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 240px) !important;
  align-items: center;
  gap: 16px;
  padding: 20px 18px !important;
}
html.is-compact .dash-hero-side {
  justify-content: center;
  align-self: center;
}
html.is-compact .dash-ring-card {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}
html.is-compact .page-hero {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
html.is-compact .page-hero .flex { flex-wrap: wrap; gap: 8px; }

/* Tables */
html.is-compact .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html.is-compact table.data { font-size: 0.84rem; }
html.is-compact table.data th,
html.is-compact table.data td { padding: 9px 10px; white-space: nowrap; }

/* Forms / modals */
html.is-compact .form-row { grid-template-columns: 1fr !important; }
html.is-compact .modal-backdrop {
  padding: 12px;
  align-items: flex-end;
  -webkit-overflow-scrolling: touch;
}
html.is-compact .modal,
html.is-compact .modal.wide {
  width: 100%;
  max-width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 16px 16px 12px 12px;
}
html.is-compact .pick-grid {
  grid-template-columns: 1fr 1fr !important;
}

/* Jump Access on tablet/iPad: side-by-side if wide enough, else stack */
html.is-compact .jump-workspace {
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(140px, 30vh) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  height: 100%;
}
html.is-compact .jump-sidebar {
  max-height: 30vh;
  min-height: 120px;
}
html.is-compact .main:has(#jump-workspace) {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
html.is-compact .main:has(#jump-workspace) .content {
  padding: 6px 8px 8px;
  overflow: hidden;
  gap: 6px;
}
html.is-compact .jump-toolbar {
  padding: 2px 0;
  min-height: 32px;
}
html.is-compact .jump-toolbar-text .dim { display: none; }
html.is-compact .session-bar-slim {
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px 5px;
}
html.is-compact .jump-tab {
  max-width: 150px;
  font-size: 0.72rem;
}
html.is-compact .jump-tab-label { max-width: 72px; }

/* iPad landscape: give jump a 2-column layout when wide enough */
@media (min-width: 900px) {
  html.is-compact .jump-workspace {
    grid-template-columns: minmax(200px, 240px) 1fr !important;
    grid-template-rows: 1fr;
  }
  html.is-compact .jump-sidebar {
    max-height: none;
    height: 100%;
  }
}

/* Toolbar */
html.is-compact .toolbar {
  gap: 8px;
}
html.is-compact .toolbar .form-control {
  min-width: 0 !important;
  flex: 1 1 180px;
}
html.is-compact .tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
html.is-compact .tab {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fallback media queries if JS class not yet applied */
@media (max-width: 900px),
       (max-width: 1400px) and (hover: none),
       (max-width: 1400px) and (pointer: coarse) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Phone refinements (≤720px) ---- */
@media (max-width: 720px) {
  html.is-compact .topbar .subtitle { display: none; }
  html.is-compact .tenant-switch-label { display: none; }
  html.is-compact .topbar-actions { max-width: min(240px, 58%); }
  html.is-compact .topbar-actions #btn-refresh {
    padding: 5px 8px;
    font-size: 0.72rem;
  }
  html.is-compact .content { padding: 12px 10px 24px; }
  html.is-compact .dash-kpi-grid,
  html.is-compact .dash-stat-grid,
  html.is-compact .stats {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Phone only: stack hero, ring centered under greeting */
  html.is-compact .dash-hero {
    grid-template-columns: 1fr !important;
    justify-items: stretch;
  }
  html.is-compact .dash-hero-side {
    justify-content: center;
    width: 100%;
  }
  html.is-compact .dash-ring-card {
    max-width: 280px;
  }
  html.is-compact .jump-workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(120px, 28vh) 1fr !important;
  }
  html.is-compact .jump-sidebar { max-height: 28vh; }
  html.is-compact .session-bar { flex-direction: column; align-items: flex-start; }
  html.is-compact .session-actions { width: 100%; }
  html.is-compact .toolbar .form-control {
    flex: 1 1 100%;
    width: 100%;
  }
  html.is-compact .toolbar .spacer { display: none; }
  html.is-compact .pick-grid { grid-template-columns: 1fr !important; }
  html.is-compact .ipam-free-grid { grid-template-columns: 1fr !important; }
  html.is-compact .login-form .form-control,
  html.is-compact .form-control {
    font-size: 16px; /* iOS: no zoom on focus */
  }
  .hide-sm { display: none !important; }
}

@media (max-width: 400px) {
  html.is-compact .dash-kpi-grid,
  html.is-compact .dash-stat-grid,
  html.is-compact .stats {
    grid-template-columns: 1fr !important;
  }
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
  .nav-item { padding: 13px 12px; min-height: 44px; }
  .jump-item { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .jump-group-head { min-height: 42px; }
  .btn-icon { width: 40px; height: 40px; }
  #btn-toggle-sidebar { min-width: 40px; min-height: 40px; }
}

/* Scroll performance — sticky chrome + continuous paint are the main jank sources */
html {
  scroll-behavior: auto;
}
.table-wrap,
.sidebar,
.modal-body,
.term-body .xterm-viewport {
  overscroll-behavior: contain;
}
/* Prefer solid paints over live-blur on glass surfaces used in-page */
.card,
.dash-panel,
.dash-kpi,
.device-card,
.subnet-card,
.master-card,
.company-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Snappy hover highlights — kill laggy lift/shadow transitions on interactive chrome.
   Layout animations (sidebar open/close) keep their own longer transitions. */
.nav-item,
.btn,
.jump-item,
.jump-tab,
.jump-group-head,
.tab,
.icon-btn,
.icon-action,
.prefix-chip,
.ipam-class-chip,
.bak-date-chip,
.dash-feed-item,
.dash-ring-card,
.tenant-switch,
.del-choice,
.proto-card,
.form-control {
  transition-duration: 0.05s !important;
  transition-timing-function: linear !important;
}
/* Table row hover must be instant (multi-cell repaint) */
table.data tbody tr,
table.data tbody tr td {
  transition: none !important;
}
/* Prefer border/bg feedback over animating transform */
.dash-kpi:hover,
.dash-quick-card:hover,
.device-card:hover,
.subnet-card:hover,
.company-card:hover,
.master-card:hover,
.child-card:hover,
.pick-card:hover,
.dash-ring-card:hover {
  transform: none !important;
}
