/* -------------------------------------------------------------
 * Felix Resch Central Hub & Live Status Dashboard Styles
 * Theme: Obsidian Glassmorphism with Cyberpunk Precision Accents
 * ------------------------------------------------------------- */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121f;
  --bg-surface: rgba(18, 24, 38, 0.65);
  --bg-surface-hover: rgba(28, 36, 56, 0.85);
  
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(56, 189, 248, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);
  --accent-violet: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --status-online: #10b981;
  --status-online-bg: rgba(16, 185, 129, 0.12);
  --status-online-glow: rgba(16, 185, 129, 0.4);
  
  --status-degraded: #f59e0b;
  --status-degraded-bg: rgba(245, 158, 11, 0.12);
  --status-degraded-glow: rgba(245, 158, 11, 0.4);
  
  --status-offline: #f43f5e;
  --status-offline-bg: rgba(244, 63, 94, 0.12);
  --status-offline-glow: rgba(244, 63, 94, 0.4);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--accent-cyan-glow);
}

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

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

/* Dynamic ambient background glow circles */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  top: -100px;
  left: 10%;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: 40%;
  right: -100px;
  animation-delay: -4s;
}

.glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #059669, transparent 70%);
  bottom: -50px;
  left: 25%;
  animation-delay: -8s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
  50% { transform: scale(1.15) translate(20px, 30px); opacity: 0.4; }
  100% { transform: scale(0.95) translate(-20px, -15px); opacity: 0.3; }
}

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Glassmorphism panel base */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.icon {
  width: 18px;
  height: 18px;
}

.icon-external {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.spin {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hero Section */
.hero-section {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: linear-gradient(145deg, rgba(18, 24, 38, 0.8), rgba(12, 16, 26, 0.6));
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.status-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  font-size: 0.95rem;
  color: #34d399;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: currentColor;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: pulseRing 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.auto-refresh-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.countdown-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.countdown-label strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.progress-bar-container {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-cyan);
  width: 100%;
  transition: width 1s linear;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Controls Section */
.controls-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  min-width: 320px;
  flex: 1;
  max-width: 420px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Services Grid */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* Service Card */
.service-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  background: var(--bg-surface-hover);
  border-color: var(--glass-border-hover);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.service-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.service-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.service-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.status-badge.online {
  background: var(--status-online-bg);
  color: var(--status-online);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.degraded {
  background: var(--status-degraded-bg);
  color: var(--status-degraded);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.offline {
  background: var(--status-offline-bg);
  color: var(--status-offline);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.service-url-chip {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.latency-indicator {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.latency-indicator.good { color: var(--status-online); }
.latency-indicator.medium { color: var(--status-degraded); }
.latency-indicator.bad { color: var(--status-offline); }

.card-action-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.service-card:hover .card-action-icon {
  color: var(--accent-cyan);
  transform: translate(2px, -2px);
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-cyan);
}

.footer-dot {
  color: var(--text-muted);
}

/* Responsive queries */
@media (max-width: 768px) {
  .app-layout {
    padding: 16px 12px 32px;
    gap: 20px;
  }

  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .nav-actions {
    justify-content: space-between;
  }

  .hero-section {
    padding: 20px;
  }

  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
    min-width: unset;
  }

  .services-container {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -------------------------------------------------------------
 * Btop & System Telemetry Overview Section Styles
 * ------------------------------------------------------------- */
.tab-btn .tab-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -2px;
}

.overview-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.overview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
}

.overview-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.overview-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.overview-host-details {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.host-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.overview-view-toggles {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  gap: 4px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

/* Btop Grid & Cards */
.btop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.btop-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.btop-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
}

#card-mem::after {
  background: linear-gradient(90deg, transparent, rgba(255, 121, 198, 0.4), transparent);
}
#card-disk::after {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.4), transparent);
}
#card-net::after {
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.4), transparent);
}

.btop-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btop-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btop-box-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.tag-cpu {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.tag-mem {
  background: rgba(255, 121, 198, 0.15);
  color: #ff79c6;
  border: 1px solid rgba(255, 121, 198, 0.35);
}
.tag-disk {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.tag-net {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.btop-box-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btop-metric-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
}

.text-cyan { color: #38bdf8 !important; }
.text-magenta { color: #ff79c6 !important; }
.text-emerald { color: #10b981 !important; }
.text-purple { color: #bd93f9 !important; }
.text-amber { color: #f59e0b !important; }
.text-light { color: #e2e8f0 !important; }

/* Btop Progress Bars */
.btop-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.btop-progress-bar.mini {
  height: 6px;
}

.btop-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.bar-cyan {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
.bar-magenta {
  background: linear-gradient(90deg, #ff79c6, #ec4899);
  box-shadow: 0 0 10px rgba(255, 121, 198, 0.5);
}
.bar-emerald {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.bar-amber {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* CPU Breakdown & Cores */
.cpu-load-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.load-val {
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

.cpu-cores-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--glass-border);
  padding-top: 12px;
}

.cores-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cpu-cores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.core-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.core-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.core-id {
  color: var(--text-muted);
}

.core-pct {
  font-weight: 700;
  color: var(--accent-cyan);
}

.core-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.core-bar-fill {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Memory Stats Grid */
.mem-stat-rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mem-stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.swap-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.swap-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.swap-title {
  color: var(--text-secondary);
}

.swap-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
}

/* Network Speeds */
.net-status-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-violet);
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.net-speeds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.net-speed-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.net-direction {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.net-icon {
  width: 18px;
  height: 18px;
}

.net-rate {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
}

.net-cumul {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Live Btop Stream Panel */
.btop-stream-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.terminal-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(5, 8, 14, 0.95);
  border-bottom: 1px solid var(--glass-border);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background: #ff5555; }
.dot-yellow { background: #f1fa8c; }
.dot-green { background: #50fa7b; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-left: 10px;
}

.terminal-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.icon-lock {
  width: 14px;
  height: 14px;
}

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

.t-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.t-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.4);
}

.t-action-btn svg {
  width: 16px;
  height: 16px;
}

.terminal-frame-container {
  position: relative;
  width: 100%;
  height: 640px;
  background: #0b0f19;
}

.btop-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

.terminal-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0b0f19;
  z-index: 1;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.sub-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

