/* ── NGINXSEC Design System ──────────────────────────────────────────────────
   Extracted from the TUI dashboard.html and extended for the full SaaS app.
   Dark abyss theme with neon accents, scanline overlay, and noise texture.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  --bg-abyss: #060a11;
  --bg-deep: #0a0f1a;
  --bg-panel: #0d1321;
  --bg-card: #111827;
  --bg-elevated: #1a2332;
  --bg-hover: #1e293b;

  --border-dim: #1e293b;
  --border-active: #334155;
  --border-glow: rgba(251, 146, 60, 0.3);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-ghost: #475569;

  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --amber-dim: #b45309;
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.15);
  --red-bright: #f87171;
  --teal: #14b8a6;
  --teal-glow: rgba(20, 184, 166, 0.12);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.12);
  --magenta: #c084fc;
  --magenta-glow: rgba(192, 132, 252, 0.12);
  --cyan: #22d3ee;
  --cyan-glow: rgba(34, 211, 238, 0.1);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.12);

  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
}

/* ── Light Theme ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg-abyss: #f1f5f9;
  --bg-deep: #e2e8f0;
  --bg-panel: #ffffff;
  --bg-card: #f8fafc;
  --bg-elevated: #e2e8f0;
  --bg-hover: #f1f5f9;

  --border-dim: #cbd5e1;
  --border-active: #94a3b8;
  --border-glow: rgba(217, 119, 6, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-ghost: #94a3b8;

  --amber: #d97706;
  --amber-glow: rgba(217, 119, 6, 0.1);
  --amber-dim: #92400e;
  --red: #dc2626;
  --red-glow: rgba(220, 38, 38, 0.1);
  --red-bright: #dc2626;
  --teal: #0d9488;
  --teal-glow: rgba(13, 148, 136, 0.1);
  --blue: #2563eb;
  --blue-glow: rgba(37, 99, 235, 0.08);
  --magenta: #9333ea;
  --magenta-glow: rgba(147, 51, 234, 0.08);
  --cyan: #0891b2;
  --cyan-glow: rgba(8, 145, 178, 0.08);
  --green: #16a34a;
  --green-glow: rgba(22, 163, 74, 0.08);
}

/* Remove scanline and noise overlays in light mode */
[data-theme="light"] body::after,
[data-theme="light"] body::before {
  display: none;
}

/* Light mode: softer shadows instead of glow */
[data-theme="light"] .topbar-brand h1 {
  text-shadow: none;
}

[data-theme="light"] .status-dot {
  box-shadow: 0 0 4px var(--teal);
}

