/* ================================================================
   Kindo Sandbox Manager — Stylesheet
   Brand: Kindo purple palette
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --brand-primary: #6320e8;
  --brand-primary-hover: #5018c8;
  --brand-primary-light: #7b3ff2;
  --brand-secondary: #3d3c44;
  --brand-accent: #F5A623;
  --brand-text: #0d0b15;
  --brand-text-muted: #6c6981;
  --brand-bg: #c1a6f6;
  --brand-surface: #F5F5F5;
  --brand-border: #D9D9D6;
  --brand-dark: #0F1624;
  --brand-danger: #E8620A;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 260px;
  --sidebar-collapsed: 68px;
  --header-height: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --transition: 0.2s ease;
}

/* ── Dark Theme (default) ──────────────────────────────────────── */
[data-theme="dark"] {
  --bg-primary: #0a0914;
  --bg-secondary: #13112a;
  --bg-surface: #1a1836;
  --bg-surface-hover: #221f42;
  --bg-card: #1e1b3a;
  --text-primary: #e8e6f0;
  --text-secondary: #a09cb8;
  --text-muted: #8c86ae;  /* WCAG AA: 4.57:1 min on dark bgs */
  --border-color: #2d2950;
  --border-light: #241f48;
  --input-bg: #13112a;
  --input-border: #2d2950;
  --input-focus: #6320e8;
  --brand-primary-a11y: #9e70f8;  /* WCAG AA: 4.56:1 min on dark bgs */
  --status-green: #34d399;
  --status-yellow: #fbbf24;
  --status-red: #f87171;
  --status-gray: #8c86ae;
  --code-bg: #0d0b1a;
}

/* ── Light Theme ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary: #f8f7fc;
  --bg-secondary: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f0eef8;
  --bg-card: #ffffff;
  --text-primary: #0d0b15;
  --text-secondary: #4a4660;
  --text-muted: #6c6981;  /* WCAG AA: 4.60:1 min on all light bgs */
  --border-color: #d9d6e8;
  --border-light: #eceaf4;
  --input-bg: #ffffff;
  --input-border: #d9d6e8;
  --input-focus: #6320e8;
  --status-green: #22c55e;
  --status-yellow: #eab308;
  --status-red: #ef4444;
  --status-gray: #9ca3af;
  --code-bg: #f0eef8;
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-divider { display: none; }

.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { justify-content: center; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .sidebar-actions { flex-direction: column; gap: 8px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover:not(.disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(99, 32, 232, 0.12);
  color: var(--brand-primary);
}

[data-theme="light"] .nav-item.active {
  background: rgba(99, 32, 232, 0.08);
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: default;
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 14px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 14px 4px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}

.logout-btn-extra svg {
  display: block;
}

.logout-btn:hover {
  color: var(--brand-primary-light);
  border-color: var(--brand-primary);
  background: var(--bg-surface-hover);
}

.logout-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Show/hide sun/moon icons based on theme */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ── Main Content ──────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.header-action-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.header-action-btn:hover {
  color: var(--brand-primary-light);
  border-color: var(--brand-primary);
  background: var(--bg-surface-hover);
}

.header-action-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.header-action-btn svg {
  width: 20px;
  height: 20px;
}

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

/* ── Flash Messages ────────────────────────────────────────────── */
.flash-container {
  padding: 0 24px;
  padding-top: 12px;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  animation: flashIn 0.3s ease;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-info { background: rgba(99, 32, 232, 0.1); color: var(--brand-primary); border: 1px solid rgba(99, 32, 232, 0.2); }
.flash-success { background: rgba(52, 211, 153, 0.1); color: var(--status-green); border: 1px solid rgba(52, 211, 153, 0.2); }
.flash-danger { background: rgba(248, 113, 113, 0.1); color: var(--status-red); border: 1px solid rgba(248, 113, 113, 0.2); }
.flash-warning { background: rgba(251, 191, 36, 0.1); color: var(--status-yellow); border: 1px solid rgba(251, 191, 36, 0.2); }

.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}
.flash-close:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand-primary);
  color: white;
}
.btn-primary:hover { background: var(--brand-primary-hover); }

.btn-full { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Login Page ────────────────────────────────────────────────── */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.login-flash { margin-bottom: 16px; }

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

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

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.15);
}

.login-form input:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.2);
}

.login-form .btn { margin-top: 8px; }

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Dashboard ─────────────────────────────────────────────────── */
.welcome-banner {
  margin-bottom: 24px;
}

.welcome-banner h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.welcome-banner p {
  font-size: 14px;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-users { background: rgba(99, 32, 232, 0.12); color: var(--brand-primary); }
.stat-icon-keys { background: rgba(245, 166, 35, 0.12); color: var(--brand-accent); }
.stat-icon-active { background: rgba(52, 211, 153, 0.12); color: var(--status-green); }
.stat-icon-launches { background: rgba(99, 32, 232, 0.08); color: var(--brand-primary-light); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Panels ────────────────────────────────────────────────────── */
.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

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

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-body {
  padding: 16px 20px;
}

/* ── Quick Actions ─────────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.quick-action-btn:hover:not([disabled]) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--brand-primary);
  text-decoration: none;
}

.quick-action-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Status List ───────────────────────────────────────────────── */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-green { background: var(--status-green); }
.status-yellow { background: var(--status-yellow); }
.status-red { background: var(--status-red); }
.status-gray { background: var(--status-gray); }

.status-text {
  flex: 1;
  color: var(--text-secondary);
}

.status-value {
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Getting Started ───────────────────────────────────────────── */
.getting-started {
  max-width: 900px;
}

.gs-intro {
  margin-bottom: 32px;
}

.gs-intro h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.gs-intro p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.step-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.step-detail {
  margin-bottom: 10px;
}

.step-detail code {
  display: inline-block;
  padding: 2px 8px;
  background: var(--code-bg);
  border-radius: 4px;
  color: var(--brand-primary);
  font-size: 12px;
}

.step-detail pre {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow-x: auto;
  margin-top: 6px;
}

.step-detail pre code {
  display: block;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.step-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}

.step-done {
  background: rgba(52, 211, 153, 0.1);
  color: var(--status-green);
}

.step-pending {
  background: rgba(109, 104, 136, 0.1);
  color: var(--text-muted);
}

/* ── Architecture Diagram ──────────────────────────────────────── */
.gs-architecture {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.gs-architecture h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.arch-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border-color);
  min-width: 120px;
  text-align: center;
}

.arch-node strong {
  font-size: 13px;
  color: var(--text-primary);
}

.arch-node span {
  font-size: 11px;
  color: var(--text-muted);
}

.arch-client { border-color: var(--status-gray); }
.arch-gateway { border-color: var(--brand-primary); background: rgba(99, 32, 232, 0.06); }
.arch-bastion { border-color: var(--brand-accent); background: rgba(245, 166, 35, 0.06); }
.arch-kali { border-color: var(--status-green); background: rgba(52, 211, 153, 0.06); }

.arch-arrow {
  font-size: 20px;
  color: var(--text-muted);
}

.arch-benefits {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.arch-benefits li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius);
}

.arch-benefits li strong {
  color: var(--text-primary);
}

/* ── Help Drawer ───────────────────────────────────────────────── */
.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  pointer-events: none;
}

.help-drawer.open {
  pointer-events: all;
}

.help-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.help-drawer.open .help-drawer-overlay { opacity: 1; }

.help-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.help-drawer.open .help-drawer-panel { transform: translateX(0); }

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.help-drawer-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.help-drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.help-drawer-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.help-section {
  margin-bottom: 24px;
}

.help-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.help-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.help-definitions dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 12px;
}

.help-definitions dd {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 0;
  margin-top: 2px;
  line-height: 1.5;
}

