/* ==========================================================================
   ASTUDIO Ops Dashboard v3 -- Airbnb-inspired CEO Dashboard
   Brand: Mint #C0E3E5, Yellow #FEC933, Dark bg
   Font: Inter (body) + JetBrains Mono (metrics)
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds -- warm dark palette */
  --bg-base: #0C0A09;
  --bg-card: #161312;
  --bg-card-hover: #1C1917;
  --bg-elevated: #1E1B1A;
  --bg-inset: #0F0D0C;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Borders */
  --border: rgba(255, 255, 255, 0.10);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(192, 227, 229, 0.4);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.88);
  --text-muted: rgba(255, 255, 255, 0.70);
  --text-on-accent: #0C0A09;

  /* Brand */
  --mint: #C0E3E5;
  --mint-soft: rgba(192, 227, 229, 0.10);
  --mint-medium: rgba(192, 227, 229, 0.18);
  --yellow: #FEC933;
  --yellow-soft: rgba(254, 201, 51, 0.10);
  --yellow-medium: rgba(254, 201, 51, 0.18);

  /* Semantic */
  --green: #34D399;
  --green-soft: rgba(52, 211, 153, 0.10);
  --green-border: rgba(52, 211, 153, 0.24);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, 0.10);
  --red-border: rgba(248, 113, 113, 0.24);
  --orange: #FB923C;
  --orange-soft: rgba(251, 146, 60, 0.10);
  --orange-border: rgba(251, 146, 60, 0.24);
  --blue: #60A5FA;
  --blue-soft: rgba(96, 165, 250, 0.10);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow-green: 0 0 12px rgba(52, 211, 153, 0.15);
  --shadow-glow-red: 0 0 12px rgba(248, 113, 113, 0.15);
  --shadow-glow-yellow: 0 0 12px rgba(254, 201, 51, 0.15);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}


/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--mint);
  text-decoration: none;
  transition: opacity var(--duration) var(--ease);
}
a:hover { opacity: 0.8; }

.hidden { display: none !important; }


/* ---------- Login Screen ---------- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(192, 227, 229, 0.03) 0%, transparent 60%),
    var(--bg-base);
}

.login-box {
  text-align: center;
  padding: 56px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--mint);
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.login-box input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}
.login-box input:focus {
  border-color: var(--border-focus);
}
.login-box input::placeholder {
  color: var(--text-muted);
}

.login-box button {
  width: 100%;
  padding: 14px;
  background: var(--yellow);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(254, 201, 51, 0.25);
}
.login-box button:active {
  transform: translateY(0);
}

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}


/* ---------- Top Navigation ---------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background: rgba(12, 10, 9, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

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

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--mint);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.nav-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2px;
}

.nav-link {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  opacity: 1;
}
.nav-link.active {
  color: var(--text-on-accent);
  background: var(--mint);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

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

/* Connection dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background: var(--green); box-shadow: var(--shadow-glow-green); }
.dot-yellow { background: var(--yellow); box-shadow: var(--shadow-glow-yellow); }
.dot-red { background: var(--red); box-shadow: var(--shadow-glow-red); }
.dot-gray { background: var(--text-muted); }

/* Alert badge */
.badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  line-height: 1;
}

/* Gear button */
.gear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-sm);
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
}
.gear-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Settings dropdown */
.settings-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-width: 200px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dd-item {
  display: block;
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background var(--duration) var(--ease);
}
.dd-item:hover {
  background: rgba(255, 255, 255, 0.05);
  opacity: 1;
}
.dd-divider {
  height: 1px;
  background: var(--border);
}


/* ---------- Main Content Area ---------- */
.main {
  padding: 96px 32px 100px;
  max-width: 1320px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.section {
  margin-bottom: 48px;
}

.section h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}


/* ---------- Hero Metric Cards (Dashboard Top) ---------- */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.summary-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.summary-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.summary-card .value {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--mono);
  letter-spacing: -2px;
  margin-bottom: 6px;
}

.summary-card .sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Hero card color accents (applied via JS) */
.summary-card--green { border-left: 3px solid var(--green); }
.summary-card--red { border-left: 3px solid var(--red); }
.summary-card--yellow { border-left: 3px solid var(--yellow); }
.summary-card--mint { border-left: 3px solid var(--mint); }


/* ---------- Server Health Bars (Dashboard) ---------- */
.server-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-bar-card {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 24px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.server-bar-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--bg-card-hover);
}

.server-bar-card .sb-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.server-bar-card .sb-ip {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 2px;
}

.server-bar-card .sb-bars {
  display: flex;
  gap: 16px;
  align-items: center;
}

