/* ──────────────────────────────────────────────────────────────
   Berkat Sales AI — Full-width bento dashboard · Plus Jakarta Sans only
   No sidebar, top nav, single-viewport "wow" landing with map
   ────────────────────────────────────────────────────────────── */

:root {
  --canvas: #FBFBFA;
  --canvas-2: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #F7F6F3;
  --surface-3: #F0EFEB;

  --ink: #1F2123;
  --ink-2: #4A4A4A;
  --ink-3: #787774;
  --ink-faint: #B8B5AE;

  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.10);

  --brand: #D6000D;
  --brand-2: #B00009;
  --brand-soft: #FDEBEC;
  --brand-soft-2: #FBD8DA;
  --brand-text: #9F2F2D;

  --alert: #D6000D;
  --alert-soft: #FDEBEC;
  --alert-fg: #9F2F2D;

  --tag-red-bg: #FDEBEC;    --tag-red-fg: #9F2F2D;
  --tag-amber-bg: #FBF3DB;  --tag-amber-fg: #956400;
  --tag-green-bg: #EDF3EC;  --tag-green-fg: #346538;
  --tag-blue-bg: #E1F3FE;   --tag-blue-fg: #1F6C9F;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 6px;
  --r-pill: 9999px;

  --font-sans: "Plus Jakarta Sans", "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  --duration: 220ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; }

/* ── Ambient ──────────────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 700px at 78% -10%, rgba(214, 0, 13, 0.035), transparent 60%),
    radial-gradient(700px 600px at -10% 30%, rgba(120, 119, 116, 0.04), transparent 60%);
  animation: ambient-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ambient-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1.5%, 1%, 0); }
}

/* ── Reveal ──────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in {
  opacity: 1; transform: translateY(0);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

/* ── Top header ──────────────────────────────────────── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(251, 251, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}

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

.header-brand .sba-logo {
  height: 42px;
  width: auto;
  display: block;
}

.header-brand .brand-divider {
  width: 1px;
  height: 26px;
  background: var(--border-strong);
}

.header-brand .brand-meta { display: flex; flex-direction: column; line-height: 1.15; }

.header-brand .brand-product {
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 13.5px;
  color: var(--ink);
}

.header-brand .brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  margin-left: 12px;
}

.header-nav .nav-item {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.header-nav .nav-item:hover { color: var(--ink); }
.header-nav .nav-item.active {
  background: var(--ink);
  color: white;
  font-weight: 600;
}
.header-nav .nav-item.dim { opacity: 0.45; cursor: default; }
.header-nav .nav-item.dim:hover { color: var(--ink-3); }

.nav-badge {
  display: inline-block;
  background: var(--brand);
  color: white;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  margin-left: 2px;
}
.nav-item.active .nav-badge { background: white; color: var(--ink); }

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  width: 220px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.search-row svg { width: 13px; height: 13px; opacity: 0.7; }

.icon-bubble {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.icon-bubble:hover { background: var(--surface-2); }
.icon-bubble svg { width: 15px; height: 15px; color: var(--ink-2); }

.icon-bubble.avatar-bubble {
  background: var(--ink);
  border-color: transparent;
  color: white;
  font-weight: 700;
  font-size: 12.5px;
}

.main {
  padding: 22px 28px 40px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Hero block ──────────────────────────────────────── */
.hero-block {
  position: relative;
  margin-bottom: 18px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px; height: 1px;
  background: var(--ink-3);
}

.hero-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
  color: var(--ink);
  max-width: 70%;
}
.hero-title em {
  font-style: normal;
  color: var(--brand);
  font-weight: 700;
}

.hero-meta-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.chip svg { width: 12px; height: 12px; }

.chip.brand-mark {
  background: transparent;
  border: none;
  padding: 0 4px 0 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.04em;
  color: var(--brand);
}

/* ── AI Insight floating card ─────────────────────────── */
.ai-insight-card {
  position: absolute;
  top: 6px;
  right: 0;
  width: 300px;
  background: var(--brand-soft);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  z-index: 2;
  box-shadow: 0 20px 36px -14px rgba(214, 0, 13, 0.18), 0 0 0 1px rgba(214, 0, 13, 0.10);
  transform: rotate(-2deg);
  transition: transform var(--duration) var(--ease);
}
.ai-insight-card:hover { transform: rotate(-1deg) translateY(-2px); }

