/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
  /* HSL Color Palette */
  --bg-primary: 220, 25%, 6%;
  --bg-secondary: 220, 20%, 9%;
  --card-bg: 220, 20%, 12%, 0.55;
  --card-border: 220, 20%, 25%, 0.18;
  
  --text-primary: 0, 0%, 96%;
  --text-secondary: 220, 15%, 70%;
  --text-muted: 220, 10%, 52%;   /* 52%, not 48%: below this it fails WCAG AA on a card (scripts/contrast-audit.mjs) */
  
  --primary: 255, 75%, 67%; /* Radiant Violet - 67%, not 65%: it is used as TEXT in 8 rules and 65% fails WCAG AA on a card */
  --primary-glow: rgba(135, 80, 255, 0.35);
  
  --success: 145, 80%, 45%;
  --success-glow: rgba(16, 185, 129, 0.3);
  
  --warning: 35, 90%, 55%;
  --warning-glow: rgba(245, 158, 11, 0.25);
  
  --danger: 352, 85%, 57%;   /* 57%, not 55%: used as text, and 55% falls just under AA on a card */
  --danger-glow: rgba(239, 68, 68, 0.3);
  
  --accent: 190, 95%, 50%; /* Electric Teal */
  
  /* Fonts */
  --font-header: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --transition-speed: 0.22s;
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
#domainSearchModal .form-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.3rem 0 0.75rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid hsl(var(--text-muted));
  border-radius: 6px;
  background: hsl(var(--bg-secondary));
  color: hsl(var(--text-primary));
  font: inherit;
}
#domainQuoteResult, #domainPurchaseResult { overflow-wrap: anywhere; }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: hsl(var(--bg-primary));
  color: hsl(var(--text-primary));
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Atmospheric Ambient Lighting */
.glow-bg-1, .glow-bg-2 {
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(160px);
  opacity: 0.1;
}

.glow-bg-1 {
  top: -20vw;
  left: -15vw;
  background: radial-gradient(circle, hsl(var(--primary)) 0%, transparent 80%);
}

.glow-bg-2 {
  bottom: -20vw;
  right: -15vw;
  background: radial-gradient(circle, hsl(var(--accent)) 0%, transparent 80%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Glassmorphic Card base */
.glass-card {
  background: hsla(220, 20%, 10%, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 35px 0 rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Layout container */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon-wrapper {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  padding: 0.6rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(135, 80, 255, 0.3);
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: white;
}

.brand-text h1 {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, hsl(var(--text-secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-brand {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  letter-spacing: 0.5px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.online { background-color: hsl(var(--success)); box-shadow: 0 0 8px hsl(var(--success)); }
.status-dot.offline { background-color: hsl(var(--text-muted)); }
.status-dot.working { background-color: hsl(var(--warning)); box-shadow: 0 0 8px hsl(var(--warning)); animation: pulse-glow 1.5s infinite; }

.status-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-speed);
}

.btn-primary {
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(265, 85%, 60%) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(135, 80, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(135, 80, 255, 0.4);
}

.btn-glow:hover { box-shadow: 0 0 20px var(--primary-glow); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: hsl(var(--text-primary));
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success { background: hsl(var(--success)); color: white; }
.btn-success:hover { box-shadow: 0 0 12px var(--success-glow); }

.btn-warning { background: hsl(var(--warning)); color: white; }
.btn-warning:hover { box-shadow: 0 0 12px var(--warning-glow); }

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-text-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--text-secondary));
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-speed);
}

.btn-text-icon:hover {
  background: rgba(255, 255, 255, 0.04);
  color: hsl(var(--text-primary));
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--text-muted));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed);
}

.btn-icon:hover { color: hsl(var(--text-primary)); }

/* ==========================================================================
   LOGIN SELECTION CARD
   ========================================================================== */
#loginPanel {
  padding: 3rem;
  max-width: 750px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.primary-glow-icon {
  color: hsl(var(--primary));
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

#loginPanel h2 {
  font-family: var(--font-header);
  font-size: 1.6rem;
  font-weight: 600;
}

.panel-description {
  color: hsl(var(--text-secondary));
  font-size: 0.95rem;
}

.login-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}

.btn-large {
  flex-direction: column;
  padding: 2rem;
  height: auto;
  border-radius: 12px;
  text-align: center;
  gap: 1rem;
}

.btn-large i {
  width: 32px;
  height: 32px;
}

.btn-largeStrong {
  font-size: 1rem;
}

.btn-large div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-large strong {
  font-size: 1rem;
  font-family: var(--font-header);
  letter-spacing: -0.2px;
}

.btn-large span {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

.setup-instructions {
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
}

.setup-instructions h3 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.setup-instructions p {
  font-size: 0.82rem;
  color: hsl(var(--text-secondary));
  line-height: 1.5;
}

.instr-icon {
  width: 16px;
  height: 16px;
  color: hsl(var(--primary));
}

/* ==========================================================================
   DASHBOARD HUB
   ========================================================================== */
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Profile header Row */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid hsl(var(--primary));
  box-shadow: 0 0 8px var(--primary-glow);
}

.profile-meta h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.account-badge {
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
}

.integrations-status {
  display: flex;
  gap: 0.75rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: hsl(var(--text-muted));
}

.badge-tag .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
}

.badge-tag.connected {
  color: hsl(var(--text-primary));
  background: rgba(255, 255, 255, 0.04);
}

.badge-tag.connected .badge-dot {
  background-color: hsl(var(--success));
  box-shadow: 0 0 6px hsl(var(--success));
}

/* Navigation Tab bar */
.navigation-tabs {
  display: flex;
  padding: 0.4rem;
  gap: 0.4rem;
  overflow-x: auto;
}

.nav-tab {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--text-secondary));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all var(--transition-speed);
}

