/* ==========================================================================
   CyberPro AI OS — design tokens
   Dark graphite surfaces, electric-blue accent, status colors validated
   for contrast + CVD separation against the graphite dark surface.
   ========================================================================== */
:root {
  /* Graphite surface scale (cool, near-black — not pure black) */
  --plane:          #0b0c0e;
  --surface:        #131418;
  --surface-2:      #191b20;
  --surface-glass:  rgba(24, 26, 31, 0.66);
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.14);

  /* Ink */
  --text:           #f2f3f5;
  --text-secondary: #a7acb8;
  --text-muted:     #6b7280;

  /* Brand accent — electric blue */
  --accent:         #3B82F6;
  --accent-strong:  #60a5fa;
  --accent-soft:    rgba(59, 130, 246, 0.14);
  --accent-ring:    rgba(59, 130, 246, 0.35);

  /* Status (fixed — never reused as decoration) */
  --good:           #10B981;
  --good-soft:      rgba(16, 185, 129, 0.14);
  --warning:        #F97316;
  --warning-soft:   rgba(249, 115, 22, 0.14);
  --critical:       #EF4444;
  --critical-soft:  rgba(239, 68, 68, 0.14);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 40px -12px rgba(0,0,0,0.55);
  --shadow-accent: 0 8px 24px -10px rgba(59, 130, 246, 0.35);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 248px;
  --topnav-h: 64px;
  --notif-w: 340px;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must always win over component display rules
   (e.g. .command-palette{display:flex}), regardless of selector specificity order. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--plane);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* wide content scrolls within its own panel, never the whole page */
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent-strong); text-decoration: none; }
code {
  background: var(--surface-2);
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.muted { color: var(--text-muted); }
::selection { background: var(--accent-soft); }

/* Faint ambient glow behind the app — reads premium without being loud */
.shell::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(59,130,246,0.10), transparent 60%),
    radial-gradient(600px 380px at 100% 0%, rgba(16,185,129,0.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar (glass) ---------- */
.sidebar {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.4rem 1.3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  color: #04101f;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.brand-name {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 500;
}
.brand-name strong { color: var(--accent-strong); font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  text-align: left;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding-top: 0.9rem; border-top: 1px solid var(--border); }

.health-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.4rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px currentColor, inset 0 0 0 1px rgba(0,0,0,0.2);
  opacity: 0.35;
}
.dot-up { background: var(--good); color: rgba(16,185,129,0.22); }
.dot-down { background: var(--critical); color: rgba(239,68,68,0.22); }
.dot-unknown { background: var(--warning); color: rgba(249,115,22,0.22); }
.dot-degraded { background: var(--warning); color: rgba(249,115,22,0.22); }
.dot-neutral { background: var(--text-muted); color: rgba(107,114,128,0.22); }

/* ---------- Top nav (glass) ---------- */
/* min-width: 0 overrides the grid track's default "auto" minimum, which otherwise lets a wide child's
   intrinsic content size (e.g. the Content Factory's multi-button nav row) inflate this whole 1fr track
   past the viewport instead of wrapping/scrolling within it. */
.main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; position: relative; z-index: 1; }

.topnav {
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-title { font-size: 1.05rem; font-weight: 600; }
.topnav-spacer { flex: 1; }
.last-updated { font-size: 0.78rem; color: var(--text-muted); }

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent-ring);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--critical);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.05rem 0.34rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Content ---------- */
.content { padding: 1.6rem; flex: 1; max-width: 1400px; min-width: 0; }

.module { display: none; }
.module.active { display: block; animation: fadeIn 0.22s var(--ease); }

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

.dash-section { margin-bottom: 2.1rem; }
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.dash-section-head h2 { font-size: 0.95rem; }
.dash-section-sub { font-size: 0.78rem; color: var(--text-muted); }

.panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-sm);
  /* Wide tables (AI Models Center, Docker Explorer) scroll inside the panel instead of
     forcing the whole page to scroll horizontally. */
  overflow-x: auto;
}
.panel h2 { font-size: 1rem; margin-bottom: 0.4rem; }

/* ---------- Live System Health hero ---------- */
.health-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.3rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(16,185,129,0.05));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.health-hero-status { display: flex; align-items: center; gap: 0.8rem; }
.health-hero-status .dot { width: 12px; height: 12px; }
.health-hero-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.health-hero-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }

