/* ============================================================
   Carmi Agency · Showroom CRM
   Editorial-Scandinavian dashboard — extends the public site.
   ============================================================ */

:root {
  /* Palette — matches assets/styles.css on the public site */
  --bg:        #F7F2EB;
  --bg-soft:   #EFE8DD;
  --bg-warm:   #E8DFD0;
  --paper:     #FBF7F0;
  --surface:   #FFFFFF;
  --ink:       #1C1A17;
  --ink-2:     #3A3631;
  --ink-3:     #6B655C;
  --ink-4:     #9A938A;
  --line:      #E1D8C9;
  --line-soft: #EBE3D4;
  --line-2:    #D4C9B5;

  /* Logo star palette */
  --s-gold:    #F2C94C;
  --s-teal:    #2FBFBE;
  --s-pink:    #E8379E;
  --s-purple:  #7B4CAA;
  --s-green:   #7CC843;

  --accent:    var(--s-pink);
  --accent-2:  var(--s-teal);
  --accent-3:  var(--s-purple);
  --accent-4:  var(--s-gold);
  --accent-5:  var(--s-green);

  /* Type — same families as public site */
  --f-display: "Poiret One", "Didot", "Bodoni 72", serif;
  --f-body:    "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --f-mono:    "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Layout */
  --sidebar-w: 280px;
  --topbar-h:  76px;
  --gutter:    2rem;

  /* Motion — same easing curves as public site */
  --e-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --e-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --e-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:    180ms;
  --t-base:    320ms;
  --t-slow:    600ms;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(28,26,23,0.04), 0 2px 8px rgba(28,26,23,0.04);
  --shadow-md: 0 6px 24px rgba(28,26,23,0.06), 0 1px 4px rgba(28,26,23,0.04);
  --shadow-lg: 0 18px 48px rgba(28,26,23,0.10), 0 2px 8px rgba(28,26,23,0.05);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-weight: 400;
  overflow: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }

/* ─── Typography helpers ─── */
.eyebrow {
  font-family: var(--f-body);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  display: inline-block;
}
.display, h1, h2 {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.12;
  color: var(--ink);
  text-rendering: geometricPrecision;
}
h1 { font-size: clamp(1.85rem, 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.8vw, 1.85rem); }
h3 { font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
.lead {
  font-family: var(--f-body);
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.6;
  font-weight: 400;
}
.dim { color: var(--ink-3); }
.tabular { font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg);
}

/* ─── Sidebar ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 1.5rem 0 1.25rem;
  overflow: hidden;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--paper));
  pointer-events: none;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  transition: opacity var(--t-fast) var(--e-out);
}
.sidebar__brand:hover { opacity: 0.78; }
.sidebar__logo { height: 44px; width: auto; }
.sidebar__sub {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

.nav-section { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-label {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-4);
  padding: 0 0.85rem;
  margin-bottom: 0.35rem;
}
.nav-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.8; }
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.is-active {
  background: var(--ink);
  color: var(--bg);
}
.nav-item.is-active svg { opacity: 1; }
.nav-count {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.5rem;
  background: var(--bg-warm);
  border-radius: 999px;
}
.nav-item.is-active .nav-count { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.nav-pill {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
}
.nav-pill--accent {
  background: var(--accent);
  color: #fff;
}
.nav-item.is-active .nav-pill--accent { background: #fff; color: var(--accent); }

.sidebar__user { padding: 0.85rem 1rem 0; border-top: 1px solid var(--line); margin-top: 0.5rem; }
.user-card {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.65rem;
  border-radius: 12px;
  transition: background var(--t-fast) var(--e-out);
}
.user-card:hover { background: var(--bg-soft); }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--s-pink), var(--s-purple));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.user-role { font-size: 0.66rem; color: var(--ink-3); letter-spacing: 0.06em; white-space: nowrap; }

/* ─── Main column ─── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 242, 235, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  flex-shrink: 0;
}
.topbar__search {
  flex: 1;
  max-width: 540px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out);
}
.topbar__search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(28,26,23,0.04);
}
.topbar__search svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.topbar__search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.86rem;
  color: var(--ink);
}
.topbar__search input::placeholder { color: var(--ink-4); }
.topbar__search kbd {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-3);
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
}

.topbar__actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-family: var(--f-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1.5px solid transparent;
  transition: background var(--t-base) var(--e-out),
              color var(--t-base) var(--e-out),
              border-color var(--t-base) var(--e-out),
              transform var(--t-base) var(--e-out),
              box-shadow var(--t-base) var(--e-out);
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(232, 55, 158, 0.22);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}
.btn--soft {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--soft:hover { border-color: var(--ink); }
.btn--lg { padding: 0.85rem 1.5rem; font-size: 0.74rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  transition: background var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

.link-btn {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.link-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ─── View host ─── */
.view-host {
  flex: 1;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter) 4rem;
}
.view {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: view-in 0.45s var(--e-out);
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.view-head__inner { display: flex; flex-direction: column; gap: 0.35rem; }
.view-head h1 { margin: 0; }
.view-head .lead { max-width: 60ch; margin-top: 0.45rem; }
.view-head__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--t-base) var(--e-out), box-shadow var(--t-base) var(--e-out), transform var(--t-base) var(--e-out);
}
.card--hover:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; }
.card__title { font-size: 0.95rem; font-weight: 600; color: var(--ink); letter-spacing: 0.005em; }
.card__sub { font-size: 0.78rem; color: var(--ink-3); margin-top: 0.2rem; }