.sb-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 100px;
}
.sb-gauge-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  width: 32px;
  flex-shrink: 0;
}
.sb-gauge-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-full);
  overflow: hidden;
}
.sb-gauge-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s var(--ease);
}
.sb-gauge-fill.green { background: var(--green); }
.sb-gauge-fill.yellow { background: var(--yellow); }
.sb-gauge-fill.red { background: var(--red); }
.sb-gauge-value {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.server-bar-card .sb-meta {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Legacy bar-row used in expanded views */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bar-label { width: 44px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bar-track { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-full); transition: width 0.6s var(--ease); }
.bar-fill.green { background: var(--green); }
.bar-fill.yellow { background: var(--yellow); }
.bar-fill.red { background: var(--red); }
.bar-value { width: 40px; font-size: 12px; font-family: var(--mono); text-align: right; color: var(--text-secondary); }


/* ---------- Dashboard Alerts List ---------- */
.dashboard-alert-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: background var(--duration) var(--ease);
}
.dashboard-alert-item:hover {
  background: var(--bg-card-hover);
}

.alert-severity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-severity-dot.critical { background: var(--red); box-shadow: var(--shadow-glow-red); }
.alert-severity-dot.warning { background: var(--yellow); box-shadow: var(--shadow-glow-yellow); }
.alert-severity-dot.info { background: var(--mint); }

.dashboard-alert-item .da-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.dashboard-alert-item .da-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ---------- Workflow Cards (Grid) ---------- */
.wf-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.wf-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
}
.wf-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.wf-card .wf-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.wf-card .wf-card-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  flex: 1;
  margin-right: 12px;
}

.wf-card .wf-card-status {
  flex-shrink: 0;
}

.wf-card .wf-card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
  /* 2-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-card .wf-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Duplicate warning */
.wf-card-dup { border-color: var(--red) !important; }
.wf-dup-banner { background: rgba(248, 81, 73, 0.12); color: #f85149; padding: 6px 12px; margin: -20px -20px 12px -20px; border-radius: 15px 15px 0 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; }
.dup-badge { display: inline; }

/* Department badge */
.dept-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tech badge */
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tech-python { background: var(--blue-soft); color: var(--blue); }
.tech-n8n { background: var(--yellow-soft); color: var(--yellow); }
.tech-cron { background: var(--mint-soft); color: var(--mint); }
.tech-systemd { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.tech-laravel { background: var(--red-soft); color: var(--red); }


/* ---------- Status Dots & Badges ---------- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-green { background: var(--green); }
.status-dot-yellow { background: var(--yellow); }
.status-dot-red { background: var(--red); }
.status-dot-gray { background: var(--text-muted); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-running, .status-healthy, .status-ok, .status-active {
  background: var(--green-soft);
  color: var(--green);
}
.status-error, .status-critical, .status-open {
  background: var(--red-soft);
  color: var(--red);
}
.status-warning, .status-investigating {
  background: var(--orange-soft);
  color: var(--orange);
}
.status-in_progress {
  background: var(--blue-soft);
  color: var(--blue);
}
.status-resolved {
  background: var(--green-soft);
  color: var(--green);
}
.status-wont_fix, .status-stopped, .status-stale, .status-idle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
.status-info {
  background: var(--mint-soft);
  color: var(--mint);
}


/* ---------- Slide-in Detail Panel ---------- */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms var(--ease);
  box-shadow: var(--shadow-lg);
}
.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 199;
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}
.detail-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dp-header h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.dp-header-badges {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.dp-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--duration) var(--ease);
  flex-shrink: 0;
}
.dp-close:hover {
  color: var(--text-primary);
}

.dp-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 28px;
}

.dp-section {
  margin-bottom: 28px;
}

.dp-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.dp-section p,
.dp-section .dp-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.dp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dp-meta-item {
  background: var(--bg-inset);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}
.dp-meta-item .dp-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dp-meta-item .dp-meta-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Connection tags in detail */
.dp-connections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dp-conn-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-secondary);
}

