/* ════════════════════════════════════════════════════════════════════
   FORGE Design System v1 — 2026-04-20
   Single source of truth for colors, typography, spacing, components.
   Load on every internal FORGE page via:
     <link rel="stylesheet" href="/forge/design-system.css"/>
   Proposal PDF output uses its own styling to match SumoQuote.
   ════════════════════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  /* Brand colors */
  --glr-green-900: #14532d;
  --glr-green-800: #166534;
  --glr-green-700: #15803d;
  --glr-green-600: #16a34a;
  --glr-green-500: #22c55e;
  --glr-green-100: #dcfce7;
  --glr-green-50:  #f0fdf4;
  
  /* Tier colors */
  --glr-silver:   #6b7280;
  --glr-gold:     #b8860b;
  --glr-platinum: #1f2937;
  
  /* Surface */
  --surface-primary:   #ffffff;
  --surface-secondary: #f8fafc;
  --surface-tertiary:  #f1f5f9;
  --surface-inverse:   #0f172a;
  
  /* Borders */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus:  var(--glr-green-700);
  
  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;
  --text-inverse:   #ffffff;
  --text-link:      var(--glr-green-700);
  
  /* Status */
  --danger:  #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --success: var(--glr-green-600);
  --success-bg: var(--glr-green-50);
  --info: #2563eb;
  --info-bg: #eff6ff;
  
  /* Typography */
  --font-display: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  
  /* Type scale (with line-heights) */
  --text-xs:    0.75rem;   /* 12px */
  --text-sm:    0.875rem;  /* 14px */
  --text-base:  1rem;      /* 16px */
  --text-lg:    1.125rem;  /* 18px */
  --text-xl:    1.25rem;   /* 20px */
  --text-2xl:   1.5rem;    /* 24px */
  --text-3xl:   1.875rem;  /* 30px */
  --text-4xl:   2.25rem;   /* 36px */
  
  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Spacing scale (4px unit) */
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  
  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Shell dimensions */
  --shell-header-height: 56px;
  --shell-sidebar-width: 240px;
  --shell-sidebar-collapsed: 64px;
}

/* ── Reset / Base ──────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }
p  { line-height: var(--leading-relaxed); }
a  { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--glr-green-900); }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ── Layout Shell ──────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--shell-sidebar-width) 1fr;
  grid-template-rows: var(--shell-header-height) 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

.shell-header {
  grid-area: header;
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 10;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--glr-green-900);
}
.shell-brand-mark {
  width: 32px; height: 32px;
  background: var(--glr-green-900);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: var(--text-sm);
}
.shell-user {
  display: flex; align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.shell-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--glr-green-900);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
}

.shell-sidebar {
  grid-area: sidebar;
  background: var(--surface-primary);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
}
.shell-nav-section {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-6);
}
.shell-nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}
.shell-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  position: relative;
}
.shell-nav-link:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}
.shell-nav-link.active {
  background: var(--glr-green-50);
  color: var(--glr-green-900);
  font-weight: 600;
}
.shell-nav-link.active::before {
  content: '';
  position: absolute;
  left: -var(--space-3);
  top: 0; bottom: 0;
  width: 3px;
  background: var(--glr-green-900);
  border-radius: 0 3px 3px 0;
}
.shell-nav-icon { font-size: 18px; width: 20px; text-align: center; }
.shell-nav-badge {
  margin-left: auto;
  background: var(--glr-green-100);
  color: var(--glr-green-900);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.shell-main {
  grid-area: main;
  overflow-y: auto;
  background: var(--surface-secondary);
}
.shell-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Page titles */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.page-header-left h1 { font-size: var(--text-2xl); margin-bottom: var(--space-1); }
.page-header-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.page-header-actions { display: flex; gap: var(--space-3); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { min-height: 48px; padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-sm { min-height: 32px; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }

.btn-primary {
  background: var(--glr-green-900);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--glr-green-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-primary);
  color: var(--glr-green-900);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--glr-green-50); border-color: var(--glr-green-700); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-tertiary); color: var(--text-primary); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2, .card-header h3 { font-size: var(--text-base); font-weight: 600; }
.card-body { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-secondary);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.card-muted {
  background: var(--surface-secondary);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
}