.nav-tab i {
  width: 16px;
  height: 16px;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: hsl(var(--text-primary));
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Tab panes */
.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: flex !important;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-intro-row {
  margin-bottom: 0.25rem;
}

.panel-intro-row h2 {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 600;
}

.panel-intro-row p {
  font-size: 0.85rem;
  color: hsl(var(--text-secondary));
}

/* ==========================================================================
   TAB 1: DNS SHIELD (DOMAINS CRIDS)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: hsl(var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-header);
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.stat-icon-wrapper {
  padding: 0.8rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon { width: 22px; height: 22px; }

.bg-blue { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.1); }
.text-blue { color: #60a5fa; }

.bg-green { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.1); }
.text-green { color: #34d399; }

.bg-red { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.1); }
.text-red { color: #f87171; }

.management-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  gap: 1rem;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: hsl(var(--text-muted));
  width: 16px;
  height: 16px;
}

.search-bar-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: white;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all var(--transition-speed);
}

.search-bar-wrapper input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(0, 0, 0, 0.25);
}

.bulk-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(135, 80, 255, 0.08) 0%, rgba(190, 95, 50, 0.03) 100%);
  border: 1px solid rgba(135, 80, 255, 0.2);
  box-shadow: 0 4px 15px rgba(135, 80, 255, 0.05);
  animation: slide-down 0.25s ease-out;
}

.bulk-info { display: flex; align-items: center; gap: 0.75rem; }
.bulk-count-badge { background: hsl(var(--primary)); color: white; font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 50px; }
.bulk-text { font-size: 0.82rem; color: hsl(var(--text-secondary)); font-weight: 500; }
.bulk-buttons { display: flex; gap: 0.6rem; }

/* Domains Container list */
.domains-container { display: flex; flex-direction: column; gap: 0.5rem; }
.domains-header, .domain-row { display: grid; grid-template-columns: 45px 1.5fr 0.7fr 1.1fr 0.7fr 1.3fr 0.9fr; align-items: center; padding: 0.75rem 1.25rem; }
.domains-header { font-size: 0.75rem; font-weight: 700; color: hsl(var(--text-secondary)); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }

.domain-row {
  background: hsla(220, 20%, 11%, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  transition: all 0.18s;
}

.domain-row:hover {
  background: hsla(220, 20%, 14%, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.domain-row.selected {
  background: hsla(255, 75%, 65%, 0.03);
  border-color: rgba(135, 80, 255, 0.2);
}

.domain-name { font-family: var(--font-header); font-weight: 600; font-size: 0.95rem; color: white; }
.plan-badge { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 4px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); color: hsl(var(--text-secondary)); }

.shield-status-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 50px; }
.shield-status-badge.blocked { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.18); color: hsl(var(--success)); }
.shield-status-badge.not-blocked { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.18); color: #f87171; }
.shield-status-badge.unsupported { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.18); color: hsl(var(--warning)); }
.shield-status-badge.checking { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); color: hsl(var(--text-secondary)); animation: checking-pulse 1.8s infinite ease-in-out; }

/* Origin TLS mode. Deliberately three-tone rather than two: strict is the only
   mode that verifies the origin certificate, full encrypts without verifying,
   and flexible/off leave the origin leg in plaintext — which is a real finding,
   not a preference. */
.tls-mode-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 50px; }
.tls-mode-badge.strict { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.18); color: hsl(var(--success)); }
.tls-mode-badge.partial { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.18); color: hsl(var(--warning)); }
.tls-mode-badge.insecure { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.18); color: #f87171; }
.tls-mode-badge.unknown { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); color: hsl(var(--text-secondary)); }
.tls-mode-badge.checking { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); color: hsl(var(--text-secondary)); animation: checking-pulse 1.8s infinite ease-in-out; }
.status-badge-icon { width: 12px; height: 12px; }
.status-badge-icon.spin { animation: spin 1.5s linear infinite; }

@keyframes checking-pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-toggle-action { font-size: 0.78rem; padding: 0.35rem 0.8rem; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 0.3rem; transition: all var(--transition-speed); }
.btn-toggle-action.block-action { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.15); }
.btn-toggle-action.block-action:hover { background: hsl(var(--success)); color: white; }
.btn-toggle-action.unblock-action { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.15); }
.btn-toggle-action.unblock-action:hover { background: hsl(var(--danger)); color: white; }

/* Custom Checkboxes */
.custom-checkbox { position: relative; display: inline-block; width: 16px; height: 16px; cursor: pointer; }
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { position: absolute; top: 0; left: 0; height: 16px; width: 16px; background-color: rgba(0, 0, 0, 0.2); border: 1.5px solid rgba(255, 255, 255, 0.18); border-radius: 4px; transition: all 0.12s; }
.custom-checkbox input:checked ~ .checkmark { background-color: hsl(var(--primary)); border-color: hsl(var(--primary)); box-shadow: 0 0 6px var(--primary-glow); }
.checkmark::after { content: ""; position: absolute; display: none; left: 4.5px; top: 1px; width: 4.5px; height: 8.5px; border: solid white; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.custom-checkbox input:checked ~ .checkmark::after { display: block; }

/* ==========================================================================
   TAB 2: RUNCLOUD LAYOUT
   ========================================================================== */
.servers-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.5rem;
  align-items: start;
}

.server-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.vps-status-card {
  padding: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.vps-status-card.active-vps {
  border-color: rgba(135, 80, 255, 0.35);
  box-shadow: 0 0 15px rgba(135, 80, 255, 0.08);
  background: hsla(220, 20%, 12%, 0.75);
}

.vps-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.vps-icon-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem;
  border-radius: 10px;
  color: hsl(var(--text-secondary));
  transition: all var(--transition-speed);
}

.vps-status-card.active-vps .vps-icon-box {
  background: rgba(135, 80, 255, 0.08);
  border-color: rgba(135, 80, 255, 0.2);
  color: hsl(var(--primary));
}

.vps-meta-text h4 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 600;
}

.vps-meta-text p {
  font-size: 0.78rem;
  color: hsl(var(--text-secondary));
}

.vps-specs-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: hsl(var(--text-muted));
}

/* Right-side details applications list */
.server-detailed-apps {
  padding: 1.5rem;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-detail-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  gap: 0.75rem;
  color: hsl(var(--text-muted));
  margin: auto;
}

.detail-icon { width: 44px; height: 44px; }
.empty-detail-state h4 { font-size: 1.1rem; color: hsl(var(--text-secondary)); }
.empty-detail-state p { font-size: 0.85rem; max-width: 320px; }

.server-detail-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-detail-header h3 {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 600;
}

.server-detail-header p {
  font-size: 0.8rem;
  color: hsl(var(--text-secondary));
}

.apps-table-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.app-table-header, .app-table-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.7fr 1fr;
  align-items: center;
  padding: 0.6rem 1rem;
}

.app-table-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: hsl(var(--text-secondary));
  letter-spacing: 0.5px;
}

.app-table-row {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  font-size: 0.82rem;
}

.app-table-row .app-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: white;
}

.app-table-row .app-domain {
  color: hsl(var(--text-secondary));
}

.app-table-row .php-badge {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #a78bfa;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  width: fit-content;
}

.ssl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.ssl-badge.secured { color: hsl(var(--success)); }
.ssl-badge.unsecured { color: hsl(var(--warning)); }

/* ==========================================================================
   TAB 3: HETZNER GRID LAYOUT
   ========================================================================== */
.grid-layout-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.hz-node-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.node-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.node-name-wrapper h3 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.node-ip-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: hsl(var(--text-secondary));
  margin-top: 0.1rem;
}

.node-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.node-status-badge.running { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.18); color: hsl(var(--success)); }
.node-status-badge.off { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.08); color: hsl(var(--text-muted)); }

.node-specification-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.6rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-item .spec-label {
  font-size: 0.7rem;
  color: hsl(var(--text-muted));
  text-transform: uppercase;
}

