/* ==========================================================================
   Eclyzer Home Monitor - Ultra-Clean High-End Dark UI
   Design Philosophy: tasteskill 2.5.1 (Obsidian Black, Sleek Grey, Electric Blue)
   ========================================================================== */

:root {
  /* Canvas & Surfaces */
  --bg-deep: #06080b;
  --bg-canvas: #0a0d13;
  --bg-surface: #0f131a;
  --bg-surface-elevated: #151b24;
  --bg-surface-hover: #1a222e;

  /* Borders & Hairlines */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: #3b82f6;

  /* Text & Inks */
  --ink-primary: #f3f4f6;
  --ink-secondary: #9ca3af;
  --ink-muted: #64748b;
  --ink-faint: #475569;

  /* Brand Electric Blue Accent */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #60a5fa;
  --accent-blue-glow: rgba(59, 130, 246, 0.15);
  --accent-blue-subtle: rgba(59, 130, 246, 0.08);
  --accent-blue-border: rgba(59, 130, 246, 0.3);

  /* Status Colors (Semantic) */
  --status-green: #10b981;
  --status-green-glow: rgba(16, 185, 129, 0.2);
  --status-green-subtle: rgba(16, 185, 129, 0.08);
  --status-green-border: rgba(16, 185, 129, 0.25);

  --status-amber: #f59e0b;
  --status-amber-glow: rgba(245, 158, 11, 0.2);
  --status-amber-subtle: rgba(245, 158, 11, 0.08);
  --status-amber-border: rgba(245, 158, 11, 0.25);

  --status-red: #ef4444;
  --status-red-glow: rgba(239, 68, 68, 0.2);
  --status-red-subtle: rgba(239, 68, 68, 0.08);
  --status-red-border: rgba(239, 68, 68, 0.25);

  /* Typography */
  --font-sans: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Card metrics */
  --radius-lg: 14px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

/* Reset & Base */
html {
  color-scheme: dark;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #1e2638 transparent;
}

/* Universal Clean Dark Scrollbar - Consistent across entire UI & No Arrows */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #1e2638;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

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

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(1200px 600px at 50% -100px, rgba(37, 99, 235, 0.07), transparent 70%),
    radial-gradient(800px 400px at 80% 400px, rgba(16, 185, 129, 0.02), transparent 60%);
  background-attachment: fixed;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Container */
.app-shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 8, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: 60px;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

.brand-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1b2330 0%, #0d1219 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.brand-text-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.brand-tag {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  background: var(--accent-blue-subtle);
  border: 1px solid var(--accent-blue-border);
  padding: 1.5px 6px;
  border-radius: 4px;
}

.brand-ip {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

/* Nav Controls */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
}

.pulse-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 8px var(--status-green);
  animation: led-glow 2s infinite ease-in-out;
}

@keyframes led-glow {
  0%, 100% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 10px var(--status-green); }
}

.segmented-control {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3.5px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn:hover {
  color: var(--ink-primary);
}

.segment-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
}

/* Owner Mode / Auth Controls */
.btn-auth-lock {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3.5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-auth-lock:hover {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.auth-unlocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--status-green-border);
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--status-green);
}

.btn-auth-logout {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  margin-left: 2px;
  transition: color 0.15s ease;
}

.btn-auth-logout:hover {
  color: #ef4444;
}

/* ==========================================================================
   Hero Status & Incident Ribbon
   ========================================================================== */
.hero-ribbon {
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s ease;
}

.hero-ribbon.status-all-good {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-surface) 100%);
  border-color: var(--status-green-border);
}

.hero-ribbon.status-attention {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.07) 0%, var(--bg-surface) 100%);
  border-color: var(--status-amber-border);
}

