/* ─── Sign Service Butler Theme ──────────────────────────────────────────────
   Green/mint accent. Friendly local service vibe.
   Loaded after tokens.css + components.css.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root[data-tenant="ssb"],
[data-tenant="ssb"] {
  --accent:       #16a34a;
  --accent-hover: #128a3e;
  --accent-deep:  #0e6e36;
  --accent-soft:  #ecfdf3;
  --accent-on:    #ffffff;
  --accent-text:  #065f29;

  --bg:           #f7faf8;
  --surface-0:    #ffffff;
  --surface-1:    #f7faf8;
  --surface-2:    #f8fbf9;
  --surface-3:    #eef5f0;
  --surface-tint: #f0f5f1;
  --hover:        #f0f5f1;
}

html { font-feature-settings: "cv11", "ss01"; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
}

/* Brand mark - green gradient (SB) */
.brand-mark {
  background: linear-gradient(160deg, #2dab63, #0e6e36);
}

/* Serif accent words */
.serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Topbar user chip */
.top-user {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
}
.top-avatar {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 50%;
  color: var(--accent-on);
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 600;
}

/* Back link */
.back-link {
  color: var(--ink-3); font-size: 12.5px; text-decoration: none;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}
.back-link:hover { background: var(--hover); color: var(--ink-1); }
.back-link svg { width: 12px; height: 12px; }

/* Admin link at bottom of sidebar */
.side-link.admin-link { color: var(--ink-4); font-size: 12px; }
.side-link.admin-link:hover { color: var(--ink-2); }

/* SSB tag variants */
.tag-brokerage { background: #fef6e7; color: #d97706; }
.tag-existing  { background: #fef2f2; color: #dc2626; }
.tag-region    { background: var(--accent-soft); color: var(--accent-text); }

/* Excluded row */
tbody tr.excluded td { opacity: 0.55; }

/* Pipeline full-width scroll wrapper */
.pipeline-wrap { overflow-x: auto; padding-bottom: 8px; }
.pipeline-board { min-width: 760px; }

/* Inbox split pane full height */
.inbox-full { height: calc(100vh - var(--topbar-h) - 60px); min-height: 500px; }

/* Thread bubbles */
.msg-bubble.out { background: var(--surface-2); }
.msg-bubble.in  { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* AI draft button */
.btn-ai {
  background: linear-gradient(135deg, #7c3aed20, #16a34a20);
  border: 1px solid #16a34a40;
  color: #0e6e36;
}
.btn-ai:hover { background: linear-gradient(135deg, #7c3aed30, #16a34a30); }

/* Scrape button pulsing when active */
.btn-scraping { animation: scrape-pulse 1.2s ease-in-out infinite; }
@keyframes scrape-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }

/* Top right admin badge */
.admin-badge {
  font-size: 11px; padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: var(--r-full);
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Dirty indicator */
#dirty-dot {
  display: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn);
  animation: pulse-dot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* KB document cards */
.kb-card {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.kb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kb-card textarea { font-size: 12.5px; min-height: 60px; }

/* Max-turns slider */
.slider {
  -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--surface-3);
  outline: none; width: 100%;
  accent-color: var(--accent);
}

/* Sample conversation preview */
.sample-conversation { background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; border: 1px solid var(--line); }
.sample-msg { padding: 8px 12px; border-radius: var(--r-md); font-size: 12.5px; margin-bottom: 6px; max-width: 85%; }
.sample-msg.out { background: var(--surface-0); border: 1px solid var(--line); align-self: flex-start; margin-left: 0; }
.sample-msg.in  { background: var(--accent-soft); align-self: flex-end; margin-left: auto; }
.sample-msg-label { font-size: 10.5px; color: var(--ink-4); margin-bottom: 3px; }

/* Handoff trigger checkboxes */
.checkbox-option, .radio-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .12s;
  font-size: 13.5px;
}
.checkbox-option:hover, .radio-option:hover { border-color: var(--accent); }
.checkbox-option input, .radio-option input { accent-color: var(--accent); width: 15px; height: 15px; }

/* Exclusion count badge */
.excl-count { font-size: 12px; color: var(--ink-3); }

/* Admin topbar */
.admin-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: var(--topbar-h);
  background: var(--surface-0);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.admin-breadcrumb { font-size: 12px; color: var(--ink-4); display: flex; align-items: center; gap: 6px; }
.admin-breadcrumb a { color: var(--ink-3); text-decoration: none; }
.admin-breadcrumb a:hover { color: var(--ink-1); }
.admin-save-btn {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}

/* KPI muted/excluded variant */
.kpi.excluded .kpi-value { color: var(--ink-4); }
.kpi.excluded .kpi-label { color: var(--ink-4); }

/* Existing clients KPI tinted */
.kpi.excluded { background: var(--surface-2); }

/* Service area route line */
.route-card {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  border: 1px solid var(--line);
}
.route-line {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0;
  font-size: 13px;
  position: relative;
}
.city-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface-0);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  z-index: 1;
  box-shadow: var(--sh-xs);
}
.city-dot.major { width: 16px; height: 16px; border-width: 3px; }
.city-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.city-meta { color: var(--ink-3); font-size: 11.5px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.route-track { width: 14px; min-height: 22px; margin-left: 6px; border-left: 2px dashed rgba(22, 163, 74, 0.4); }

/* Existing clients automation note */
.automation-note {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--accent-text);
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.automation-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* Volume preference radios */
.volume-radio-group {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
