/* ============================================================
   TomeOS Customer App — Design System
   Implements Sati's Framer design brief (2026-08-11)
   Royal Indigo accent (#6366F1) — TomeOS vertical
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@1&family=Geist+Sans:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Base palette */
  --bg-base:       #09090B;
  --bg-surface:    #111113;
  --bg-elevated:   #1C1C1F;

  /* Borders */
  --border-subtle: #27272A;
  --border-strong: #3F3F46;

  /* Text */
  --text-primary:   #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted:     #52525B;
  --text-inverse:   #09090B;

  /* TomeOS accent: Royal Indigo */
  --accent:        #6366F1;
  --accent-light:  #818CF8;
  --accent-dim:    rgba(99, 102, 241, 0.15);
  --accent-dimmer: rgba(99, 102, 241, 0.08);
  --accent-glow:   rgba(99, 102, 241, 0.30);

  /* Semantic */
  --success:       #22C55E;
  --success-dim:   rgba(34, 197, 94, 0.12);
  --success-border:rgba(34, 197, 94, 0.3);
  --warning:       #F59E0B;
  --warning-dim:   rgba(245, 158, 11, 0.12);
  --warning-border:rgba(245, 158, 11, 0.3);
  --danger:        #EF4444;
  --danger-dim:    rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  /* Spacing */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-ui:      'Geist Sans', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--text-primary); }

/* ── Layout containers ─────────────────────────────────────── */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.page--wide {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.page--full {
  max-width: 100%;
  padding: 0;
}

/* ── Wordmark / Logo ───────────────────────────────────────── */
.wordmark {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wordmark .wordmark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Eyebrow labels ────────────────────────────────────────── */
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

/* ── Typography scale ──────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 48px;
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.t-hero {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.t-section {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.t-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.t-small {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.t-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.t-number {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.0;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Utility typography */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-center    { text-align: center; }
.text-small     { font-size: 13px; }
.text-xs        { font-size: 11px; }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: background 0.2s, border-color 0.2s;
}
.card--elevated {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}
.card--hover:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}
.card--accent {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
}
.card + .card { margin-top: 12px; }

/* Agent division card */
.division-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.division-card:hover {
  background: var(--bg-elevated);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}
.division-card .division-icon {
  font-size: 24px;
  line-height: 1;
}
.division-card .division-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.division-card .division-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary: filled accent with gradient */
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn--primary:hover {
  background: linear-gradient(315deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 24px var(--accent-glow);
  color: #fff;
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }

/* Secondary: ghost */
.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn--secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Ghost accent */
.btn--ghost {
  background: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.btn--ghost:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
}

/* Danger */
.btn--danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* Size variants */
.btn--sm {
  padding: 8px 16px;
  font-size: 13px;
}
.btn--lg {
  padding: 16px 32px;
  font-size: 15px;
}
.btn--full {
  width: 100%;
}

/* Loading spinner inside btn */
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Form elements ─────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}
.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
input::placeholder,
textarea::placeholder { color: var(--text-muted); }
input.error,
select.error,
textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2352525B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Input with monospace (for keys) */
.input--mono {
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  letter-spacing: 0.02em;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.badge--success {
  background: var(--success-dim);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.badge--warning {
  background: var(--warning-dim);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}
.badge--danger {
  background: var(--danger-dim);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.badge--muted {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.badge--accent {
  background: var(--accent-dim);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-light);
}
.badge--tier {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(129,140,248,0.2));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Progress steps bar ─────────────────────────────────────── */
.progress-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
}
.progress-step {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-subtle);
  transition: background 0.3s ease;
  position: relative;
}
.progress-step::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.progress-step.active::after {
  transform: scaleX(1);
}
.progress-step.complete {
  background: var(--success);
}
.progress-step.complete::after { display: none; }

/* Step labels */
.step-labels {
  display: flex;
  margin-bottom: 32px;
  gap: 6px;
}
.step-label {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.2s;
}
.step-label.active  { color: var(--accent-light); font-weight: 500; }
.step-label.done    { color: var(--success); }

/* ── Provisioning progress (activating page) ───────────────── */
.provision-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.provision-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}
.provision-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 44px;
  width: 2px;
  height: calc(100% - 28px);
  background: var(--border-subtle);
}
.provision-step.complete::after {
  background: var(--success);
}
.provision-step.active::after {
  background: linear-gradient(180deg, var(--accent), var(--border-subtle));
}

.provision-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: all 0.3s ease;
  z-index: 1;
}
.provision-step.complete .provision-step-icon {
  background: var(--success-dim);
  border-color: var(--success);
  color: var(--success);
}
.provision-step.active .provision-step-icon {
  background: var(--accent-dim);
  border-color: var(--accent);
  animation: pulse-border 1.5s ease-in-out infinite;
}
.provision-step.pending .provision-step-icon {
  color: var(--text-muted);
}

.provision-step-content { flex: 1; padding-top: 4px; }
.provision-step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.provision-step.pending .provision-step-label { color: var(--text-muted); }
.provision-step-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.provision-step.active .provision-step-sub { color: var(--accent-light); }

/* ── Alert / Banner ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert + .alert { margin-top: 8px; }
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert--error {
  background: var(--danger-dim);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.alert--success {
  background: var(--success-dim);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.alert--info {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.alert--warning {
  background: var(--warning-dim);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

/* ── Navigation header ─────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Status bar ─────────────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.status-bar--active {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.25);
}
.status-bar--provisioning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.25);
}

/* Status dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.dot--green  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot--yellow { background: var(--warning); animation: pulse-dot 2s ease-in-out infinite; }
.dot--red    { background: var(--danger); }
.dot--muted  { background: var(--text-muted); }

/* ── Dashboard layout ───────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 28px;
  max-width: 1000px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Agent grid */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Activity feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-title {
  font-size: 13px;
  color: var(--text-primary);
}
.activity-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Pipeline */
.pipeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.pipeline-item:last-child { border-bottom: none; }
.pipeline-cover {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ── Empty states ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto 16px;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 24px 0;
}
.divider--sm { margin: 16px 0; }

/* ── Monospace block ────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  word-break: break-all;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Summary confirm block ──────────────────────────────────── */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label  { color: var(--text-muted); }
.summary-row .value  { color: var(--text-primary); font-weight: 500; }

/* ── Decorative glow ────────────────────────────────────────── */
.glow-bg {
  position: relative;
}
.glow-bg::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header glow for welcome pages */
.page-header {
  position: relative;
  margin-bottom: 48px;
}
.page-header::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ── Grid helpers ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ── Spacing helpers ────────────────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ── Flex helpers ───────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4   { gap: 4px; }
.gap-6   { gap: 6px; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.gap-24  { gap: 24px; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--warning); }
  50%       { opacity: 0.6; box-shadow: 0 0 2px var(--warning); }
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

@keyframes spin-ring {
  to { stroke-dashoffset: 0; }
}

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

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes progress-fill {
  from { width: 0; }
  to   { width: var(--progress-width, 0%); }
}

.animate-in {
  animation: fade-in 0.35s ease both;
}
.animate-in-up {
  animation: fade-in-up 0.4s ease both;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Animated spinner (SVG-based) */
.spinner-ring {
  animation: spin 0.8s linear infinite;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page        { padding: 40px 20px 60px; }
  .page--wide  { padding: 24px 16px 60px; }
  .dashboard-layout { padding: 20px 16px; }
  .nav { padding: 0 20px; }
  .t-display { font-size: 36px; }
  .t-hero    { font-size: 26px; }
  .grid-2,
  .grid-3    { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { flex-direction: column; }
  .quick-actions .btn { width: 100%; }
}

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