/* ==========================================================================
   VPS MONITOR - MODERN OBSIDIAN GLASS THEME
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --bg-input: #0b111e;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(56, 189, 248, 0.3);
  --border-focus: rgba(99, 102, 241, 0.6);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);
  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.3);
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.3);
  --accent-purple: #a855f7;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow-cyan: 0 0 20px var(--accent-cyan-glow);
  --shadow-glow-emerald: 0 0 20px var(--accent-emerald-glow);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
}

/* ==========================================================================
   HEADER & TOP NAV
   ========================================================================== */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 16px;
}

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

.brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.logo-svg {
  width: 22px;
  height: 22px;
}

.live-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  border: 2px solid var(--bg-primary);
  animation: pulse-dot 2s infinite ease-in-out;
}

.live-dot.offline {
  background-color: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #f8fafc, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.server-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.meta-item.hostname {
  color: var(--accent-cyan);
  font-weight: 600;
}

.meta-sep {
  color: var(--text-dim);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Timeframe buttons */
.timeframe-selector {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

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

.tf-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(6, 182, 212, 0.35));
  color: #fff;
  border: 1px solid var(--border-accent);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

/* Global Health Pill */
.global-health-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  min-width: 170px;
}

.health-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
  transition: all var(--transition-normal);
}

.health-indicator.degraded {
  background-color: var(--accent-amber);
  box-shadow: 0 0 12px var(--accent-amber);
}

.health-indicator.critical {
  background-color: var(--accent-rose);
  box-shadow: 0 0 12px var(--accent-rose);
}

.health-details {
  display: flex;
  flex-direction: column;
}

.health-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.health-status-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
}

/* ==========================================================================
   MAIN CONTENT & SUMMARY BANNER
   ========================================================================== */

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.summary-banner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1200px) {
  .summary-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-card.health-score-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .summary-banner {
    grid-template-columns: 1fr;
  }
  .summary-card.health-score-card {
    grid-column: span 1;
  }
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.summary-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* Health score card */
.health-score-card {
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.85), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-header {
  display: flex;
  flex-direction: column;
}

.card-subtitle {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.health-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-dial {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.dial-fill {
  fill: none;
  stroke: var(--accent-emerald);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease, stroke 0.4s ease;
}

.dial-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.score-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-percent {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: -4px;
}

.score-narrative {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge-status-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-pill.degraded {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-status-pill.critical {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.score-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Quick Stats */
.quick-stat {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.cpu-icon-wrap { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.25); }
.ram-icon-wrap { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo); border: 1px solid rgba(99, 102, 241, 0.25); }
.disk-icon-wrap { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.25); }
.ports-icon-wrap { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.25); }

.stat-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stat-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}

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

#stat-cpu-bar { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo)); }
#stat-ram-bar { background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple)); }
#stat-disk-bar { background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan)); }

.stat-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.port-chip {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==========================================================================
   PANEL CARDS & CHARTS
   ========================================================================== */

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.chart-container {
  position: relative;
  width: 100%;
  height: 170px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* CPU Cores grid */
.cores-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.core-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.core-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

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

.core-bar-bg {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

/* Memory metrics breakdown */
.memory-metrics-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.mem-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mem-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mem-val {
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-emerald); }
.text-indigo { color: var(--accent-indigo); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }

/* ==========================================================================
   TOP RESOURCE CONSUMERS (CPU & MEMORY)
   ========================================================================== */

.top-processes-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.processes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.process-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: all var(--transition-fast);
}

.process-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.process-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.process-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.process-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.process-rank.rank-1 { color: #f59e0b; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.process-rank.rank-2 { color: #94a3b8; background: rgba(148, 163, 184, 0.15); }
.process-rank.rank-3 { color: #b45309; background: rgba(180, 83, 9, 0.15); }

.process-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.process-name-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-submeta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.process-value-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.process-value-pill.cpu-pill {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.process-value-pill.ram-pill {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.process-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.process-bar-fill.cpu-fill {
  background: linear-gradient(90deg, var(--accent-cyan), #38bdf8);
}

.process-bar-fill.ram-fill {
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

/* ==========================================================================
   DISKS & STORAGE
   ========================================================================== */

.disks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.disk-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.disk-item-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.disk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.disk-mount {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.disk-mount-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.disk-fs {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.disk-usage-tag {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.disk-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.disk-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   OPEN PORTS & PROCESS TABLE
   ========================================================================== */

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 34px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  width: 220px;
  transition: border-color var(--transition-fast), width var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-accent);
  width: 260px;
}

.protocol-filter {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.ports-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.ports-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.ports-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.ports-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.scope-filter {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.scope-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.scope-btn:hover {
  color: var(--text-primary);
}

.scope-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(99, 102, 241, 0.25));
  color: #fff;
  border: 1px solid var(--border-accent);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.proto-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.proto-badge.tcp { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.25); }
.proto-badge.udp { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }
.proto-badge.dual { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }

.port-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.port-host-ip {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: normal;
}

.container-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.container-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.container-target-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.image-tag-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill-running {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-pill-running .live-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.loading-td {
  text-align: center;
  padding: 30px !important;
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 4px;
  margin-top: auto;
}

/* ==========================================================================
   INTERACTIVE DISK STORAGE EXPLORER MODAL
   ========================================================================== */

.disk-item-card.clickable {
  cursor: pointer;
}

.disk-item-card.clickable:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
  transform: translateY(-2px);
}

.disk-click-hint {
  font-size: 9px;
  font-family: var(--font-sans);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.8;
}

.disk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.disk-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.disk-modal-container {
  background: #0d121d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(6, 182, 212, 0.1);
  border-radius: var(--radius-xl);
  width: min(760px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.disk-modal-backdrop.open .disk-modal-container {
  transform: scale(1) translateY(0);
}

.disk-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

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

.modal-btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.06);
}

.modal-btn-icon svg {
  width: 16px;
  height: 16px;
}

.disk-breadcrumbs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
}

.crumb-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.crumb-btn.active {
  color: var(--accent-cyan);
  border-color: var(--border-accent);
  background: rgba(6, 182, 212, 0.12);
}

.crumb-sep {
  color: var(--text-dim);
  font-size: 11px;
}

.disk-folder-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 24px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.disk-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 240px;
  max-height: 55vh;
}

.disk-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  gap: 12px;
}

.disk-item-row.is-dir {
  cursor: pointer;
}

.disk-item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.disk-item-row.is-dir:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-grow: 1;
}

.item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon.folder { color: var(--accent-amber); }
.item-icon.file { color: var(--text-muted); }

.item-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.item-size-bar-wrap {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.item-size-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-full);
}

.item-size-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 70px;
  text-align: right;
}

.item-pct-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  min-width: 42px;
  text-align: right;
}

.item-arrow {
  color: var(--text-dim);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.disk-item-row.is-dir:hover .item-arrow {
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.disk-loading-state, .disk-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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