/* ── Design tokens: light ──────────────────────────────────── */
:root {
  --purple: #7f40fa;
  --teal: #00c2cb;
  --blue: #5271ff;

  /* Stage colours — muted, not garish */
  --stage-new-bg:      rgba(59,130,246,0.1);   --stage-new:      #2563eb;
  --stage-proposal-bg: rgba(245,158,11,0.12);  --stage-proposal: #b45309;
  --stage-followup-bg: rgba(127,64,250,0.1);   --stage-followup: #7f40fa;
  --stage-closed-bg:   rgba(16,185,129,0.1);   --stage-closed:   #059669;
  --stage-overdue-bg:  rgba(239,68,68,0.1);    --stage-overdue:  #dc2626;

  /* Surfaces */
  --bg:         #f4f4f8;
  --surface:    #ffffff;
  --surface-2:  #f0f0f6;
  --surface-3:  #e6e6f0;
  --border:     rgba(0,0,0,0.07);
  --border-mid: rgba(0,0,0,0.12);

  /* Text */
  --text:   #0d0d14;
  --text-2: #6b6b7a;
  --text-3: #9898a8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 2px 10px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg: 0 20px 64px rgba(0,0,0,0.13);

  /* Legacy compat */
  --card:   var(--surface);
  --muted:  var(--text-2);
  --radius: 16px;
  --shadow: var(--shadow-lg);
}

/* ── Design tokens: dark ───────────────────────────────────── */
[data-theme="dark"] {
  --bg:         #0e0e16;
  --surface:    #15151f;
  --surface-2:  #1c1c2a;
  --surface-3:  #242436;
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.13);

  --text:   #ebebf5;
  --text-2: #7474a0;
  --text-3: #48486a;
  --card:   var(--surface);

  --stage-new-bg:      rgba(59,130,246,0.15);  --stage-new:      #60a5fa;
  --stage-proposal-bg: rgba(245,158,11,0.15);  --stage-proposal: #fbbf24;
  --stage-followup-bg: rgba(127,64,250,0.15);  --stage-followup: #a78bfa;
  --stage-closed-bg:   rgba(16,185,129,0.15);  --stage-closed:   #34d399;
  --stage-overdue-bg:  rgba(239,68,68,0.15);   --stage-overdue:  #f87171;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 2px 10px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 64px rgba(0,0,0,0.65);
}

/* ── Reset & base ─────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 0%, rgba(0,194,203,0.15), transparent 32rem),
    radial-gradient(circle at 94% 8%, rgba(127,64,250,0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Raleway, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: color 0.25s ease;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(0,194,203,0.05), transparent 32rem),
    radial-gradient(circle at 94% 8%, rgba(127,64,250,0.07), transparent 32rem),
    var(--bg);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(244,244,248,0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .topbar {
  background: rgba(14,14,22,0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.search {
  min-width: 0;
  flex: 1;
  height: 40px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search::placeholder { color: var(--text-3); }
.search:focus {
  border-color: rgba(127,64,250,0.5);
  box-shadow: 0 0 0 3px rgba(127,64,250,0.1);
}

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-mid);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

.sign-out-btn {
  width: auto;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.sign-out-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none;  }
[data-theme="dark"] .theme-toggle .icon-moon { display: none;  }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* ── Metrics strip ────────────────────────────────────────── */
.metrics-strip {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.metric {
  padding: 10px 10px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: center;
  transition: background 0.25s;
}

.metric strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.metric strong.accent { color: var(--purple); }

.metric-urgent strong { color: var(--stage-overdue); }

.metric span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── DB status badge ──────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.status { display: none; }

/* ── Shell & layout ───────────────────────────────────────── */
.shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 12px 14px 112px;
}

.view { margin-top: 12px; }

.layout { display: grid; gap: 12px; }
.grid   { display: grid; gap: 10px; }