.health-strip { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.health-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.health-chip:hover { transform: translateY(-2px); border-color: var(--border-strong); }

/* ---------- Status / stat cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.status-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.status-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.status-card-header { display: flex; align-items: center; justify-content: space-between; }
.status-card-title {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.status-card-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.status-card-detail { font-size: 0.78rem; color: var(--text-secondary); }

/* ---------- Tables ---------- */
.data-table { width: 100%; min-width: 640px; border-collapse: collapse; margin-top: 0.6rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tr { transition: background 0.15s var(--ease); }
.data-table tbody tr:hover { background: var(--surface-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pill-good { color: var(--good); background: var(--good-soft); border-color: rgba(16,185,129,0.3); }
.pill-warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(249,115,22,0.3); }
.pill-critical { color: var(--critical); background: var(--critical-soft); border-color: rgba(239,68,68,0.3); }

/* ---------- Chips (business units) ---------- */
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent-ring); }

/* ---------- Activity timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: flex;
  gap: 0.9rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; padding-top: 0.3rem; }
.timeline-item .dot { box-shadow: 0 0 0 3px currentColor; opacity: 1; }
.timeline-body { flex: 1; }
.timeline-title { font-size: 0.85rem; }
.timeline-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ---------- Quick actions ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.quick-action-btn svg { width: 16px; height: 16px; }
.quick-action-btn:hover {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}
.quick-action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04101f;
  font-weight: 600;
}
.quick-action-btn.primary:hover { background: var(--accent-strong); box-shadow: var(--shadow-accent); }

/* ---------- Settings ---------- */
.settings-list { display: grid; grid-template-columns: 160px 1fr; row-gap: 0.7rem; }
.settings-list dt { color: var(--text-muted); }
.settings-list dd { margin: 0; font-family: ui-monospace, monospace; font-size: 0.85rem; }

/* ---------- Notifications panel (glass) ---------- */
.notifications-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--notif-w);
  height: 100vh;
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  z-index: 20;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.notifications-panel.open { transform: translateX(0); }

.notifications-header { display: flex; justify-content: space-between; align-items: center; }
.notifications-header h3 { font-size: 0.95rem; }
.notifications-list { list-style: none; padding: 0; margin: 0.9rem 0 0; overflow-y: auto; }
.notifications-list li {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}
.notifications-list li:hover { background: var(--surface-2); }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.55);
  backdrop-filter: blur(2px);
  z-index: 15;
}

/* ---------- Business switcher ---------- */
.business-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.7rem;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.business-switcher:hover { border-color: var(--accent-ring); transform: translateY(-1px); }
.business-switcher svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }

.business-menu {
  list-style: none;
  margin: -0.3rem 0 0.7rem;
  padding: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 260px;
  overflow-y: auto;
}
.business-menu li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s var(--ease);
}
.business-menu li:hover { background: var(--surface); }
.business-menu li.current { color: var(--accent-strong); font-weight: 600; }

/* ---------- Topnav search trigger ---------- */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  min-width: 260px;
  transition: border-color 0.18s var(--ease);
}
.search-trigger:hover { border-color: var(--accent-ring); color: var(--text-secondary); }
.search-trigger svg { width: 15px; height: 15px; flex-shrink: 0; }
.search-trigger span { flex: 1; text-align: left; }

kbd {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  color: var(--text-muted);
}

/* ---------- Command palette ---------- */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.command-palette-box {
  width: min(560px, 92vw);
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.command-palette-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.command-palette-input-row svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.92rem;
}
#command-input::placeholder { color: var(--text-muted); }

.command-results { list-style: none; margin: 0; padding: 0.4rem; max-height: 360px; overflow-y: auto; }
.command-results li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
}
.command-results li:hover, .command-results li.selected { background: var(--accent-soft); color: var(--accent-strong); }
.command-results .cmd-group { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0.5rem 0.7rem 0.2rem; cursor: default; }
.command-results .cmd-group:hover { background: none; color: var(--text-muted); }
.command-results .cmd-empty { padding: 1.2rem; text-align: center; color: var(--text-muted); cursor: default; }
.command-results .cmd-empty:hover { background: none; }

/* ---------- AI Chat panel ---------- */
.ai-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--notif-w);
  height: 100vh;
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  z-index: 20;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.ai-chat-panel.open { transform: translateX(0); }

.chat-provider-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.8rem 0; font-size: 0.8rem; color: var(--text-muted); }
.chat-provider-row select {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.2rem 0.1rem;
}
.chat-msg {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 92%;
}
.chat-msg.assistant { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; }
.chat-msg.user { background: var(--accent-soft); color: var(--text); align-self: flex-end; border: 1px solid var(--accent-ring); }
.chat-msg.pending { color: var(--text-muted); font-style: italic; }
.chat-msg.error { background: var(--critical-soft); border: 1px solid rgba(239,68,68,0.3); color: var(--critical); }

