/* ─── Pitches Component Library ──────────────────────────────────────────────
   Base component classes lifted from CESS prototypes.
   Import after tokens.css. Tenant-specific overrides live in theme.css files.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Body defaults ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Tabular numbers ────────────────────────────────────────────────── */
.num, .tabular, td.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }

/* ── LAYOUT SHELL ───────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h);
  padding: 0 20px;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar-w) - 20px); }
.brand-mark {
  width: 28px; height: 28px;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-weight: 700; font-size: 10.5px; color: var(--accent-on);
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.brand-text { line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.012em; }
.brand-sub  { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* DEMO BANNER */
.banner-demo {
  background: oklch(0.95 0.06 78);
  border-bottom: 1px solid oklch(0.85 0.08 78);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12.5px; color: var(--warn-ink);
  position: sticky; top: var(--topbar-h); z-index: 40;
}
.banner-demo strong { font-weight: 600; }
.banner-demo .dismiss { margin-left: auto; cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.6; }
.banner-demo .dismiss:hover { opacity: 1; }
.banner-demo.hidden { display: none; }

/* BODY LAYOUT */
.layout { display: flex; flex: 1; min-height: 0; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  padding: 16px 10px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.side-label {
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 10px 5px;
}
.side-link {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
  border: none; background: transparent; width: 100%; text-align: left;
}
.side-link:hover { background: var(--hover); color: var(--ink-1); }
.side-link.active { background: var(--surface-0); color: var(--ink-1); box-shadow: var(--sh-card); }
.side-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.side-link.active svg { opacity: 1; color: var(--accent); }
.side-link .badge {
  margin-left: auto;
  font-size: 11px; font-weight: 500;
  padding: 1px 7px;
  background: var(--hover);
  border-radius: var(--r-full);
  color: var(--ink-4);
}
.side-link.active .badge { background: var(--accent-soft); color: var(--accent-text); }

/* MAIN CONTENT */
.main { flex: 1; padding: 28px 36px 60px; overflow: auto; min-width: 0; }

/* ── PAGE HEADER ────────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title { font-size: var(--fs-h1); font-weight: 600; letter-spacing: var(--tr-h1); line-height: var(--lh-h1); margin-bottom: 4px; }
.page-title .serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.page-sub { color: var(--ink-3); font-size: var(--fs-body); }

/* ── BUTTONS ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; height: var(--btn-h); padding: 0 14px;
  border-radius: var(--r-md);
  font: 500 13px/1 var(--font-sans);
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .04s;
  user-select: none; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary   { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface-0); color: var(--ink-1); border-color: var(--line-strong); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--hover); }
.btn-ghost     { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--ink-1); }
.btn-danger    { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-danger:hover { filter: brightness(0.93); }
.btn-sm { height: var(--btn-h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { height: var(--btn-h-lg); padding: 0 18px; font-size: 14px; }

/* ── INPUTS / FIELDS ────────────────────────────────────────────────── */
.input, .select, .textarea {
  height: var(--field-h); padding: 0 12px;
  background: var(--surface-0);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font: 400 13.5px/1 var(--font-sans); color: var(--ink-1);
  transition: border-color .12s, box-shadow .12s;
  outline: none; width: 100%;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 80px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field-help  { font-size: 11.5px; color: var(--ink-3); }

/* Search box with icon */
.search-box {
  padding: 0 12px 0 34px;
  background: var(--surface-0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239A9A9E' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
}

/* ── PANELS ─────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface-0);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--sh-card);
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.panel-title { font-size: 14px; font-weight: 600; letter-spacing: -0.012em; }

/* ── CARD ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

/* ── KPI ROW ────────────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.kpi {
  background: var(--surface-0);
  border-radius: var(--r-lg);
  padding: 16px 18px 18px;
  box-shadow: var(--sh-card);
  position: relative; overflow: hidden;
}
.kpi-label { font-size: 11.5px; color: var(--ink-3); margin-bottom: 8px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-label svg { width: 13px; height: 13px; opacity: 0.55; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-trend { font-size: 11.5px; color: var(--good-ink); margin-top: 6px; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.kpi-trend svg { width: 11px; height: 11px; }
.kpi-trend.muted { color: var(--ink-4); }

/* ── PILLS / TAGS ───────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 500;
  background: var(--accent-soft); color: var(--ink-2);
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
  box-shadow: 0 0 0 2.5px color-mix(in srgb, currentColor 25%, transparent); }
.pill-live { background: var(--good-soft); color: var(--good-ink); }
.pill-live .pill-dot { animation: pulse-dot 2s ease-in-out infinite; }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-bad  { background: var(--bad-soft);  color: var(--bad-ink); }
.pill-muted { background: var(--hover); color: var(--ink-3); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: var(--r-sm); font-weight: 500; }
.tag-new       { background: var(--surface-2); color: var(--ink-3); }
.tag-emailed   { background: #eff5ff; color: #2563eb; }
.tag-opened    { background: #eff5ff; color: #2563eb; }
.tag-replied   { background: var(--good-soft); color: var(--good-ink); }
.tag-discussion{ background: var(--warn-soft); color: var(--warn-ink); }
.tag-booked    { background: var(--accent-soft); color: var(--accent-text); }
.tag-won       { background: var(--good-soft); color: var(--good-ink); }
.tag-lost      { background: var(--bad-soft); color: var(--bad-ink); }

/* ── TOOLBAR / FILTER BAR ───────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-pill {
  padding: 0 12px; height: 28px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500;
  color: var(--ink-3); cursor: pointer;
  transition: all .12s; display: inline-flex; align-items: center;
}
.filter-pill:hover { border-color: var(--line-strong); color: var(--ink-1); }
.filter-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

/* ── TABLE ──────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left;
  font-size: 10.5px; letter-spacing: var(--tr-micro); text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  padding: 10px var(--row-pad-x);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.table thead th:first-child { border-top-left-radius: var(--r-sm); }
.table thead th:last-child  { border-top-right-radius: var(--r-sm); }
.table tbody td { padding: 11px var(--row-pad-x); border-bottom: 1px solid var(--line-faint); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; cursor: default; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr.clickable { cursor: pointer; }
.table td b { font-weight: 500; }

/* ── KANBAN PIPELINE ────────────────────────────────────────────────── */
.pipeline-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 10px 8px;
  min-width: 160px; max-width: 200px;
  min-height: 300px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: background .12s;
}
.kanban-col.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.kanban-col-head {
  font-size: 10.5px; color: var(--ink-3); font-weight: 600;
  letter-spacing: var(--tr-micro); text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 2px;
}
.kanban-col-count {
  background: var(--surface-0);
  padding: 1px 6px; border-radius: var(--r-full);
  font-size: 11px; color: var(--ink-1);
  box-shadow: var(--sh-xs); font-variant-numeric: tabular-nums;
}
.kanban-card {
  background: var(--surface-0);
  border-radius: var(--r-sm);
  padding: 9px 10px;
  margin-bottom: 5px;
  box-shadow: var(--sh-card);
  cursor: grab;
  transition: transform .12s, box-shadow .12s;
  user-select: none;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-name { font-size: 12px; font-weight: 500; margin-bottom: 2px; line-height: 1.3; }
.kanban-card-meta { font-size: 11px; color: var(--ink-4); }
.kanban-card-actions { margin-top: 8px; display: flex; gap: 4px; }
.kanban-card .btn-sm { font-size: 11px; height: 22px; padding: 0 8px; }

/* ── INBOX ──────────────────────────────────────────────────────────── */
.inbox-layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: 100%; }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; }
.thread-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-faint);
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  transition: background .1s;
}
.thread-item:hover { background: var(--hover); }
.thread-item.active { background: var(--accent-soft); }
.thread-item.unread .thread-from { color: var(--ink-1); font-weight: 600; }
.thread-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--accent-on);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.thread-from { font-size: 13px; font-weight: 500; margin-bottom: 2px; line-height: 1.3; color: var(--ink-2); }
.thread-subj { font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-snippet { font-size: 12px; color: var(--ink-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thread-time { font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.thread-unread-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; flex-shrink: 0; }

.thread-pane { display: flex; flex-direction: column; min-height: 0; }
.thread-pane-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.thread-pane-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.thread-pane-reply { padding: 14px 20px; border-top: 1px solid var(--line); flex-shrink: 0; }
.msg-bubble {
  max-width: 640px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  font-size: 13.5px; line-height: 1.6;
}
.msg-bubble.out {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: var(--r-xs);
  align-self: flex-start;
}
.msg-bubble.in {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-bottom-right-radius: var(--r-xs);
  align-self: flex-end;
}
.msg-meta { font-size: 11px; color: var(--ink-4); margin-bottom: 6px; }

/* ── TEMPLATE CARDS ─────────────────────────────────────────────────── */
.template-card {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  transition: border-color .12s;
}
.template-card:hover { border-color: var(--accent); }
.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.template-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.template-meta { font-size: 12px; color: var(--ink-4); margin-bottom: 10px; }
.template-subj { font-size: 12.5px; background: var(--surface-0); padding: 8px 11px; border-radius: var(--r-sm); border: 1px solid var(--line); margin-bottom: 8px; }
.template-stats { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.template-stats b { color: var(--ink-1); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── EMAIL PREVIEW ──────────────────────────────────────────────────── */
.email-preview {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-size: 13px; line-height: 1.6;
  border: 1px solid var(--line);
}
.email-meta { color: var(--ink-3); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-strong); font-size: 12px; }
.email-meta b { color: var(--ink-1); font-weight: 500; }
.email-body { white-space: pre-wrap; font-size: 13px; color: var(--ink-1); }

/* ── MODAL ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(24,24,26,0.35);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface-0);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ── TAB STRIP ──────────────────────────────────────────────────────── */
.tab-strip { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r-md); }
.tab-item { padding: 5px 12px; height: 27px; border-radius: 5px; font: 500 12.5px/1 var(--font-sans); color: var(--ink-3); background: transparent; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.tab-item:hover:not(.active) { color: var(--ink-1); }
.tab-item.active { background: var(--surface-0); color: var(--ink-1); box-shadow: var(--sh-xs); }

/* ── TOGGLE ─────────────────────────────────────────────────────────── */
.toggle {
  width: 36px; height: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  position: relative; cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface-0);
  box-shadow: var(--sh-sm);
  transition: transform .15s;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* ── TOAST SYSTEM ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--ink-1); color: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: 13px; font-weight: 500;
  pointer-events: all;
  animation: toastIn .25s ease-out;
  max-width: 360px;
}
.toast.success { background: var(--good-ink); }
.toast.error   { background: var(--bad); }
.toast.warning { background: oklch(0.52 0.14 52); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(4px); } }

/* ── SKELETON LOADING ───────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skel-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── SPINNER ────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CHIP (admin targeting) ─────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 500; color: var(--accent-text);
}
.chip-remove { cursor: pointer; opacity: 0.6; font-size: 13px; line-height: 1; }
.chip-remove:hover { opacity: 1; }

/* ── VIEW SWITCHING ─────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ── ADMIN SECTIONS ─────────────────────────────────────────────────── */
.admin-section { padding: 28px 32px; border-bottom: 1px solid var(--line); }
.admin-section:last-child { border-bottom: none; }
.admin-section-head { margin-bottom: 20px; }
.admin-section-title { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 3px; }
.admin-section-sub { font-size: 13px; color: var(--ink-3); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── LAYOUT GRIDS ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ── REGIONS ────────────────────────────────────────────────────────── */
.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.region-card { background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.region-card::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.region-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; letter-spacing: -0.01em; }
.region-cities { font-size: 11.5px; color: var(--ink-3); margin-bottom: 12px; }
.region-stat { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-top: 1px solid var(--line); }
.region-stat span:last-child { color: var(--ink-1); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── FLOW STEPS ─────────────────────────────────────────────────────── */
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-step { background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px; border: 1px solid var(--line); }
.flow-step-num { width: 26px; height: 26px; background: var(--surface-0); color: var(--accent); border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-bottom: 12px; box-shadow: var(--sh-xs); }
.flow-step h3 { font-size: 13px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.flow-step p  { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* ── EMPTY STATE ────────────────────────────────────────────────────── */
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.empty-state-sub { font-size: 13px; color: var(--ink-3); max-width: 300px; margin: 0 auto 16px; }

/* ── ACTIVITY FEED ──────────────────────────────────────────────────── */
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-faint); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.activity-body { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.activity-body b { font-weight: 500; color: var(--ink-1); }
.activity-time { font-size: 11px; color: var(--ink-4); white-space: nowrap; }

/* ── FOOTER NOTE ────────────────────────────────────────────────────── */
.footer-note { color: var(--ink-4); font-size: 11.5px; text-align: center; margin-top: 32px; padding: 16px; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout { flex-direction: column; }
  .sidebar { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr 1fr; }
  .region-grid { grid-template-columns: 1fr; }
  .main { padding: 20px; }
  .inbox-layout { grid-template-columns: 1fr; }
  .settings-grid, .settings-grid-3 { grid-template-columns: 1fr; }
  .pipeline-board { min-width: 600px; }
}