.spec-item .spec-val {
  font-family: var(--font-header);
  font-weight: 500;
  color: hsl(var(--text-secondary));
}

.node-actions-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
  gap: 0.5rem;
}

.node-actions-footer .btn {
  flex: 1;
}

/* ==========================================================================
   TAB 4: MONITORING SYSTEM & GRAPH LAYOUT
   ========================================================================== */
.monitoring-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.5rem;
  align-items: start;
}

.monitor-controls-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-monitor-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 1.25rem;
}

.monitors-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.monitor-row-item {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.monitor-row-item.active-mon {
  border-color: rgba(135, 80, 255, 0.35);
  background: hsla(220, 20%, 12%, 0.75);
}

.mon-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mon-row-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mon-row-header h4 {
  font-family: var(--font-header);
  font-size: 0.92rem;
  font-weight: 600;
}

.mon-url-text {
  font-size: 0.75rem;
  color: hsl(var(--text-secondary));
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ping-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.ping-status-indicator.up { background-color: hsl(var(--success)); box-shadow: 0 0 6px hsl(var(--success)); }
.ping-status-indicator.down { background-color: hsl(var(--danger)); box-shadow: 0 0 6px hsl(var(--danger)); }

.mon-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Latency chart container. Sticky, because the monitor list to its left is
   many screens tall: selecting a monitor far down otherwise meant scrolling
   all the way back up to see the chart it drew. */
.monitor-latency-chart {
  position: sticky;
  top: 1rem;
  padding: 1.5rem;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: hsl(var(--text-muted));
  gap: 0.75rem;
}

.chart-icon { width: 44px; height: 44px; }
.chart-empty-state h4 { font-size: 1.1rem; color: hsl(var(--text-secondary)); }
.chart-empty-state p { font-size: 0.85rem; max-width: 320px; }

.chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-wrapper h3 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 600;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ==========================================================================
   TAB 5: AI SECURITY AUDIT VIEW
   ========================================================================== */
.audit-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
  align-items: start;
}

.static-findings-panel {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 400px;
}

.panel-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
}

.panel-sub-header h3 {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 600;
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.finding-card {
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  gap: 0.75rem;
  align-items: start;
}

.finding-card.critical { border-left: 3px solid hsl(var(--danger)); }
.finding-card.warning { border-left: 3px solid hsl(var(--warning)); }
.finding-card.info { border-left: 3px solid hsl(var(--primary)); }

.finding-icon-wrapper {
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
}

.finding-card.critical .finding-icon-wrapper { background: rgba(239, 68, 68, 0.05); color: hsl(var(--danger)); }
.finding-card.warning .finding-icon-wrapper { background: rgba(245, 158, 11, 0.05); color: hsl(var(--warning)); }
.finding-card.info .finding-icon-wrapper { background: rgba(135, 80, 255, 0.05); color: hsl(var(--primary)); }

.finding-body h4 {
  font-family: var(--font-header);
  font-size: 0.92rem;
  font-weight: 600;
  color: white;
}

.finding-body p {
  font-size: 0.8rem;
  color: hsl(var(--text-secondary));
  margin-top: 0.15rem;
}

.finding-body .recommendation-box {
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.02);
  color: hsl(var(--text-secondary));
}

/* Generative AI report text container */
.generative-ai-report {
  padding: 1.5rem;
  height: 600px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.generative-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
}

.ai-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-title-wrapper h3 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 600;
}

.purple-glow-icon {
  color: #c084fc;
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.4));
}

.ai-report-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Modern custom scrollbar styling */
.ai-report-body::-webkit-scrollbar {
  width: 6px;
}
.ai-report-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--border-radius-sm);
}
.ai-report-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--border-radius-sm);
}
.ai-report-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.ai-report-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: hsl(var(--text-muted));
  gap: 0.75rem;
  padding: 4rem 2rem;
}

.ai-icon { width: 44px; height: 44px; }
.ai-report-empty h4 { font-size: 1.1rem; color: hsl(var(--text-secondary)); }
.ai-report-empty p { font-size: 0.85rem; max-width: 340px; }

/* Markdown inside AI Report */
.ai-generated-markdown {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  line-height: 1.5;
  color: hsl(var(--text-secondary));
}

.ai-generated-markdown h1,
.ai-generated-markdown h2,
.ai-generated-markdown h3 {
  font-family: var(--font-header);
  color: white;
  margin-top: 0.5rem;
}

.ai-generated-markdown h3 { font-size: 1.05rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); padding-bottom: 0.25rem; }

.ai-generated-markdown ul,
.ai-generated-markdown ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-generated-markdown li strong {
  color: white;
}

/* ==========================================================================
   TAB 6: CREDENTIALS FLEX GRID
   ========================================================================== */
