:root {
  --bg-canvas: #070b14;
  --bg-panel: #0d1322;
  --bg-card: #121a2d;
  --bg-card-hover: #172138;
  --border-subtle: rgba(148, 163, 184, 0.13);
  --border-accent: rgba(59, 130, 246, 0.35);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --coral: #f43f5e;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono, .tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
}

/* Subtle institutional glassmorphism */
.glass-panel {
  background: linear-gradient(180deg, rgba(18, 26, 45, 0.92) 0%, rgba(13, 19, 34, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.kpi-card {
  background: linear-gradient(160deg, rgba(20, 29, 49, 0.95) 0%, rgba(13, 19, 34, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.kpi-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #070b14;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Terminal inputs */
.term-input, .term-select {
  background-color: #090e1a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 0.42rem 0.65rem;
  font-size: 0.8125rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.term-input:focus, .term-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.58rem 0.85rem;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.16) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.35);
}

.badge-live {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-delayed {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.badge-stale {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.table-row-hover:hover {
  background-color: rgba(30, 41, 59, 0.42);
}

@media (max-width: 1024px) {
  .sidebar-desktop {
    display: none;
  }
}


/* Mobile & Android Touch Ergonomics */
@media (max-width: 767px) {
  .term-input, .term-select {
    font-size: 16px; /* Prevents Android Chrome auto-zoom on input focus */
    min-height: 40px;
    padding: 0.5rem 0.65rem;
  }
  .touch-btn {
    min-height: 42px;
  }
}

.mobile-bottom-nav {
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.4rem 0.25rem;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  flex: 1;
  min-height: 50px;
}

.mobile-nav-btn.active {
  color: #60a5fa;
  font-weight: 600;
}


html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
.glass-panel, .kpi-card {
  min-width: 0;
  max-width: 100%;
}
canvas {
  max-width: 100% !important;
}
