@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════
   RESET & BASE
═══════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .text-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 2rem 0 0.75rem;
}

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

.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ═══════════════════════════════
   ACCENT BAR — signature
═══════════════════════════════ */
.accent-bar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--accent-bar-w);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  z-index: 200;
  pointer-events: none;
}

/* ═══════════════════════════════
   LAYOUT
═══════════════════════════════ */
.layout {
  display: flex;
  min-height: 100vh;
  padding-left: var(--accent-bar-w);
}

/* ═══════════════════════════════
   SIDEBAR
═══════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.sidebar-brand svg {
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-brand-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
  display: block;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  padding: 14px 8px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.sidebar-link svg { flex-shrink: 0; }

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-link.has-badge {
  justify-content: space-between;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  padding: 10px 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  width: 100%;
  min-height: 36px;
}

.sidebar-user-badge .user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 40px;
  transition: background 0.12s;
}

.sidebar-logout:hover {
  background: var(--danger-bg);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 90;
  backdrop-filter: blur(3px);
}

.sidebar-overlay.is-open { display: block; }

/* ═══════════════════════════════
   MAIN WRAP + TOPBAR
═══════════════════════════════ */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}

.topbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.topbar-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

.topbar-app-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  flex-shrink: 0;
}

.topbar-app-name span { color: var(--accent); }

.topbar-search {
  flex: 1;
  max-width: 320px;
  position: relative;
  margin-left: 8px;
}

.topbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 14px;
  height: 14px;
  z-index: 1;
}

.topbar-search input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px 8px 32px;
  width: 100%;
  height: 38px;
  transition: border-color 0.12s;
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
}
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.topbar-notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  height: 40px;
}

.topbar-profile-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1280px;
  width: 100%;
}

/* ═══════════════════════════════
   AUTH LAYOUT (login)
═══════════════════════════════ */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-left: calc(24px + var(--accent-bar-w));
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-bg);
  color: var(--accent);
  margin: 0 auto 20px;
}

.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ═══════════════════════════════
   CARDS
═══════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* ═══════════════════════════════
   PAGE HEADER
═══════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ═══════════════════════════════
   STAT CARDS (KPI)
═══════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s;
}

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

.stat-card-body { flex: 1; min-width: 0; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

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

/* Icon box color variants */
.icon-blue   { background: var(--info-bg);    color: var(--info); }
.icon-green  { background: var(--success-bg); color: var(--success); }
.icon-orange { background: var(--warning-bg); color: var(--warning); }
.icon-red    { background: var(--danger-bg);  color: var(--danger); }
.icon-purple { background: var(--purple-bg);  color: var(--purple); }
.icon-pink   { background: var(--accent-bg);  color: var(--accent); }
.icon-muted  { background: var(--muted-bg);   color: var(--text-muted); }

/* ═══════════════════════════════
   DASHBOARD GRID
═══════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1023px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════
   SERVICE ROWS
═══════════════════════════════ */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.12s, border-color 0.12s;
  min-height: 60px;
}

.service-row:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  text-decoration: none;
}

.service-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-row-body { flex: 1; min-width: 0; }

.service-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.service-row-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.service-row-arrow {
  color: var(--text-subtle);
  flex-shrink: 0;
}