/* Issues in detail */
.dp-issue {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.dp-issue:last-child { border-bottom: none; }


/* ---------- Process Map ---------- */
.process-map {
  padding: 20px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.pm-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pm-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-node {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pm-trigger {
  background: var(--yellow-soft);
  color: var(--yellow);
  border: 1px solid rgba(254, 201, 51, 0.2);
}
.pm-step {
  background: var(--mint-soft);
  color: var(--mint);
  border: 1px solid rgba(192, 227, 229, 0.15);
}
.pm-output {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.pm-arrow {
  color: var(--text-muted);
  font-size: 14px;
}
.pm-arrow::after { content: '\2192'; }


/* ---------- Tabs & Filters ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--r-md);
  width: fit-content;
}

.tab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.tab.active {
  color: var(--text-on-accent);
  background: var(--mint);
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filters input,
.filters select {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}
.filters input {
  min-width: 240px;
}
.filters input:focus,
.filters select:focus {
  border-color: var(--border-focus);
}
.filters input::placeholder {
  color: var(--text-muted);
}


/* ---------- Infrastructure Cards ---------- */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.infra-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.infra-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--bg-card-hover);
}

.infra-card .ic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.infra-card .ic-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.infra-card .ic-ip {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-top: 2px;
}

.infra-card .ic-gauges {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

/* Circular gauge */
.circular-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.circular-gauge svg {
  width: 64px;
  height: 64px;
}
.circular-gauge .gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 4;
}
.circular-gauge .gauge-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.circular-gauge .gauge-text {
  fill: var(--text-primary);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}
.circular-gauge .gauge-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

/* Actual values row under gauges */
.ic-actuals {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 12px;
  text-align: center;
}

.infra-card .ic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.infra-card .ic-containers {
  font-size: 13px;
  color: var(--text-secondary);
}
.infra-card .ic-containers strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* ---------- Infrastructure Detail (Accordion) ---------- */
.server-cards-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.server-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.server-detail .sd-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.server-detail .sd-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.server-detail .sd-body {
  padding: 0 24px 24px;
}

.sd-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sd-metric {
  background: var(--bg-inset);
  padding: 16px;
  border-radius: var(--r-md);
}
.sd-metric .label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sd-metric .value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1;
}
.sd-metric .sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sd-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
  padding: 12px 16px;
  background: var(--bg-inset);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--mint);
}

.chevron {
  display: inline-block;
  transition: transform 200ms var(--ease);
  color: var(--text-muted);
  font-size: 12px;
}
.open .chevron { transform: rotate(90deg); }


/* ---------- Tables (inside detail panels and expanded views) ---------- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-inset);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.container-table { font-size: 12px; }
.container-table td { padding: 8px 12px; }
.cpu-hot { color: var(--red); font-weight: 600; }
.cpu-warm { color: var(--yellow); }


/* ---------- Website Cards ---------- */
.website-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.website-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all var(--duration) var(--ease);
}
.website-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.website-card .wc-domain {
  font-weight: 600;
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.website-card .wc-tech {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.website-card .wc-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}
.website-card .wc-detail:first-of-type {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Website meta row */
.wc-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.wc-meta strong { color: var(--text-primary); }

/* Website warning banner */
.wc-has-warning { border-color: rgba(248, 81, 73, 0.3); }
.wc-warning {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.wc-warning:hover { background: rgba(248, 81, 73, 0.14); }
.wc-warning strong { color: #f87171; }
.wc-warning-link { display: block; margin-top: 6px; color: #f87171; font-size: 12px; font-weight: 600; }

/* Website groups */
.website-group { margin-bottom: 32px; }
.wg-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.wc-subdomain {
  margin-left: 24px;
  border-left: 2px solid var(--border);
}

/* ---------- Alerts Timeline ---------- */
.alerts-timeline {
  position: relative;
  padding-left: 24px;
}
.alerts-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.alert-timeline-item {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-left: 8px;
  transition: background var(--duration) var(--ease);
}
.alert-timeline-item:hover {
  background: var(--bg-card-hover);
}

.alert-timeline-item::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}
.alert-timeline-item.sev-critical::before { background: var(--red); }
.alert-timeline-item.sev-warning::before { background: var(--yellow); }
.alert-timeline-item.sev-info::before { background: var(--mint); }

.alert-timeline-item.resolved-item {
  opacity: 0.45;
}

.ati-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ati-message {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  flex: 1;
}

.ati-time {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Alert context (impact + fix) */
.ati-context {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--yellow);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.ati-impact { margin-bottom: 4px; }
.ati-impact strong, .ati-action strong { color: var(--text-primary); }

.ati-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.ati-source {
  font-size: 12px;
  color: var(--text-muted);
}

/* Legacy alert items (used in dashboard + infra) */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.alert-item.resolved, .alert-item.wont_fix { opacity: 0.45; }

.alert-sev {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--r-full);
}
.alert-sev.critical { background: var(--red-soft); color: var(--red); }
.alert-sev.warning { background: var(--orange-soft); color: var(--orange); }
.alert-sev.info { background: var(--mint-soft); color: var(--mint); }

.alert-body { flex: 1; }
.alert-msg { font-size: 14px; line-height: 1.5; }
.alert-source { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.alert-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.alert-status-select {
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  cursor: pointer;
}


/* ---------- Feedback Icon ---------- */
.fb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  cursor: pointer;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}
.fb-icon:hover {
  border-color: var(--mint);
  color: var(--mint);
  background: var(--mint-soft);
}
.fb-icon.has-feedback {
  background: var(--mint-soft);
  border-color: rgba(192, 227, 229, 0.3);
  color: var(--mint);
}
.fb-icon.pending {
  background: var(--yellow-soft);
  border-color: rgba(254, 201, 51, 0.3);
  color: var(--yellow);
}
.fb-count {
  font-size: 10px;
  font-weight: 700;
}


/* ---------- Feedback Panel ---------- */
.feedback-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 250;
  display: flex;
  flex-direction: column;
  transition: transform 300ms var(--ease);
  box-shadow: var(--shadow-lg);
}

.fp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.fp-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.fp-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--duration) var(--ease);
}
.fp-close:hover { color: var(--text-primary); }

.fp-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fp-msg {
  padding: 10px 14px;
  border-radius: var(--r-md);
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
}
.fp-msg.ceo {
  align-self: flex-end;
  background: var(--mint-soft);
  border: 1px solid rgba(192, 227, 229, 0.15);
}
.fp-msg.claude {
  align-self: flex-start;
  background: var(--bg-inset);
  border: 1px solid var(--border);
}
.fp-msg.system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}
.fp-msg .fp-author {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.fp-msg .fp-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--mono);
}