/* ── Error Page ────────────────────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 24px;
}

.error-container {
  text-align: center;
}

.error-container h1 {
  font-size: 64px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 8px;
}

.error-container p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-page-inner {
  text-align: center;
  padding: 48px 24px;
}

.error-page-inner h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.error-page-inner p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-menu-toggle { display: flex; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .quick-actions { grid-template-columns: 1fr; }

  .dashboard-panels { grid-template-columns: 1fr; }

  .arch-benefits { grid-template-columns: 1fr; }

  .step-card { flex-direction: column; }
}

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

  .content-body { padding: 16px; }

  .login-container { padding: 28px 20px; }
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   Sprint 2 — User Management Styles
   ================================================================ */

/* ── Nav Badge (admin-only indicators) ─────────────────────────── */
.nav-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(99, 32, 232, 0.15);
  color: var(--brand-primary);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}


/* ── Table Toolbar (instances, etc.) ───────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
/* ── Page Toolbar ──────────────────────────────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Search Box ────────────────────────────────────────────────── */
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  font-family: var(--font-family);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ── Filter Selects ────────────────────────────────────────────── */
.filter-group {
  display: flex;
  gap: 8px;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  font-family: var(--font-family);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236d6888' stroke-width='2'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}

.filter-select:focus {
  border-color: var(--input-focus);
}

.filter-select:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

/* ── Users Summary ─────────────────────────────────────────────── */
.users-summary {
  margin-bottom: 12px;
  padding: 0 4px;
}

.summary-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Data Table ────────────────────────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.col-actions {
  width: 120px;
  text-align: right;
}

/* ── User cell ─────────────────────────────────────────────────── */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-cell-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-cell-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-admin {
  background: rgba(99, 32, 232, 0.12);
  color: var(--brand-primary);
}

.badge-operator {
  background: rgba(109, 104, 136, 0.1);
  color: var(--text-secondary);
}

/* ── Status Indicator ──────────────────────────────────────────── */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.status-indicator .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-active .status-dot { background: var(--status-green); }
.status-active { color: var(--status-green); }

.status-inactive .status-dot { background: var(--status-gray); }
.status-inactive { color: var(--text-muted); }

/* ── Date text ─────────────────────────────────────────────────── */
.date-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Action Buttons ────────────────────────────────────────────── */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.btn-danger-icon:hover {
  color: var(--status-red);
  background: rgba(248, 113, 113, 0.1);
}

/* ── Table Empty State ─────────────────────────────────────────── */
.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 12px;
  color: var(--text-muted);
}

.table-empty p {
  font-size: 14px;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

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

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-header-danger h3 {
  color: var(--status-red);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.modal-body {
  padding: 24px;
}

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

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

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

.modal-body input:focus-visible,
.modal-body select:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.15);
}

.modal-body select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236d6888' stroke-width='2'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.password-input-wrapper {
  position: relative;
}

.password-input-wrapper input {
  padding-right: 40px;
}

.btn-show-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.form-error {
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius);
  color: var(--status-red);
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--status-red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

.modal-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Responsive — User Management ──────────────────────────────── */
@media (max-width: 768px) {
  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left {
    flex-direction: column;
  }

  .search-box {
    max-width: 100%;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .col-created,
  .col-updated {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .modal {
    max-width: 100%;
    margin: 16px;
  }
}

/* ================================================================
   API Key Management — Sprint 3
   ================================================================ */

/* ── Keys Stats Bar ────────────────────────────────────────────── */
.keys-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.keys-stat {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 120px;
}

.keys-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.keys-stat-active {
  color: var(--status-green);
}

.keys-stat-revoked {
  color: var(--text-muted);
}

.keys-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Keys Toolbar ──────────────────────────────────────────────── */
.keys-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.keys-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.keys-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Keys Summary ──────────────────────────────────────────────── */
.keys-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 4px;
}

.keys-summary .summary-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Keys Table Specifics ──────────────────────────────────────── */
.keys-table .col-check {
  width: 40px;
  text-align: center;
}

.keys-table .col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.key-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-icon {
  flex-shrink: 0;
  opacity: 0.6;
}

.key-name {
  font-weight: 500;
  color: var(--text-primary);
}

.key-prefix-code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
}

.key-owner {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-revoke:hover {
  border-color: var(--brand-danger);
  color: var(--brand-danger);
}

.revoked-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

/* ── Status Badges ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.status-active {
  background: rgba(52, 211, 153, 0.15);
  color: var(--status-green);
}

.status-revoked {
  background: rgba(109, 104, 136, 0.15);
  color: var(--text-muted);
}

/* ── Key Info Box ──────────────────────────────────────────────── */
.key-info-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.key-info-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.7;
}

.key-info-box p {
  margin: 0;
}

/* ── Key Created Success ───────────────────────────────────────── */
.key-created-success {
  text-align: center;
  padding: 16px 0 8px;
}

.key-created-success svg {
  margin-bottom: 8px;
}

.key-created-success h4 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.key-created-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Key Display Box ───────────────────────────────────────────── */
.key-display-box {
  margin: 20px 0 16px;
}

.key-display-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.key-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.key-display-value {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  line-height: 1.4;
}

.btn-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ── Key Warning Box ───────────────────────────────────────────── */
.key-warning-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.key-warning-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--status-red);
}

.key-warning-box p {
  margin: 0;
}

/* ── Button Variants ───────────────────────────────────────────── */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--brand-danger);
  border: 1px solid var(--brand-danger);
  color: #fff;
  padding: 8px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-danger .modal-header {
  border-bottom-color: rgba(232, 98, 10, 0.2);
}

/* ── Date Cell ─────────────────────────────────────────────────── */
.date-cell {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.date-cell em {
  font-style: italic;
  color: var(--text-muted);
}

/* ── Responsive — API Keys ─────────────────────────────────────── */
@media (max-width: 768px) {
  .keys-stats {
    flex-wrap: wrap;
  }

  .keys-stat {
    flex: 1;
    min-width: 100px;
  }

  .keys-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .keys-toolbar-left {
    flex-direction: column;
  }

  .keys-toolbar-right {
    justify-content: flex-end;
  }

  .col-prefix,
  .col-used {
    display: none;
  }
}

@media (max-width: 480px) {
  .keys-stats {
    flex-direction: column;
  }

  .col-owner,
  .col-created {
    display: none;
  }

  .key-display-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-copy {
    align-self: flex-end;
  }
}

/* ================================================================
   Sprint 4 — Sandbox Gateway API Styles
   ================================================================ */

/* ── Panel Wide (full width) ───────────────────────────────────── */
.panel-wide {
  grid-column: 1 / -1;
}

/* ── API Reference Grid ───────────────────────────────────────── */
.api-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.api-endpoint-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.api-endpoint-card:hover {
  border-color: var(--brand-primary);
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  min-width: 42px;
}

.api-method-post {
  background: rgba(245, 166, 35, 0.15);
  color: var(--brand-accent);
}

.api-method-get {
  background: rgba(52, 211, 153, 0.15);
  color: var(--status-green);
}

.api-method-put {
  background: rgba(99, 32, 232, 0.15);
  color: var(--brand-primary);
}

.api-method-delete {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-red);
}

