@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap");

/* =========================================================
   Vouch design system — clean, rounded, vibrant accents
   Font preserved: Quicksand
   ========================================================= */
:root {
  --bg: #E6E8EC;
  --shell: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --canvas: #F6F7F9;
  --text: #18191B;
  --text-2: #7A808C;
  --brand: #1B74FF;
  --brand-hover: #145CD1;
  --clay: #FF3B9A;
  --border: #E6E8EE;
  --line: #ECEEF2;
  --success: #139E46;
  --warning: #B7791F;
  --danger: #D93848;

  --accent-green: #18C956;
  --accent-blue: #1B74FF;
  --accent-pink: #FF3B9A;

  --mint: #E7FAEE;
  --pink: #FFEAF4;
  --butter: #FEF4DB;
  --lilac: #E8F1FF;

  --radius-xl: 30px;
  --radius: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 22px 60px rgba(17, 24, 39, 0.10);
  --shadow-soft: 0 4px 20px rgba(17, 24, 39, 0.035);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --font: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 18px;
  min-height: 100vh;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 var(--space-3); font-weight: 700; line-height: 1.18; letter-spacing: -0.025em; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 var(--space-3); }
small, .muted { color: var(--text-2); }
.icon { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 24px; height: 24px; }
.icon-sm { width: 15px; height: 15px; }
.flip { transform: rotate(180deg); }

/* ---------- App Shell ---------- */
.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  min-height: calc(100vh - 36px);
  background: var(--shell);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.drawer-overlay { display: none; }

/* ---------- Top Navigation Bar (Cognify Pill Tabs) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 30px 10px;
  position: relative;
  z-index: 30;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--text);
}
.brand-link:hover { color: var(--text); }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-name {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.03em;
}
.topbar-spacer { flex: 1; }

.top-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.top-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  color: #3D424D;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid #ECEEF2;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.top-tab:hover {
  background: #ECEEF2;
  color: var(--text);
}
.top-tab.active {
  background: var(--text);
  color: #FFFFFF;
  border-color: var(--text);
  box-shadow: 0 6px 16px rgba(24, 25, 27, 0.16);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.icon-pill-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid #ECEEF2;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: background .15s ease;
}
.icon-pill-btn:hover, .icon-pill-btn.active {
  background: #ECEEF2;
  color: var(--text);
}
.notif-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 1.5px solid #fff;
}
.notif-dot.subtle { opacity: 0.45; }

.user-menu-wrap { position: relative; }
.avatar-pill-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B74FF 0%, #18C956 100%);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.10);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.12);
  padding: 8px;
  z-index: 60;
}
.user-dropdown-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-dropdown-name { font-weight: 700; font-size: 14px; }
.user-dropdown-meta { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
}
.user-dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.user-dropdown-item.danger { color: var(--danger); }

.mobile-toggle { display: none; }
.mobile-nav-drawer { display: none; }

.content {
  padding: 16px 30px 36px;
  width: 100%;
  flex: 1;
}

/* ---------- Dashboard Header & 6-Card Grid ---------- */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-header-row h1 {
  font-size: 30px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-dark-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(24, 25, 27, 0.16);
  transition: transform .15s ease, background .15s ease;
}
.btn-dark-pill:hover { background: #2D3036; color: #fff; transform: translateY(-1px); }
.btn-dark-pill .icon { color: #fff; stroke: #fff; }

.kpi-grid, .viz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid #EEF0F4;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

/* KPI Cards */
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kpi-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kpi-icon-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  padding: 5px;
}
.kpi-icon-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.kpi-icon-ring.green { background: #E3F9EB; }
.kpi-icon-ring.green .kpi-icon-core { background: var(--accent-green); box-shadow: 0 4px 12px rgba(24, 201, 86, 0.28); }
.kpi-icon-ring.blue { background: #E5F0FF; }
.kpi-icon-ring.blue .kpi-icon-core { background: var(--accent-blue); box-shadow: 0 4px 12px rgba(27, 116, 255, 0.28); }
.kpi-icon-ring.pink { background: #FFE6F2; }
.kpi-icon-ring.pink .kpi-icon-core { background: var(--accent-pink); box-shadow: 0 4px 12px rgba(255, 59, 154, 0.28); }

.kpi-label {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  color: #2B2F36;
}
.kpi-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  flex: none;
  transition: background .15s ease;
}
.kpi-arrow-btn:hover { background: #E4E7EC; color: var(--text); }

.kpi-mid {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 14px;
}
.kpi-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi-delta {
  font-size: 12px;
  font-weight: 700;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-2); }

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.kpi-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}
.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: #3D424D;
  white-space: nowrap;
}
.mini-avatar-group {
  display: flex;
  align-items: center;
}
.mini-plus-btn, .mini-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #fff;
}
.mini-plus-btn {
  background: var(--surface-2);
  color: var(--text);
  margin-right: 4px;
}
.mini-chip { margin-left: -6px; color: #fff; }
.mini-chip.green { background: var(--accent-green); }
.mini-chip.dark { background: var(--text); }

/* Visualization Cards */
.viz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.viz-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Card 4: Readiness Progress */
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.viz-big-pct {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 10px;
}
.viz-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.legend-stack {
  display: grid;
  gap: 8px;
}
.legend-item { text-align: right; }
.legend-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 600;
}
.legend-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.legend-dot .icon-sm { width: 11px; height: 11px; }
.legend-dot.pink { background: var(--accent-pink); }
.legend-dot.blue { background: var(--accent-blue); }
.legend-dot.green { background: var(--accent-green); }
.legend-val {
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 1px;
}

