/* ==========================================================================
   MIM UPTIME PULSE - ENTERPRISE DESIGN SYSTEM (v3.0)
   Ultra-Modern Obsidian & Glassmorphic Dashboard
   ========================================================================== */

:root {
  /* HSL Color System */
  --hue-base: 220;
  
  /* Backgrounds */
  --bg-app: hsl(var(--hue-base), 25%, 3%);
  --bg-sidebar: hsla(var(--hue-base), 20%, 6%, 0.85);
  --bg-card: hsla(var(--hue-base), 20%, 9%, 0.7);
  --bg-card-hover: hsla(var(--hue-base), 20%, 12%, 0.85);
  --bg-card-active: hsla(var(--hue-base), 30%, 15%, 0.95);
  --bg-subtle: hsla(0, 0%, 100%, 0.03);
  --bg-input: hsla(var(--hue-base), 25%, 5%, 0.7);
  
  /* Borders */
  --border-subtle: hsla(0, 0%, 100%, 0.06);
  --border-medium: hsla(0, 0%, 100%, 0.12);
  --border-highlight: hsla(230, 80%, 65%, 0.5);
  
  /* Text */
  --text-primary: hsl(0, 0%, 98%);
  --text-secondary: hsl(215, 15%, 70%);
  --text-muted: hsl(215, 15%, 50%);
  
  /* Status Colors */
  --status-up: hsl(150, 80%, 45%);
  --status-down: hsl(0, 80%, 60%);
  --status-warn: hsl(40, 90%, 55%);
  
  /* Accents */
  --accent-primary: hsl(230, 85%, 65%);
  --accent-cyan: hsl(190, 90%, 50%);
  
  /* Typography */
  --font-heading: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing & Sizing */
  --sidebar-width: 280px;
  --header-height: 70px;
  
  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Shadows & Effects */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px hsla(230, 85%, 65%, 0.15);
  --glass-blur: blur(24px);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(circle at 15% 10%, hsla(230, 85%, 65%, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, hsla(190, 90%, 50%, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  
  /* THE FIX: Unbreakable Grid Shell */
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Typography Globals */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--accent-primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { filter: brightness(1.2); }

/* Utility Classes */
.text-up { color: var(--status-up); }
.text-down { color: var(--status-down); }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); }

/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(145deg, var(--accent-primary), hsl(230, 80%, 55%));
  color: #fff;
  box-shadow: 0 4px 15px hsla(230, 85%, 65%, 0.3);
  border-top: 1px solid hsla(255, 255, 255, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px hsla(230, 85%, 65%, 0.4);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: hsla(0, 0%, 100%, 0.08);
  border-color: hsla(0, 0%, 100%, 0.2);
}

.btn-danger {
  background: hsla(0, 80%, 60%, 0.1);
  color: var(--status-down);
  border-color: hsla(0, 80%, 60%, 0.3);
}

.btn-danger:hover {
  background: hsla(0, 80%, 60%, 0.2);
  border-color: hsla(0, 80%, 60%, 0.5);
}

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

/* Inputs */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent-primary);
  background: hsla(var(--hue-base), 25%, 8%, 0.9);
  box-shadow: 0 0 0 3px hsla(230, 85%, 65%, 0.2);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

/* ==========================================================================
   LAYOUT: SIDEBAR
   ========================================================================== */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  position: relative;
  z-index: 50;
  transition: transform var(--transition-smooth);
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}


.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding: 0 4px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px hsla(190, 90%, 50%, 0.3);
  color: #fff;
}

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

.brand-text h1 { font-size: 18px; line-height: 1.2; display: flex; align-items: center; gap: 8px;}
.brand-text span { font-size: 12px; color: var(--text-muted); font-weight: 500;}

.version-badge {
  font-size: 10px;
  background: hsla(230, 85%, 65%, 0.15);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid hsla(230, 85%, 65%, 0.3);
}

/* System Health Widget */
.health-widget {
  background: linear-gradient(to right, hsla(0,0%,100%,0.02), hsla(0,0%,100%,0.05));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  transition: var(--transition-fast);
}