.chat-input-row { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
#chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}
#chat-input:focus { border-color: var(--accent-ring); }

/* ---------- Empty state (business switcher) ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}
.empty-state svg { color: var(--text-muted); margin-bottom: 0.4rem; }
.empty-state h2 { font-size: 1.1rem; color: var(--text); }

/* Clickable status cards */
.status-card.clickable { cursor: pointer; }
.status-card.clickable:hover { border-color: var(--accent-ring); }

/* ---------- KPI row (Phase 1) ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
}
.kpi-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent-ring); }
.kpi-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; color: var(--accent-strong); }
.kpi-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }

/* ---------- Skeleton loaders (Phase 12) ---------- */
.skeleton-card {
  height: 92px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  border: 1px solid var(--border);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Sparklines (Phase 2 trends) ---------- */
.sparkline { display: block; margin-top: 0.4rem; overflow: visible; }
.sparkline path { fill: none; stroke-width: 1.6; }

/* ---------- Pull model row (Phase 3) ---------- */
.pull-model-row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.pull-model-row input {
  flex: 1;
  max-width: 320px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.action-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  cursor: pointer;
  margin-right: 0.3rem;
  transition: all 0.15s var(--ease);
}
.action-link:hover { border-color: var(--accent-ring); color: var(--accent-strong); }
.action-link.danger:hover { border-color: rgba(239,68,68,0.5); color: var(--critical); }

/* ---------- Copilot quick prompts (Phase 10) ---------- */
.copilot-quick-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.copilot-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.copilot-chip:hover { border-color: var(--accent-ring); color: var(--accent-strong); }

/* ---------- Confirm / test-prompt modal (Phase 7/8/3) ---------- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal-box {
  width: min(480px, 92vw);
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.4rem;
}
.confirm-modal-box h3 { margin-bottom: 0.8rem; font-size: 1rem; }
.confirm-modal-body { font-size: 0.85rem; color: var(--text-secondary); max-height: 40vh; overflow-y: auto; }
.confirm-modal-body table { width: 100%; }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; }

/* ---------- Empty/error state helpers (Phase 12) ---------- */
.inline-error { color: var(--critical); font-size: 0.82rem; }
.inline-success { color: var(--good); font-size: 0.82rem; }

/* ---------- Content Factory (Milestone 6) — generic per-business framework ---------- */
/* No margin:auto here deliberately — auto margins on a flex item's cross axis disable the parent's
   align-items:stretch and force shrink-to-fit sizing instead, which (with .cf-nav's wrapping button row)
   made this element size to the sum of all nav buttons rather than the available width. */
.content-factory { padding: 1.6rem 2rem; max-width: 1400px; min-width: 0; }
.cf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.cf-header h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.cf-header .quick-action-btn { flex-shrink: 0; white-space: nowrap; }

/* Healthcare's persistent, non-dismissable sample-data notice — see HEALTHCARE_SECURITY_BLUEPRINT.md §7.
   Uses the warning color deliberately: this needs attention every time it's seen, not just once. */
.hc-sample-banner {
  background: var(--warning-soft);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 1.2rem;
}
.hc-sample-banner code { color: var(--warning); }

.cf-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
}
.cf-nav-item {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.cf-nav-item:hover { border-color: var(--accent-ring); color: var(--text); }
.cf-nav-item.active { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-ring); font-weight: 600; }

.cf-module { display: none; }
.cf-module.active { display: block; }

.cf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.cf-panel-head h3 { font-size: 1rem; }
.cf-panel-head .quick-action-btn { flex-shrink: 0; white-space: nowrap; }

.cf-field-row { display: block; margin-bottom: 0.9rem; }
.cf-field-row span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.cf-field-row input,
.cf-field-row select,
.cf-field-row textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.cf-field-row textarea { resize: vertical; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.24s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .notifications-panel { width: 100%; }
  .health-hero { flex-direction: column; align-items: flex-start; }
}

/* ---------- Milestone 42: former inline style="" attributes, moved out for CSP's style-src 'self'
   (same discipline login.html's inline <style> block already followed — see login.css) ---------- */
.health-pill-user-row { margin-top: 0.5rem; justify-content: space-between; }
.current-user-label { font-size: 0.78rem; }
.hero-dot-size { width: 14px; height: 14px; }
.text-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.commit-message-input { flex: 1 1 260px; padding: 0.65rem 0.9rem; }
.test-prompt-input { width: 100%; padding: 0.6rem; font-family: inherit; }
.section-note { font-size: 0.8rem; margin-bottom: 0.4rem; }
.section-note-lg { font-size: 0.8rem; margin-bottom: 0.6rem; }
.panel-spaced { margin-top: 1.4rem; }
.empty-state-note { font-size: 0.75rem; margin-top: 1.2rem; }
.empty-state-infra { justify-content: center; }
.empty-state-back-btn { margin-top: 1.4rem; }
.test-prompt-result { margin-top: 0.8rem; white-space: pre-wrap; }
.docker-logs-pre { white-space: pre-wrap; font-size: 0.75rem; max-height: 50vh; overflow: auto; }