.hatched-bars-stage {
  position: relative;
  height: 175px;
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: flex-end;
}
.hatched-bar {
  position: relative;
  flex: 1;
  height: var(--bar-h, 60%);
  min-height: 92px;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
}
.hatched-bar.pink {
  background: linear-gradient(180deg, #FF2E93 0%, #FF6AB4 100%);
  z-index: 1;
}
.hatched-bar.blue {
  background: linear-gradient(180deg, #166EFF 0%, #589CFF 100%);
  margin-left: -10px;
  z-index: 2;
}
.hatched-bar.green {
  background: linear-gradient(180deg, #00C244 0%, #44E07B 100%);
  margin-left: -10px;
  z-index: 3;
}
.bar-badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.bar-label-wrap {
  color: #fff;
  line-height: 1.2;
}
.bar-title {
  font-size: 13px;
  font-weight: 700;
}
.bar-pct {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}

/* Card 5: Opportunity Status (Donut + Hatched Tracks) */
.seg-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  width: 28px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.donut-stage {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
}
.donut-svg { width: 100%; height: 100%; }
.donut-center {
  position: absolute;
  text-align: center;
}
.donut-total { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.donut-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.donut-tooltip {
  position: absolute;
  top: 10px;
  left: -18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--accent-green); }
.dot.blue { background: var(--accent-blue); }
.dot.pink { background: var(--accent-pink); }

.status-bars { display: grid; gap: 10px; margin-top: auto; }
.status-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}
.status-row-top span { color: var(--text-2); font-weight: 500; }
.status-row-top strong { color: var(--text); font-weight: 700; }
.hatched-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.hatched-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 10%;
  background-size: 10px 10px;
}
.hatched-fill.green {
  background-color: var(--accent-green);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.28) 0 2px, transparent 2px 6px);
}
.hatched-fill.pink {
  background-color: var(--accent-pink);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.28) 0 2px, transparent 2px 6px);
}
.hatched-fill.blue {
  background-color: var(--accent-blue);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.28) 0 2px, transparent 2px 6px);
}