.credentials-flex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.credential-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.cred-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-wrapper {
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cloudflare-glow { background: rgba(249, 115, 22, 0.06); border: 1px solid rgba(249, 115, 22, 0.15); color: #f97316; }
.runcloud-glow { background: rgba(59, 130, 246, 0.06); border: 1px solid rgba(59, 130, 246, 0.15); color: #3b82f6; }
.hetzner-glow { background: rgba(239, 68, 68, 0.06); border: 1px solid rgba(239, 68, 68, 0.15); color: #ef4444; }

.cred-card-header h3 {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 600;
}

/* The Telegram form shares the look but not the class: credentials.js submits
   every .credential-link-form as a single token, and Telegram's is two fields. */
.credential-link-form,
.telegram-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.credential-link-form .form-group,
.telegram-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.credential-link-form label,
.telegram-form label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: hsl(var(--text-muted));
  letter-spacing: 0.5px;
}

.credential-link-form input,
.telegram-form input {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.55rem 0.85rem;
  border-radius: var(--border-radius-sm);
  color: white;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.credential-link-form input:focus,
.telegram-form input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 8px var(--primary-glow);
}

.cred-status-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
}

.cred-status-tag.connected { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.18); color: hsl(var(--success)); }
.cred-status-tag.disconnected { background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(255, 255, 255, 0.05); color: hsl(var(--text-muted)); }

/* ==========================================================================
   FLOATING LOG PANEL (Aesthetic Console)
   ========================================================================== */
.activity-log-panel {
  padding: 1rem 1.5rem;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.4rem;
}

.log-title { display: flex; align-items: center; gap: 0.4rem; }
.log-icon { width: 16px; height: 16px; }
.log-icon.green { color: hsl(var(--success)); }
.log-header h2 { font-family: var(--font-header); font-size: 0.9rem; font-weight: 600; color: hsl(var(--text-secondary)); }

.console-log {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--border-radius-sm);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.log-entry { line-height: 1.4; word-break: break-all; }
.log-entry.system { color: hsl(var(--text-muted)); }
.log-entry.info { color: #94a3b8; }
.log-entry.success { color: #86efac; }
.log-entry.warning { color: #fef08a; }
.log-entry.error { color: #fca5a5; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  text-align: center;
  color: hsl(var(--text-muted));
  font-size: 0.72rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* A Copilot proposal: a suggestion with a button, never something already
 * done. Styled as a distinct block rather than a chat bubble so it does not
 * read as more of the model's prose. */
.copilot-proposal {
  margin: 0.6rem 0;
  padding: 0.75rem 0.9rem;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}
.copilot-proposal-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: hsl(var(--text-primary));
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.copilot-proposal-head svg { width: 15px; height: 15px; color: #38bdf8; }
.copilot-proposal-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.35rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: hsl(var(--text-secondary));
}
.copilot-proposal-body { color: hsl(var(--text-secondary)); margin: 0 0 0.4rem; line-height: 1.5; }
/* The consequence is never collapsed behind a disclosure: an operator who has
 * to expand something to learn every visitor will see a challenge page has not
 * really been told. */
.copilot-proposal-warn {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  margin: 0 0 0.55rem;
  line-height: 1.5;
}
.copilot-proposal-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.copilot-proposal-result { margin-top: 0.45rem; font-size: 0.75rem; }

/* The domain name doubles as the affordance for its change history: the
 * zone grid's seven columns are full, and a name is what an operator already
 * points at when asking "what happened to this one". Styled to inherit the
 * name's appearance so the row does not grow a button-shaped distraction. */
.domain-name-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px dotted hsla(190, 95%, 50%, 0.4);
}
.domain-name-btn:hover,
.domain-name-btn:focus-visible { color: hsl(var(--accent)); border-bottom-color: hsl(var(--accent)); }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 1000;
  padding: 0.5rem 0.9rem;
  border-radius: var(--border-radius-sm);
  background: hsl(var(--bg-secondary));
  color: hsl(var(--text-primary));
  border: 1px solid hsl(var(--accent));
  font-size: 0.85rem;
  text-decoration: none;
  /* Off-screen until focused rather than display:none, which would take it
   * out of the tab order entirely and defeat the point. */
  transition: top var(--transition-speed);
}
.skip-link:focus { top: 0.5rem; }

.spin { animation: spin 1s infinite linear; }

/* A small ring for "this is happening right now" beside a line of text — used
 * by a rescale in progress. Motion is already answered globally by the
 * prefers-reduced-motion block at the end of this file, which flattens every
 * animation rather than each one opting in. */
.spinner-inline {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}

/* Busy state on the BUTTON, not on its icon.
   lucide.createIcons() re-emits data-lucide on the <svg> it generates, so
   every later call replaces that svg with a new element. A class put on the
   icon therefore rides onto a detached node the moment anything re-renders,
   and the handle held from before points at the wrong element — which is how
   a finished scan kept spinning forever. The button is not a lucide
   placeholder, so it survives. */
.btn.is-busy svg { animation: spin 1s infinite linear; }

@keyframes pulse-glow {
  0% { opacity: 0.6; box-shadow: 0 0 5px var(--warning-glow); }
  50% { opacity: 1; box-shadow: 0 0 12px var(--warning-glow); }
  100% { opacity: 0.6; box-shadow: 0 0 5px var(--warning-glow); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.animate-pulse { animation: pulse 2s infinite ease-in-out; }

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: slide-down 0.35s cubic-bezier(0.4, 0, 0.2, 1); }

.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 992px) {
  .servers-split-layout,
  .monitoring-layout,
  .audit-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Four on a phone: the checkbox, the name, its state, and Block/Allow,
     which was hidden here, so a zone could not be changed from a phone. */
  .domains-header, .domain-row {
    grid-template-columns: 40px minmax(0, 1.5fr) 1fr auto;
    gap: 0.5rem;
  }

  .plan-col, .plan-badge, .cache-col, .ssl-col {
    display: none !important;
  }
  
  .login-options-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    text-align: center;
  }
  
  .user-profile {
    justify-content: center;
  }
  
  .integrations-status {
    justify-content: center;
  }
}

/* ==========================================================================
   DEMO MODE BANNER
   ========================================================================== */
.demo-mode-banner {
  background: hsla(35, 90%, 10%, 0.25);
  border: 1px solid hsla(var(--warning), 0.35);
  box-shadow: 0 4px 20px 0 var(--warning-glow);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: var(--border-radius);
  transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.demo-mode-banner:hover {
  transform: translateY(-2px);
  border-color: hsla(var(--warning), 0.55);
  box-shadow: 0 6px 25px 0 rgba(245, 158, 11, 0.35);
}

.demo-mode-banner .banner-icon-wrapper {
  background: hsla(var(--warning), 0.15);
  color: hsl(var(--warning));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow var(--transition-speed);
}

.demo-mode-banner .banner-icon {
  width: 20px;
  height: 20px;
}

.demo-mode-banner .banner-content {
  flex-grow: 1;
}

.demo-mode-banner .banner-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 600;
  color: hsl(var(--warning));
  margin-bottom: 0.15rem;
}

.demo-mode-banner .banner-text {
  font-size: 0.88rem;
  color: hsl(var(--text-secondary));
  line-height: 1.5;
}

/* A button (keyboard-reachable) that reads as a link in the banner's text. */
button.banner-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.demo-mode-banner .banner-link {
  color: hsl(var(--accent));
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed hsla(var(--accent), 0.4);
  transition: border-bottom-color var(--transition-speed), color var(--transition-speed);
  cursor: pointer;
}

.demo-mode-banner .banner-link:hover {
  color: hsl(var(--text-primary));
  border-bottom-color: hsl(var(--text-primary));
}

.demo-mode-banner .banner-action-btn {
  background: hsla(var(--warning), 0.1);
  border: 1px solid hsla(var(--warning), 0.25);
  color: hsl(var(--warning));
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-speed), border-color var(--transition-speed), transform var(--transition-speed);
  flex-shrink: 0;
}

.demo-mode-banner .banner-action-btn:hover {
  background: hsla(var(--warning), 0.2);
  border-color: hsla(var(--warning), 0.45);
  transform: scale(1.02);
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.demo-mode-banner .banner-icon-wrapper.pulse-amber {
  animation: pulse-warning 2.5s infinite;
}

@media (max-width: 768px) {
  .demo-mode-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1rem;
  }
  
  .demo-mode-banner .banner-action-btn {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   ENTERPRISE DASHBOARD & NEW GAUGES
   ========================================================================== */
.dashboard-sync-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
}

.sync-badge {
  font-size: 0.8rem;
  color: hsl(var(--text-secondary));
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.dashboard-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title-group i {
  width: 20px;
  height: 20px;
}

.card-title-group h3 {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
}

.card-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
}

.card-status-badge.badge-ok {
  background: hsla(142, 70%, 45%, 0.15);
  color: hsl(142, 70%, 50%);
  border: 1px solid hsla(142, 70%, 45%, 0.25);
}

.card-status-badge.badge-warning {
  background: hsla(38, 92%, 50%, 0.15);
  color: hsl(38, 92%, 55%);
  border: 1px solid hsla(38, 92%, 50%, 0.25);
}

.card-status-badge.badge-critical {
  background: hsla(0, 84%, 60%, 0.15);
  color: hsl(0, 84%, 65%);
  border: 1px solid hsla(0, 84%, 60%, 0.25);
}

/* A recorded decision, not a failure: the target cannot host the gateway. */
.card-status-badge.badge-neutral {
  background: hsla(215, 15%, 60%, 0.12);
  color: hsl(215, 15%, 65%);
  border: 1px solid hsla(215, 15%, 60%, 0.22);
}

.gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}

.circular-gauge {
  position: relative;
  width: 130px;
  height: 130px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.gauge-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cyan-stroke { stroke: hsl(180, 70%, 50%); }
.green-stroke { stroke: hsl(142, 70%, 50%); }
.orange-stroke { stroke: hsl(24, 90%, 55%); }
.purple-stroke { stroke: hsl(270, 70%, 60%); }
.ok-stroke { stroke: hsl(142, 70%, 50%); }
.warning-stroke { stroke: hsl(45, 90%, 50%); }
.critical-stroke { stroke: hsl(0, 85%, 50%); }

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: hsl(var(--text-primary));
  font-family: var(--font-mono);
}

.gauge-label {
  font-size: 0.72rem;
  color: hsl(var(--text-muted));
  margin-top: 0.1rem;
}

.card-footer-metrics {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 0.5rem;
}

.footer-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.footer-metric .lbl {
  font-size: 0.72rem;
  color: hsl(var(--text-muted));
}

.footer-metric .val {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  font-family: var(--font-mono);
}

.footer-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
}