[data-theme="light"] .metric-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .panel {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cat-tag {
  font-weight: 700;
}

[data-theme="light"] .cat-tag.--wp-brute { background: rgba(220, 38, 38, 0.08); color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }
[data-theme="light"] .cat-tag.--wp-core { background: rgba(234, 88, 12, 0.08); color: #ea580c; border-color: rgba(234, 88, 12, 0.2); }
[data-theme="light"] .cat-tag.--woocommerce { background: rgba(217, 119, 6, 0.08); color: #b45309; border-color: rgba(217, 119, 6, 0.2); }
[data-theme="light"] .cat-tag.--exploit-scan { background: rgba(147, 51, 234, 0.08); color: #7c3aed; border-color: rgba(147, 51, 234, 0.2); }
[data-theme="light"] .cat-tag.--system-leak { background: rgba(8, 145, 178, 0.08); color: #0e7490; border-color: rgba(8, 145, 178, 0.2); }

[data-theme="light"] .feed-status.--401 { background: rgba(217, 119, 6, 0.1); color: #b45309; }
[data-theme="light"] .feed-status.--403 { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
[data-theme="light"] .feed-status.--404 { background: rgba(8, 145, 178, 0.1); color: #0e7490; }

[data-theme="light"] .panel-badge.--live { background: rgba(220, 38, 38, 0.08); color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }
[data-theme="light"] .panel-badge.--count { background: rgba(217, 119, 6, 0.08); color: #b45309; border-color: rgba(217, 119, 6, 0.2); }
[data-theme="light"] .panel-badge.--online { background: rgba(22, 163, 74, 0.08); color: #16a34a; border-color: rgba(22, 163, 74, 0.2); }

[data-theme="light"] .server-status-badge.--online { background: rgba(22, 163, 74, 0.08); color: #16a34a; border-color: rgba(22, 163, 74, 0.2); }
[data-theme="light"] .server-status-badge.--pending { background: rgba(217, 119, 6, 0.08); color: #b45309; border-color: rgba(217, 119, 6, 0.2); }
[data-theme="light"] .server-status-badge.--offline { background: rgba(220, 38, 38, 0.08); color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }

[data-theme="light"] .auth-card { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08); }

[data-theme="light"] .form-group input {
  background: #ffffff;
  border-color: #cbd5e1;
}
[data-theme="light"] .form-group input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-glow);
}
[data-theme="light"] .form-group input::placeholder { color: #94a3b8; }

[data-theme="light"] .btn.--primary { background: #d97706; border-color: #d97706; color: #fff; }
[data-theme="light"] .btn.--primary:hover { background: #b45309; border-color: #b45309; }

[data-theme="light"] .gauge-track { stroke: #e2e8f0; }
[data-theme="light"] .gauge-fill { filter: none; }

[data-theme="light"] .setup-box-command code { background: #f1f5f9; border-color: #cbd5e1; color: #0d9488; }

[data-theme="light"] .server-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
[data-theme="light"] .server-card:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }

[data-theme="light"] .modal-overlay { background: rgba(15, 23, 42, 0.4); }
[data-theme="light"] .modal { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }

/* ── Theme Toggle Button ──────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); }

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background: var(--bg-abyss);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scanline overlay ─────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── Noise texture ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shell ─────────────────────────────────────────────────── */
.shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 20px;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  cursor: pointer;
}

.topbar-brand h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  line-height: 1;
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
}

.topbar-brand .subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.topbar-user .user-name {
  color: var(--text-primary);
  font-weight: 600;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red-bright); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal), 0 0 20px rgba(20, 184, 166, 0.3);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--teal), 0 0 20px rgba(20, 184, 166, 0.3); }
  50% { opacity: 0.6; box-shadow: 0 0 4px var(--teal); }
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  letter-spacing: 0.04em;
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── Navigation Tabs ──────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-dim);
}

.nav-tab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.nav-tab:hover { color: var(--text-secondary); }
.nav-tab.--active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ── Server Selector ──────────────────────────────────────── */
.server-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.server-selector label {
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  flex-shrink: 0;
}

.server-selector select {
  background: var(--bg-card);
  color: var(--amber);
  border: 1px solid var(--border-dim);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  flex: 1;
  max-width: 400px;
  cursor: pointer;
}
.server-selector select:focus { outline: none; border-color: var(--amber); }

/* ── Metric Strip ─────────────────────────────────────────── */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

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

.metric-card:hover { border-color: var(--border-active); }

.metric-card.--amber::before { background: var(--amber); box-shadow: 0 0 20px var(--amber-glow); }
.metric-card.--red::before { background: var(--red); box-shadow: 0 0 20px var(--red-glow); }
.metric-card.--teal::before { background: var(--teal); box-shadow: 0 0 20px var(--teal-glow); }
.metric-card.--blue::before { background: var(--blue); box-shadow: 0 0 20px var(--blue-glow); }
.metric-card.--magenta::before { background: var(--magenta); box-shadow: 0 0 20px var(--magenta-glow); }
.metric-card.--green::before { background: var(--green); box-shadow: 0 0 20px var(--green-glow); }

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.metric-card.--amber .metric-value { color: var(--amber); }
.metric-card.--red .metric-value { color: var(--red-bright); }
.metric-card.--teal .metric-value { color: var(--teal); }
.metric-card.--blue .metric-value { color: var(--blue); }
.metric-card.--magenta .metric-value { color: var(--magenta); }
.metric-card.--green .metric-value { color: var(--green); }

.metric-delta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin-top: 6px;
  color: var(--text-ghost);
}

.metric-delta .up { color: var(--red-bright); }
.metric-delta .down { color: var(--teal); }

/* ── Main Grid ────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

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

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

.panel-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.panel-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-badge.--live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-bright);
  border: 1px solid rgba(239, 68, 68, 0.25);
  animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.panel-badge.--count {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.panel-badge.--online {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.panel-body { padding: 0; }
.panel-body.--padded { padding: 18px; }

/* ── IP Table ─────────────────────────────────────────────── */
.ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ip-table thead th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-deep);
  position: sticky;
  top: 0;
  z-index: 2;
}

.ip-table thead th:nth-child(4),
.ip-table thead th:nth-child(5) { text-align: center; }

.ip-table tbody tr {
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  transition: background 0.15s;
}

.ip-table tbody tr:hover { background: var(--bg-hover); }
.ip-table tbody tr:last-child { border-bottom: none; }

.ip-table td {
  padding: 9px 14px;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.ip-table .rank { color: var(--text-ghost); font-size: 0.7rem; width: 32px; }
.ip-table .ip-addr { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.ip-table .hits { text-align: center; font-weight: 700; }
.ip-table .hits.--critical { color: var(--red-bright); }
.ip-table .hits.--warning { color: var(--amber); }
.ip-table .hits.--normal { color: var(--text-secondary); }
.ip-table .status-code { text-align: center; font-weight: 600; }
.ip-table .status-code.--401 { color: var(--amber); }
.ip-table .status-code.--403 { color: var(--red-bright); }
.ip-table .status-code.--404 { color: var(--cyan); }

.ip-table .request-snip {
  color: var(--text-muted);
  font-size: 0.72rem;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category tags */
.cat-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}

.cat-tag.--wp-brute { background: rgba(239, 68, 68, 0.15); color: var(--red-bright); border: 1px solid rgba(239, 68, 68, 0.25); }
.cat-tag.--wp-core { background: rgba(251, 146, 60, 0.12); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.2); }
.cat-tag.--woocommerce { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.cat-tag.--exploit-scan { background: rgba(192, 132, 252, 0.12); color: var(--magenta); border: 1px solid rgba(192, 132, 252, 0.2); }
.cat-tag.--system-leak { background: rgba(34, 211, 238, 0.1); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.18); }

/* ── Live Feed ────────────────────────────────────────────── */
.feed-list {
  list-style: none;
  max-height: 640px;
  overflow-y: auto;
}

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

.feed-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.4);
  animation: feed-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.feed-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
}

.feed-item.--wp-brute::before { background: var(--red); }
.feed-item.--wp-core::before { background: #fb923c; }
.feed-item.--woocommerce::before { background: var(--amber); }
.feed-item.--exploit-scan::before { background: var(--magenta); }
.feed-item.--system-leak::before { background: var(--cyan); }

.feed-item:hover { background: var(--bg-hover); }

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

.feed-ts {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-ghost);
  letter-spacing: 0.04em;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.feed-ip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.feed-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.feed-status.--401 { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.feed-status.--403 { background: rgba(239, 68, 68, 0.15); color: var(--red-bright); }
.feed-status.--404 { background: rgba(34, 211, 238, 0.1); color: var(--cyan); }

.feed-req {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-server {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-ghost);
  margin-top: 2px;
}

/* ── Category Breakdown ──────────────────────────────────── */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-breakdown { padding: 14px 18px; }

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cat-row:last-child { margin-bottom: 0; }

.cat-row-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.cat-row-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.cat-row-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-row-fill.--wp-brute { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.cat-row-fill.--wp-core { background: #fb923c; }
.cat-row-fill.--woocommerce { background: var(--amber); }
.cat-row-fill.--exploit-scan { background: var(--magenta); }
.cat-row-fill.--system-leak { background: var(--cyan); }

.cat-row-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Velocity Gauge ───────────────────────────────────────── */
.gauge-wrap {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg { width: 200px; height: 120px; }
.gauge-track { fill: none; stroke: var(--bg-elevated); stroke-width: 10; stroke-linecap: round; }
.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s;
  filter: drop-shadow(0 0 6px currentColor);
}
.gauge-value { font-family: var(--font-display); font-size: 2rem; fill: var(--text-primary); text-anchor: middle; letter-spacing: 0.04em; }
.gauge-unit { font-family: var(--font-mono); font-size: 0.55rem; fill: var(--text-muted); text-anchor: middle; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── Bottom grid ──────────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ── Row flash effect ─────────────────────────────────────── */
.ip-table tbody tr.--new { animation: row-flash 1s ease-out; }
@keyframes row-flash {
  from { background: rgba(245, 158, 11, 0.1); }
  to { background: transparent; }
}

/* ── Auth Page ────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-deep);
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
  margin-bottom: 4px;
}

.auth-header p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-dim);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.--active { color: var(--amber); border-bottom-color: var(--amber); }

.auth-form { padding: 24px; }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-glow);
}
.form-group input::placeholder { color: var(--text-ghost); }

.form-error {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--red-bright);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--red-glow);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius);
  display: none;
}
.form-error.--visible { display: block; }

.form-success {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--green-glow);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius);
  display: none;
}
.form-success.--visible { display: block; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn.--primary {
  background: var(--amber);
  color: var(--bg-abyss);
  border-color: var(--amber);
}
.btn.--primary:hover { background: #d97706; border-color: #d97706; }

.btn.--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-active);
}
.btn.--secondary:hover { border-color: var(--text-muted); }

.btn.--danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-bright);
  border-color: rgba(239, 68, 68, 0.25);
}
.btn.--danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn.--full { width: 100%; }

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

/* ── Server Cards ─────────────────────────────────────────── */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.server-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
  cursor: pointer;
}
.server-card:hover { border-color: var(--border-active); }

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.server-card-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.server-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}

.server-status-badge.--online {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.server-status-badge.--pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.server-status-badge.--offline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-bright);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.server-status-badge.--stale {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.server-card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.server-card-meta span {
  display: block;
  margin-bottom: 4px;
}

.server-card-meta .label {
  color: var(--text-ghost);
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

/* ── Server Detail ────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-dim);
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

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

/* ── Setup Command Box ────────────────────────────────────── */
.setup-box {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.setup-box-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  margin-bottom: 8px;
}

.setup-box-command {
  display: flex;
  gap: 8px;
  align-items: center;
}

.setup-box-command code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-dim);
  overflow-x: auto;
  white-space: nowrap;
}

.btn-copy {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--amber); color: var(--amber); }
.btn-copy.--copied { border-color: var(--teal); color: var(--teal); }

/* ── Log Sources Table ────────────────────────────────────── */
.log-table {
  width: 100%;
  border-collapse: collapse;
}

.log-table th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-deep);
}

.log-table td {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  color: var(--text-secondary);
}

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

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

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border-dim);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--teal);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: var(--teal);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 17, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-deep);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Fleet Status Bar ─────────────────────────────────────── */
.fleet-strip {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.fleet-card {
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fleet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fleet-dot.--online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.fleet-dot.--offline { background: var(--red); }
.fleet-dot.--pending { background: var(--amber); }
.fleet-dot.--stale { background: var(--text-ghost); }

.fleet-info {
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.fleet-info .name { color: var(--text-primary); font-weight: 600; }
.fleet-info .meta { color: var(--text-ghost); font-size: 0.6rem; margin-top: 2px; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 20px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .shell { padding: 12px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .server-grid { grid-template-columns: 1fr; }
}