.health-widget:hover { border-color: var(--border-medium); }

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status-up);
  box-shadow: 0 0 12px var(--status-up);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.pulse-dot.down { background: var(--status-down); box-shadow: 0 0 12px var(--status-down); }
.pulse-dot.warn { background: var(--status-warn); box-shadow: 0 0 12px var(--status-warn); }

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 hsla(150, 80%, 45%, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px hsla(150, 80%, 45%, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 hsla(150, 80%, 45%, 0); }
}

.health-widget-text { display: flex; flex-direction: column; }
.health-widget-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.health-widget-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px;}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item-left { display: flex; align-items: center; gap: 12px; }
.nav-item svg { width: 18px; height: 18px; opacity: 0.8; transition: var(--transition-fast); }

.nav-item:hover {
  background: hsla(0, 0%, 100%, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: hsla(230, 85%, 65%, 0.1);
  color: #fff;
  border-color: hsla(230, 85%, 65%, 0.3);
  box-shadow: inset 4px 0 0 var(--accent-primary);
}

.nav-item.active svg {
  color: var(--accent-primary);
  opacity: 1;
}

.nav-badge {
  background: hsla(0, 0%, 100%, 0.1);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-item.active .nav-badge {
  background: var(--accent-primary);
  color: #fff;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   LAYOUT: MAIN WORKSPACE
   ========================================================================== */
.main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll */
}

/* Top Bar */
.topbar {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: hsla(var(--hue-base), 25%, 3%, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 40;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.mobile-menu-btn:hover { background: hsla(0,0%,100%,0.1); }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .mobile-menu-btn { display: block; }
}

.search-box {
  position: relative;
  width: 380px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  padding-left: 40px;
  border-radius: var(--radius-full);
  background: hsla(0,0%,100%,0.03);
}

.search-box .kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  background: hsla(0,0%,100%,0.08);
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  pointer-events: none;
}

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

/* Scrollable Workspace Body */
.workspace-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px;
  /* Smooth scrolling */
  scroll-behavior: smooth;
}

/* ==========================================================================
   HERO METRICS GRID
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 600px) {
  .hero-grid { grid-template-columns: 1fr; }
  .workspace-scroll { padding: 16px; }
  .search-box { display: none; } /* Hide search on small mobile for space */
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, hsla(0,0%,100%,0.1), transparent);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon svg { width: 26px; height: 26px; }

/* Icon Colors */
.icon-green { background: hsla(150, 80%, 45%, 0.1); color: var(--status-up); }
.icon-cyan { background: hsla(190, 90%, 50%, 0.1); color: var(--accent-cyan); }
.icon-indigo { background: hsla(230, 85%, 65%, 0.1); color: var(--accent-primary); }
.icon-warn { background: hsla(40, 90%, 55%, 0.1); color: var(--status-warn); }

/* ==========================================================================
   TAB VIEWS
   ========================================================================== */
.tab-view {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.tab-view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MASTER-DETAIL SPLIT (WEBSITES)
   ========================================================================== */
.split-layout {
  display: grid;
  /* Fixed width list, fluid detail panel */
  grid-template-columns: 420px minmax(0, 1fr); 
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .split-layout { grid-template-columns: 1fr; }
}

/* Left List */
.list-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filters::-webkit-scrollbar { display: none; }

.filter-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.filter-chip:hover {
  background: hsla(0,0%,100%,0.08);
  color: var(--text-primary);
}

.filter-chip.active {
  background: hsla(230, 85%, 65%, 0.15);
  color: var(--accent-primary);
  border-color: hsla(230, 85%, 65%, 0.4);
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Target Item Card */
.target-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.target-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateX(4px);
}

.target-item.selected {
  background: var(--bg-card-active);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.target-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.target-url {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 14px;
}

/* Mini Heartbeats */
.mini-beats {
  display: flex;
  gap: 2px;
  height: 20px;
  margin-bottom: 12px;
}

.beat-slot {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: hsla(0,0%,100%,0.05);
  transition: transform 0.15s;
}

.beat-slot.up { background: var(--status-up); }
.beat-slot.down { background: var(--status-down); }
.beat-slot:hover { transform: scaleY(1.4); }

.target-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-critical { background: hsla(0, 80%, 60%, 0.15); color: hsl(0, 90%, 70%); border: 1px solid hsla(0, 80%, 60%, 0.3); }
.badge-high { background: hsla(40, 90%, 55%, 0.15); color: hsl(40, 90%, 65%); border: 1px solid hsla(40, 90%, 55%, 0.3); }
.badge-normal { background: hsla(230, 85%, 65%, 0.15); color: hsl(230, 90%, 75%); }
.badge-up { background: hsla(150, 80%, 45%, 0.15); color: hsl(150, 80%, 60%); }
.badge-down { background: hsla(0, 80%, 60%, 0.15); color: hsl(0, 90%, 70%); }

/* Right Panel: Detail View */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-subtle);
  /* The min-width 0 prevents flex/grid blowout from charts */
  min-width: 0; 
}