.hero-ribbon.status-outage {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-surface) 100%);
  border-color: var(--status-red-border);
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ribbon-icon-chip {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ribbon-icon-chip.green {
  background: var(--status-green-subtle);
  color: var(--status-green);
}

.ribbon-icon-chip.amber {
  background: var(--status-amber-subtle);
  color: var(--status-amber);
}

.ribbon-icon-chip.red {
  background: var(--status-red-subtle);
  color: var(--status-red);
}

.ribbon-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.ribbon-desc {
  font-size: 12px;
  color: var(--ink-secondary);
}

.ribbon-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Telemetry Ribbon Bar (6 Metrics)
   ========================================================================== */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.telemetry-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.telemetry-tile:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

.telemetry-tile.tile-clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.telemetry-tile.tile-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.telemetry-tile.tile-clickable:active {
  transform: translateY(0);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tile-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.tile-icon {
  opacity: 0.75;
}

.tile-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tile-value {
  font-size: 19px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  font-feature-settings: 'tnum';
}

.tile-unit {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.tile-progress {
  height: 3.5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.tile-progress-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: width 0.35s ease;
}

.tile-progress-fill.warn { background: var(--status-amber); }
.tile-progress-fill.danger { background: var(--status-red); }

.tile-sub {
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Telemetry Split: Live CPU & RAM History Charts + Top Processes (3 Cards)
   ========================================================================== */
.system-telemetry-split {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 12px;
  margin-top: 12px;
}

.chart-card, .proc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 184px;
  box-sizing: border-box;
}

.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-heading {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.chart-canvas-wrap {
  position: relative;
  height: 105px;
  width: 100%;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.chart-area-path {
  fill: url(#cpuGrad);
  transition: d 0.25s ease;
}

.chart-area-path.ram-mode {
  fill: url(#ramGrad);
}

.chart-stroke-path {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: d 0.25s ease;
}

.chart-stroke-path.ram-mode {
  stroke: var(--status-green);
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

/* Top Processes Table */
.proc-table-wrap {
  overflow-y: auto;
  height: 130px;
  max-height: 130px;
  content-visibility: auto;
  contain-intrinsic-size: auto 130px;
}

.proc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--font-mono);
}

.proc-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 3px 6px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 2;
}

.proc-table td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--ink-secondary);
}

.proc-table tr:hover td {
  background: var(--bg-surface-elevated);
  color: var(--ink-primary);
}

.proc-name-col {
  color: var(--ink-primary);
  font-weight: 500;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proc-num {
  text-align: right;
  font-feature-settings: 'tnum';
}

/* ==========================================================================
   Project View Controls & Tabs
   ========================================================================== */
.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.view-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.cat-tab-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-tab-btn:hover {
  color: var(--ink-primary);
}

.cat-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Quick Search Box */
.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 9px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5.5px 28px 5.5px 29px;
  width: 220px;
  outline: none;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--ink-muted);
  opacity: 0.85;
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-glow);
  width: 270px;
}

.search-kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  line-height: 1.2;
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1;
}

.search-clear-btn:hover {
  color: var(--ink-primary);
}

/* View Mode Switcher */
.view-mode-control {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.view-mode-btn:hover {
  color: var(--ink-primary);
}

.view-mode-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Projects Deck (True Masonry: Equal Width, Dynamic Height, Uniform 14px Spacing)
   ========================================================================== */
.projects-deck {
  column-count: 2;
  column-gap: 14px;
  width: 100%;
}

.project-card {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px; /* Exact same vertical gap as column-gap */
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  height: fit-content; /* Strictly size according to content */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}

.project-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.project-card.outage {
  border-color: var(--status-red-border);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.03) 0%, var(--bg-surface) 100%);
}

.project-card.degraded {
  border-color: var(--status-amber-border);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, var(--bg-surface) 100%);
}

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

.project-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-icon-box img {
  width: 18px;
  height: 18px;
}

.project-meta-titles {
  display: flex;
  flex-direction: column;
}

.project-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.project-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.project-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.project-status-pill.operational {
  background: var(--status-green-subtle);
  color: var(--status-green);
  border: 1px solid var(--status-green-border);
}