.dashboard-snapshots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.snap-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 240px;
}

.snap-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
}

.snap-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.snap-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 180px;
}

.snap-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: hsl(var(--text-muted));
  font-size: 0.85rem;
}

.snap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.snap-row .name-col {
  font-weight: 500;
  font-size: 0.85rem;
  color: hsl(var(--text-secondary));
}

.snap-row .val-col {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ==========================================================================
   AI AUDIT COPILOT WIDGET (Chat Box)
   ========================================================================== */
.ai-copilot-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.copilot-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
}

.copilot-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.copilot-title-wrapper h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.copilot-glow-icon {
  width: 22px;
  height: 22px;
  color: hsl(270, 85%, 65%);
  filter: drop-shadow(0 0 8px hsla(270, 85%, 65%, 0.5));
}

.copilot-subtitle {
  font-size: 0.85rem;
  color: hsl(var(--text-muted));
}

.copilot-chat-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-thread {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius);
  padding: 1rem;
  min-height: 250px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 85%;
  animation: message-slide-in 0.25s ease-out;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.message-sender {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--text-muted));
}

.chat-message.user .message-sender {
  text-align: right;
  color: hsl(var(--accent));
}

.chat-message.assistant .message-sender {
  color: hsl(270, 85%, 65%);
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: hsl(var(--text-primary));
}

.chat-message.assistant .message-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 2px;
}

.chat-message.user .message-content {
  background: hsla(var(--accent), 0.12);
  border: 1px solid hsla(var(--accent), 0.25);
  border-bottom-right-radius: 2px;
}

.chat-message.assistant .message-content p {
  margin-bottom: 0.5rem;
}

.chat-message.assistant .message-content p:last-child {
  margin-bottom: 0;
}

.chat-message.assistant .message-content ul, 
.chat-message.assistant .message-content ol {
  margin-left: 1.2rem;
  margin-bottom: 0.5rem;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.suggestion-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: hsl(var(--text-secondary));
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.suggestion-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: hsl(var(--text-primary));
  transform: translateY(-1px);
}

.copilot-input-area {
  display: flex;
  gap: 0.75rem;
}

.copilot-input-area input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  color: hsl(var(--text-primary));
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: all var(--transition-speed);
}

.copilot-input-area input:focus {
  outline: none;
  border-color: hsla(270, 85%, 65%, 0.4);
  box-shadow: 0 0 12px hsla(270, 85%, 65%, 0.15);
}

@keyframes message-slide-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icons & Badge custom colors */
.slack-glow {
  background: hsla(180, 80%, 45%, 0.1) !important;
  color: #36c5f0 !important;
}
.discord-glow {
  background: hsla(235, 85%, 65%, 0.1) !important;
  color: #5865f2 !important;
}
.telegram-glow {
  background: hsla(200, 90%, 55%, 0.1) !important;
  color: #229ed9 !important;
}

@media (max-width: 900px) {
  .dashboard-snapshots {
    grid-template-columns: 1fr;
  }
}