.dp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}

.dp-title h2 { font-size: 26px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.dp-title .badge { font-size: 12px; }

/* Detail 4 Metrics */
.dp-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dp-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.dp-stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px;}
.dp-stat-val { font-family: var(--font-heading); font-size: 24px; font-weight: 800; color: var(--status-up); }

/* Chart Container */
.dp-chart-wrap {
  background: hsla(var(--hue-base), 25%, 5%, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.dp-chart-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.dp-chart-title { font-weight: 700; font-family: var(--font-heading); }

/* CRITICAL: Position relative for Chart.js to scale correctly */
.dp-canvas-container {
  position: relative;
  width: 100%;
  height: 280px; 
}

/* Security Box */
.dp-security {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.sec-item { display: flex; flex-direction: column; gap: 6px; }
.sec-item-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.sec-item-val { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ==========================================================================
   SERVERS VIEW
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.srv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition-smooth);
}

.srv-card:hover { border-color: var(--border-medium); transform: translateY(-3px); }

.srv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.srv-id { display: flex; align-items: center; gap: 14px; }
.srv-icon {
  width: 48px; height: 48px;
  background: hsla(0,0%,100%,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.srv-name { font-family: var(--font-heading); font-size: 18px; font-weight: 700; display:flex; align-items:center; gap:8px;}
.srv-ip { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Circular Gauges */
.gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

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

.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-svg-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 12px;
}

.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: hsla(0,0%,100%,0.05); stroke-width: 6; }
.gauge-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gauge-fill.cpu { stroke: var(--accent-primary); }
.gauge-fill.ram { stroke: var(--accent-cyan); }
.gauge-fill.disk { stroke: var(--status-up); }
.gauge-fill.danger { stroke: var(--status-down); }

.gauge-center {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
}

.gauge-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.gauge-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Server Meta */
.srv-meta { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.meta-row { display: flex; justify-content: space-between; }
.meta-label { color: var(--text-muted); }
.meta-val { font-weight: 600; color: var(--text-primary); text-align: right; }

/* ==========================================================================
   SETTINGS & INCIDENTS
   ========================================================================== */
.settings-panel {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.set-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.set-header { margin-bottom: 24px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 16px; }
.set-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; display:flex; justify-content:space-between;}
.set-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.incidents-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--status-up);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inc-card.active { border-left-color: var(--status-down); }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: hsla(0,0%,0%,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-dialog {
  background: var(--bg-card-active);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog.wide { max-width: 800px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 20px; font-weight: 700; font-family: var(--font-heading); }
.modal-close {
  background: transparent; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; transition: var(--transition-fast);
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast */
.toast-container { position: fixed; bottom: 32px; right: 32px; display: flex; flex-direction: column; gap: 12px; z-index: 2000; }
.toast {
  background: hsla(var(--hue-base), 25%, 15%, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-medium);
  color: #fff; padding: 14px 20px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-subtle);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Code Box */
.code-box {
  background: #000;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5b4fc;
  margin: 16px 0;
  word-break: break-all;
}

/* Process Table */
table.procs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.procs th { text-align: left; padding: 10px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-subtle); }
table.procs td { padding: 10px; border-bottom: 1px solid hsla(0,0%,100%,0.02); }