/* ============================================================
   Dashboard view
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.0;
  transition: opacity var(--t-base) var(--e-out);
}
.kpi:hover::before { opacity: 1; }
.kpi:nth-child(1)::before { background: var(--s-pink); }
.kpi:nth-child(2)::before { background: var(--s-teal); }
.kpi:nth-child(3)::before { background: var(--s-gold); }
.kpi:nth-child(4)::before { background: var(--s-purple); }
.kpi__label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.kpi__value {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi__delta {
  font-size: 0.74rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.kpi__delta strong { font-weight: 600; }
.kpi__delta--up strong { color: var(--s-green); }
.kpi__delta--down strong { color: var(--accent); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
}

/* Sales chart */
.chart {
  position: relative;
  height: 220px;
  margin-top: 0.5rem;
}
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .area { fill: url(#chart-grad); opacity: 0.85; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.chart .axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis-label { font-size: 10px; fill: var(--ink-4); letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--f-body); font-weight: 600; }
.chart .y-label { font-size: 10px; fill: var(--ink-3); font-family: var(--f-body); font-weight: 500; font-variant-numeric: tabular-nums; }
.chart .value-label { font-size: 11px; fill: var(--ink); font-family: var(--f-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .dot-bg { fill: #fff; }
.chart {
  height: 240px;
}

.legend { display: flex; gap: 1.25rem; align-items: center; }
.legend__item { display: flex; align-items: center; gap: 0.45rem; font-size: 0.74rem; color: var(--ink-3); }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; }

/* Activity feed */
.activity { display: flex; flex-direction: column; gap: 0.85rem; }
.activity__item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.activity__item:last-child { border-bottom: none; }
.activity__icon {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.activity__icon svg { width: 14px; height: 14px; }
.activity__icon--pink { background: rgba(232, 55, 158, 0.12); color: var(--s-pink); }
.activity__icon--teal { background: rgba(47, 191, 190, 0.14); color: var(--s-teal); }
.activity__icon--gold { background: rgba(242, 201, 76, 0.18); color: #b78d11; }
.activity__icon--purple { background: rgba(123, 76, 170, 0.14); color: var(--s-purple); }
.activity__icon--green { background: rgba(124, 200, 67, 0.14); color: #5a9931; }
.activity__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.activity__title { font-size: 0.84rem; color: var(--ink); font-weight: 500; line-height: 1.45; }
.activity__title strong { font-weight: 600; }
.activity__meta { font-size: 0.7rem; color: var(--ink-4); letter-spacing: 0.04em; }
.activity__time {
  font-size: 0.7rem;
  color: var(--ink-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.quick-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  text-align: left;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
.quick-tile:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-tile__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
}
.quick-tile__icon svg { width: 18px; height: 18px; }
.quick-tile__title { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.quick-tile__sub { font-size: 0.74rem; color: var(--ink-3); line-height: 1.5; }
.quick-tile--pink .quick-tile__icon { background: rgba(232, 55, 158, 0.12); color: var(--s-pink); }
.quick-tile--teal .quick-tile__icon { background: rgba(47, 191, 190, 0.14); color: var(--s-teal); }
.quick-tile--gold .quick-tile__icon { background: rgba(242, 201, 76, 0.18); color: #b78d11; }

/* ============================================================
   Tables
   ============================================================ */
.table-card { padding: 0; overflow: hidden; }
.table-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.table-card__filters { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.table-card__head-actions { display: flex; align-items: center; gap: 0.5rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.95rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table th {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr { transition: background var(--t-fast); cursor: pointer; }
.table tbody tr:hover { background: var(--bg-soft); }
/* Sortable headers */
.th-sort { cursor: pointer; user-select: none; transition: color var(--t-fast); }
.th-sort:hover { color: var(--ink); }
.th-caret { margin-left: 0.25rem; font-size: 0.7em; color: var(--s-pink); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.cell-retailer { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.retailer-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--s-pink), var(--s-purple));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: 0.92rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.retailer-mark[data-color="teal"] { background: linear-gradient(135deg, var(--s-teal), #1a8b8a); }
.retailer-mark[data-color="gold"] { background: linear-gradient(135deg, var(--s-gold), #d6a51c); color: var(--ink); }
.retailer-mark[data-color="purple"] { background: linear-gradient(135deg, var(--s-purple), #4d2e6d); }
.retailer-mark[data-color="green"] { background: linear-gradient(135deg, var(--s-green), #4f8a23); }
.retailer-mark[data-color="pink"] { background: linear-gradient(135deg, var(--s-pink), #b3216f); }
.retailer-name { display: flex; flex-direction: column; min-width: 0; }
.retailer-name__name { font-weight: 600; color: var(--ink); }
.retailer-name__loc { font-size: 0.74rem; color: var(--ink-3); }

/* Brand chips */
.brand-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--ink);
  padding: 0.28rem 0.62rem 0.28rem 0.42rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--t-fast);
}
.brand-chip:hover { border-color: var(--ink); }
.brand-chip__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--c, var(--ink-4));
  flex-shrink: 0;
}
.brand-chip[data-color="pink"]   { --c: var(--s-pink); }
.brand-chip[data-color="teal"]   { --c: var(--s-teal); }
.brand-chip[data-color="gold"]   { --c: var(--s-gold); }
.brand-chip[data-color="purple"] { --c: var(--s-purple); }
.brand-chip[data-color="green"]  { --c: var(--s-green); }
.brand-chip--more {
  font-size: 0.7rem;
  color: var(--ink-3);
  background: var(--bg-soft);
  border: none;
  padding: 0.32rem 0.58rem;
}

/* Status pills */
.status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--ink-4);
}
.status--active   { background: rgba(124, 200, 67, 0.14); color: #4f8a23; }
.status--active::before   { background: var(--s-green); }
.status--prospect { background: rgba(242, 201, 76, 0.20); color: #8b6912; }
.status--prospect::before { background: var(--s-gold); }
.status--lapsed   { background: rgba(232, 55, 158, 0.12); color: var(--s-pink); }
.status--lapsed::before   { background: var(--s-pink); }

/* Filter chips */
.filter-bar {
  display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:hover { border-color: var(--ink-4); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip__count { font-size: 0.66rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.chip.is-active .chip__count { color: rgba(255,255,255,0.6); }
.chip--ghost { background: transparent; }

.search-input {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 280px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(28,26,23,0.04); }
.search-input svg { width: 14px; height: 14px; color: var(--ink-3); }
.search-input input { border: none; outline: none; background: transparent; font-size: 0.8rem; flex: 1; }

/* ============================================================
   Brand catalog
   ============================================================ */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.brand-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
.brand-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.brand-card__hero {
  height: 200px;
  background: var(--bg-soft) center/cover no-repeat;
  background-position: center 28%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.brand-card__hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(28,26,23,0.32) 100%);
}
.brand-card__hero-mark {
  position: absolute;
  inset: auto auto 0.85rem 0.85rem;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.brand-card__hero-mark svg { width: 100%; height: 100%; }
.brand-card__body { padding: 1rem 1.25rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.brand-card__name { font-family: var(--f-display); font-size: 1.25rem; color: var(--ink); line-height: 1.1; }
.brand-card__tagline { font-size: 0.78rem; color: var(--ink-3); line-height: 1.5; min-height: 2.4em; }
.brand-card__meta {
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.7rem;
  color: var(--ink-4);
  letter-spacing: 0.06em;
}
.brand-card__meta strong { color: var(--ink); font-weight: 600; }

/* Star icon — used as mini brand badge */
.mini-star {
  width: 22px; height: 22px;
  display: inline-block;
  color: var(--star-color, var(--ink));
  flex-shrink: 0;
}
.mini-star svg { width: 100%; height: 100%; }
.mini-star path, .mini-star polygon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.mini-star--filled path, .mini-star--filled polygon { fill: currentColor; stroke: none; }

/* ============================================================
   AI Prospecting (Scrape) view
   ============================================================ */
.ai-hero {
  position: relative;
  background: linear-gradient(135deg, #1c1a17 0%, #2a2723 100%);
  color: #fff;
  padding: 2.5rem 2.5rem 2.25rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.ai-hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(232, 55, 158, 0.45) 0%, transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.ai-hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -8%;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(47, 191, 190, 0.35) 0%, transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.ai-hero__inner { position: relative; max-width: 740px; }
.ai-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.85rem;
}
.ai-hero__eyebrow::before {
  content: ""; width: 28px; height: 1px; background: rgba(255,255,255,0.7);
}
.ai-hero h1 { color: #fff; font-size: clamp(1.85rem, 2.6vw, 2.6rem); margin-bottom: 0.55rem; }
.ai-hero p { color: rgba(255,255,255,0.78); font-size: 0.95rem; line-height: 1.6; max-width: 56ch; }
.ai-hero__form {
  position: relative;
  margin-top: 1.5rem;
  display: flex; gap: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1.25rem;
  align-items: center;
  max-width: 620px;
}
.ai-hero__form input {
  flex: 1;
  border: none; outline: none; background: transparent;
  color: #fff;
  font-size: 0.95rem;
  padding: 0.65rem 0;
}
.ai-hero__form input::placeholder { color: rgba(255,255,255,0.5); }
.ai-hero__form .btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ai-hero__form .btn--primary:hover { background: #fff; color: var(--accent); border-color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,0.25); }

/* Scrape result table */
.scrape-results-wrap { display: flex; flex-direction: column; gap: 1rem; }
.scrape-meta {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scrape-meta__item { display: flex; flex-direction: column; gap: 0.2rem; }
.scrape-meta__label { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); }
.scrape-meta__value { font-family: var(--f-display); font-size: 1.4rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }

.scan-progress {
  margin-top: 1.25rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scan-step {
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.84rem;
  color: var(--ink-3);
  transition: color var(--t-base);
}
.scan-step.is-active { color: var(--ink); }
.scan-step.is-done { color: var(--ink); }
.scan-step__dot {
  width: 14px; height: 14px;
  border-radius: 999px;
  border: 2px solid var(--line-2);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  transition: all var(--t-base) var(--e-out);
}
.scan-step.is-active .scan-step__dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 55, 158, 0.12);
  animation: scan-pulse 1.4s ease-in-out infinite;
}
.scan-step.is-done .scan-step__dot {
  background: var(--accent);
  border-color: var(--accent);
}
.scan-step.is-done .scan-step__dot::after {
  content: "";
  position: absolute;
  left: 3px; top: 1.5px;
  width: 4px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes scan-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 55, 158, 0.12); }
  50%      { box-shadow: 0 0 0 8px rgba(232, 55, 158, 0.04); }
}
.scan-step__count {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Modals
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[hidden], .drawer[hidden] { display: none !important; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(28, 26, 23, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.25s var(--e-out);
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 3rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: panel-in 0.4s var(--e-out);
}
.modal__panel--lg { max-width: 880px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal__header {
  padding: 1.5rem 1.75rem 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 1.5rem; margin-top: 0.4rem; }
.modal__body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.modal__footer {
  padding: 1rem 1.75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.footer__note { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.74rem; color: var(--ink-3); }
.footer__note svg { width: 14px; height: 14px; color: var(--ink-4); }
.footer__actions { display: flex; gap: 0.6rem; }

/* ─── Form fields ─── */
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field__label {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.field__hint { font-size: 0.74rem; color: var(--ink-3); }
.field__row { display: flex; align-items: center; gap: 0.85rem; }
.field__row--between { justify-content: space-between; margin-top: 0.4rem; }
.field__actions { display: flex; gap: 1rem; }

.input, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--ink);
  font-family: var(--f-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  resize: vertical;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(28,26,23,0.05);
}
.input--lg { padding: 0.95rem 1.25rem; font-size: 0.95rem; }
.textarea { line-height: 1.6; min-height: 140px; }

/* Recipient picker */
.recipient-picker {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  min-height: 56px;
  align-items: center;
  transition: border-color var(--t-fast);
}
.recipient-picker:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(28,26,23,0.05); }
.recipient-picker input {
  flex: 1;
  min-width: 180px;
  border: none; outline: none; background: transparent;
  font-size: 0.84rem;
  padding: 0.35rem 0.4rem;
}
.recipient-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0.32rem 0.45rem 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink);
}
.recipient-chip__close {
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  transition: background var(--t-fast), color var(--t-fast);
}
.recipient-chip__close:hover { background: var(--ink); color: #fff; }
.recipient-chip__close svg { width: 10px; height: 10px; }

.recipient-suggestions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
  display: none;
}
.recipient-suggestions.is-open { display: block; }
.recipient-suggestion {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--t-fast);
}
.recipient-suggestion:last-child { border-bottom: none; }
.recipient-suggestion:hover, .recipient-suggestion.is-focused { background: var(--bg-soft); }
.recipient-suggestion__name { font-size: 0.84rem; font-weight: 500; color: var(--ink); }
.recipient-suggestion__meta { font-size: 0.72rem; color: var(--ink-3); margin-left: auto; }

/* Attachments */
.attachment-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.attachment {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.attachment:hover { border-color: var(--ink); background: var(--bg-soft); }
.attachment svg { width: 14px; height: 14px; color: var(--ink-3); }

/* Scrape modal specifics */
.scrape-intro p { color: var(--ink-2); }
.scrape-input { display: flex; gap: 0.6rem; align-items: stretch; margin-top: 0.5rem; }
.scrape-input .input { flex: 1; }
.scrape-suggestions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.scrape-results {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 80px;
}
.scrape-result {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  animation: result-in 0.45s var(--e-out) backwards;
}
.scrape-result:nth-child(1) { animation-delay: 0.04s; }
.scrape-result:nth-child(2) { animation-delay: 0.08s; }
.scrape-result:nth-child(3) { animation-delay: 0.12s; }
.scrape-result:nth-child(4) { animation-delay: 0.16s; }
.scrape-result:nth-child(5) { animation-delay: 0.20s; }
.scrape-result:nth-child(6) { animation-delay: 0.24s; }
.scrape-result:nth-child(7) { animation-delay: 0.28s; }
.scrape-result:nth-child(8) { animation-delay: 0.32s; }
@keyframes result-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.scrape-result__check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--t-fast);
}
.scrape-result.is-selected .scrape-result__check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.scrape-result__check svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--t-fast); }
.scrape-result.is-selected .scrape-result__check svg { opacity: 1; }
.scrape-result__main { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.scrape-result__name { font-weight: 600; color: var(--ink); font-size: 0.88rem; }
.scrape-result__meta { font-size: 0.74rem; color: var(--ink-3); }
.scrape-result__contact { font-size: 0.74rem; color: var(--ink-3); text-align: right; line-height: 1.5; }
.scrape-result__contact a { color: var(--ink-2); }
.scrape-result__contact a:hover { color: var(--accent); }
.scrape-result__source {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-4);
  padding: 0.22rem 0.55rem;
  background: var(--bg-soft);
  border-radius: 999px;
}

/* ============================================================
   Customer profile drawer
   ============================================================ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: flex-end;
}
.drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(28, 26, 23, 0.32);
  animation: fade-in 0.3s var(--e-out);
}
.drawer__panel {
  position: relative;
  width: min(640px, 100%);
  height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(28,26,23,0.10);
  overflow-y: auto;
  animation: drawer-in 0.4s var(--e-out);
}
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.profile-head {
  padding: 1.75rem 2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.85rem;
}
.profile-head__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.profile-head__id { display: flex; align-items: center; gap: 1rem; }
.profile-head .retailer-mark { width: 56px; height: 56px; font-size: 1.45rem; border-radius: 14px; }
.profile-head__name { font-family: var(--f-display); font-size: 2rem; line-height: 1.05; }
.profile-head__sub { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.25rem; }

.profile-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.profile-meta__cell { display: flex; flex-direction: column; gap: 0.2rem; }
.profile-meta__label { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; color: var(--ink-3); }
.profile-meta__value { font-size: 0.86rem; color: var(--ink); font-weight: 500; }

.profile-section { padding: 1.5rem 2rem; border-bottom: 1px solid var(--line); }
.profile-section:last-child { border-bottom: none; }
.profile-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.profile-section__title { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; color: var(--ink); }

.profile-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.profile-tags .brand-chip {
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem 0.4rem 0.55rem;
}
.profile-tag-add {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.profile-tag-add:hover { border-color: var(--ink); color: var(--ink); }
.profile-tag-add svg { width: 12px; height: 12px; }

.profile-orders { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-order {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.84rem;
  align-items: center;
}
.profile-order:last-child { border-bottom: none; }
.profile-order__name { color: var(--ink); }
.profile-order__name strong { font-weight: 600; }
.profile-order__brand { font-size: 0.72rem; color: var(--ink-3); }
.profile-order__date { font-size: 0.74rem; color: var(--ink-4); white-space: nowrap; }
.profile-order__amount { font-weight: 600; font-variant-numeric: tabular-nums; }

.profile-contacts { display: flex; flex-direction: column; gap: 0.7rem; }
.profile-contact {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  gap: 0.85rem;
  align-items: center;
}
.profile-contact__edit { width: 30px; height: 30px; color: var(--ink-3); flex-shrink: 0; }
.profile-contact__edit svg { width: 15px; height: 15px; }
.profile-contact__edit:hover { color: var(--ink); }
.profile-contact__avatar {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
}
.profile-contact__name { font-size: 0.88rem; font-weight: 500; color: var(--ink); }
.profile-contact__role { font-size: 0.72rem; color: var(--ink-3); }
.profile-contact__email { font-size: 0.74rem; color: var(--ink-3); text-align: right; }

/* Inline-editable status + pipeline-stage selects in the customer drawer */
.drawer-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  font-family: inherit; font-weight: 600;
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.32rem 1.55rem 0.32rem 0.7rem;
  background-color: var(--bg-soft); color: var(--ink-2);
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  cursor: pointer; max-width: 100%;
  transition: filter var(--t-fast);
}
.drawer-select:hover { filter: brightness(0.97); }
.drawer-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.drawer-status-select { font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.drawer-status-select.status--active   { background-color: rgba(124, 200, 67, 0.16); color: #4f8a23; }
.drawer-status-select.status--prospect { background-color: rgba(242, 201, 76, 0.22); color: #8b6912; }
.drawer-status-select.status--lapsed   { background-color: rgba(232, 55, 158, 0.14); color: var(--s-pink); }
.drawer-stage-select { font-size: 0.8rem; text-transform: capitalize; width: 100%; color: var(--ink); text-overflow: ellipsis; }

/* Destructive ghost button (e.g. remove contact) */
.btn--danger { color: var(--s-pink); }
.btn--danger:hover { background: rgba(232, 55, 158, 0.10); border-color: var(--s-pink); color: var(--s-pink); }

.profile-notes { font-size: 0.86rem; color: var(--ink-2); line-height: 1.7; }
.profile-notes p + p { margin-top: 0.85rem; }

.profile-actions {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 1rem 2rem;
  display: flex; gap: 0.6rem;
}

/* ============================================================
   Map view
   ============================================================ */
.view--map { gap: 1rem; }
.customer-map {
  height: calc(100vh - 280px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.customer-map .leaflet-container {
  background: #f4ecdf;
  font-family: var(--f-body);
}
.map-pin-wrap { background: transparent !important; border: none !important; }
.map-pin {
  position: relative;
  width: 16px; height: 16px;
}
.map-pin__dot {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--pin-color, var(--accent));
  border: 2.5px solid #fff;
  box-shadow: 0 1px 6px rgba(28,26,23,0.20), 0 0 0 2px var(--pin-color, var(--accent));
  transition: transform 0.18s var(--e-out), box-shadow 0.18s var(--e-out);
  cursor: pointer;
}
.map-pin__dot:hover {
  transform: scale(1.4);
  box-shadow: 0 4px 14px rgba(28,26,23,0.28), 0 0 0 4px rgba(28,26,23,0.06);
}
.map-pin__label { display: none; }
.leaflet-tooltip {
  background: var(--ink) !important;
  color: var(--bg) !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  padding: 0.55rem 0.75rem !important;
  font-family: var(--f-body) !important;
  font-weight: 500;
  box-shadow: var(--shadow-md) !important;
  line-height: 1.5;
}
.leaflet-tooltip-top:before { border-top-color: var(--ink) !important; }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--ink) !important; }

/* ============================================================
   Profile drawer — addresses + contact lines
   ============================================================ */
.profile-contactlines {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.profile-contactline {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  font-size: 0.84rem;
  gap: 0.6rem;
}
.profile-contactline__label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.profile-contactline a {
  color: var(--ink);
  border-bottom: 1px dashed var(--line-soft);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.profile-contactline a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.profile-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.profile-address {
  display: flex; flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.profile-address__label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.profile-address__body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-line;
}

@media (max-width: 720px) {
  .profile-addresses { grid-template-columns: 1fr; }
}

/* ============================================================
   Calendar
   ============================================================ */
.view--calendar { gap: 1rem; }
.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.calendar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.85rem;
}
.calendar__head h2 {
  font-family: var(--f-display);
  font-size: 1.6rem;
  margin: 0;
}
.calendar__legend { display: flex; gap: 1rem; flex-wrap: wrap; }
.cal-legend {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; color: var(--ink-3);
  letter-spacing: 0.06em;
}
.cal-legend__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.calendar__weekday {
  padding: 0.6rem 0.85rem;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  text-align: left;
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(96px, auto);
}
.calendar__cell {
  padding: 0.45rem 0.55rem 0.5rem;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface);
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.calendar__cell.is-other { background: var(--bg-soft); }
.calendar__cell.is-other .calendar__date { color: var(--ink-4); }
.calendar__cell.is-today { background: rgba(232, 55, 158, 0.04); }
.calendar__cell:nth-child(7n) { border-right: none; }
.calendar__date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.calendar__cell.is-today .calendar__date {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 999px;
  font-size: 0.74rem;
}
.calendar__events {
  display: flex; flex-direction: column;
  gap: 0.18rem;
}
.cal-event {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  line-height: 1.3;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  border-left: 3px solid var(--c, var(--accent));
}
.cal-event__dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--c, var(--accent));
  flex-shrink: 0;
}
.cal-event--more {
  background: transparent;
  border-left: none;
  color: var(--ink-3);
  font-style: italic;
  padding-left: 0.4rem;
}
.cal-event--scheduled { font-style: italic; }
.calendar__cell { position: relative; }
.calendar__add {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.calendar__cell:hover .calendar__add { opacity: 1; }
.calendar__add:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: scale(1.08); }
.cal-event[data-action="edit-cal-event"] { cursor: pointer; }
.calendar__cell[data-action] { cursor: pointer; }

.attachment--filled {
  background: var(--surface);
  border-style: solid;
  border-color: var(--line);
  cursor: default;
}
.attachment--filled:hover { background: var(--surface); border-color: var(--ink-4); }
.attachment .recipient-chip__close { margin-left: 0.25rem; }

.cal-event {
  display: block;
  width: 100%;
  font-size: 0.66rem;
  line-height: 1.3;
  padding: 0.16rem 0.4rem 0.16rem 0.45rem;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  border-left: 3px solid var(--c, var(--accent));
  box-sizing: border-box;
}
.cal-event__dot { display: none; }

.calendar__weekdays {
  position: sticky;
  top: 0;
  z-index: 1;
}

@media (max-width: 980px) {
  .calendar__grid { grid-auto-rows: minmax(80px, auto); }
  .calendar__head { padding: 0.85rem 1rem; }
  .calendar__head h2 { font-size: 1.3rem; }
  .calendar__legend { display: none; }
  .cal-event { font-size: 0.6rem; padding: 0.1rem 0.32rem; }
}
@media (max-width: 640px) {
  .calendar__grid { grid-auto-rows: minmax(64px, auto); }
  .calendar__cell { padding: 0.32rem 0.36rem; }
  .calendar__weekday { padding: 0.4rem 0.5rem; font-size: 0.54rem; }
  .calendar__date { font-size: 0.7rem; }
  .cal-event { font-size: 0.56rem; padding: 0.08rem 0.28rem; border-left-width: 2px; }
}

/* Sales-by-brand horizontal bar chart */
.brand-bars {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-top: 0.5rem;
}
.brand-bar {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  align-items: center;
  gap: 1rem;
  font-size: 0.84rem;
}
.brand-bar__label {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--ink);
  font-weight: 500;
}
.brand-bar__track {
  height: 18px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.brand-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s var(--e-out);
  min-width: 4px;
}
.brand-bar__value {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 720px) {
  .brand-bar { grid-template-columns: 1fr; gap: 0.3rem; }
  .brand-bar__value { text-align: left; }
}

/* Multi-email contact display */
.profile-contact__emails {
  display: flex; flex-direction: column; gap: 0.18rem;
  align-items: flex-end;
  font-size: 0.74rem;
  color: var(--ink-3);
}
.profile-contact__emails a {
  color: var(--ink-2);
  border-bottom: 1px dashed transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.profile-contact__emails a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Settings — toggle, signature, header preview */
.toggle {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: #fff;
  transition: transform var(--t-fast) var(--e-out);
}
.toggle input[type="checkbox"]:checked {
  background: var(--ink);
}
.toggle input[type="checkbox"]:checked::before {
  transform: translateX(16px);
}

.email-header-preview {
  margin-top: 1rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-warm) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.email-header-preview img { height: 64px; width: auto; }

.signature-editor { display: flex; flex-direction: column; gap: 0.85rem; }
.signature-preview {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.signature-text {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.signature-text strong { color: var(--ink); font-weight: 600; }
.signature-text a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.signature-logo { height: 56px; width: auto; opacity: 0.92; }
@media (max-width: 720px) {
  .signature-preview { flex-direction: column; align-items: flex-start; }
}

/* AI prefill multi-line rows */
.ai-prefill__row--multi { align-items: flex-start; }
.ai-prefill__row--multi .ai-prefill__label { padding-top: 0.45rem; }
.ai-prefill__value textarea.ai-field {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  color: inherit;
  resize: vertical;
}
.ai-prefill__value textarea.ai-field:focus {
  outline: none;
  border-style: solid;
  border-color: var(--ink);
}

/* ============================================================
   Login screen
   ============================================================ */
.login {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  animation: fade-in 0.5s var(--e-out);
}
.login__inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.85rem;
  max-width: 620px;
  width: 100%;
  text-align: center;
}
.login__brand {
  display: flex; align-items: center; gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.login__brand img { height: 56px; width: auto; }
.login__sub {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  white-space: nowrap;
}
.login h1 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  margin-top: 0.5rem;
}
.login .lead { color: var(--ink-2); max-width: 50ch; line-height: 1.6; }
.login__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
}
.login__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem 1.5rem 1.6rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  text-align: center;
}
.login__card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.login__avatar {
  width: 84px; height: 84px;
  border-radius: 999px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.login__avatar--initial {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: 2.6rem;
  background: linear-gradient(135deg, var(--s-pink), var(--s-purple));
  color: #fff;
  letter-spacing: 0.02em;
}
.login__name { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.1; }
.login__role {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.login__cta {
  margin-top: 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.6rem;
  border-top: 1px solid var(--line-soft);
  width: 100%;
  transition: color var(--t-base);
}
.login__card:hover .login__cta { color: var(--accent); }
.login__footer {
  font-size: 0.74rem;
  color: var(--ink-4);
  margin-top: 1.5rem;
  max-width: 50ch;
  line-height: 1.6;
}

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

/* Supabase email/password form */
.login__shortcuts {
  display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
  margin-top: 0.5rem;
}
.login__shortcut {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.85rem 0.45rem 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.login__shortcut:hover { border-color: var(--ink); transform: translateY(-1px); }
.login__avatar-sm {
  width: 28px; height: 28px;
  border-radius: 999px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.login__avatar-sm.login__avatar--initial {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--s-pink), var(--s-purple));
  color: #fff;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 380px;
  margin-top: 1rem;
  text-align: left;
}
.login__form .field { gap: 0.35rem; }
.login__form .input--lg {
  padding: 0.95rem 1.15rem;
  font-size: 0.95rem;
  border-radius: 12px;
}
.login__form .btn--lg {
  margin-top: 0.4rem;
  padding: 0.95rem 1.5rem;
  justify-content: center;
}
.login__error {
  padding: 0.75rem 1rem;
  background: rgba(232, 55, 158, 0.08);
  border: 1px solid rgba(232, 55, 158, 0.28);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.84rem;
  text-align: center;
}

/* User card avatar — supports photo OR initials */
.user-avatar {
  /* base: initials look (default for any non-photo user) */
  background-image: none;
  text-indent: 0;
}
.user-avatar.user-avatar--photo {
  text-indent: -9999px;
}
.user-logout {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--t-fast), color var(--t-fast);
}
.user-card:hover .user-logout { opacity: 1; }
.user-logout:hover { color: var(--accent); }

/* ============================================================
   Toasts
   ============================================================ */
.toast-host {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex; flex-direction: column; gap: 0.6rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  font-size: 0.86rem;
  letter-spacing: 0.005em;
  animation: toast-in 0.4s var(--e-spring);
  min-width: 260px;
  max-width: 380px;
}
.toast svg { width: 16px; height: 16px; color: var(--s-green); flex-shrink: 0; }
.toast--error svg { color: #ff7a9c; }
.toast--error { border-left: 3px solid #ff7a9c; }
.toast.is-leaving { animation: toast-out 0.3s var(--e-out) forwards; }
@keyframes toast-in { from { transform: translateY(20px) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(20px) scale(0.95); opacity: 0; } }

/* ============================================================
   Empty / loading states
   ============================================================ */
.empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.empty__title { font-family: var(--f-display); font-size: 1.4rem; color: var(--ink); }
.empty__sub { font-size: 0.86rem; max-width: 40ch; line-height: 1.6; }

/* ============================================================
   Add Customer modal — tabs, manual fields, AI lookup, CSV
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 1.75rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
  margin-bottom: -1px;
}
.tab svg { width: 14px; height: 14px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel { animation: tab-in 0.32s var(--e-out); display: flex; flex-direction: column; gap: 1.1rem; }
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.divider {
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3);
  margin: 0.4rem 0 -0.25rem;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider span { white-space: nowrap; }

.brand-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.45rem;
}
.brand-toggle {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  text-align: left;
  font-weight: 500;
  color: var(--ink-2);
}
.brand-toggle__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.brand-toggle:hover { border-color: var(--ink-4); color: var(--ink); }
.brand-toggle.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236B655C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
  cursor: pointer;
}

/* ─── AI Lookup ──────────────────────────────────────────────── */
.ai-lookup__form {
  display: flex; gap: 0.5rem; align-items: stretch;
  margin-top: 0.4rem;
}
.ai-lookup__form input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ai-lookup__form input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(28,26,23,0.05); }
.ai-lookup__form .btn { white-space: nowrap; }
.ai-lookup__suggestions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

.ai-source-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  margin: 0.5rem 0 1rem;
}
.ai-source {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--ink-3);
}
.ai-source svg { width: 12px; height: 12px; color: var(--ink-4); }

.ai-prefill {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem 1.25rem;
  display: flex; flex-direction: column;
}
.ai-prefill__row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  font-size: 0.86rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.ai-prefill__row:last-child { border-bottom: none; }
.ai-prefill__label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.ai-prefill__value { font-weight: 500; color: var(--ink); min-width: 0; }
.ai-prefill__value input.ai-field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line-soft);
  font: inherit;
  color: inherit;
  padding: 0.25rem 0;
}
.ai-prefill__value input.ai-field:focus {
  outline: none;
  border-bottom-color: var(--ink);
  border-bottom-style: solid;
}
.ai-prefill__confidence {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ai-prefill__confidence--high { background: rgba(124, 200, 67, 0.16); color: #4f8a23; }
.ai-prefill__confidence--med  { background: rgba(242, 201, 76, 0.22); color: #8b6912; }
.ai-prefill__confidence--low  { background: rgba(154, 147, 138, 0.18); color: var(--ink-3); }

.callout {
  padding: 0.85rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.84rem;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.callout--warn {
  background: rgba(232, 55, 158, 0.06);
  border-color: rgba(232, 55, 158, 0.22);
  color: var(--ink);
}
.callout .link-btn { color: var(--accent); border-bottom-color: transparent; }
.callout .link-btn:hover { border-bottom-color: var(--accent); }

/* ─── CSV Import ─────────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.65rem;
  padding: 2.5rem 1.5rem;
  background: var(--paper);
  border: 2px dashed var(--line-2);
  border-radius: 14px;
  text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--ink);
  background: var(--bg-soft);
}
.dropzone.is-drag { transform: scale(1.005); }
.dropzone svg { width: 36px; height: 36px; color: var(--ink-3); }
.dropzone__title { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.dropzone__sub { font-size: 0.78rem; color: var(--ink-3); max-width: 40ch; line-height: 1.5; }

.csv-preview { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.25rem; }
.csv-preview__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.csv-preview__filename {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; color: var(--ink); font-size: 0.86rem;
}
.csv-preview__filename svg {
  width: 18px; height: 18px;
  color: #fff;
  background: var(--s-green);
  border-radius: 999px;
  padding: 3px;
}

.csv-mapping {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.csv-mapping table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.csv-mapping th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 140px;
  white-space: nowrap;
}
.csv-mapping td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 220px;
  overflow: hidden;
}
.csv-mapping tbody tr:last-child td { border-bottom: none; }
.csv-mapping-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.32rem 1.7rem 0.32rem 0.5rem;
  font-size: 0.74rem;
  color: var(--ink);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8' fill='none' stroke='%236B655C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  cursor: pointer;
}
.csv-mapping-select:focus { outline: none; border-color: var(--ink); }

/* Make the customer modal body roomy enough to show CSV mapping */
#customer-modal .modal__panel { max-width: 920px; }
#customer-modal .modal__body { max-height: calc(100vh - 240px); }

/* ── Brand tags (Essentials, Women's, etc.) ────────────────── */
.brand-card__tag {
  display: inline-block;
  font-family: var(--f-body, sans-serif);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  background: var(--bg-soft, #f4f3f0);
  color: var(--ink-3, #888);
  vertical-align: middle;
  margin-left: 0.35rem;
  position: relative;
  top: -1px;
}

/* ─── Activity feed (#5) ──────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.activity-entry:last-child { border-bottom: none; }
.activity-entry__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: var(--ink-3);
}
.activity-entry__dot[data-type="created"] { background: var(--s-green); }
.activity-entry__dot[data-type="edited"] { background: var(--s-teal); }
.activity-entry__dot[data-type="order"] { background: var(--s-gold); }
.activity-entry__dot[data-type="note"] { background: var(--s-pink); }
.activity-entry__dot[data-type="brand-added"],
.activity-entry__dot[data-type="brand-removed"] { background: var(--s-purple); }
.activity-entry__dot[data-type="deleted"] { background: #c44; }
.activity-entry__body { flex: 1; min-width: 0; }
.activity-entry__text {
  font-size: 0.82rem;
  color: var(--ink);
  display: block;
}
.activity-entry__meta {
  font-size: 0.72rem;
  display: block;
  margin-top: 0.15rem;
}

/* ─── Deal stage pills (#9) ──────────────────────────────── */
.deal-stage {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.deal-stage--won { background: color-mix(in srgb, var(--s-green) 18%, transparent); color: var(--s-green); }
.deal-stage--negotiating { background: color-mix(in srgb, var(--s-teal) 18%, transparent); color: var(--s-teal); }
.deal-stage--meeting-booked,
.deal-stage--samples-sent { background: color-mix(in srgb, var(--s-purple) 18%, transparent); color: var(--s-purple); }
.deal-stage--line-sheets-sent { background: color-mix(in srgb, var(--s-gold) 18%, transparent); color: var(--s-gold); }
.deal-stage--contacted { background: color-mix(in srgb, var(--s-teal) 18%, transparent); color: var(--s-teal); }
.deal-stage--lost { background: color-mix(in srgb, var(--s-pink) 18%, transparent); color: #c44; }

/* ─── Timestamped notes (#10) ────────────────────────────── */
.note-entry { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.note-entry:last-child { border-bottom: none; }
.note-entry p { margin: 0 0 0.2rem; font-size: 0.84rem; color: var(--ink); }
.note-meta { font-size: 0.72rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}
/* Hamburger + nav scrim are hidden on desktop; the 820px block below reveals them.
   These must precede the media query so the mobile rules win on source order. */
.nav-toggle { display: none; }
.nav-scrim { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  /* Sidebar becomes an off-canvas drawer instead of vanishing entirely. */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(82vw, 290px);
    z-index: 60;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    transform: translateX(-100%);
    transition: transform 0.26s var(--e-out);
  }
  .app.nav-open .sidebar { transform: translateX(0); box-shadow: 2px 0 28px rgba(20, 18, 15, 0.22); }
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(20, 18, 15, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 0.26s ease;
  }
  .app.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .topbar__search { max-width: none; }
  .topbar__actions .btn span { display: none; }
  .quick-grid { grid-template-columns: 1fr; }
  .profile-meta { grid-template-columns: 1fr 1fr; }
  /* 16px on text-entry controls stops iOS Safari auto-zooming on focus. */
  .input, .input--lg, .textarea,
  .search-input input, .topbar__search input,
  .recipient-picker input { font-size: 16px; }
}
/* Calendar "+" add button: always visible & finger-sized on touch devices. */
@media (hover: none) {
  .calendar__add { opacity: 1; width: 30px; height: 30px; }
}

/* ============================================================
   Enhanced mobile responsiveness
   ============================================================ */

/* ─── Phone (max-width: 640px) ─── */
@media (max-width: 640px) {

  /* Layout */
  :root {
    --gutter: 1rem;
    --topbar-h: 60px;
  }
  .view-host {
    padding: 1rem var(--gutter) 3rem;
  }
  .view {
    gap: 1.25rem;
  }

  /* View headers — stack vertically */
  .view-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .view-head__actions {
    width: 100%;
    flex-direction: column;
  }
  .view-head__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* KPI grid — 2 columns */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .kpi {
    padding: 1rem 1.1rem;
  }
  .kpi__value {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }

  /* Quick tiles — single column */
  .quick-grid {
    grid-template-columns: 1fr;
  }

  /* Dashboard grid */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Tables — horizontal scroll */
  .table-card {
    border-radius: var(--radius-sm);
  }
  .table-card__head {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
  }
  .table-card__filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }
  .table-card__filters::-webkit-scrollbar {
    display: none;
  }
  .table-card__filters .chip {
    flex-shrink: 0;
  }
  .table-card .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table th,
  .table td {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }

  /* Filter bars — horizontal scroll */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }
  .filter-bar::-webkit-scrollbar {
    display: none;
  }
  .filter-bar .chip {
    flex-shrink: 0;
  }

  /* Search input */
  .search-input {
    width: 100%;
  }

  /* Brand cards — single column */
  .brand-grid {
    grid-template-columns: 1fr;
  }
  .brand-card__hero {
    height: 190px;
  }

  /* Customer form modal — full-width, stacked fields */
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  .modal__panel {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal__panel--lg {
    max-width: 100%;
  }
  #customer-modal .modal__panel {
    max-width: 100%;
  }
  .modal__header {
    padding: 1.15rem 1.25rem 1rem;
  }
  .modal__title {
    font-size: 1.25rem;
  }
  .modal__body {
    padding: 1.15rem 1.25rem;
  }
  .modal__footer {
    padding: 0.85rem 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  .footer__actions {
    width: 100%;
    flex-direction: column;
  }
  .footer__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* Tabs inside modals */
  .tabs {
    padding: 0 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    flex-shrink: 0;
    padding: 0.85rem 0.75rem;
    font-size: 0.74rem;
  }

  /* AI prefill rows */
  .ai-prefill__row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.6rem 0;
  }
  .ai-prefill__confidence {
    justify-self: start;
  }

  /* AI lookup form */
  .ai-lookup__form {
    flex-direction: column;
  }
  .ai-lookup__form input {
    width: 100%;
  }

  /* Email composer modal */
  .recipient-picker {
    min-height: 48px;
  }
  .recipient-picker input {
    min-width: 120px;
  }
  .textarea {
    min-height: 120px;
  }
  .attachment-picker {
    flex-direction: column;
  }
  .attachment-picker .attachment {
    width: 100%;
    justify-content: center;
  }

  /* Profile drawer — full-width */
  .drawer__panel {
    width: 100%;
  }
  .profile-head {
    padding: 1.25rem 1.25rem 1rem;
  }
  .profile-head__name {
    font-size: 1.6rem;
  }
  .profile-head .retailer-mark {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
    border-radius: 12px;
  }
  .profile-meta {
    grid-template-columns: 1fr 1fr;
    padding: 1rem 1.25rem;
    gap: 0.85rem;
  }
  .profile-section {
    padding: 1.15rem 1.25rem;
  }
  .profile-addresses {
    grid-template-columns: 1fr;
  }
  .profile-order {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
  .profile-order__date {
    grid-column: 1 / -1;
    font-size: 0.7rem;
  }
  .profile-contact {
    grid-template-columns: 32px 1fr auto;
    gap: 0.65rem;
  }
  .profile-contact__avatar {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }
  .profile-contact__email,
  .profile-contact__emails {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: calc(32px + 0.65rem);
  }
  .profile-actions {
    padding: 0.85rem 1.25rem;
    flex-direction: column;
  }
  .profile-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Calendar */
  .calendar__head h2 {
    font-size: 1.2rem;
  }
  .cal-event {
    font-size: 0.54rem;
    padding: 0.06rem 0.22rem;
    border-left-width: 2px;
  }

  /* AI hero section */
  .ai-hero {
    padding: 1.75rem 1.5rem 1.5rem;
  }
  .ai-hero h1 {
    font-size: clamp(1.4rem, 5vw, 1.85rem);
  }
  .ai-hero__form {
    flex-direction: column;
    border-radius: var(--radius);
    padding: 0.85rem;
    gap: 0.65rem;
  }
  .ai-hero__form input {
    padding: 0.5rem 0;
  }
  .ai-hero__form .btn {
    width: 100%;
    justify-content: center;
  }

  /* Scrape results */
  .scrape-result {
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
  }
  .scrape-result__contact {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: calc(22px + 0.65rem);
  }
  .scrape-result__source {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: calc(22px + 0.65rem);
  }
  .scrape-meta {
    flex-direction: column;
    gap: 0.85rem;
  }

  /* Topbar */
  .topbar {
    padding: 0 var(--gutter);
    gap: 0.75rem;
  }
  .topbar__search kbd {
    display: none;
  }

  /* Cards */
  .card {
    padding: 1.15rem;
    border-radius: var(--radius-sm);
  }

  /* Chart */
  .chart {
    height: 180px;
  }

  /* Brand bars */
  .brand-bar {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .brand-bar__value {
    text-align: left;
  }

  /* Toasts */
  .toast-host {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
  }

  /* Login */
  .login__cards {
    grid-template-columns: 1fr;
  }
  .login__avatar {
    width: 68px;
    height: 68px;
  }
  .login__avatar--initial {
    font-size: 2rem;
  }
  .login__name {
    font-size: 1.3rem;
  }

  /* CSV mapping scroll */
  .csv-mapping {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .csv-mapping table {
    min-width: 480px;
  }

  /* Signature preview */
  .signature-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Dropzone */
  .dropzone {
    padding: 2rem 1.25rem;
  }
}

/* ─── Small phone (max-width: 480px) ─── */
@media (max-width: 480px) {

  /* KPI grid — single column */
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi__value {
    font-size: 1.4rem;
  }

  /* Profile meta — single column */
  .profile-meta {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  /* Calendar — tighter cells */
  .calendar__grid {
    grid-auto-rows: minmax(52px, auto);
  }
  .calendar__cell {
    padding: 0.22rem 0.25rem;
  }
  .calendar__date {
    font-size: 0.64rem;
  }
  .calendar__cell.is-today .calendar__date {
    width: 18px;
    height: 18px;
    font-size: 0.62rem;
  }
  .cal-event {
    font-size: 0;
    padding: 0;
    height: 4px;
    border-radius: 2px;
    border-left-width: 0;
    margin: 1px 0;
  }
  .calendar__weekday {
    padding: 0.35rem 0.25rem;
    font-size: 0.48rem;
    letter-spacing: 0.1em;
    text-align: center;
  }
  .calendar__head {
    padding: 0.65rem 0.85rem;
  }
  .calendar__head h2 {
    font-size: 1.1rem;
  }
  .calendar__add {
    display: none;
  }

  /* Modal — fully anchored */
  .modal__panel {
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }
  .modal__header {
    padding: 1rem;
  }
  .modal__body {
    padding: 1rem;
  }
  .modal__footer {
    padding: 0.75rem 1rem;
  }

  /* Topbar — compact */
  .topbar {
    height: 52px;
  }
  .topbar__search {
    padding: 0.45rem 0.7rem;
  }
  .topbar__search input {
    font-size: 0.8rem;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  /* View head */
  h1 {
    font-size: clamp(1.4rem, 5vw, 1.85rem);
  }
  h2 {
    font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  }

  /* Activity feed */
  .activity__item {
    grid-template-columns: 28px 1fr;
    gap: 0.65rem;
  }
  .activity__icon {
    width: 28px;
    height: 28px;
  }
  .activity__icon svg {
    width: 12px;
    height: 12px;
  }
  .activity__time {
    grid-column: 2;
    font-size: 0.66rem;
  }

  /* Buttons — slightly smaller */
  .btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.66rem;
  }
  .btn--lg {
    padding: 0.75rem 1.2rem;
    font-size: 0.7rem;
  }

  /* Brand card */
  .brand-card__hero {
    height: 170px;
  }
  .brand-card__body {
    padding: 0.85rem 1rem;
  }
  .brand-card__name {
    font-size: 1.1rem;
  }

  /* Profile drawer — tighter padding */
  .profile-head {
    padding: 1rem;
  }
  .profile-head__name {
    font-size: 1.35rem;
  }
  .profile-section {
    padding: 1rem;
  }
  .profile-actions {
    padding: 0.75rem 1rem;
  }

  /* Scrape input */
  .scrape-input {
    flex-direction: column;
  }

  /* Email header preview */
  .email-header-preview {
    padding: 1rem 1.25rem;
  }
  .email-header-preview img {
    height: 48px;
  }

  /* Login form */
  .login h1 {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }
  .login__card {
    padding: 1.5rem 1.15rem 1.25rem;
  }

  /* Legend */
  .legend {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ============================================================
   Bulk select · contact-card sharing · swipe-to-delete · dedupe
   ============================================================ */
.col-select { width: 44px; text-align: center; padding-left: 1.1rem !important; padding-right: 0.25rem !important; }
.row-select, #select-all-customers {
  width: 17px; height: 17px;
  accent-color: var(--s-pink);
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}
.table tbody tr.is-selected { background: rgba(232, 55, 158, 0.07); }
.table tbody tr.is-selected:hover { background: rgba(232, 55, 158, 0.10); }

/* Selection action bar (sits between filters and the table) */
.selection-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--bg);
  border-bottom: 1px solid var(--line);
  animation: selbar-in 0.18s var(--e-out);
}
.selection-bar[hidden] { display: none; }
@keyframes selbar-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.selection-bar__count { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; }
.selection-bar__actions { display: flex; align-items: center; gap: 0.5rem; }
.selection-bar .btn {
  padding: 0.42rem 0.85rem;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.10);
  color: var(--bg);
  border-color: rgba(255, 255, 255, 0.22);
}
.selection-bar .btn:hover { background: rgba(255, 255, 255, 0.20); border-color: rgba(255, 255, 255, 0.4); }
.selection-bar .link-btn { color: rgba(255, 255, 255, 0.7); border: none; padding: 0.3rem 0.2rem; }
.selection-bar .link-btn:hover { color: #fff; }

/* Swipe-to-delete (slide a customer row to the right) */
.table tbody tr.swipe-row { will-change: transform; }
.table tbody tr.is-swiping { transition: none !important; position: relative; z-index: 2; }
.table tbody tr.is-swiping td {
  background-image: linear-gradient(90deg, rgba(232, 55, 158, 0.22), rgba(232, 55, 158, 0) 60%);
}
.table tbody tr.is-swipe-armed td { background-color: rgba(232, 55, 158, 0.16); }
.table tbody tr.is-swipe-armed .retailer-mark {
  background: linear-gradient(135deg, var(--s-pink), #b3216f) !important;
  color: #fff !important;
}

/* Duplicate cleanup modal */
.dupe-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.dupe-group__head {
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-soft);
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.dupe-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.9rem;
}
.dupe-item + .dupe-item { border-top: 1px solid var(--line-soft); }
.dupe-item.is-del { opacity: 0.5; }
.dupe-item__main { flex: 1; min-width: 0; }
.dupe-item__name { font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.dupe-item__meta { font-size: 0.74rem; color: var(--ink-3); margin-top: 0.1rem; }
.dupe-toggle {
  flex-shrink: 0;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  transition: all var(--t-fast);
}
.dupe-toggle--keep { background: rgba(124, 200, 67, 0.14); color: #4f8a23; border-color: transparent; }
.dupe-toggle--del { background: rgba(232, 55, 158, 0.12); color: var(--s-pink); border-color: transparent; }
.dupe-toggle:hover { border-color: var(--ink); }

@media (max-width: 720px) {
  .selection-bar { flex-direction: column; align-items: stretch; gap: 0.55rem; padding: 0.7rem 1rem; }
  .selection-bar__actions { justify-content: space-between; }
  .col-select { padding-left: 0.75rem !important; }
}