.api-path {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.api-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

/* ── Python Client Section ─────────────────────────────────────── */
.gs-python-client {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

.gs-python-client h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── Responsive — API Reference ────────────────────────────────── */
@media (max-width: 768px) {
  .api-reference-grid {
    grid-template-columns: 1fr;
  }

  .api-desc {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Sprint 5 — Instance Monitoring Dashboard
   ══════════════════════════════════════════════════════════════════ */

/* ── Stats grid 4-col ──────────────────────────────────────────── */
.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .stats-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Instance status badges ────────────────────────────────────── */
.instance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.instance-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.instance-status-running {
  background: rgba(52, 211, 153, 0.15);
  color: var(--status-green, #34D399);
}
.instance-status-running .status-dot {
  background: var(--status-green, #34D399);
  box-shadow: 0 0 6px var(--status-green, #34D399);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.instance-status-launching {
  background: rgba(251, 191, 36, 0.15);
  color: var(--status-yellow, #FBBF24);
}
.instance-status-launching .status-dot {
  background: var(--status-yellow, #FBBF24);
  animation: pulse-dot 1s infinite;
}

.instance-status-terminated {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
}
.instance-status-terminated .status-dot {
  background: var(--text-muted);
}

.instance-status-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-red, #F87171);
}
.instance-status-error .status-dot {
  background: var(--status-red, #F87171);
}

/* ── Instance table cells ──────────────────────────────────────── */
.instance-id-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.instance-id-code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.instance-id-code:hover {
  color: var(--brand-primary);
}

.sandbox-id-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.instance-type-badge {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elevated, rgba(99, 32, 232, 0.08));
  color: var(--text-secondary, var(--text-primary));
  padding: 2px 8px;
  border-radius: 4px;
}

.project-tag {
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-elevated, rgba(99, 32, 232, 0.08));
  color: var(--text-secondary, var(--text-primary));
  padding: 2px 8px;
  border-radius: 4px;
}

.uptime-value {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 500;
}

.cost-value {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-accent, #F5A623);
}

/* ── Action buttons in table ───────────────────────────────────── */
.action-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md, 6px);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary, var(--text-primary));
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-icon:hover {
  background: var(--bg-elevated, rgba(99, 32, 232, 0.08));
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-danger-icon:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: var(--status-red, #F87171);
  color: var(--status-red, #F87171);
}

.status-label-inline {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Auto-refresh toggle ───────────────────────────────────────── */
.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary, var(--text-primary));
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--border-color);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle-label input:checked + .toggle-slider {
  background: var(--brand-primary);
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 12px;
  font-weight: 500;
}

.refresh-indicator {
  display: inline-flex;
  align-items: center;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.refresh-indicator.active {
  opacity: 1;
}

.refresh-indicator.active .spin-icon {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.summary-last-refresh {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 12px;
}

/* ── Instance detail panel ─────────────────────────────────────── */
.instance-detail-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  max-height: 60vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  z-index: 100;
  overflow: auto;
}

.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.detail-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.detail-panel-body {
  padding: 16px 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

@media (max-width: 540px) {
  .instance-detail-panel {
    width: 100vw;
    right: 0;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Exec modal (wider) ────────────────────────────────────────── */
.modal-lg {
  max-width: 680px;
  width: 90vw;
}

.exec-target {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated, rgba(99, 32, 232, 0.06));
  border-radius: var(--radius-md, 6px);
  margin-bottom: 16px;
  font-size: 13px;
}

.exec-label {
  font-weight: 600;
  color: var(--text-muted);
}

.exec-target code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-primary);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group-half {
  flex: 1;
}

.exec-output-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

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

.exec-output-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.exec-exit-code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.exec-exit-code.exit-success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--status-green, #34D399);
}

.exec-exit-code.exit-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-red, #F87171);
}

.exec-output-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.exec-tab {
  background: none;
  border: none;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.exec-tab:hover {
  color: var(--text-primary);
}

.exec-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.exec-output {
  background: var(--bg-main, #1a1a2e);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 6px);
  padding: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* ── Terminate modal warning ───────────────────────────────────── */
.modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-md, 6px);
  margin-bottom: 12px;
}

.modal-warning svg {
  flex-shrink: 0;
  color: var(--status-red, #F87171);
  margin-top: 2px;
}

.modal-warning p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

/* ── Danger button ─────────────────────────────────────────────── */
.btn-danger {
  background: var(--status-red, #F87171);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md, 6px);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: #ef4444;
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Table row hover for clickable rows ────────────────────────── */
.instances-page .data-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.instances-page .data-table tbody tr:hover {
  background: var(--bg-elevated, rgba(99, 32, 232, 0.04));
}

/* ── Responsive: hide columns on narrow screens ────────────────── */
@media (max-width: 1100px) {
  .col-cost, .col-project {
    display: none;
  }
}

@media (max-width: 768px) {
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .col-type, .col-execs, .col-owner {
    display: none;
  }

  .instance-detail-panel {
    width: 100vw;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .modal-lg {
    width: 98vw;
  }
}

@media (max-width: 540px) {
  .col-uptime {
    display: none;
  }

  .auto-refresh-toggle .toggle-text {
    display: none;
  }
}

/* ── Sprint 6: Audit Logs & Settings ─────────────────────────────── */

/* Audit log category badges */
.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.category-auth { background: rgba(99, 32, 232, 0.15); color: var(--brand-primary); }
.category-user { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.category-apikey { background: rgba(245, 166, 35, 0.15); color: #d4910a; }
.category-instance { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.category-settings { background: rgba(156, 163, 175, 0.15); color: #6b7280; }
.category-system { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

[data-theme="dark"] .category-auth { background: rgba(99, 32, 232, 0.25); color: #a78bfa; }
[data-theme="dark"] .category-user { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
[data-theme="dark"] .category-apikey { background: rgba(245, 166, 35, 0.25); color: #fbbf24; }
[data-theme="dark"] .category-instance { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
[data-theme="dark"] .category-settings { background: rgba(156, 163, 175, 0.25); color: #9ca3af; }
[data-theme="dark"] .category-system { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }

/* Audit status badges */
.audit-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.audit-status-success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.audit-status-failure { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
[data-theme="dark"] .audit-status-success { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
[data-theme="dark"] .audit-status-failure { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }

/* Action code in audit table */
.action-code {
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
  font-size: 0.8rem;
  padding: 2px 6px;
  background: var(--brand-surface);
  border-radius: 3px;
  color: var(--brand-text);
}
[data-theme="dark"] .action-code {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

/* Audit time column */
.audit-time {
  font-size: 0.8rem;
  color: var(--brand-text-muted);
  white-space: nowrap;
}

/* Target value */
.target-value {
  max-width: 150px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Detail text */
.detail-text {
  max-width: 250px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 0.85rem;
  color: var(--brand-text-muted);
}

/* Audit stat icon */
.stat-icon-audit {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}
[data-theme="dark"] .stat-icon-audit {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}
.pagination-info {
  font-size: 0.875rem;
  color: var(--brand-text-muted);
}

/* ── Settings page ────────────────────────────────────────────────── */

.settings-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--brand-border);
  margin-top: 8px;
}

.settings-meta {
  font-size: 0.8rem;
  color: var(--brand-text-muted);
  margin-top: 12px;
}

.settings-success {
  color: #059669;
  font-size: 0.875rem;
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
}
[data-theme="dark"] .settings-success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

/* ENV override badge */
.env-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(245, 166, 35, 0.15);
  color: #b45309;
  margin-left: 6px;
  vertical-align: middle;
}
[data-theme="dark"] .env-badge {
  background: rgba(245, 166, 35, 0.2);
  color: #fbbf24;
}

/* Required asterisk */
.required {
  color: #dc2626;
  font-weight: 600;
}

/* ── System Health ────────────────────────────────────────────────── */

.settings-health-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.health-healthy { background: rgba(16, 185, 129, 0.15); color: #059669; }
.health-degraded { background: rgba(245, 166, 35, 0.15); color: #b45309; }
.health-unhealthy { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
[data-theme="dark"] .health-healthy { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
[data-theme="dark"] .health-degraded { background: rgba(245, 166, 35, 0.2); color: #fbbf24; }
[data-theme="dark"] .health-unhealthy { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.health-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--brand-surface);
  font-size: 0.875rem;
}
[data-theme="dark"] .health-check {
  background: rgba(255, 255, 255, 0.04);
}

.health-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.health-check-ok .health-icon { color: #059669; }
.health-check-warning .health-icon { color: #d97706; }
.health-check-error .health-icon { color: #dc2626; }
.health-check-info .health-icon { color: #6b7280; }

[data-theme="dark"] .health-check-ok .health-icon { color: #6ee7b7; }
[data-theme="dark"] .health-check-warning .health-icon { color: #fbbf24; }
[data-theme="dark"] .health-check-error .health-icon { color: #fca5a5; }
[data-theme="dark"] .health-check-info .health-icon { color: #9ca3af; }

.health-name {
  font-weight: 600;
  min-width: 140px;
  flex-shrink: 0;
}

.health-detail {
  color: var(--brand-text-muted);
  font-size: 0.8rem;
}

/* ── Audit logs page responsive ───────────────────────────────────── */

.audit-logs-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .health-check {
    flex-wrap: wrap;
  }
  .health-name {
    min-width: auto;
  }
  .detail-text, .target-value {
    max-width: 100px;
  }
  .col-detail, .col-target {
    display: none;
  }
}

/* ── AMI Catalog ──────────────────────────────────────────────── */
.ami-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ami-catalog-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ami-catalog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.ami-catalog-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.ami-catalog-card-title strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ami-catalog-card-id {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ami-catalog-card-body {
  padding: 12px 14px 4px;
}

.ami-catalog-card-body .form-row {
  display: flex;
  gap: 12px;
}

.ami-catalog-card-body .form-group-half {
  flex: 1;
  min-width: 0;
}

.ami-catalog-card-body .form-group {
  margin-bottom: 10px;
}

.ami-catalog-card-body label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.ami-catalog-empty {
  text-align: center;
  padding: 24px 16px;
}

.settings-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* AMI column in instances table */
.col-ami {
  min-width: 100px;
}

.ami-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .col-ami {
    display: none;
  }

  .ami-catalog-card-body .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ── RBAC Panel Styles (Sprint 3) ──────────────────────────────── */
.rbac-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.rbac-role-card {
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-color, #1a1a2e);
}
.rbac-role-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.rbac-perm-count {
  font-size: 0.8rem;
  color: var(--text-secondary, #999);
}
.rbac-perm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rbac-perm-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--tag-bg, rgba(99, 32, 232, 0.15));
  color: var(--text-secondary, #aaa);
  font-family: 'Inter', monospace;
  line-height: 1.4;
}
.badge-viewer {
  background: var(--badge-viewer-bg, rgba(99, 32, 232, 0.2));
  color: var(--badge-viewer-text, #a78bfa);
}

/* ── Sprint 4: Analytics & Health Styles ──────────────────────── */

/* Analytics Page */
.analytics-page { padding: 0; }
.analytics-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.time-range-selector {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.time-range-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  outline-offset: -2px;
}
.time-range-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.time-range-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  z-index: 1;
}
.time-range-btn.active {
  background: var(--brand-primary);
  color: #fff;
}
.time-range-btn + .time-range-btn {
  border-left: 1px solid var(--border);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.analytics-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.analytics-card-header {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.analytics-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.analytics-card-body {
  padding: 1rem 1.25rem;
  min-height: 220px;
  position: relative;
}
.analytics-card-body canvas {
  max-height: 220px;
}
.analytics-loading,
.analytics-error {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}
.analytics-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Health Summary Bar (Dashboard) */
.health-summary-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.health-summary-bar h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.health-indicators {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.health-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.health-dot-healthy { background: #22c55e; }
.health-dot-degraded { background: #F5A623; }
.health-dot-unreachable { background: #E8620A; }
.health-dot-unchecked { background: var(--text-muted); }
.health-count {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.health-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Health status badges in instance tables */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.health-badge-healthy {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.health-badge-degraded {
  background: rgba(245, 166, 35, 0.15);
  color: #d97706;
}
.health-badge-unreachable {
  background: rgba(232, 98, 10, 0.15);
  color: #E8620A;
}
.health-badge-unchecked {
  background: var(--surface);
  color: var(--text-muted);
}

/* Cost stat icon */
.stat-icon-cost {
  background: rgba(245, 166, 35, 0.15);
  color: #F5A623;
}
.stat-icon-exec {
  background: rgba(99, 32, 232, 0.15);
  color: var(--brand-primary);
}

/* Loading spinner */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state in analytics */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* CloudTrail info in instance detail */
.cloudtrail-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
}
.cloudtrail-info dt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.cloudtrail-info dd {
  margin: 0 0 0.5rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}
.cloudtrail-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
}
.cloudtrail-link:hover {
  text-decoration: underline;
}

/* ================================================================
   Sprint 1 — Design System Consolidation additions
   ================================================================ */

/* ── MFA page layout ───────────────────────────────────────── */
.mfa-step-card {
  margin-bottom: 16px;
}

.mfa-step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.qr-container {
  text-align: center;
  margin: 20px auto;
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  max-width: 280px;
}

.manual-key-section {
  margin-top: 16px;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.backup-code {
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: 6px;
  text-align: center;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.mfa-verify-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.mfa-code-input {
  text-align: center;
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  max-width: 200px;
}

.mfa-enforce-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.mfa-users-section {
  margin-top: 20px;
}

.mfa-summary-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

/* ── Change password page ──────────────────────────────────── */
.change-password-card {
  max-width: 480px;
  margin: 2rem auto;
}

.change-password-header {
  text-align: center;
  margin-bottom: 24px;
}

.change-password-header svg {
  margin-bottom: 12px;
}

.change-password-header h2 {
  font-size: 1.25rem;
  margin: 0 0 8px 0;
}

.change-password-header p {
  margin: 0;
  font-size: 0.9rem;
}

.btn-full-width {
  width: 100%;
  padding: 12px 16px;
}

/* ── Section header ────────────────────────────────────────── */
.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.section-header p {
  margin: 0;
  font-size: 0.9rem;
}

/* ── Content section ───────────────────────────────────────── */
.content-section {
  max-width: 680px;
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 20px;
}

.page-subtitle,
.page-description p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}


/* ── Unified page header block (Sprint 1) ──────────────────── */
.page-header-block {
  margin-bottom: 20px;
}

.page-header-block .breadcrumbs {
  margin-bottom: 8px;
}

.page-header-block .bc-home {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--transition);
}

.page-header-block .bc-home:hover {
  color: var(--brand-primary);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-text {
  flex: 1;
  min-width: 0;
}

.page-header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.page-header-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

.page-header-block .page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 0;
}

/* Mobile breadcrumb truncation */
@media (max-width: 640px) {
  .page-header-block .breadcrumbs {
    font-size: 0.75rem;
    gap: 4px;
  }
  .page-header-block .breadcrumbs a,
  .page-header-block .bc-current {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .page-header-row {
    flex-direction: column;
    gap: 8px;
  }
  .page-header-block .page-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Col actions for tables ────────────────────────────────── */
.col-actions {
  text-align: right;
}

/* ── Transitions for table rows ────────────────────────────── */
.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* ══════════════════════════════════════════════════════════════════
   Sprint 2 — Enterprise Dashboard Redesign
   ══════════════════════════════════════════════════════════════════ */

/* ── Welcome Hero ──────────────────────────────────────────────── */
.welcome-hero {
  margin-bottom: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(99, 32, 232, 0.08) 0%, rgba(99, 32, 232, 0.02) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-primary);
  border-radius: 4px 0 0 4px;
}

.welcome-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.welcome-greeting h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.welcome-greeting p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Health Score Badge (in welcome hero) ──────────────────────── */
.health-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  flex-shrink: 0;
}

.health-score-ring {
  width: 72px;
  height: 72px;
}

.health-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.health-score-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.health-score-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.health-score-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Enterprise Stats Grid ─────────────────────────────────────── */
.stats-grid-enterprise {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.stat-card-enhanced {
  position: relative;
  overflow: hidden;
}

.stat-card-enhanced .stat-sparkline {
  position: absolute;
  bottom: 8px;
  right: 12px;
  opacity: 0.7;
}

.stat-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-trend span {
  font-size: 11px;
}

.stat-trend-up {
  color: var(--status-green);
  background: rgba(52, 211, 153, 0.1);
}

.stat-trend-down {
  color: var(--status-red);
  background: rgba(248, 113, 113, 0.1);
}

.stat-trend-flat {
  color: var(--text-muted);
  background: var(--bg-surface);
}

.stat-sub {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Enterprise Dashboard Panels ───────────────────────────────── */
.dashboard-panels-enterprise {
  grid-template-columns: 1fr 1fr;
}

.panel-header-status,
.panel-header-activity {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-header-badge-green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--status-green);
}

.panel-header-badge-yellow {
  background: rgba(251, 191, 36, 0.12);
  color: var(--status-yellow);
}

.panel-header-badge-red {
  background: rgba(248, 113, 113, 0.12);
  color: var(--status-red);
}

.panel-header-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-primary);
  text-decoration: none;
}

.panel-header-link:hover {
  text-decoration: underline;
}

/* ── Status empty state ────────────────────────────────────────── */
.status-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
}

.status-empty span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
}

.status-item-highlight {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.status-value-bold {
  font-weight: 600;
  color: var(--text-primary);
}

.status-dot-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Quick Actions Enterprise ──────────────────────────────────── */
.quick-actions-enterprise {
  grid-template-columns: 1fr 1fr;
}

.quick-action-primary {
  border-color: var(--brand-primary);
  background: rgba(99, 32, 232, 0.04);
}

.quick-action-primary:hover {
  background: rgba(99, 32, 232, 0.1);
  border-color: var(--brand-primary);
}

/* ── Activity Timeline ─────────────────────────────────────────── */
.panel-body-timeline {
  padding: 12px 20px 16px;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.activity-icon-auth { background: rgba(99, 32, 232, 0.1); color: var(--brand-primary); }
.activity-icon-sandbox { background: rgba(52, 211, 153, 0.1); color: var(--status-green); }
.activity-icon-admin { background: rgba(245, 166, 35, 0.1); color: var(--brand-accent); }
.activity-icon-api { background: rgba(99, 32, 232, 0.08); color: var(--brand-primary-light); }
.activity-icon-health { background: rgba(248, 113, 113, 0.1); color: var(--status-red); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.activity-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.activity-badge-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--status-green);
}

.activity-badge-failure {
  background: rgba(248, 113, 113, 0.12);
  color: var(--status-red);
}

.activity-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.activity-user {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-primary);
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Enterprise Dashboard responsive ───────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-panels-enterprise {
    grid-template-columns: 1fr;
  }
  .welcome-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .health-score-badge {
    align-self: flex-end;
    margin-top: -48px;
  }
}

@media (max-width: 640px) {
  .stats-grid-enterprise {
    grid-template-columns: 1fr 1fr;
  }
  .quick-actions-enterprise {
    grid-template-columns: 1fr;
  }
  .welcome-hero {
    padding: 16px 20px;
  }
  .health-score-badge {
    margin-top: 0;
    align-self: center;
  }
}

/* ================================================================
   Sprint 4 — Navigation & Global UX Improvements
   ================================================================ */

/* ── Collapsible Nav Groups ────────────────────────────────────── */
.nav-group {
  margin-bottom: 2px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-group-header:hover {
  color: var(--text-secondary);
}

.nav-group-header:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  border-radius: 4px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-group-chevron {
  transition: transform 0.2s ease;
  opacity: 0.5;
  flex-shrink: 0;
}

.nav-group-header[aria-expanded="false"] .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 600px;
  opacity: 1;
}

.nav-group.collapsed .nav-group-items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Hide group headers and chevrons in collapsed sidebar */
.sidebar.collapsed .nav-group-header {
  display: none;
}

.sidebar.collapsed .nav-group.collapsed .nav-group-items {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}

/* ── Live Count Badges ─────────────────────────────────────────── */
.nav-live-badge {
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: var(--brand-primary);
  color: #fff;
  line-height: 1;
}

.nav-live-badge.badge-zero {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.sidebar.collapsed .nav-live-badge {
  display: none;
}

/* ── User Profile Dropdown ─────────────────────────────────────── */
.sidebar-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  gap: 8px;
}

.user-profile-trigger:hover {
  background: var(--bg-surface-hover);
}

.user-profile-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.user-profile-trigger.open .user-profile-chevron {
  transform: rotate(180deg);
}

.sidebar.collapsed .user-profile-trigger {
  justify-content: center;
}

.sidebar.collapsed .user-profile-chevron {
  display: none;
}

.user-profile-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 10px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: dropdownSlideUp 0.15s ease;
}

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

.user-profile-dropdown.open {
  display: block;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.dropdown-item-danger {
  color: var(--status-red);
}

.dropdown-item-danger:hover {
  background: rgba(248, 113, 113, 0.08);
  color: var(--status-red);
}

/* ── Command Palette ───────────────────────────────────────────── */
.cmd-palette-trigger {
  gap: 6px;
}

.cmd-palette-shortcut {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 1px 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  line-height: 1.4;
  background: var(--bg-surface);
}

@media (max-width: 768px) {
  .cmd-palette-shortcut {
    display: none;
  }
}

.cmd-palette-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: min(20vh, 160px);
}

.cmd-palette-overlay.open {
  display: flex;
}

.cmd-palette {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: cmdPaletteIn 0.15s ease;
}

@keyframes cmdPaletteIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cmd-palette-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.cmd-palette-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cmd-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--text-primary);
}

.cmd-palette-input:focus-visible {
  box-shadow: inset 0 -2px 0 0 var(--brand-primary);
}

.cmd-palette-input::placeholder {
  color: var(--text-muted);
}

.cmd-palette-kbd {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  font-family: var(--font-family);
}

.cmd-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 0;
}

.cmd-palette-group {
  padding: 4px 0;
}

.cmd-palette-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 16px;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
}

.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: var(--bg-surface-hover);
  text-decoration: none;
}

.cmd-palette-item .item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cmd-palette-item .item-info {
  flex: 1;
  min-width: 0;
}

.cmd-palette-item .item-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-palette-item .item-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-palette-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.cmd-palette-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.cmd-palette-hint {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cmd-palette-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-family);
  background: var(--bg-card);
  color: var(--text-secondary);
}

/* ── Enterprise Login Page (split layout) ──────────────────────── */
.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-brand-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #0a0914 0%, #1a0e3e 50%, #6320e8 100%);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(99, 32, 232, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.login-brand-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 32px;
}

.login-brand-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.login-brand-tagline {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 40px;
  line-height: 1.5;
}

.login-brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.login-feature svg {
  color: var(--brand-accent, #F5A623);
  flex-shrink: 0;
}

.login-brand-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg-primary);
}

.login-form-container {
  width: 100%;
  max-width: 400px;
}

.login-form-header {
  margin-bottom: 32px;
}

.login-form-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-form-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.login-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.25);
  color: var(--brand-accent, #F5A623);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.4;
}

.login-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.form-control-icon {
  padding-left: 40px;
}

.btn-login {
  margin-top: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .login-split {
    flex-direction: column;
  }
  .login-brand-panel {
    padding: 32px 24px;
    min-height: auto;
  }
  .login-brand-tagline {
    margin-bottom: 24px;
  }
  .login-brand-features {
    display: none;
  }
  .login-form-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .login-brand-panel {
    padding: 24px 20px;
  }
  .login-brand-title {
    font-size: 22px;
  }
  .login-form-panel {
    padding: 24px 20px;
  }
  .login-form-title {
    font-size: 20px;
  }
}

/* ── Header Actions Block ──────────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.header-actions .btn {
  padding: 6px 14px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .header-actions {
    display: none;
  }
}


/* ══════════════════════════════════════════════════════════════
   Sprint 5 — Accessibility & Interaction Polish
   ═════════════════════════════════════════════════════════════ */

/* ── Table row transitions ──────────────────────────────────── */
.data-table tbody tr {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.data-table tbody tr:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  background: var(--hover-bg, rgba(99, 32, 232, 0.06));
}

/* ── Card focus states ──────────────────────────────────────── */
.stat-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-card:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-md);
}
.stat-card:hover {
  transform: translateY(-1px);
}

.card {
  transition: box-shadow 0.2s ease;
}
.card:focus-within {
  box-shadow: var(--shadow-md);
}

/* ── Button interaction polish ──────────────────────────────── */
.btn {
  transition: background-color 0.15s ease, border-color 0.15s ease,
              box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.25);
}
.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgba(232, 98, 10, 0.25);
}

/* ── Toggle switch accessibility ────────────────────────────── */
.toggle-label[role="switch"]:focus-within {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 12px;
}

/* ── Modal overlay transition ───────────────────────────────── */
.modal-overlay {
  transition: opacity 0.2s ease;
}
.modal-overlay[aria-modal="true"] {
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-overlay .modal {
  transition: transform 0.2s ease;
}
.modal-overlay[aria-modal="true"] .modal {
  animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Chart empty state illustration ─────────────────────────── */
.chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  min-height: 180px;
  color: var(--text-muted, #6c6981);
}
.chart-empty-state svg {
  margin-bottom: 12px;
  color: var(--text-muted, #6c6981);
}
.chart-empty-state p {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted, #6c6981);
}

/* ── MFA step progress indicator ────────────────────────────── */
.mfa-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 32px 0;
  padding: 0;
  list-style: none;
}
.mfa-progress-step {
  display: flex;
  align-items: center;
  gap: 0;
}
.mfa-progress-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--border-color, #D9D9D6);
  color: var(--text-muted, #6c6981);
  background: var(--bg-surface, #F5F5F5);
  transition: all 0.3s ease;
  position: relative;
}
.mfa-progress-step.active .mfa-progress-circle {
  border-color: var(--brand-primary, #6320e8);
  background: var(--brand-primary, #6320e8);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99, 32, 232, 0.15);
}
.mfa-progress-step.completed .mfa-progress-circle {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}
.mfa-progress-label {
  font-size: 12px;
  color: var(--text-muted, #6c6981);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}
.mfa-progress-step.active .mfa-progress-label {
  color: var(--brand-primary, #6320e8);
  font-weight: 600;
}
.mfa-progress-step.completed .mfa-progress-label {
  color: #22c55e;
}
.mfa-progress-connector {
  width: 48px;
  height: 2px;
  background: var(--border-color, #D9D9D6);
  margin: 0 4px;
  transition: background 0.3s ease;
  align-self: center;
  margin-bottom: 18px;
}
.mfa-progress-step.completed + .mfa-progress-connector,
.mfa-progress-connector.completed {
  background: #22c55e;
}
.mfa-progress-step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Scheduled ops enhancements ─────────────────────────────── */
.ops-last-run {
  font-size: 12px;
  color: var(--text-muted, #6c6981);
  display: block;
  margin-top: 2px;
}
.ops-next-run {
  font-size: 12px;
  color: var(--brand-primary, #6320e8);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
.ops-schedule-cell {
  min-width: 140px;
}

/* ── Badge animation ────────────────────────────────────────── */
.badge {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ── Time range button focus ────────────────────────────────── */
.time-range-btn {
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.time-range-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.time-range-btn[aria-pressed="true"] {
  font-weight: 600;
}

/* ── Clickable rows keyboard focus ──────────────────────────── */
.clickable-rows tbody tr:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
}
.clickable-rows tbody tr {
  cursor: pointer;
}

/* ── Search input focus enhancement ─────────────────────────── */
.search-input:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

/* ── Form control focus ─────────────────────────────────────── */
.form-control:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

/* ── Nav item focus ─────────────────────────────────────────── */
.nav-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  border-radius: 6px;
}

/* ── Flash message transition ───────────────────────────────── */
.flash-message {
  animation: flashSlideIn 0.3s ease;
}
@keyframes flashSlideIn {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Filter select focus ────────────────────────────────────── */
.filter-select:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.12);
}

@media (max-width: 768px) {
  .mfa-progress {
    gap: 0;
  }
  .mfa-progress-connector {
    width: 24px;
  }
  .mfa-progress-label {
    font-size: 10px;
  }
  .mfa-progress-circle {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
}

/* ── Overview Page ─────────────────────────────────────────────── */
.overview-page {
  max-width: 1200px;
}

.overview-intro {
  margin-bottom: 24px;
}

.overview-intro h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.overview-intro p {
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.overview-card {
  background: var(--card-bg, var(--surface-color));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.overview-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.overview-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.overview-card ul li {
  padding: 4px 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.overview-card ul li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary, #6320e8);
  margin-right: 8px;
  vertical-align: middle;
}

/* ── Next Steps (Getting Started) ──────────────────────────────── */
.gs-next-steps {
  margin-top: 32px;
}

.gs-next-steps h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.next-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--card-bg, var(--surface-color));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.next-step-card:hover,
.next-step-card:focus-visible {
  border-color: var(--brand-primary, #6320e8);
  box-shadow: 0 2px 8px rgba(99, 32, 232, 0.1), 0 0 0 2px var(--brand-primary, #6320e8);
  outline: none;
}

.next-step-card svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-primary, #6320e8);
}

.next-step-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.next-step-info p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ── API Docs Enhancements ─────────────────────────────────────── */
.api-method-delete {
  background: var(--brand-danger, #E8620A);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.api-method-put {
  background: #F5A623;
  color: #1a1a1a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

/* ── Dark-theme brand-primary accessibility overrides ──────── */
/* Use --brand-primary-a11y (#9e70f8) for brand-colored TEXT on dark
   backgrounds so we meet WCAG AA 4.5:1. The original --brand-primary
   (#6320e8) stays for backgrounds, borders, and light-theme text. */
[data-theme="dark"] .nav-item.active {
  color: var(--brand-primary-a11y);
}

[data-theme="dark"] a {
  color: var(--brand-primary-a11y);
}

[data-theme="dark"] .badge-primary,
[data-theme="dark"] .text-brand {
  color: var(--brand-primary-a11y);
}

[data-theme="dark"] .nav-item.active .nav-icon {
  color: var(--brand-primary-a11y);
}

[data-theme="dark"] .mfa-progress-step.active .mfa-progress-label {
  color: var(--brand-primary-a11y);
}

[data-theme="dark"] .ops-next-run {
  color: var(--brand-primary-a11y);
}

/* Focus indicators: ensure visible in both themes */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

[data-theme="dark"] :focus-visible {
  outline-color: var(--brand-primary-a11y);
}

/* Keep brand-primary for backgrounds (buttons, avatars, badges-bg) unchanged
   since white text on #6320e8 bg = 6.53:1 (PASS). */

/* ── Dropdown menu item focus ───────────────────────────────── */
.dropdown-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  border-radius: 6px;
  background: var(--hover-bg, rgba(99, 32, 232, 0.06));
}

/* ── Quick action button focus ──────────────────────────────── */
.quick-action-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Health indicator focus ─────────────────────────────────── */
.health-indicator:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ── Activity item focus ────────────────────────────────────── */
.activity-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── User profile trigger focus ─────────────────────────────── */
.user-profile-trigger:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 8px;
}


/* ── Screen-reader only utility (a11y) ─────────────────────── */
.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;
}

/* ── Data state containers (loading/empty/error) ───────────── */
.data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: 0.75rem;
}

.data-state .state-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-state .state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.25rem 0 0;
}

.data-state .state-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0;
  line-height: 1.5;
}

.data-state-loading .state-text {
  color: var(--text-muted);
}

.data-state-error {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.data-state-empty {
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.data-state-empty svg {
  color: var(--text-muted);
}

/* ── Icon-only button a11y: minimum tap target ─────────────── */
.btn-icon {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

[data-theme="dark"] .btn-icon:focus-visible {
  outline-color: var(--brand-primary-a11y);
}


/* ================================================================
   Sprint 2 — Unified States, Reduced-Motion & Accessibility
   ================================================================ */

/* ── prefers-reduced-motion: disable non-essential animations ── */
@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;
  }

  .state-spinner svg animateTransform {
    dur: 0.01ms;
  }

  .flash-message {
    animation: none;
  }

  .badge-dot {
    animation: none;
  }

  .loading-spinner {
    animation: none;
  }

  .cmd-palette-overlay,
  .help-drawer,
  .modal-overlay {
    transition: none;
  }

  /* Tour overlay transitions */
  .tour-overlay,
  .tour-tooltip {
    transition: none;
    animation: none;
  }
}

/* ── Keyboard shortcut overlay ─────────────────────────────────── */
.shortcut-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.shortcut-overlay-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.shortcut-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.shortcut-overlay-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.shortcut-overlay-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.shortcut-overlay-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.shortcut-overlay-close:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.shortcut-overlay-body {
  padding: 16px 20px;
}

.shortcut-group {
  margin-bottom: 16px;
}

.shortcut-group:last-child {
  margin-bottom: 0;
}

.shortcut-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
}

.shortcut-item:hover {
  background: var(--bg-surface-hover);
}

.shortcut-item dt {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.shortcut-item dd {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.shortcut-overlay kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border-color);
}

.shortcut-overlay-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.shortcut-footer-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.shortcut-footer-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font-family: var(--font-family);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
}

/* ── WCAG AA contrast fixes for status badges in both themes ──── */
/* Dark theme: ensure 4.5:1 minimum on dark backgrounds */
[data-theme="dark"] .badge-warning .badge-dot,
[data-theme="dark"] .badge-pending .badge-dot,
[data-theme="dark"] .badge-starting .badge-dot,
[data-theme="dark"] .badge-stopping .badge-dot,
[data-theme="dark"] .badge-initializing .badge-dot,
[data-theme="dark"] .badge-building .badge-dot {
  background: #fbbf24;
}

[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge-pending,
[data-theme="dark"] .badge-starting,
[data-theme="dark"] .badge-stopping,
[data-theme="dark"] .badge-initializing,
[data-theme="dark"] .badge-building {
  color: #fcd34d;  /* Lighter yellow: 5.2:1 on #1a1836 */
}

[data-theme="dark"] .audit-status-failure {
  color: #fca5a5;  /* Lighter red: 5.8:1 on dark bg */
}

[data-theme="dark"] .category-badge {
  color: var(--text-primary);
}

/* Light theme: ensure contrast on white backgrounds */
[data-theme="light"] .badge-warning,
[data-theme="light"] .badge-pending,
[data-theme="light"] .badge-starting,
[data-theme="light"] .badge-stopping,
[data-theme="light"] .badge-initializing,
[data-theme="light"] .badge-building {
  color: #92400e;  /* Dark amber: 5.7:1 on #fff */
  background: rgba(251, 191, 36, 0.15);
}

[data-theme="light"] .badge-warning .badge-dot,
[data-theme="light"] .badge-pending .badge-dot,
[data-theme="light"] .badge-starting .badge-dot,
[data-theme="light"] .badge-stopping .badge-dot,
[data-theme="light"] .badge-initializing .badge-dot,
[data-theme="light"] .badge-building .badge-dot {
  background: #d97706;  /* Amber-600: visible on light bg */
}

[data-theme="light"] .text-muted,
[data-theme="light"] .state-text {
  color: #57534e;  /* Stone-600: 5.0:1 on #fff */
}

/* ── Skip-to-content refinement ────────────────────────────────── */
.skip-to-content:focus {
  top: 16px;
  outline: 3px solid var(--brand-accent, #F5A623);
  outline-offset: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Data table scope header visual alignment ─────────────────── */
.data-table th[scope="col"] {
  text-align: left;
}

.data-table th[scope="row"] {
  text-align: left;
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════════
   Sprint 3 — Toast Notification System
   ═══════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius, 8px);
  background: var(--surface-primary, #1a1a2e);
  border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.3));
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: none;
  }
  .toast-enter {
    transform: none;
  }
  .toast-exit {
    transform: none;
  }
  .toast-progress-bar {
    animation: none !important;
  }
}

.toast-enter {
  opacity: 1;
  transform: translateX(0);
}

.toast-exit {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  display: block;
  word-wrap: break-word;
}

.toast-undo {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.toast-undo:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  background: currentColor;
  opacity: 0.4;
  animation: toastProgress linear forwards;
  transform-origin: left;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Toast variants */
.toast-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: var(--status-green, #34d399);
}
.toast-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--status-red, #f87171);
}
.toast-warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--status-yellow, #fbbf24);
}
.toast-info {
  background: rgba(99, 32, 232, 0.12);
  border-color: rgba(99, 32, 232, 0.25);
  color: var(--brand-primary, #6320e8);
}

/* Light theme toast adjustments */
[data-theme="light"] .toast {
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .toast-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}
[data-theme="light"] .toast-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}
[data-theme="light"] .toast-warning {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
  color: #b45309;
}
[data-theme="light"] .toast-info {
  background: rgba(99, 32, 232, 0.06);
  border-color: rgba(99, 32, 232, 0.15);
  color: #5b21b6;
}
[data-theme="light"] .toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .toast-undo:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Mobile toast positioning */
@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 16px;
    right: 8px;
    left: 8px;
    max-width: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 3 — Confirmation Modal Enhancements
   ═══════════════════════════════════════════════════════════════════ */

.confirm-modal {
  max-width: 480px;
}

.confirm-icon-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.1);
  color: var(--status-red, #f87171);
}
.confirm-icon-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--status-red, #f87171);
}
.confirm-icon-warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--status-yellow, #fbbf24);
}
.confirm-icon-primary {
  background: rgba(99, 32, 232, 0.1);
  color: var(--brand-primary, #6320e8);
}

[data-theme="light"] .confirm-icon-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}
[data-theme="light"] .confirm-icon-warning {
  background: rgba(217, 119, 6, 0.08);
  color: #b45309;
}

.confirm-message {
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-primary, #e2e8f0);
}

.confirm-impact {
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: var(--radius, 8px);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 16px;
}

.confirm-type-to-confirm {
  margin-top: 16px;
}
.confirm-type-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-secondary, #94a3b8);
}
.confirm-type-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius, 8px);
  background: var(--surface-secondary, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, #e2e8f0);
  font-size: 14px;
  font-family: "Inter", system-ui, sans-serif;
  transition: border-color 0.15s;
}
.confirm-type-input:focus {
  border-color: var(--brand-primary, #6320e8);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.15);
}
.confirm-type-input:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.25);
}

.confirm-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 6px;
  color: var(--status-red, #f87171);
  font-size: 13px;
}

[data-theme="light"] .confirm-message {
  color: #1e293b;
}
[data-theme="light"] .confirm-impact {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.12);
  color: #475569;
}
[data-theme="light"] .confirm-type-label {
  color: #475569;
}
[data-theme="light"] .confirm-type-input {
  background: #fff;
  border-color: #d1d5db;
  color: #1e293b;
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 3 — Status Pill Animations (Optimistic UI)
   ═══════════════════════════════════════════════════════════════════ */

.status-transitioning {
  animation: statusPulse 1.5s ease-in-out;
}

.status-dot-pulse {
  animation: statusDotPulse 1s ease-in-out 3;
}

@keyframes statusPulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes statusDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .status-transitioning {
    animation: none;
  }
  .status-dot-pulse {
    animation: none;
  }
}

/* Launching status gets a continuous pulse to indicate progress */
.instance-status-launching .status-dot {
  animation: launchPulse 1.5s ease-in-out infinite;
}
.instance-status-provisioning .status-dot {
  animation: launchPulse 1.5s ease-in-out infinite;
}
@keyframes launchPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
  .instance-status-launching .status-dot,
  .instance-status-provisioning .status-dot {
    animation: none;
  }
}

/* Provisioning status — between launching and running */
.instance-status-provisioning {
  color: var(--status-blue, #60a5fa);
}
.instance-status-provisioning .status-dot {
  background: var(--status-blue, #60a5fa);
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 3 — Bulk Action Progress
   ═══════════════════════════════════════════════════════════════════ */

.bulk-progress {
  margin-top: 16px;
}
.bulk-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bulk-progress-fill {
  height: 100%;
  background: var(--brand-primary, #6320e8);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bulk-progress-text {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
}

[data-theme="light"] .bulk-progress-bar {
  background: #e5e7eb;
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 4 — Filter Chips, Saved Views, Command Palette Enhancements
   ═══════════════════════════════════════════════════════════════════ */

/* ── Filter Chips Bar ────────────────────────────────────────────── */
.filter-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-chips-list {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-chips-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius, 6px);
  background: var(--brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.filter-chip-label {
  opacity: 0.85;
}

.filter-chip-value {
  font-weight: 600;
}

.filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: 2px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.filter-chip-remove:hover {
  background: rgba(255,255,255,0.4);
}

.filter-chip-remove:focus-visible {
  outline: 2px solid var(--brand-accent, #F5A623);
  outline-offset: 1px;
}

.filter-chip-clear {
  padding: 4px 10px;
  border: 1px solid var(--border-color, var(--brand-border));
  border-radius: var(--radius, 6px);
  background: transparent;
  color: var(--text-secondary, #888);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.filter-chip-clear:hover {
  color: var(--brand-danger, #E8620A);
  border-color: var(--brand-danger, #E8620A);
}

.filter-chip-clear:focus-visible {
  outline: 2px solid var(--brand-accent, #F5A623);
  outline-offset: 1px;
}

/* ── Saved Views ─────────────────────────────────────────────────── */
.saved-views-dropdown {
  position: relative;
}

.saved-views-trigger {
  gap: 6px;
  font-size: 12px;
}

.saved-views-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 200;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  padding: 4px;
  border-radius: var(--radius, 6px);
  background: var(--surface-color, var(--brand-surface));
  border: 1px solid var(--border-color, var(--brand-border));
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
}

[data-theme="dark"] .saved-views-menu {
  background: var(--surface-dark, #1a1a2e);
  border-color: var(--border-dark, #333);
}

.saved-view-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}

.saved-view-item:hover {
  background: var(--hover-bg, rgba(99,32,232,0.08));
}

[data-theme="dark"] .saved-view-item:hover {
  background: rgba(255,255,255,0.06);
}

.saved-view-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #222);
  cursor: pointer;
}

[data-theme="dark"] .saved-view-name {
  color: var(--text-light, #e0e0e0);
}

.saved-view-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary, #888);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.saved-view-item:hover .saved-view-delete {
  opacity: 1;
}

.saved-view-delete:hover {
  color: var(--brand-danger, #E8620A);
}

.saved-view-delete:focus-visible {
  outline: 2px solid var(--brand-accent, #F5A623);
  outline-offset: 1px;
  opacity: 1;
}

.btn-save-view {
  gap: 4px;
  font-size: 12px;
}

/* ── Command Palette Enhancements (Sprint 4) ─────────────────────── */
.cmd-palette-item .item-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius, 6px);
  background: var(--surface-subtle, rgba(99,32,232,0.08));
  color: var(--text-secondary, #888);
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

[data-theme="dark"] .cmd-palette-item .item-badge {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted-dark, #aaa);
}

.cmd-palette-item .item-desc {
  display: block;
  font-size: 11px;
  color: var(--text-secondary, #888);
  margin-top: 1px;
}

[data-theme="dark"] .cmd-palette-item .item-desc {
  color: var(--text-muted-dark, #aaa);
}

.cmd-palette-item[aria-selected="true"],
.cmd-palette-item.active {
  background: var(--brand-primary);
  color: #fff;
}

.cmd-palette-item[aria-selected="true"] .item-desc,
.cmd-palette-item.active .item-desc,
.cmd-palette-item[aria-selected="true"] .item-badge,
.cmd-palette-item.active .item-badge {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
}

.cmd-palette-item[aria-selected="true"] .item-icon svg,
.cmd-palette-item.active .item-icon svg {
  stroke: #fff;
}

/* ── Sort Indicator on Table Headers ─────────────────────────────── */
th.sortable.sorted-asc::after {
  content: " \2191";
  font-size: 11px;
  opacity: 0.7;
}

th.sortable.sorted-desc::after {
  content: " \2193";
  font-size: 11px;
  opacity: 0.7;
}

/* ── Highlight matched row (from search palette) ─────────────────── */
tr.highlight-row {
  animation: row-highlight 2s ease-out;
}

@keyframes row-highlight {
  0% { background: rgba(99,32,232,0.15); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  tr.highlight-row {
    animation: none;
    background: rgba(99,32,232,0.1);
  }
}

/* ── Responsive Filter Chips ─────────────────────────────────────── */
@media (max-width: 768px) {
  .filter-chips-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-chips-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .saved-views-menu {
    left: 0;
    right: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Sprint 5 — Brand Polish, Login Refinement, Dashboard, Onboarding
   ═══════════════════════════════════════════════════════════════════ */

/* ── SSO button + login footer links ────────────────────────────── */

.login-sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.login-sso-divider::before,
.login-sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-sso:hover:not(:disabled) {
  border-color: var(--brand-primary);
  background: rgba(99, 32, 232, 0.06);
}
.btn-sso:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-sso:disabled::after {
  content: " (coming soon)";
  font-size: 11px;
  opacity: 0.7;
  margin-left: 4px;
}

.login-footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.login-footer-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.login-footer-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* ── Onboarding checklist ──────────────────────────────────────── */

.onboarding-checklist {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  transition: opacity 0.3s, max-height 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-checklist {
    transition: none;
  }
}

.onboarding-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.onboarding-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.onboarding-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.onboarding-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-dismiss {
    transition: none;
  }
}

.onboarding-dismiss:hover {
  color: var(--text-primary);
  background: rgba(99, 32, 232, 0.1);
}
.onboarding-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.onboarding-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-progress-fill {
    transition: none;
  }
}

.onboarding-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.onboarding-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-step {
    transition: none;
  }
}

.onboarding-step:hover {
  background: rgba(99, 32, 232, 0.04);
}
.onboarding-step-done {
  opacity: 0.6;
}
.onboarding-step-done .onboarding-step-label {
  text-decoration: line-through;
}
.onboarding-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.onboarding-check svg {
  color: var(--status-green);
}
.onboarding-check-empty {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
}
.onboarding-step-label {
  font-size: 14px;
  color: var(--text-primary);
}
a.onboarding-step-label {
  color: var(--brand-primary);
  text-decoration: none;
}
a.onboarding-step-label:hover {
  text-decoration: underline;
}

/* ── Needs Attention cards ─────────────────────────────────────── */

.needs-attention {
  margin-bottom: 20px;
}
.needs-attention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.needs-attention-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.needs-attention-title svg {
  color: var(--brand-accent);
}
.needs-attention-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-color);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.needs-attention-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.attention-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .attention-card {
    transition: none;
  }
}

.attention-card:hover {
  border-color: var(--brand-primary);
}
.attention-card-warning {
  border-left: 3px solid var(--status-yellow);
}
.attention-card-error {
  border-left: 3px solid var(--status-red);
}
.attention-card-info {
  border-left: 3px solid var(--brand-primary);
}
.attention-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(99, 32, 232, 0.08);
}
.attention-card-warning .attention-card-icon {
  background: rgba(245, 166, 35, 0.12);
  color: var(--status-yellow);
}
.attention-card-error .attention-card-icon {
  background: rgba(232, 98, 10, 0.12);
  color: var(--status-red);
}
.attention-card-body {
  flex: 1;
  min-width: 0;
}
.attention-card-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.attention-card-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.attention-card-action {
  flex-shrink: 0;
  align-self: center;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .attention-card-action {
    transition: none;
  }
}

.attention-card-action:hover {
  color: var(--brand-primary);
  background: rgba(99, 32, 232, 0.08);
}

/* ── Cost Trend Panel ──────────────────────────────────────────── */

.cost-trend-panel {
  margin-bottom: 20px;
}
.cost-trend-panel .panel {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cost-trend-panel .panel-body {
  padding: 16px 20px;
  height: 200px;
}
.panel-header-badge-neutral {
  background: rgba(99, 32, 232, 0.1);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

/* ── Mobile responsive adjustments ─────────────────────────────── */

@media (max-width: 768px) {
  .onboarding-checklist {
    padding: 16px;
  }
  .needs-attention-cards {
    grid-template-columns: 1fr;
  }
  .login-footer-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}