.fp-input {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.fp-input textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}
.fp-input textarea:focus {
  border-color: var(--border-focus);
}
.fp-input button {
  padding: 10px 20px;
  background: var(--yellow);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration) var(--ease);
}
.fp-input button:hover {
  transform: translateY(-1px);
}


/* ---------- Info Tooltips ---------- */
.info-tip {
  position: relative;
  cursor: help;
}
.info-tip .tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  margin-left: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  vertical-align: middle;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}
.info-tip:hover .tip-icon {
  background: var(--mint-soft);
  color: var(--mint);
  border-color: rgba(192, 227, 229, 0.3);
}
.info-tip .tip-text {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 400;
  white-space: normal;
  width: 260px;
  z-index: 300;
  margin-bottom: 8px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
}
.info-tip:hover .tip-text { display: block; }


/* ---------- Settings ---------- */
.add-server-form {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.add-server-form h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.form-row input {
  padding: 10px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  flex: 1;
  min-width: 140px;
  outline: none;
}
.form-row input:focus { border-color: var(--border-focus); }
.form-row button {
  padding: 10px 20px;
  background: var(--yellow);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}

/* Connections */
.connections { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.conn-tag {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}


/* ---------- Empty States ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.3;
}


/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }


/* ---------- Mobile Bottom Nav ---------- */
.bottomnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(12, 10, 9, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}
.bnav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  padding: 6px 12px;
  transition: color var(--duration) var(--ease);
}
.bnav-link.active { color: var(--mint); }


/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .infra-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topnav { display: none; }
  .bottomnav { display: flex; }
  .main { padding: 20px 16px 80px; }
  .summary-cards { grid-template-columns: 1fr; }
  .wf-card-grid { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: 1fr; }
  .website-cards { grid-template-columns: 1fr; }
  .sd-metrics { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: column; }
  .filters input { min-width: unset; }
  .feedback-panel { width: 100%; }
  .detail-panel { width: 100%; }
  .dp-meta-grid { grid-template-columns: 1fr; }
  .server-bar-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .server-bar-card .sb-bars {
    flex-direction: column;
    gap: 8px;
  }
  .sb-gauge { min-width: unset; }
}

@media (max-width: 480px) {
  .summary-card .value { font-size: 32px; }
  .page-header h1 { font-size: 22px; }
}


/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-card,
.wf-card,
.infra-card,
.server-bar-card,
.website-card,
.alert-timeline-item {
  animation: fadeIn 300ms var(--ease) backwards;
}

/* Stagger animations for cards */
.summary-card:nth-child(1) { animation-delay: 0ms; }
.summary-card:nth-child(2) { animation-delay: 50ms; }
.summary-card:nth-child(3) { animation-delay: 100ms; }

.server-bar-card:nth-child(1) { animation-delay: 0ms; }
.server-bar-card:nth-child(2) { animation-delay: 40ms; }
.server-bar-card:nth-child(3) { animation-delay: 80ms; }
.server-bar-card:nth-child(4) { animation-delay: 120ms; }
.server-bar-card:nth-child(5) { animation-delay: 160ms; }


/* ---------- Utility Classes ---------- */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-mint { color: var(--mint); }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--mono); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