.stat-card {
  padding: var(--space-5);
}
.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-delta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}
.stat-delta.positive { color: var(--success); }
.stat-delta.negative { color: var(--danger); }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.badge-silver { background: #f1f5f9; color: var(--glr-silver); }
.badge-gold { background: #fef3c7; color: var(--glr-gold); }
.badge-platinum { background: #e2e8f0; color: var(--glr-platinum); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-sent { background: var(--info-bg); color: var(--info); }
.badge-signed { background: var(--glr-green-100); color: var(--glr-green-900); }
.badge-sold { background: var(--glr-green-100); color: var(--glr-green-900); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-tertiary); color: var(--text-secondary); }

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.good { background: var(--success); }
.status-dot.fair { background: var(--warning); }
.status-dot.poor { background: var(--danger); }
.status-dot.active { background: var(--info); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.status-dot.pending { background: var(--text-tertiary); }

/* ── Inputs ────────────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.input-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.input {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}
.input::placeholder { color: var(--text-tertiary); }
.input-search {
  padding-left: var(--space-10);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2394a3b8'><path stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/></svg>");
  background-repeat: no-repeat;
  background-position: var(--space-3) center;
  background-size: 20px;
}
.input-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ── Tables ────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-primary);
}
.data-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: left;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tbody tr { transition: background var(--transition-fast); cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Phase Bar (Audit → Estimates → Select → Preview → Document) ───── */
.phase-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}
.phase-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: default;
}
.phase-step.done { color: var(--glr-green-700); }
.phase-step.active {
  color: var(--glr-green-900);
  background: var(--glr-green-50);
  font-weight: 600;
}
.phase-step.locked { opacity: 0.5; cursor: not-allowed; }
.phase-step-num {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface-tertiary);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.phase-step.done .phase-step-num { background: var(--glr-green-700); color: #fff; }
.phase-step.active .phase-step-num { background: var(--glr-green-900); color: #fff; }
.phase-step-sep {
  width: 24px; height: 1px;
  background: var(--border-strong);
  flex-shrink: 0;
}

/* ── Utility classes ───────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); } .gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Loading states ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-tertiary) 25%, var(--border-subtle) 50%, var(--surface-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--glr-green-900);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
.spinner-lg { width: 24px; height: 24px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 100;
}
.loading-overlay-message {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}
.loading-overlay-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── Alerts / Toast ────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--text-sm);
}
.alert-danger { background: var(--danger-bg); border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: var(--warning-bg); border-color: #fde68a; color: #78350f; }
.alert-success { background: var(--success-bg); border-color: #bbf7d0; color: #14532d; }
.alert-info { background: var(--info-bg); border-color: #bfdbfe; color: #1e3a8a; }

/* Coming soon placeholder */
.coming-soon {
  background: var(--surface-primary);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-16);
  text-align: center;
}
.coming-soon-icon { font-size: 48px; margin-bottom: var(--space-4); }
.coming-soon-title { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.coming-soon-desc { font-size: var(--text-sm); color: var(--text-secondary); max-width: 480px; margin: 0 auto; }

/* Mobile menu toggle (hamburger) */
.shell-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}
.shell-menu-toggle:hover { background: var(--surface-tertiary); }
.shell-menu-toggle svg { width: 22px; height: 22px; }
.shell-sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 19;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.shell.menu-open .shell-sidebar-scrim { display: block; opacity: 1; }

/* Responsive tablet */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Responsive mobile */
@media (max-width: 768px) {
  :root { --shell-header-height: 56px; }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: calc(var(--shell-header-height) + env(safe-area-inset-top)) 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .shell-menu-toggle { display: inline-flex; }
  .shell-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 20;
    padding-top: calc(var(--space-4) + env(safe-area-inset-top));
    box-shadow: var(--shadow-xl);
  }
  .shell.menu-open .shell-sidebar { transform: translateX(0); }
  .shell-header {
    padding: 0 var(--space-4);
    padding-top: env(safe-area-inset-top);
    height: calc(var(--shell-header-height) + env(safe-area-inset-top));
  }
  .shell-user .shell-user-text { display: none; }
  .shell-user > a { display: none; }
  .shell-content { padding: var(--space-4) var(--space-4) calc(var(--space-12) + env(safe-area-inset-bottom)) var(--space-4); }
  .page-header { margin-bottom: var(--space-4); flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .page-header-left h1 { font-size: var(--text-xl); }
  .page-header-subtitle { font-size: var(--text-sm); }
  .page-header-actions { flex-wrap: wrap; width: 100%; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: var(--space-3); }
  .stat-card { padding: var(--space-4); }
  .stat-value { font-size: var(--text-2xl); }
  .card-header { padding: var(--space-3) var(--space-4); flex-wrap: wrap; gap: var(--space-2); }
  .card-body { padding: var(--space-4); }
  .card-footer { padding: var(--space-3) var(--space-4); flex-wrap: wrap; gap: var(--space-2); }
  .btn { min-height: 48px; padding: var(--space-3) var(--space-4); }
  .btn-sm { min-height: 40px; padding: var(--space-2) var(--space-3); }
  .btn-lg { min-height: 52px; }
  .data-table { font-size: var(--text-xs); }
  .data-table th, .data-table td { padding: var(--space-2) var(--space-3); }
  .hide-mobile { display: none !important; }
  .phase-bar { overflow-x: auto; padding: var(--space-3); gap: var(--space-1); flex-wrap: nowrap; }
  .phase-step { padding: var(--space-2); font-size: var(--text-xs); flex-shrink: 0; }
  .phase-step-sep { width: 12px; }
  .alert { padding: var(--space-3); font-size: var(--text-xs); }
  .settings-tabs { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
  .settings-tab { flex-shrink: 0; }
}

@media (max-width: 400px) {
  .shell-brand { font-size: var(--text-base); }
  .stat-card .stat-value { font-size: var(--text-xl); }
}