/* Card 6: Activity Trend */
.trend-box {
  background: #F6F7FA;
  border-radius: 18px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trend-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.trend-pill.dark { background: var(--text); color: #fff; }
.trend-pill.light { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.trend-svg { width: 100%; height: 110px; display: block; }
.trend-days {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.day-pill {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 0;
  border-radius: 999px;
  cursor: pointer;
}
.day-pill.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text);
  font-weight: 700;
}
.trend-foot {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}
.trend-foot-label { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.trend-foot-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

/* Secondary lists */
.mini-list { display: grid; gap: 10px; }
.mini-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--shell);
  transition: background .15s ease;
}
.mini-list-row:hover { background: #ECEEF2; color: var(--text); }
.mini-list-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list-sub { font-size: 12px; color: var(--text-2); }
.attention-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  flex: none;
}

/* ---------- Shared Page Headers & Cards ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin: 2px 0 0; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid #EEF0F4;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--space-5);
}
.card + .card { margin-top: var(--space-4); }
.card.mint { background: var(--mint); border-color: transparent; }
.card.pink { background: var(--pink); border-color: transparent; }
.card.butter { background: var(--butter); border-color: transparent; }
.card.lilac { background: var(--lilac); border-color: transparent; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--space-4); }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: var(--space-3); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .11em; color: var(--text-2); font-weight: 700; margin: var(--space-4) 0 var(--space-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:hover { background: #2D3036; border-color: #2D3036; color: #fff; }
.btn-clay { background: var(--accent-pink); border-color: var(--accent-pink); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.circle-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface); color: var(--text);
  display: grid; place-items: center; flex: none; border: 1px solid var(--border); cursor: pointer;
}

/* ---------- Forms ---------- */
.form-row { display: grid; gap: 6px; margin-bottom: var(--space-4); }
label, .label { font-weight: 700; font-size: 13px; color: var(--text); }
input, select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--shell); color: var(--text); font-family: var(--font); font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(27, 116, 255, 0.16); border-color: var(--brand); background: #fff; }
textarea { min-height: 104px; resize: vertical; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; margin-bottom: 12px; }
.checkbox input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--brand); }
.hint { font-size: 12px; color: var(--text-2); font-weight: 500; }
.form-section { border-bottom: 1px solid var(--line); padding-bottom: var(--space-5); margin-bottom: var(--space-5); }
.form-section:last-child { border: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .form-row { margin: 0; min-width: 150px; }

/* ---------- Option Picker Pills (Onboarding & Profile) ---------- */
.pick-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--shell);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}
.pick-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pick-pill:hover {
  background: var(--surface-2);
}
.pick-pill.selected {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.pick-other-wrap {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.pick-other-wrap[hidden] {
  display: none !important;
}

/* ---------- Badges, alerts, stats ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.badge.success { background: var(--mint); color: var(--success); }
.badge.warning { background: var(--butter); color: var(--warning); }
.badge.danger { background: var(--pink); color: var(--danger); }
.badge.brand { background: var(--lilac); color: var(--brand); }
.badge.clay { background: var(--pink); color: var(--accent-pink); }
.badge.demo { background: var(--butter); color: var(--text-2); }
.alert { padding: 14px 18px; border-radius: var(--radius-md); background: var(--surface-2); margin-bottom: var(--space-4); font-size: 14px; }
.alert.compact { padding: 9px 14px; font-size: 12.5px; margin-bottom: 12px; }
.alert.info { background: var(--mint); }
.alert.warn { background: var(--butter); }
.alert.error { background: var(--pink); color: var(--danger); }
.alert strong { font-weight: 700; }
.flash-stack { display: grid; gap: 8px; margin-bottom: var(--space-4); }
.flash { padding: 11px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.flash.success { background: var(--mint); color: var(--success); border-color: transparent; }
.flash.error { background: var(--pink); color: var(--danger); border-color: transparent; }
.flash.info { background: var(--lilac); color: var(--brand); border-color: transparent; }
.stat { background: var(--surface); border: 1px solid #EEF0F4; border-radius: var(--radius); padding: 20px; }
.stat .label { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.stat .value { font-size: 34px; font-weight: 700; margin-top: 6px; letter-spacing: -.03em; }
.stat .foot { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- Tables, tabs, text ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); font-weight: 700; background: var(--shell); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--shell); }
td .secondary { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.tab { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.tab.active { color: #fff; background: var(--text); border-color: var(--text); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--text-2); font-weight: 600; }
.kv dd { margin: 0; }
.source-note { font-size: 12px; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 10px; }
.definition { border-left: 3px solid var(--accent-pink); padding: 2px 0 2px 12px; margin-bottom: 10px; }
.definition strong { display: block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
pre { background: var(--shell); padding: 14px; border-radius: var(--radius-md); overflow-x: auto; font-size: 12px; }

.empty { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-2); }
.empty .empty-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--lilac); display: grid; place-items: center; margin: 0 auto 12px; color: var(--brand); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.progress { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--text); border-radius: 999px; }
.progress.warn > span { background: var(--warning); }
.progress.danger > span { background: var(--danger); }
.meter { display: flex; align-items: center; gap: 10px; }
.meter .progress { flex: 1; }
.meter .value { font-weight: 700; font-size: 13px; min-width: 38px; text-align: right; }

/* ---------- Chat / Assistant ---------- */
.chat-log { display: grid; gap: 14px; max-height: 62vh; overflow-y: auto; padding-right: 6px; }
.msg { max-width: 82%; padding: 13px 18px; border-radius: 20px; background: var(--surface-2); white-space: pre-wrap; font-size: 14px; }
.msg.user { margin-left: auto; background: var(--text); color: #fff; }
.msg .sources { display: block; margin-top: 8px; font-size: 11px; opacity: .75; }
.chat-compose { display: flex; gap: 10px; margin-top: var(--space-4); }
.chat-compose textarea { min-height: 68px; }

.assistant-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-4); min-height: calc(100vh - 250px); }
.history-rail { align-self: start; border-radius: var(--radius); padding: 18px; }
.history-rail .new-form { display: grid; gap: 8px; margin-bottom: 14px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.history-item.active { background: var(--lilac); color: var(--brand); }
.history-item .icon { width: 17px; height: 17px; padding: 6px; box-sizing: content-box; border-radius: 50%; }
.history-item.active .icon { background: var(--text); color: #fff; }
.chat-panel { display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); border: 1px solid #EEF0F4; box-shadow: var(--shadow-soft); overflow: hidden; height: calc(100vh - 300px); min-height: 360px; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.chat-header h3 { margin: 0; font-size: 17px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 30px 24px; }
.chat-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 18px; }
.chat-empty { margin: auto; text-align: center; padding: 40px 10px; }
.chat-empty .empty-icon { width: 64px; height: 64px; background: var(--lilac); border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; color: var(--brand); }
.chat-empty .empty-icon .icon { width: 28px; height: 28px; }
.chat-empty h2 { font-size: 28px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chat-suggestions span { background: var(--shell); border-radius: 999px; padding: 8px 14px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.composer-wrap { padding: 12px 24px 24px; }
.composer {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 12px;
  background: var(--shell); border: 1px solid var(--border); border-radius: 24px; padding: 10px 10px 10px 18px;
}
.composer textarea { border: 0; background: transparent; min-height: 42px; max-height: 160px; padding: 10px 0; box-shadow: none; }
.composer textarea:focus { outline: none; border: 0; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.send-btn:hover { background: var(--brand); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.composer-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .15s, color .15s, border-color .15s;
}
.composer-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.composer-icon-btn.recording {
  background: var(--pink); color: var(--accent-pink); border-color: var(--accent-pink);
  animation: pulse-mic 1.2s infinite ease-in-out;
}
@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 154, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(255, 59, 154, 0); }
}
.file-chip-row {
  max-width: 760px; margin: 0 auto 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  background: var(--lilac); color: var(--brand); font-size: 12.5px; font-weight: 700;
}
.file-chip button {
  border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px;
}
.composer-note { max-width: 760px; margin: 8px auto 0; text-align: center; font-size: 11px; }

/* ---------- Tender detail & foldables ---------- */
.simple-summary { background: var(--lilac); border-radius: var(--radius); padding: 24px; margin-bottom: var(--space-4); }
.simple-summary h2 { font-size: 26px; margin: 8px 0 16px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps a { display: grid; gap: 4px; background: rgba(255,255,255,.78); border-radius: 16px; padding: 14px 16px; }
.steps a strong { font-size: 14px; }
.steps a span { font-size: 12px; color: var(--text-2); }
.fold { margin-top: var(--space-4); }
.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 14px 18px; font-weight: 700; color: var(--text);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .icon:last-child { margin-left: auto; transition: transform .15s; }
.fold[open] > summary .icon:last-child { transform: rotate(90deg); }
.fold .card { margin-top: 10px; }

/* ---------- Authentication & Landing ---------- */
.auth-wrap { min-height: calc(100vh - 200px); display: grid; place-items: center; }
.auth-card { max-width: 470px; width: 100%; border-radius: 28px; padding: 36px; background: var(--surface); box-shadow: var(--shadow-soft); border: 1px solid #EEF0F4; }
.auth-card h1 { font-size: 32px; }
.auth-card .btn-primary { border-radius: 999px; }

.opp-card { background: var(--surface); border: 1px solid #EEF0F4; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-soft); }
.opp-card.mint { background: var(--mint); border-color: transparent; }
.opp-card.pink { background: var(--pink); border-color: transparent; }
.opp-card.butter { background: var(--butter); border-color: transparent; }
.opp-card.lilac { background: var(--lilac); border-color: transparent; }
.opp-card h3 { font-size: 20px; margin: 10px 0 4px; }

.simple-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--surface); border: 1px solid #EEF0F4; border-radius: var(--radius); padding: 36px;
  box-shadow: var(--shadow-soft);
}
.simple-hero h2 { font-size: 30px; margin: 8px 0; max-width: 640px; }
.simple-hero p { color: var(--text-2); max-width: 620px; margin: 0; }
.hero-orb { width: 112px; height: 112px; border-radius: 50%; background: var(--lilac); display: grid; place-items: center; flex: none; color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .kpi-grid, .viz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-tabs { display: none; }
  .mobile-toggle { display: grid; }
  .mobile-nav-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    z-index: 80;
    padding: 20px;
    transform: translateX(100%);
    transition: transform .2s ease;
    box-shadow: -12px 0 32px rgba(0,0,0,0.12);
  }
  .mobile-nav-drawer.open { transform: translateX(0); }
  .mobile-nav-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
  .mobile-nav-links { display: grid; gap: 8px; }
  .mobile-nav-links .top-tab { justify-content: flex-start; }
  .drawer-overlay.show { display: block; position: fixed; inset: 0; background: rgba(24,25,27,.28); z-index: 70; }
}
@media (max-width: 760px) {
  body { padding: 0; }
  .app-shell { border-radius: 0; min-height: 100vh; }
  .topbar { padding: 14px 18px; }
  .content { padding: 12px 18px 28px; }
  .kpi-grid, .viz-grid, .secondary-grid, .grid-2, .grid-3, .grid-4, .steps, .assistant-shell {
    grid-template-columns: 1fr;
  }
  .kv { grid-template-columns: 1fr; gap: 2px; }
}
@media print {
  .topbar, .no-print { display: none !important; }
  body { padding: 0; background: #fff; }
  .app-shell { margin: 0; box-shadow: none; border-radius: 0; }
  .content { padding: 0; }
  .card, .dash-card { border: 0; box-shadow: none; }
}