.ai-insight-card .label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 8px;
}
.ai-insight-card .label svg { width: 12px; height: 12px; }
.ai-insight-card .text {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.ai-insight-card .text strong { color: var(--brand-text); font-weight: 700; }
.ai-insight-card .arrow-pin {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: rgba(214, 0, 13, 0.10);
  color: var(--brand);
  display: grid; place-items: center;
}
.ai-insight-card .arrow-pin svg { width: 11px; height: 11px; }

.ai-insight-card.layer-2 {
  width: 280px;
  top: 20px;
  right: -14px;
  z-index: 1;
  opacity: 0.55;
  transform: rotate(4deg);
  pointer-events: none;
}
.ai-insight-card.layer-3 {
  width: 270px;
  top: 32px;
  right: -28px;
  z-index: 0;
  opacity: 0.28;
  transform: rotate(8deg);
  pointer-events: none;
}

/* ── Bento — single-viewport layout ───────────────────── */
.bento {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 1.4fr;
  grid-template-rows: 150px 1fr;
  gap: 12px;
  height: calc(100vh - var(--header-h) - 22px - 195px - 40px);
  min-height: 480px;
  max-height: 620px;
  margin-bottom: 24px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.tile .tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tile .tile-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.tile .tile-label svg { width: 12px; height: 12px; }

.tile .expand-pin {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.tile .expand-pin svg { width: 10px; height: 10px; }

.tile-value {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.tile-value .unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
  letter-spacing: -0.01em;
}
.tile-value .delta {
  display: inline-block;
  margin-left: 8px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--tag-green-fg);
  vertical-align: middle;
}
.tile-value .delta.down { color: var(--brand); }

.tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  gap: 12px;
}

.tile-foot .lf, .tile-foot .rt {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tile-foot .rt { align-items: flex-end; text-align: right; }
.tile-foot .num {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.tile-foot .lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.barseg {
  display: flex;
  gap: 2px;
  height: 12px;
  margin-top: 4px;
}
.barseg span {
  flex: 1;
  background: var(--surface-3);
  border-radius: 2px;
}
.barseg span.on { background: var(--ink); }
.barseg span.warn { background: var(--brand); }

/* Tile spans for the layout */
.tile.kpi-omzet { grid-column: 1; grid-row: 1; }
.tile.kpi-toko  { grid-column: 2; grid-row: 1; }
.tile.kpi-anom  { grid-column: 3; grid-row: 1; }
.tile.ai-chat   { grid-column: 4; grid-row: 1 / span 2; }
.tile.map-tile  { grid-column: 1 / span 3; grid-row: 2; padding: 0; }

/* Donut tile (compact) */
.tile-gauge {
  display: flex;
  align-items: center;
  gap: 14px;
}
.donut {
  width: 92px; height: 92px;
  flex-shrink: 0;
  position: relative;
}
.donut svg { transform: rotate(-90deg); display: block; }
.donut .track { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.donut .fill  { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; }
.donut .center {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
}
.donut .center .num-row {
  display: inline-block;
  white-space: nowrap;
}
.donut .center .pct-unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 1px;
}

.gauge-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.gauge-meta .gauge-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--ink-2);
}
.gauge-meta .gauge-row .k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.gauge-meta .gauge-row .v { font-weight: 600; color: var(--ink); font-size: 12px; }

/* ── Map tile ─────────────────────────────────────────── */
.tile.map-tile {
  position: relative;
  overflow: hidden;
}
.tile.map-tile #dashboard-map-large {
  width: 100%; height: 100%;
  background: var(--surface-2);
}
.map-overlay-tl {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-overlay-tl .label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}
.map-overlay-tl .stat-row {
  display: flex;
  gap: 18px;
  align-items: baseline;
}
.map-overlay-tl .num {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.map-overlay-tl .stat-row .small {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.map-overlay-tl .stat-row .small strong { color: var(--brand); font-weight: 600; }

.map-overlay-tr {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 400;
  display: flex;
  gap: 6px;
}

.map-overlay-bl {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 400;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.map-overlay-bl .legend-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}

/* ── AI Chat tile ──────────────────────────────────────── */
.tile.ai-chat {
  padding: 0;
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.ai-chat-head {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ai-chat-head .label {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
}
.ai-chat-head .label svg { width: 12px; height: 12px; color: var(--brand); }
.ai-chat-head .expand-pin {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  border: none;
}
.ai-chat-head .expand-pin svg { width: 10px; height: 10px; }

.ai-chat-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg { display: flex; gap: 10px; }
.chat-msg .who {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.chat-msg .who.ai {
  background: rgba(214, 0, 13, 0.18);
  color: #FF8A91;
}
.chat-msg .body { flex: 1; min-width: 0; }
.chat-msg .name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.chat-msg .name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: white;
}
.chat-msg .ts {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.5);
}
.chat-msg .text {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  line-height: 1.5;
}
.chat-msg .hash-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  background: rgba(255,255,255,0.07);
  color: #FF8A91;
  padding: 3px 7px;
  border-radius: 4px;
}

.deviation-block {
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.deviation-block .head {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}
.deviation-block .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}
.deviation-block .row .k { color: rgba(255,255,255,0.7); }
.deviation-block .row .v {
  font-family: var(--font-mono);
  font-weight: 500;
  color: white;
  font-size: 11px;
}
.deviation-block .row.peak .v { color: #FF8A91; }
.deviation-block .progress {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.deviation-block .progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.ai-chat-foot {
  padding: 12px 16px 14px;
  display: flex;
  gap: 5px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ai-chat-foot .pill-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-pill);
  padding: 5px 11px;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ai-chat-foot .pill-btn svg { width: 11px; height: 11px; }
.ai-chat-foot .pill-btn:hover { background: rgba(255,255,255,0.10); }

/* ── Below-fold attention list ─────────────────────────── */
.attention-strip {
  margin-bottom: 24px;
}
.attention-strip .strip-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 14px;
}
.attention-strip .strip-head h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.attention-strip .strip-head h2 em { font-style: normal; color: var(--brand); }
.attention-strip .strip-head .sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 4px;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
  background: var(--surface);
}
.action-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.action-card.high { box-shadow: inset 3px 0 0 var(--brand); }
.action-card.med  { box-shadow: inset 3px 0 0 var(--tag-amber-fg); }

.priority-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--tag-red-bg);
  color: var(--tag-red-fg);
  margin-bottom: 10px;
}
.action-card.med .priority-pill { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }

.action-card .title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.action-card .summary {
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.action-card .meta {
  display: flex; gap: 14px; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.action-card .meta svg { width: 12px; height: 12px; opacity: 0.7; }
.action-card .meta .meta-item { display: inline-flex; align-items: center; gap: 5px; }

/* ── Drawer / Buttons / Misc — keep concise ────────────── */
.btn {
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 9px 16px;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--duration) var(--ease), transform 120ms var(--ease), border-color var(--duration) var(--ease);
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--ink); color: white; }
.btn.primary:hover { background: #2c2f33; }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.dark { background: var(--ink); color: white; }
.btn.dark:hover { background: #2c2f33; }
.btn.accent { background: var(--brand); color: white; }
.btn.accent:hover { background: var(--brand-2); }

.btn-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: grid; place-items: center;
}
.btn-icon:hover { background: var(--surface-2); }
.btn-icon svg { color: var(--ink-2); }

/* ── Drawer ─────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(31, 33, 35, 0.32);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 500px;
  max-width: 92vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 380ms var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.drawer-body { padding: 22px 28px; overflow-y: auto; flex: 1; }
.drawer-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

.drawer h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  margin: 22px 0 10px;
}
.section-label:first-child { margin-top: 0; }

.reasoning-list { padding-left: 18px; margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.reasoning-list li { margin-bottom: 6px; }

.kv-row {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--ink-3); }
.kv-val { font-weight: 500; color: var(--ink); }

.sku-list { display: flex; flex-direction: column; gap: 6px; }
.sku-item {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
  border-left: 2px solid var(--ink);
}

.score-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin: 8px 0 14px;
}
.score-bar > span {
  display: block; height: 100%;
  background: var(--brand);
  border-radius: var(--r-pill);
}

/* ── Map view (full /map route) ──────────────────────── */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 24px;
}

.topbar h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}
.topbar h1 .italic { font-style: normal; color: var(--brand); font-weight: 700; }