/* Color Coding in Terminal Console */
.terminal-pass { color: #10b981; font-weight: bold; }
.terminal-warn { color: #f59e0b; font-weight: bold; }
.terminal-stop { color: #ef4444; font-weight: bold; }
.terminal-fixed { color: #a855f7; font-weight: bold; }
.terminal-cmd { color: #60a5fa; font-weight: 500; }
.terminal-sub { color: #94a3b8; }

/* History Row Item */
.history-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.history-row-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.history-meta-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.history-task-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #e2e8f0;
}

.history-decision-badge {
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.history-decision-badge.pass { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.history-decision-badge.warn { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }
.history-decision-badge.stop { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.history-decision-badge.fixed { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.25); }
.history-decision-badge.running { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25); animation: pulse 2s infinite ease-in-out; }

.history-time {
  font-size: 0.72rem;
  color: hsl(var(--text-muted));
}

/* Abstracted Contextual Ops Diagnostics Utility Styles */
.ops-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ops-status-badge.active {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.ops-status-badge.missing {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}
.ops-status-badge.corrupted {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.ops-card-terminal-drawer {
  background: #020617;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.75rem;
  border-radius: var(--border-radius-xs);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  opacity: 0;
}
.ops-card-terminal-drawer.expanded {
  max-height: 320px;
  opacity: 1;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ops-inline-terminal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #10b981;
  background: #030712;
  padding: 0.75rem;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.4;
  border-radius: var(--border-radius-xs);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.app-row-expanded-details {
  grid-column: 1 / -1;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  .dashboard-snapshots {
    grid-template-columns: 1fr;
  }
}









/* Color Coding in Terminal Console */
.terminal-pass { color: #10b981; font-weight: bold; }
.terminal-warn { color: #f59e0b; font-weight: bold; }
.terminal-stop { color: #ef4444; font-weight: bold; }
.terminal-fixed { color: #a855f7; font-weight: bold; }
.terminal-cmd { color: #60a5fa; font-weight: 500; }
.terminal-sub { color: #94a3b8; }

/* History Row Item */
.history-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.history-row-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.history-meta-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.history-task-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #e2e8f0;
}

.history-decision-badge {
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.history-decision-badge.pass { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.history-decision-badge.warn { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }
.history-decision-badge.stop { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.history-decision-badge.fixed { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.25); }
.history-decision-badge.running { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25); animation: pulse 2s infinite ease-in-out; }

.history-time {
  font-size: 0.72rem;
  color: hsl(var(--text-muted));
}

/* Abstracted Contextual Ops Diagnostics Utility Styles */
.ops-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ops-status-badge.active {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.ops-status-badge.missing {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}
.ops-status-badge.corrupted {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.ops-card-terminal-drawer {
  background: #020617;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.75rem;
  border-radius: var(--border-radius-xs);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  opacity: 0;
}
.ops-card-terminal-drawer.expanded {
  max-height: 320px;
  opacity: 1;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ops-inline-terminal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #10b981;
  background: #030712;
  padding: 0.75rem;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.4;
  border-radius: var(--border-radius-xs);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.app-row-expanded-details {
  grid-column: 1 / -1;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
.app-row-expanded-details.expanded {
  max-height: 450px;
  opacity: 1;
}
.app-ops-controls-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.btn-xs-toolkit {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  gap: 0.3rem;
}

/* ==========================================================================
   COMBINED PREMIUM MAIN HEADER STYLING
   ========================================================================== */
.main-header-combined {
  /* Above the tab bar: the Operations menu drops down from here, and both
     bars are glass-cards whose backdrop-filter makes them stacking contexts —
     without an explicit order the later sibling paints on top of the menu. */
  position: relative;
  z-index: 120;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  background: hsla(220, 25%, 10%, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.main-header-combined .sub-brand {
  display: none !important;
}

.main-header-combined .brand-text h1 {
  font-size: 1.1rem;
  line-height: 1.2;
}

.header-combined-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.header-combined-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-profile-combined {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.85rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile-combined .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(135, 80, 255, 0.3);
  box-shadow: 0 0 10px rgba(135, 80, 255, 0.2);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-meta h4 {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

.integrations-status {
  display: flex;
  gap: 0.3rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-tag .badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444; /* default disconnected red */
}

.badge-tag.connected .badge-dot {
  background: #10b981; /* connected green */
}

.header-combined-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.header-combined-actions .btn {
  white-space: nowrap !important;
  font-size: 0.76rem !important;
  padding: 0.35rem 0.6rem !important;
  gap: 0.3rem !important;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.header-combined-actions .btn i {
  width: 14px !important;
  height: 14px !important;
}

.sync-badge {
  color: hsl(var(--text-muted));
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ==========================================================================
   BACKDROP-BLURRED FLOATING CREDENTIALS MODAL STYLING
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 24, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 24, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-backdrop.active,
.modal-backdrop[style*="display: flex"] {
  display: flex !important;
}

.modal-card {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius);
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-content {
  width: 100%;
  max-width: 950px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes modal-slide-up {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.credential-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.cred-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cred-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.cred-card-header .logo-wrapper {
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
}

.cred-status-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  text-transform: uppercase;
}

.cred-status-tag.connected {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.cred-status-tag.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   UNIFIED ACCORDION DIRECTORY STYLING (FULL-WIDTH)
   ========================================================================== */
.servers-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.server-accordion-node {
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.01);
}

.server-accordion-node:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.server-accordion-node.expanded {
  border-color: hsla(270, 85%, 65%, 0.25);
  background: rgba(255, 255, 255, 0.02);
}

.server-accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
}

.server-accordion-trigger .chevron {
  transition: transform 0.25s ease;
  color: hsl(var(--text-muted));
}

.server-accordion-node.expanded .server-accordion-trigger .chevron {
  transform: rotate(180deg);
  color: hsl(var(--primary));
}

.server-trigger-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.server-trigger-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.server-state-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 10px transparent;
}

.server-state-light.running {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.server-state-light.stopped {
  background: #64748b;
}

.server-state-light.high-load {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.server-info-inline h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.15rem 0;
  color: white;
}

.server-info-inline p {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  margin: 0;
}

.server-metrics-summary {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
}

.server-metric-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.server-accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid transparent;
}

.server-accordion-node.expanded .server-accordion-content {
  max-height: 20000px; /* huge max height to support nested elements */
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.server-details-panel {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.15);
}

/* Applications Nested Section */
.server-nested-apps-section {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.nested-apps-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--text-muted));
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app-accordion-node {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 0.5rem;
}

.app-accordion-node:last-child {
  margin-bottom: 0;
}

.app-accordion-node.expanded {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(255, 255, 255, 0.015);
}

.app-accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
}

.app-accordion-node.expanded .app-accordion-trigger .chevron {
  transform: rotate(180deg);
  color: #34d399;
}

.app-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-trigger-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.app-info-inline h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.1rem 0;
  color: #e2e8f0;
}

.app-info-inline p {
  font-size: 0.78rem;
  color: hsl(var(--text-muted));
  margin: 0;
}

.app-accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid transparent;
}

.app-accordion-node.expanded .app-accordion-content {
  max-height: 10000px;
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.app-details-panel {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   APP-CONTEXTUAL SUB-TABS STYLING
   ========================================================================== */
.app-contextual-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-contextual-tab,
.app-contextual-tab-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: hsl(var(--text-muted)) !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

.app-contextual-tab:hover,
.app-contextual-tab-btn:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.app-contextual-tab.active,
.app-contextual-tab-btn.active {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15) !important;
}

.app-contextual-tab:hover {
  color: white;
}

.app-contextual-tab.active {
  color: #34d399;
  border-bottom-color: #34d399;
}

.app-contextual-pane {
  display: none;
  animation: fade-in 0.2s ease;
}

.app-contextual-pane.active {
  display: block;
}

/* ==========================================================================
   SIMULATED DATA MARKERS
   --------------------------------------------------------------------------
   Applied to any figure the system generated rather than measured. Deliberately
   high-contrast: the failure mode this prevents is an operator acting on an
   invented number, so it should be hard to overlook.
   ========================================================================== */

.simulated-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-left: 3px solid #fbbf24;
  border-radius: var(--border-radius-sm);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 0.7rem;
  line-height: 1.45;
}

.simulated-notice strong {
  color: #fbbf24;
}

/* ==========================================================================
   ACCESSIBILITY
   --------------------------------------------------------------------------
   The dashboard previously had three :focus rules in three thousand lines and
   no reduced-motion handling, while shipping several infinite animations.
   Keyboard users could not see where they were, and the motion could not be
   turned off.
   ========================================================================== */

/* A visible focus ring on everything focusable. :focus-visible keeps it off
   for mouse users, so this costs the pointer experience nothing. */
:focus-visible {
  outline: 2px solid hsl(198, 93%, 60%);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Some controls sit on light-on-dark panels where the default ring is faint. */
.btn:focus-visible,
.nav-tab:focus-visible,
.modal-close-btn:focus-visible,
.btn-close:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid hsl(198, 93%, 65%);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px hsla(198, 93%, 60%, 0.25);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid hsl(198, 93%, 65%);
  outline-offset: 1px;
}

/* Non-native controls that carry role="button" should look interactive. */
[role="button"] {
  cursor: pointer;
}

/* The operator's activity log is the operator's: a client is told what
   happened in messages (core.js notify), not in system lines. */
body.is-client .activity-log-panel {
  display: none;
}

/* Prevent the page behind an open dialog from scrolling. */
body.modal-open {
  overflow: hidden;
}

/* Announced-only text, for context a sighted user gets from layout. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honour a stated preference for reduced motion. The dashboard runs infinite
   pulse and spin animations that are actively unpleasant for some vestibular
   conditions. */
/* A migration's step track (Migrations tab): done, now (flowing), to come. */
.mig-steps { display: flex; gap: 3px; margin-top: 0.5rem; }
.mig-step { flex: 1 1 0; min-width: 0; }
.mig-step-bar { display: block; height: 5px; border-radius: 3px; background: rgba(148, 163, 184, 0.18); }
.mig-step.done .mig-step-bar { background: #10b981; }
.mig-step.now .mig-step-bar {
  background: linear-gradient(90deg, #b45309 0%, #fcd34d 50%, #b45309 100%);
  background-size: 200% 100%;
  animation: migFlow 1.4s linear infinite;
}
.mig-step-label {
  display: block; margin-top: 0.22rem; font-size: 0.58rem; color: hsl(var(--text-muted));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mig-step.done .mig-step-label { color: #6ee7b7; }
.mig-step.now .mig-step-label { color: #fcd34d; font-weight: 700; }
@keyframes migFlow { from { background-position: 200% 0; } to { background-position: 0 0; } }
/* A site moving, in the legacy servers' list: a dot that breathes. */
.mig-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 0.3rem; animation: migBreathe 1.6s ease-in-out infinite; }
@keyframes migBreathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-pulse,
  .spin,
  .pulse-amber,
  .mig-step.now .mig-step-bar,
  .mig-dot {
    animation: none !important;
  }
}

/* ==========================================================================
   Terminal toolbar (Copy + Expand), added to every SRE terminal at runtime.
   ========================================================================== */
.terminal-wrap {
  position: relative;
}

.terminal-toolbar {
  position: absolute;
  top: 4px;
  right: 6px;
  display: flex;
  gap: 4px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Reveal on hover or when anything inside the terminal has focus, so the
   buttons stay reachable by keyboard without cluttering the read view. */
.terminal-wrap:hover .terminal-toolbar,
.terminal-wrap:focus-within .terminal-toolbar {
  opacity: 1;
}

.terminal-tool-btn {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  color: hsl(var(--text-secondary));
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.terminal-tool-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(2, 6, 23, 0.98);
}

.terminal-tool-btn:focus-visible {
  outline: 2px solid hsl(198, 93%, 65%);
  outline-offset: 1px;
}

.terminal-tool-btn.copied {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

/* The expand lightbox: a big, scrollable copy of one terminal's output. */
.terminal-lightbox-card {
  width: min(1100px, 92vw);
  height: min(80vh, 900px);
  display: flex;
  flex-direction: column;
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.terminal-lightbox-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.terminal-lightbox-body {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #10b981;
  background: #030712;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   OPERATIONS MENU (header)
   --------------------------------------------------------------------------
   A native details/summary dropdown holding the operator tools that were
   once eight separate header buttons. The summary is styled as a button;
   the panel floats below it, right-aligned so it stays inside the header. */
.ops-menu {
  position: relative;
}

.ops-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

.ops-menu > summary::-webkit-details-marker {
  display: none;
}

.ops-menu[open] > summary {
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.ops-menu-caret {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
}

.ops-menu[open] .ops-menu-caret {
  transform: rotate(180deg);
}

.ops-menu-list {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 130;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.ops-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: hsl(var(--text-secondary));
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.ops-menu-item:hover,
.ops-menu-item:focus-visible {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  outline: none;
}

.ops-menu-item i,
.ops-menu-item svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* Dashboard "Needs Attention" rows */
.attention-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.attention-row:hover,
.attention-row:focus-visible {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.25);
  outline: none;
}

/* Text for screen readers only: a form label the layout has no room to show. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Supplementary help stays reachable without hovering and expands in place. */
.help-note {
  margin: 0.45rem 0;
  font-size: 0.74rem;
  color: hsl(var(--text-muted));
  font-weight: 400;
}
.help-note > summary {
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
  padding: 0.2rem 0;
  color: #7dd3fc;
  line-height: 1.5;
}
.help-note > summary:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 3px;
  border-radius: 3px;
}
.help-note-body {
  margin: 0.3rem 0 0.5rem;
  padding: 0.55rem 0.75rem;
  border-left: 2px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.05);
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 65ch;
  overflow-wrap: anywhere;
}

/* Operator finance: numeric reports remain usable without an AI response. */
.finance-dialog { width: min(1180px, calc(100vw - 2rem)); max-height: 90vh; overflow-y: auto; padding: 1.25rem; background: #0f172a; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: #e2e8f0; font-size: .82rem; }
.finance-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.finance-header h2 { font-size: 1.2rem; margin: 0; color: white; }
.finance-header p, .finance-muted { color: #94a3b8; font-size: .75rem; line-height: 1.55; }
.finance-header p { margin: .25rem 0 0; }
.finance-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .65rem 0; }
.finance-toolbar > span { font-size: .72rem; color: #94a3b8; }
.finance-status { min-height: 1.4rem; line-height: 1.5; margin: .5rem 0; color: #bae6fd; }
.finance-error { color: #fca5a5; }
.finance-warning { color: #fcd34d; }
.finance-verdict { padding: .8rem 1rem; border: 1px solid currentColor; border-radius: 8px; font-weight: 600; }
.finance-report-heading { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.finance-report-heading h3 { margin: 0; font-size: 1rem; }
.finance-report-heading > span { color: #94a3b8; font-size: .75rem; }
.finance-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.finance-metric { min-width: 0; padding: .9rem; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.02); }
.finance-metric h3 { font-size: .82rem; line-height: 1.45; margin: 0 0 .5rem; }
.finance-metric > strong { font-size: 1.5rem; color: #f1f5f9; overflow-wrap: anywhere; }
.finance-metric dl, .finance-cash dl { margin: .75rem 0; font-size: .74rem; }
.finance-metric dl > div { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
.finance-metric dt, .finance-cash dt { color: #94a3b8; }
.finance-metric dd, .finance-cash dd { margin: 0; text-align: right; }
.finance-cash { padding: .8rem 0; }
.finance-cash h3 { font-size: .9rem; margin: 0; }
.finance-cash dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; }
.finance-cash dd { margin-top: .25rem; text-align: left; font-size: .9rem; }
.finance-panel { margin: .8rem 0; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; }
.finance-panel > summary { padding: .85rem 1rem; cursor: pointer; font-size: .9rem; font-weight: 600; color: #f1f5f9; }
.finance-panel-body { padding: 0 1rem 1rem; }
.finance-panel-body > h3 { margin: 1rem 0 .5rem; font-size: .9rem; }
.finance-panel summary:focus-visible, .finance-table [tabindex]:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.finance-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .6rem; align-items: end; margin: .8rem 0; }
.finance-form .finance-field:has(textarea) { grid-column: 1 / -1; }
.finance-field { min-width: 0; }
.finance-field label { display: block; font-size: .73rem; color: #cbd5e1; margin-bottom: .3rem; }
.finance-field input, .finance-field select, .finance-field textarea { width: 100%; box-sizing: border-box; color: #f1f5f9; background: #0b1220; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: .45rem .55rem; font: inherit; font-size: .78rem; }
.finance-field textarea { resize: vertical; min-height: 7rem; }
.finance-table-scroll { overflow: auto; max-height: 55vh; margin: .5rem 0; }
.finance-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.finance-table th, .finance-table td { padding: .5rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.08); max-width: 32ch; overflow-wrap: anywhere; }
.finance-table th { color: #94a3b8; font-weight: 600; }
.finance-table small { display: block; color: #94a3b8; margin-top: .2rem; }
.finance-finding { margin: .65rem 0; padding: .7rem .85rem; border-left: 3px solid currentColor; background: rgba(255,255,255,.025); }
.finance-finding h4 { margin: 0 0 .35rem; font-size: .84rem; }
.finance-finding p { margin: .35rem 0; line-height: 1.5; }
.finance-coverage-row { display: grid; grid-template-columns: minmax(120px, .7fr) repeat(3, minmax(120px, 1fr)) auto; gap: .5rem; align-items: end; padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.finance-coverage-row h4 { margin: 0; font-size: .8rem; align-self: center; }
.finance-coverage-row small { grid-column: 1 / -1; color: #94a3b8; font-size: .68rem; }
.finance-menu-badge { border-radius: 999px; padding: .05rem .4rem; background: rgba(245,158,11,.18); color: #fcd34d; font-size: .7rem; }
@media (max-width: 900px) { .finance-metrics { grid-template-columns: 1fr; } .finance-coverage-row { grid-template-columns: 1fr 1fr; } .finance-coverage-row h4 { grid-column: 1 / -1; } }
@media (max-width: 520px) { .finance-dialog { padding: .85rem; } .finance-panel-body { padding: 0 .7rem .7rem; } .finance-coverage-row { grid-template-columns: 1fr; } .finance-toolbar > .btn { flex: 1 1 auto; } }
.accounts-workspace { width: min(1040px, 100%); max-height: 90vh; overflow-y: auto; }
.workspace-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .7rem 0; }
.workspace-toolbar input, .workspace-field input, .workspace-field select { width: 100%; min-width: 0; padding: .5rem .65rem; color: hsl(var(--text-primary)); background: #111827; border: 1px solid #64748b; border-radius: 6px; }
.workspace-toolbar > input { flex: 1; min-width: 10rem; }
.workspace-status, .workspace-muted { font-size: .8rem; color: #cbd5e1; margin: .6rem 0; overflow-wrap: anywhere; }
.workspace-error { color: #fca5a5; }
.workspace-accounts-list { display: flex; flex-direction: column; gap: .7rem; }
.workspace-account { border: 1px solid #475569; border-radius: 8px; background: #111827; }
.workspace-account > summary { padding: .85rem 1rem; cursor: pointer; overflow-wrap: anywhere; }
.workspace-account > summary span, .workspace-account > summary small { display: block; margin: .2rem 0 0 1rem; color: #cbd5e1; }
.workspace-account-body { padding: .3rem 1rem 1rem; font-size: .85rem; overflow-wrap: anywhere; }
.workspace-account-body h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.workspace-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); align-items: end; gap: .75rem; margin: 1rem 0; }
.workspace-field { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.workspace-field label { font-size: .8rem; color: #e2e8f0; }
.workspace-check { display: flex; gap: .5rem; align-items: center; min-height: 2.7rem; }
.workspace-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; margin: .6rem 0; }
.workspace-facts div { min-width: 0; }
.workspace-facts dt { color: #cbd5e1; font-size: .75rem; }
.workspace-facts dd { margin: .2rem 0 0; color: #f8fafc; overflow-wrap: anywhere; }
.workspace-readiness { border-left: 3px solid #94a3b8; padding: .6rem .85rem; margin: .7rem 0; }
.workspace-readiness ul { margin-left: 1rem; }
.workspace-readiness li { margin: .5rem 0; }
.workspace-server-link { padding: .6rem 0; border-bottom: 1px solid #475569; }
.workspace-managed-server { border: 1px solid #475569; border-radius: 10px; margin: .5rem 0 1rem; padding: .75rem; min-width: 0; }
.workspace-server-summary { font-size: .82rem; margin-bottom: .75rem; overflow-wrap: anywhere; }
.workspace-power { font-size: .8rem; max-width: 100%; }
.workspace-power summary { cursor: pointer; padding: .45rem; }
.client-site-next { flex-basis: 100%; color: #cbd5e1; font-size: .8rem; line-height: 1.5; }
.workspace-account summary:focus-visible, .workspace-power summary:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
@media (max-width: 520px) {
  #inviteAccountForm { grid-template-columns: 1fr !important; }
  .workspace-toolbar > *, .workspace-form > * { max-width: 100%; }
  .workspace-managed-server { padding: .5rem; }
}
/* Client portal actions stay readable and usable on touch screens. */
#clientPortalPanel .btn { min-height: 44px; font-size: max(.875rem, 14px) !important; }
#clientPortalPanel .help-note, #clientPortalPanel .client-site-next { font-size: .9rem; line-height: 1.55; }
#clientServicesCard p, #clientBillingContainer { font-size: .9rem !important; line-height: 1.55; }
.client-support { padding: .75rem 1rem; margin-bottom: 1rem; color: #e2e8f0; line-height: 1.5; overflow-wrap: anywhere; }
.client-support a { color: #7dd3fc; }
.client-websites > div:first-child { flex-wrap: wrap; gap: .65rem; }
.client-availability { flex-basis: 100%; color: #cbd5e1; font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.client-site-manage { flex-basis: 100%; color: #e2e8f0; }
.client-site-manage > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: #7dd3fc; font-weight: 600; }
.client-site-manage > summary:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; }
.client-service-actions { flex-wrap: wrap; }
.client-service-actions > .btn { flex-basis: 9rem !important; }