/* ═══════════════════════════════
   STATUS DOT
═══════════════════════════════ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-green  { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-dot-red    { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-bg); }
.status-dot-blue   { background: var(--info);    box-shadow: 0 0 0 3px var(--info-bg); animation: pulse 1.4s ease-in-out infinite; }
.status-dot-orange { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ═══════════════════════════════
   BADGES
═══════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--muted-bg);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-active    { background: var(--success-bg); color: var(--success); }
.badge-inactive,
.badge-dead,
.badge-unknown   { background: var(--muted-bg); color: var(--text-muted); }
.badge-failed    { background: var(--danger-bg); color: var(--danger); }
.badge-activating,
.badge-deactivating { background: var(--info-bg); color: var(--info); }
.badge-disabled  { background: var(--warning-bg); color: var(--warning); }
.badge-revoked   { background: var(--danger-bg); color: var(--danger); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-error     { background: var(--danger-bg); color: var(--danger); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-info      { background: var(--info-bg); color: var(--info); }

/* ═══════════════════════════════
   BUTTONS
═══════════════════════════════ */
button { font-family: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.12s, opacity 0.12s;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-dim); text-decoration: none; color: #fff; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-auto { width: auto; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn-warning {
  background: transparent;
  border: 1px solid var(--warning);
  color: var(--warning);
}
.btn-warning:hover { background: var(--warning-bg); color: var(--warning); }

.btn-success {
  background: var(--success);
  color: #fff;
  border: none;
}
.btn-success:hover { opacity: 0.85; }

.btn-discord {
  background: #5865F2;
  color: #fff;
  border: none;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 14px;
}
.btn-discord:hover { background: #4752C4; color: #fff; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══════════════════════════════
   FORMS
═══════════════════════════════ */
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.12s;
  min-height: 40px;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input[type="checkbox"] {
  width: auto;
  display: inline-block;
  min-height: auto;
  accent-color: var(--accent);
}

textarea { resize: vertical; }

.form-group { margin-bottom: 1rem; }

.error {
  color: var(--danger);
  font-size: 13px;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 1rem;
  border: 1px solid rgba(239,68,68,0.2);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ═══════════════════════════════
   TOGGLE SWITCHES
═══════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

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

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-bg);
  border-color: var(--accent);
}

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

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

.toggle-row:last-child { border-bottom: none; }
.toggle-row-label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.toggle-row-hint  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════
   SETTINGS
═══════════════════════════════ */
.settings-block { margin-bottom: 1.25rem; }

.settings-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.settings-block-title svg { color: var(--accent); }

.settings-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.settings-meta strong { color: var(--text-primary); }

/* ═══════════════════════════════
   GAUGES
═══════════════════════════════ */
.gauge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.9rem;
}

.gauge-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gauge-track {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: var(--info);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.gauge-fill.gauge-warn { background: var(--warning); }
.gauge-fill.gauge-danger { background: var(--danger); }

.gauge-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════
   TABLES
═══════════════════════════════ */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

table.data-table tbody td {
  font-size: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

/* ═══════════════════════════════
   LOGS
═══════════════════════════════ */
.logs {
  background: #050508;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #8B9BB4;
  max-height: 380px;
  line-height: 1.7;
}

/* ═══════════════════════════════
   NOTIFICATION BADGE
═══════════════════════════════ */
.notif-count {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.5;
  min-width: 18px;
  text-align: center;
  display: inline-block;
}

/* ═══════════════════════════════
   SECTION HEADER (h2-level blocks)
═══════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ═══════════════════════════════
   LATENCY / STATUS DOT (replaces emoji)
═══════════════════════════════ */
.dot-green  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.dot-yellow { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }
.dot-red    { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }

/* ═══════════════════════════════
   UTILITIES
═══════════════════════════════ */
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.htmx-indicator { opacity: 0; transition: opacity 0.15s; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: var(--accent-bar-w);
    bottom: 0;
    z-index: 100;
    transform: translateX(calc(-100% - var(--accent-bar-w)));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    height: 100%;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .layout {
    display: block;
    padding-left: var(--accent-bar-w);
  }

  .main-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    padding: 20px 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-search { display: none; }
  .topbar-app-name { font-size: 14px; }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-value { font-size: 24px; }

  .stat-card { padding: 16px; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header-right { align-self: flex-start; }

  table.data-table thead { display: none; }
  table.data-table tbody td {
    display: block;
    padding: 8px 14px;
    border-bottom: none;
  }
  table.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    display: block;
    padding: 6px 0;
  }
}