.topbar .sub {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.map-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  height: calc(100vh - var(--header-h) - 130px);
  min-height: 540px;
}

#map {
  width: 100%; height: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
}

.map-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.map-filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink-2);
}
.filter-pill.active { background: var(--ink); color: white; border-color: var(--ink); }

.legend-row { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px;
  vertical-align: middle;
}

.prospect-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
}
.prospect-row:hover { background: var(--surface-2); border-color: var(--border-strong); }
.score-chip {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.score-chip.high { background: var(--tag-red-bg); color: var(--tag-red-fg); }
.score-chip.mid { background: var(--tag-amber-bg); color: var(--tag-amber-fg); }
.score-chip.low { background: var(--surface-2); color: var(--ink-3); }
.prospect-row .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── WhatsApp simulator (unchanged) ─────────────────── */
.outreach-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-top: 12px;
}

.phone-frame {
  background: #15181B;
  border-radius: 26px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-width: 420px;
  margin: 0 auto;
  height: 640px;
}

.wa-screen {
  background: #ECE5DD;
  border-radius: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wa-header {
  background: #075E54;
  color: white;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.wa-header .avatar {
  background: #128C7E; color: white;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}

.wa-thread {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  position: relative;
  line-height: 1.5;
  word-wrap: break-word;
}
.bubble.me { background: #DCF8C6; align-self: flex-end; border-bottom-right-radius: 3px; }
.bubble.them { background: white; align-self: flex-start; border-bottom-left-radius: 3px; }
.bubble .ts {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: 4px;
  text-align: right;
}

.bubble.typing { display: inline-flex; gap: 4px; padding: 11px 14px; }
.bubble.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.wa-input {
  background: #F0F0F0;
  padding: 8px;
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.wa-input textarea {
  flex: 1; border: none; border-radius: 18px;
  padding: 8px 14px; resize: none;
  font-family: inherit; font-size: 13px;
  outline: none; min-height: 38px; max-height: 80px;
}
.wa-input .send-btn {
  background: #25D366; color: white; border: none;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.wa-input .send-btn svg { width: 16px; height: 16px; }
.wa-input .send-btn:disabled { background: #C7C7C7; cursor: not-allowed; }

.ai-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: flex-start;
}

.ai-suggest-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.ai-suggest-card .label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-suggest-card .label svg { width: 11px; height: 11px; }

.ai-suggest-card.success {
  background: var(--tag-green-bg);
  border-color: rgba(52, 101, 56, 0.15);
}
.ai-suggest-card.success .label { color: var(--tag-green-fg); }

.ai-parse-grid { display: flex; flex-direction: column; gap: 6px; }
.ai-parse-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.ai-parse-row .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.ai-parse-row .v { font-weight: 500; text-align: right; color: var(--ink); }

.briefing-card {
  background: var(--ink);
  color: white;
  border-radius: var(--r-lg);
  padding: 26px;
  margin-top: 16px;
}
.briefing-card h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: white;
}
.briefing-card .sub {
  color: rgba(255,255,255,0.55);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 18px;
}
.briefing-card .section-label { color: rgba(255,255,255,0.55); }
.briefing-card .kv-row { border-bottom-color: rgba(255,255,255,0.10); }
.briefing-card .kv-key { color: rgba(255,255,255,0.55); }
.briefing-card .kv-val { color: white; }
.briefing-card .talking-list { padding-left: 18px; font-size: 13px; color: rgba(255,255,255,0.88); line-height: 1.6; }
.briefing-card .talking-list li { margin-bottom: 6px; }

/* ── Dashboard Tour (Next-able guided walkthrough) ─── */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
}
.tour-backdrop.on { opacity: 1; pointer-events: auto; }

/* Used when a step has no target — full-screen dim for the welcome modal */
.tour-fallback-dim {
  position: fixed;
  inset: 0;
  z-index: 72;
  background: rgba(15, 16, 18, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms var(--ease);
}
.tour-fallback-dim.on { opacity: 1; }

/*
 * Highlight: a transparent box positioned exactly over the target.
 * The HUGE outward box-shadow paints the dim effect across the rest of
 * the viewport — everything OUTSIDE this rectangle is dimmed, but the
 * target visible inside the rectangle stays perfectly crisp.
 */
.tour-highlight {
  position: fixed;
  z-index: 76;
  border: 2px solid var(--brand);
  border-radius: var(--r-lg);
  pointer-events: none;
  opacity: 0;
  background: transparent;
  box-shadow:
    0 0 0 4px rgba(214, 0, 13, 0.20),
    0 0 28px rgba(214, 0, 13, 0.28),
    0 0 0 9999px rgba(15, 16, 18, 0.55);
  transition:
    top 360ms var(--ease),
    left 360ms var(--ease),
    width 360ms var(--ease),
    height 360ms var(--ease),
    opacity 280ms var(--ease);
}
.tour-highlight.on { opacity: 1; }

.tour-tooltip {
  position: fixed;
  z-index: 80;
  background: var(--ink);
  color: white;
  border-radius: var(--r-lg);
  padding: 22px 24px 20px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease), top 360ms var(--ease), left 360ms var(--ease);
}
.tour-tooltip.on {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tour-step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.tour-step-counter {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
  background: rgba(214, 0, 13, 0.14);
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.tour-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tour-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: white;
  line-height: 1.2;
}

.tour-body {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  margin: 0 0 18px;
}
.tour-body strong { color: white; font-weight: 600; }

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tour-nav {
  display: flex;
  gap: 6px;
}

.tour-btn {
  font-family: inherit;
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background var(--duration) var(--ease), transform 120ms var(--ease);
}
.tour-btn:active { transform: scale(0.97); }
.tour-btn.primary {
  background: var(--brand);
  color: white;
}
.tour-btn.primary:hover { background: var(--brand-2); }
.tour-btn.ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.tour-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

/* ── Story coach (legacy — kept for compatibility) ─── */
.story-coach {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 80;
  max-width: 620px;
  width: calc(100vw - 48px);
  font-size: 12.5px;
  animation: slideUp 380ms var(--ease);
  border: 1px solid rgba(255,255,255,0.08);
}
@keyframes slideUp {
  from { transform: translate(-50%, 16px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.story-coach .step-num {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  background: var(--brand);
  color: white;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.story-coach .step-body { flex: 1; line-height: 1.5; }
.story-coach .step-body strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.55);
}
.story-coach .step-actions { display: flex; gap: 6px; }
.story-coach button.skip {
  background: transparent; color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.12); border-radius: var(--r-sm);
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* ── Leaflet ───────────────────────────────────────── */
.leaflet-container { font-family: var(--font-sans) !important; background: var(--surface-2) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--r-md) !important; }
.leaflet-popup-content { margin: 14px 16px !important; font-size: 13px; color: var(--ink); }
.leaflet-control-zoom { border: none !important; }
.leaflet-control-zoom a {
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--ink) !important;
  border-radius: var(--r-sm) !important;
}

.hella-pin {
  background: var(--brand);
  border: 2px solid white;
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  color: white;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
}
.prospect-pin {
  border: 2px solid white;
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.prospect-pin.high { background: var(--brand); }
.prospect-pin.mid { background: #C99A4F; }
.prospect-pin.low { background: var(--ink-faint); }

/* ── Misc ───────────────────────────────────────── */
.hidden { display: none !important; }
.muted { color: var(--ink-3); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Insights kept lightweight */
.insight-list { display: flex; flex-direction: column; gap: 6px; }
.insight-card {
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border-left: 2px solid var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.insight-card .insight-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 4px;
}

/* ── Responsive guard ───────────────────────────── */
@media (max-width: 1280px) {
  .hero-title { font-size: 36px; max-width: 100%; }
  .header-tools .search-row { width: 160px; }
  .bento { grid-template-columns: 1fr 1fr 1fr 1.3fr; }
}
@media (max-width: 1080px) {
  .main { padding: 20px 18px 60px; }
  .header-nav .nav-item { padding: 6px 12px; font-size: 12px; }
  .header-tools .search-row { display: none; }
  .ai-insight-card { position: relative; top: auto; right: auto; transform: none; margin-top: 12px; width: 100%; }
  .ai-insight-card.layer-2, .ai-insight-card.layer-3 { display: none; }
  .bento { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 140px 240px auto; height: auto; }
  .tile.ai-chat { grid-column: 1 / span 3; grid-row: 3; min-height: 360px; }
  .tile.map-tile { grid-column: 1 / span 3; }
}