/* ── Tabs (bottom nav on mobile, top nav on desktop) ─────── */
.tabs {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-width: 520px;
  margin: 0 auto;
  padding: 5px;
  border: 1px solid var(--border-mid);
  border-radius: 22px;
  background: rgba(255,255,255,0.93);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .tabs {
  background: rgba(21,21,31,0.93);
  border-color: var(--border);
}

.tab {
  min-height: 46px;
  border: 0;
  border-radius: 17px;
  color: var(--text-2);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tab.active {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 4px 14px rgba(127,64,250,0.35);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pad { padding: 16px; }

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Typography helpers ───────────────────────────────────── */
.title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.hint, .sub {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.sub { margin-top: 3px; }
.danger { color: var(--stage-overdue); font-weight: 600; }

.value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--purple);
  white-space: nowrap;
}

/* ── Pill / tag / stage ───────────────────────────────────── */
.pill, .tag, .stage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill {
  color: var(--purple);
  background: var(--stage-followup-bg);
}

.tag {
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stage { color: var(--text-3); background: var(--surface-2); }

.stage.New       { background: var(--stage-new-bg);      color: var(--stage-new);      }
.stage.Proposal  { background: var(--stage-proposal-bg); color: var(--stage-proposal); }
.stage.Follow-up { background: var(--stage-followup-bg); color: var(--stage-followup); }
.stage.Closed    { background: var(--stage-closed-bg);   color: var(--stage-closed);   }
.stage.Overdue   { background: var(--stage-overdue-bg);  color: var(--stage-overdue);  }

/* ── Layout helpers ───────────────────────────────────────── */
.row     { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ── Deal card layout ─────────────────────────────────────── */
.action-card { overflow: hidden; touch-action: pan-y; }
.action-inner { padding: 14px; transition: transform 180ms ease; }

.deal-card { padding: 14px 16px; }

.deal-primary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.deal-meta { flex: 1; min-width: 0; }

.deal-value-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.deal-next {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.deal-next.overdue { color: var(--stage-overdue); }

.due-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.due-chip.overdue {
  background: var(--stage-overdue-bg);
  border-color: transparent;
  color: var(--stage-overdue);
}

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ── Action row ───────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.mini, .btn, .icon-btn {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 13px;
}

.mini {
  min-height: 30px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 12px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s, color 0.13s;
}

.mini:hover { background: var(--surface-3); color: var(--text); }

.mini.active {
  color: #fff;
  border-color: transparent;
  background: #111;
}

[data-theme="dark"] .mini.active {
  background: #ddddf0;
  color: #0d0d14;
}

/* Stage-specific active mini buttons */
.mini[data-stage="New"].active       { background: var(--stage-new-bg);      color: var(--stage-new);      border-color: var(--stage-new);      }
.mini[data-stage="Proposal"].active  { background: var(--stage-proposal-bg); color: var(--stage-proposal); border-color: var(--stage-proposal); }
.mini[data-stage="Follow-up"].active { background: var(--stage-followup-bg); color: var(--stage-followup); border-color: var(--stage-followup); }
.mini[data-stage="Closed"].active    { background: var(--stage-closed-bg);   color: var(--stage-closed);   border-color: var(--stage-closed);   }

.btn {
  color: #fff;
  background: #111;
  padding: 0 16px;
  transition: opacity 0.15s;
}

[data-theme="dark"] .btn {
  background: #e0e0f0;
  color: #0d0d14;
}

.btn:hover { opacity: 0.82; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 0;
  border-radius: 0;
}

.link-btn:hover { opacity: 0.72; }

.link-title {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  display: block;
  width: 100%;
  transition: color 0.13s;
}

.link-title:hover { color: var(--purple); }

.gradient {
  background: linear-gradient(135deg, var(--teal), var(--blue), var(--purple));
  color: #fff !important;
}

.ghost {
  color: var(--text);
  border: 1px solid var(--border-mid);
  background: var(--surface);
}

[data-theme="dark"] .ghost {
  background: var(--surface-2);
}

.icon-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background 0.13s, color 0.13s;
}

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

/* ── Brief ────────────────────────────────────────────────── */
.brief { display: grid; gap: 8px; }

.brief-item {
  border-left: 3px solid var(--purple);
  border-radius: 10px;
  padding: 10px 13px;
  background: rgba(127,64,250,0.06);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

[data-theme="dark"] .brief-item { background: rgba(127,64,250,0.1); }

.empty {
  padding: 22px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { display: grid; gap: 10px; }

.timeline-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--purple);
  flex-shrink: 0;
}

/* ── FAB ──────────────────────────────────────────────────── */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 32;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue), var(--purple));
  box-shadow: 0 16px 40px rgba(127,64,250,0.38);
  font-size: 30px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 20px 48px rgba(127,64,250,0.48);
}

/* ── Drawers — frosted glass backdrop + slide-in panel ──────── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(0,0,0,0);
  transition:
    opacity 0.22s ease,
    visibility 0s linear 0.22s,
    background 0.22s ease;
}

.drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    opacity 0.22s ease,
    visibility 0s linear 0s,
    background 0.22s ease;
}

.drawer-panel {
  position: relative;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(30px);
  transition: transform 0.32s cubic-bezier(0.34, 1.08, 0.64, 1);
}

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

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.drawer p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  padding: 10px 13px;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}

input::placeholder, textarea::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

textarea { min-height: 80px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(127,64,250,0.12);
}

.save-btn { width: 100%; margin-top: 12px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(162px + env(safe-area-inset-bottom));
  z-index: 90;
  display: none;
  max-width: 480px;
  margin: 0 auto;
  padding: 11px 16px;
  border-radius: 14px;
  color: #fff;
  background: #111;
  box-shadow: var(--shadow-md);
  font-weight: 700;
  font-size: 14px;
}

[data-theme="dark"] .toast { background: #e0e0f0; color: #0d0d14; }
.toast.show { display: block; }

/* ── Edit drawer specifics ────────────────────────────────── */
.edit-footer { display: grid; gap: 8px; margin-top: 16px; }

.add-opp-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.add-opp-btn:hover { background: var(--surface-3); }

.danger-btn { color: #fff; background: #c0392b; }
.danger-btn:hover { background: #a93226; }

.contact-opps-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.contact-opps-head {
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.contact-opp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.contact-opp-row:last-child { border-bottom: 0; }
.contact-opp-closed { opacity: 0.45; }

.contact-opp-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.contact-opp-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: var(--text);
}

.contact-opp-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.contact-opp-empty {
  padding: 14px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.delete-confirm {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(192,57,43,0.25);
  border-radius: 14px;
  background: rgba(192,57,43,0.05);
}

.delete-warning {
  margin: 0 0 10px;
  color: #c0392b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.captured-by-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 12px;
  background: rgba(127,64,250,0.06);
  border-radius: 10px;
  font-size: 13px;
}

.captured-by-label { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.captured-by-name  { font-weight: 700; color: var(--text); }

.captured-by-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  cursor: default;
  flex-shrink: 0;
}

/* ── Utility ──────────────────────────────────────────────── */
.row-wrap  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-call  { flex-shrink: 0; font-size: 13px; min-height: 34px; padding: 0 14px; }
.dim       { opacity: 0.48; }

/* ── Desktop ──────────────────────────────────────────────── */
@media (min-width: 760px) {
  .topbar {
    padding-left: 22px;
    padding-right: 22px;
  }

  .metrics-strip {
    display: flex;
    align-items: center;
    padding: 10px 22px;
    gap: 12px;
  }

  .metrics {
    gap: 8px;
    flex: 1;
  }

  .metric { padding: 11px 14px 9px; }
  .metric strong { font-size: 21px; }

  .shell {
    padding: 16px 22px 48px;
  }

  .tabs {
    position: static;
    max-width: none;
    margin: 0 0 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 4px;
    border-radius: 14px;
    gap: 2px;
  }

  [data-theme="dark"] .tabs {
    background: var(--surface-2);
  }

  .tab {
    min-height: 38px;
    font-size: 13px;
    border-radius: 10px;
  }

  .tab.active { box-shadow: 0 3px 10px rgba(127,64,250,0.25); }

  .layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  }

  .form-grid { grid-template-columns: 1fr 1fr; }
  .wide { grid-column: 1 / -1; }

  .drawer-panel {
    max-width: 680px;
    border-radius: 24px;
    margin-bottom: 32px;
  }

  .fab { bottom: 28px; }
  .toast { bottom: 28px; }
}