.project-status-pill.degraded {
  background: var(--status-amber-subtle);
  color: var(--status-amber);
  border: 1px solid var(--status-amber-border);
}

.project-status-pill.outage {
  background: var(--status-red-subtle);
  color: var(--status-red);
  border: 1px solid var(--status-red-border);
}

.status-dot-mini {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.project-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 11.5px;
}

.project-domain-link {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-domain-link:hover {
  text-decoration: underline;
  color: var(--accent-blue-hover);
}

.project-desc {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Active Ingress Domains Bar in Project Card */
.project-domains-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}

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

.domains-tag-label {
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.domains-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2.5px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-primary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.domain-pill:hover {
  background: var(--accent-blue-subtle);
  border-color: var(--accent-blue-border);
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.domain-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 5px var(--status-green);
}

.domain-dot.internal {
  background: var(--accent-blue);
  box-shadow: 0 0 4px var(--accent-blue);
}

.domain-host {
  font-weight: 500;
}

.ext-arrow {
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.domain-pill:hover .ext-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

.domain-latency-badge {
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 1px 4.5px;
  border-radius: 3px;
  margin-left: 2px;
  line-height: 1.2;
}

.domain-latency-badge.online {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.domain-latency-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Compact Mode Adaptations */
.projects-deck.compact-view .project-card {
  padding: 12px 14px;
  margin-bottom: 10px;
}

.projects-deck.compact-view .project-desc {
  display: none;
}

.projects-deck.compact-view .project-icon-box {
  width: 26px;
  height: 26px;
}

.projects-deck.compact-view .project-icon-box img {
  width: 14px;
  height: 14px;
}

.projects-deck.compact-view .project-name {
  font-size: 13.5px;
}

.projects-deck.compact-view .project-domains-bar {
  margin-bottom: 8px;
  padding: 4px 8px;
  gap: 4px;
}

.projects-deck.compact-view .domain-pill {
  font-size: 10px;
  padding: 1.5px 6px;
}

.projects-deck.compact-view .service-row {
  padding: 3px 5px;
}

.projects-deck.compact-view .service-details {
  display: none;
}

/* Component Service Table inside Card */
.service-table {
  width: 100%;
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
  font-size: 11.5px;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background-color 0.15s ease;
  border-radius: 4px;
}

.service-row:hover {
  background-color: var(--bg-surface-elevated);
}

.service-row.row-alert {
  background-color: rgba(239, 68, 68, 0.06);
  border-bottom-color: rgba(239, 68, 68, 0.15);
}

.service-row.row-warn {
  background-color: rgba(245, 158, 11, 0.06);
  border-bottom-color: rgba(245, 158, 11, 0.15);
}

.service-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.service-state-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-state-led.ok { background: var(--status-green); }
.service-state-led.warn { background: var(--status-amber); box-shadow: 0 0 4px var(--status-amber); }
.service-state-led.error { background: var(--status-red); box-shadow: 0 0 4px var(--status-red); }

.service-name {
  font-family: var(--font-mono);
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-details {
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 3px;
}

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

.service-resource {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-secondary);
}

.btn-icon-log {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.btn-icon-log:hover {
  background: var(--accent-blue-subtle);
  border-color: var(--accent-blue-border);
  color: var(--accent-blue);
}

/* ==========================================================================
   Diagnostics & Live Terminal Window
   ========================================================================== */
.terminal-card {
  margin-top: 24px;
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.terminal-titlebar {
  background: #0d1017;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.traffic-lights {
  display: flex;
  gap: 5px;
}

.traffic-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.light-red { background: #ef4444; }
.light-amber { background: #f59e0b; }
.light-green { background: #10b981; }

.titlebar-title {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
}

.terminal-target-badge {
  color: var(--accent-blue);
}

.terminal-line-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.terminal-filter-wrap svg {
  position: absolute;
  left: 8px;
  color: var(--ink-muted);
  pointer-events: none;
}

.terminal-filter-input {
  background: #05070a;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3.5px 22px 3.5px 24px;
  width: 130px;
  outline: none;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease;
}

.terminal-filter-input:focus {
  border-color: var(--accent-blue);
  width: 190px;
}

.terminal-filter-clear {
  position: absolute;
  right: 5px;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.terminal-filter-clear:hover {
  color: var(--ink-primary);
}

.terminal-close-btn {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.terminal-close-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

.terminal-screen {
  padding: 14px 18px;
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: #cbd5e1;
  background: #05070a;
}

.terminal-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 12px;
}

.terminal-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 0;
}

.terminal-line.error { color: #f87171; }
.terminal-line.warn { color: #fbbf24; }
.terminal-line.info { color: #38bdf8; }

.terminal-timestamp {
  color: #64748b;
  margin-right: 6px;
  user-select: none;
}

.terminal-highlight {
  background: rgba(234, 179, 8, 0.25);
  color: #fef08a;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ==========================================================================
   Hardware Detail Modal (Memory & Storage) - Modern Native Dialog
   ========================================================================== */
.modal-backdrop,
dialog.modal-native {
  position: fixed;
  inset: 0;
  z-index: 100;
  border: none;
  padding: 20px;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  margin: 0;
  background: transparent;
}

dialog.modal-native:not([open]) {
  display: none;
}

.modal-backdrop,
dialog.modal-native[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.modal-native:modal {
  overscroll-behavior: contain;
}

dialog.modal-native::backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
  animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop {
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 660px;
  max-height: 92vh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.modal-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.modal-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

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

.modal-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3.5px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-tab-btn:hover {
  color: var(--ink-primary);
}

.modal-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--ink-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-footer {
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-footer-note {
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.modal-action-btn {
  background: var(--accent-blue);
  border: none;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-action-btn:hover {
  background: var(--accent-blue-hover);
}

.modal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.modal-stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.modal-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.modal-stat-val {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--ink-primary);
}

.modal-stat-sub {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.modal-progress-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.modal-progress-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.modal-progress-fill.green {
  background: var(--status-green);
}

/* ==========================================================================
   Access Code Authentication Modal & Locked State
   ========================================================================== */
.auth-dialog {
  max-width: 440px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 8px 36px 8px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.auth-eye-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.auth-eye-btn:hover {
  color: var(--ink-primary);
}

.auth-error-msg {
  color: #f87171;
  font-size: 11px;
  font-family: var(--font-sans);
  margin-top: 4px;
}

.auth-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.auth-hint svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-blue);
}

.modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn-cancel:hover {
  color: var(--ink-primary);
  background: rgba(255, 255, 255, 0.04);
}

.locked-proc-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  text-align: center;
}

.btn-unlock-inline {
  margin-top: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue);
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-unlock-inline:hover {
  background: var(--accent-blue);
  color: #fff;
}

.shake-anim {
  animation: auth-shake 0.35s ease-in-out;
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Toast Notification (Baseline Modern Web - Popover API) */
.toast-notify {
  position: fixed;
  bottom: 24px;
  right: 24px;
  margin: 0;
  inset: auto 24px 24px auto;
  z-index: 150;
  background: #0f131a;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-primary);
  font-size: 12.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.15);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, display 0.25s allow-discrete, overlay 0.25s allow-discrete;
}

.toast-notify.show,
.toast-notify:popover-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@starting-style {
  .toast-notify:popover-open {
    transform: translateY(80px);
    opacity: 0;
  }
}

.toast-icon-box {
  color: var(--status-green);
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.footer-meta-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-meta-block strong {
  color: var(--accent-blue);
}

/* ==========================================================================
   Nginx Port & Virtual Host Matrix (tasteskill 2.5.1 aligned)
   ========================================================================== */

.nginx-card-matrix {
  margin-top: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nginx-matrix-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.nginx-matrix-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
}

.btn-nginx-modal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--accent-blue-subtle);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue);
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nginx-modal-pill:hover {
  background: var(--accent-blue);
  color: #fff;
}

.nginx-vhost-list {
  display: flex;
  flex-direction: column;
}

.nginx-vhost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  transition: background-color 0.15s ease;
  gap: 10px;
}

.nginx-vhost-row:last-child {
  border-bottom: none;
}

.nginx-vhost-row:hover {
  background-color: var(--bg-surface-hover);
}

.vhost-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  flex-shrink: 0;
}

.vhost-name {
  color: var(--ink-primary);
  font-weight: 500;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  transition: color 0.15s ease;
}

.vhost-name:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.vhost-project-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--ink-secondary);
}

.vhost-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-grow: 1;
  font-family: var(--font-mono);
  font-size: 11px;
}

.vhost-listen-badge {
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: var(--ink-secondary);
  font-size: 10px;
}

.route-badge {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.route-badge.proxy {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
}

.route-badge.static {
  background: var(--status-green-subtle);
  color: var(--status-green);
  border: 1px solid var(--status-green-border);
}

.route-badge.redirect {
  background: var(--status-amber-subtle);
  color: var(--status-amber);
  border: 1px solid var(--status-amber-border);
}

.route-badge.drop {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-muted);
  border: 1px solid var(--border-subtle);
}

.vhost-arrow {
  color: var(--ink-faint);
  font-size: 11px;
}

.vhost-target {
  color: var(--ink-primary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}

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

.vhost-lat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-blue);
}

.vhost-status-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.vhost-status-badge.up {
  background: var(--status-green-subtle);
  color: var(--status-green);
  border: 1px solid var(--status-green-border);
}

.vhost-status-badge.down {
  background: var(--status-red-subtle);
  color: var(--status-red);
  border: 1px solid var(--status-red-border);
}

/* ==========================================================================
   Spacious Modal & Nginx Table Styling (tasteskill 2.5.1 aligned)
   ========================================================================== */

.modal-dialog.modal-wide {
  max-width: 1140px !important;
  width: 95vw !important;
  height: 86vh !important;
  max-height: 86vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.modal-dialog.modal-wide .modal-body {
  padding: 16px 20px;
  gap: 12px;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.nginx-grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
}

.nginx-modal-card {
  margin-top: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

.nginx-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0 !important;
}

.modal-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  width: 280px;
  transition: all 0.15s ease;
}

.modal-search-wrap:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-subtle);
}

.modal-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink-primary);
  font-size: 11px;
  font-family: inherit;
  width: 100%;
}

.modal-search-input::placeholder {
  color: var(--ink-faint);
}

/* Nginx Table Scroll Container - Smooth unified single scroll container */
.nginx-table-scroll-container {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  background: var(--bg-surface);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

@media (max-height: 768px) {
  .modal-dialog.modal-wide {
    height: 94vh !important;
    max-height: 94vh !important;
  }
}

.nginx-table-scroll-container::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.nginx-table-scroll-container::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.nginx-table-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.nginx-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

.modal-nginx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.modal-nginx-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-surface-elevated);
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: left;
}

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

.modal-nginx-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

.nginx-table-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nginx-table-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.nginx-target-cell code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-blue);
  word-break: break-all;
  white-space: normal;
  display: inline-block;
  max-width: 320px;
}

.vhost-listen-badge.lan {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

@media (max-width: 900px) {
  .nginx-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .modal-search-wrap {
    width: 180px;
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1140px) {
  .system-telemetry-split {
    grid-template-columns: 1fr 1fr;
  }
  .system-telemetry-split .proc-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .projects-deck {
    column-count: 1;
  }
  .telemetry-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 0 14px;
  }
  .system-telemetry-split {
    grid-template-columns: 1fr;
  }
  .system-telemetry-split .proc-card {
    grid-column: auto;
  }
  .telemetry-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-ribbon {
    flex-direction: column;
    align-items: flex-start;
  }
  .view-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
