/* Outreach CRM — interface styles
   Palette: ink navy for structure, cool paper background, one orange for the primary action. */
:root {
  --ink: #14213d;
  --ink-2: #22335a;
  --ink-3: #8a97b3;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --sunken: #f7f8fb;
  --line: #e1e5ec;
  --line-2: #cfd5df;
  --text: #1b2333;
  --muted: #5d6779;
  --faint: #8b94a5;
  --accent: #e8590c;
  --accent-2: #c94a06;
  --accent-soft: #fff1e8;
  --green: #23744a;  --green-soft: #e7f4ec;
  --amber: #9a6100;  --amber-soft: #fdf3dc;
  --red: #b42318;    --red-soft: #fdecea;
  --teal: #0e6f6a;   --teal-soft: #e3f3f2;
  --blue: #2850a8;   --blue-soft: #e9effb;
  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --sidebar-w: 244px;
  --focus: 0 0 0 3px rgba(232, 89, 12, .28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text);
  background: var(--paper); font-feature-settings: 'tnum' 1, 'cv11' 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; }
h2 { font-size: 1.06rem; font-weight: 700; margin: 0 0 .75rem; }
h3 { font-size: .98rem; font-weight: 700; margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--r-s); z-index: 2000; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .82rem; }
.mt-s { margin-top: .5rem; } .mt-l { margin-top: 1.75rem; }
.center { text-align: center; }
.tone-green { color: var(--green) !important; } .tone-amber { color: var(--amber) !important; }
.tone-red { color: var(--red) !important; } .tone-teal { color: var(--teal) !important; } .tone-blue { color: var(--blue) !important; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Brand mark: an envelope fold drawn in CSS */
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent); flex-shrink: 0; position: relative; overflow: hidden;
}
.brand-mark::before {
  content: ''; position: absolute; left: 7px; right: 7px; top: 10px; bottom: 10px; border: 2px solid #fff; border-radius: 3px;
}
.brand-mark::after {
  content: ''; position: absolute; left: 50%; top: 6px; width: 13px; height: 13px; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: translateX(-50%) rotate(45deg);
}

/* ---------------------------------------------------------------- Buttons (also used without Bootstrap) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  padding: .58rem 1rem; border-radius: var(--r-s); border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s;
}
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { box-shadow: var(--focus); }
.btn-sm { padding: .4rem .7rem; font-size: .84rem; }
.btn-lg { padding: .75rem 1.3rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-icon { padding-left: .55rem; padding-right: .55rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent, #fff); }
.btn-primary:active, .btn-primary:focus { background: var(--accent-2) !important; border-color: var(--accent-2) !important; color: var(--on-accent, #fff) !important; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.btn-light { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-light:hover:not(:disabled) { background: var(--sunken); border-color: var(--faint); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--sunken); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }
.btn-link { background: none; border: none; color: var(--blue); padding-left: .4rem; padding-right: .4rem; font-weight: 600; }
.btn-link:hover { text-decoration: underline !important; }
.btn-link-inline { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.btn-count { background: rgba(255,255,255,.22); border-radius: 99px; padding: 0 .45rem; font-size: .78rem; min-width: 1.5rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-s); border: 1px solid transparent; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }

/* ---------------------------------------------------------------- Form fields */
.label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink); margin: .95rem 0 .35rem; }
.label .opt { font-weight: 500; color: var(--faint); margin-left: .25rem; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .95rem; flex-wrap: wrap; }
.label-row .label { margin: 0; }
.input {
  display: block; width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-s); padding: .58rem .75rem; min-height: 40px;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input:disabled { background: var(--sunken); color: var(--muted); }
.input-sm { min-height: 36px; padding: .4rem .6rem; font-size: .86rem; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235d6779' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }
textarea.input { resize: vertical; line-height: 1.55; }
.hint { color: var(--muted); font-size: .82rem; margin: .35rem 0 0; }
.hint-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
.hint-row .hint { margin: 0; }
.check { display: flex; gap: .55rem; align-items: flex-start; margin: .9rem 0 0; font-size: .9rem; cursor: pointer; }
.check input { margin-top: .22rem; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 576px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2-wide { grid-template-columns: 2fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.file-pill {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; font-weight: 600; color: var(--ink);
  border: 1px dashed var(--line-2); border-radius: 99px; padding: .35rem .8rem; cursor: pointer; background: var(--surface); max-width: 100%;
}
.file-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill:hover { border-color: var(--accent); color: var(--accent-2); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 4rem; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; padding: .3rem .5rem; }
.disclosure { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.disclosure summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink); }
.note-box { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-s); padding: .7rem .85rem; font-size: .88rem; margin-top: .9rem; }
.note-warn { background: var(--amber-soft); border-color: #f1dca8; }

/* ---------------------------------------------------------------- Alerts & toasts */
.alert { border-radius: var(--r-s); padding: .7rem .9rem; font-size: .9rem; margin: 0 0 .75rem; border: 1px solid; display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.alert-success { background: var(--green-soft); border-color: #bfe0cc; color: #18512f; }
.alert-error   { background: var(--red-soft); border-color: #f5c6c0; color: #7a1a12; }
.alert-warn    { background: var(--amber-soft); border-color: #f1dca8; color: #6a4300; }
.alert-close { border: 0; background: none; font-size: 1.2rem; line-height: 1; color: inherit; opacity: .6; cursor: pointer; padding: 0 .2rem; }
.flash-stack:empty { display: none; }
.toast-stack { position: fixed; z-index: 2100; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; pointer-events: none; }
.toast-x { pointer-events: auto; background: var(--ink); color: #fff; border-radius: var(--r-m); padding: .7rem 1rem; font-size: .9rem; max-width: 420px; box-shadow: 0 8px 24px rgba(20,33,61,.25); animation: toast-in .18s ease-out; }
.toast-x.is-error { background: #7a1a12; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Sign-in & setup */
.auth-body { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 32px; background: var(--paper); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-wrap-wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; color: var(--ink); font-size: 1.05rem; margin-bottom: 1.25rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px 24px; }
@media (min-width: 576px) { .auth-card { padding: 34px 36px; } }
.auth-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 .35rem; letter-spacing: -0.02em; }
.lead-text { color: var(--muted); margin: 0 0 1.1rem; }
.auth-card .btn-block { margin-top: 1.4rem; }
.auth-card .btn-ghost.btn-block { margin-top: .25rem; }
.steps { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .8rem; font-weight: 600; color: var(--faint); }
.steps li { flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.steps li::before { content: ''; height: 3px; border-radius: 3px; background: var(--line); }
.steps li.current, .steps li.done { color: var(--ink); }
.steps li.current::before { background: var(--accent); }
.steps li.done::before { background: var(--ink); }
.steps span { display: none; }
.choice-row { display: grid; gap: .6rem; margin-bottom: .5rem; }
@media (min-width: 520px) { .choice-row { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--r-m); padding: .8rem .9rem; cursor: pointer; }
.choice input { accent-color: var(--accent); margin-top: .2rem; }
.choice small { display: block; color: var(--muted); font-weight: 500; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- App shell */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--ink); color: var(--side-text, #d7deeb);
  display: flex; flex-direction: column; z-index: 1040; transform: translateX(-100%); transition: transform .2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sidebar-head { display: flex; align-items: center; gap: .7rem; padding: 18px 16px 14px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { color: var(--side-strong, #fff); font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text span { font-size: .76rem; color: var(--ink-3); }
.sidebar-close { margin-left: auto; color: var(--side-strong, #fff); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.side-group { font-size: .74rem; font-weight: 700; color: var(--ink-3); padding: 14px 10px 6px; }
.side-link {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: var(--r-s); color: var(--side-text, #d7deeb);
  font-weight: 600; font-size: .9rem; text-decoration: none !important; margin-bottom: 1px; position: relative;
}
.side-link i { width: 18px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.side-link:hover { background: var(--side-hover, rgba(255,255,255,.06)); color: var(--side-strong, #fff); }
.side-link.active { background: var(--side-hover, rgba(255,255,255,.1)); color: var(--side-strong, #fff); }
.side-link.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-link.active i { color: var(--side-strong, #fff); }
.side-count { margin-left: auto; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: .05rem .45rem; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 10px; }
.me-card { gap: .65rem; }
.me-card::before { display: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text strong { color: var(--side-strong, #fff); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--ink-3); font-size: .76rem; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2f4373; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; background: var(--blue-soft); color: var(--blue); }
.signout { display: block; color: var(--ink-3); font-size: .84rem; font-weight: 600; padding: .45rem .7rem; }
.signout:hover { color: var(--side-strong, #fff); text-decoration: none; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem;
  background: rgba(243,245,248,.92); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px 12px; min-height: 58px;
}
.page-title { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.clock { color: var(--muted); font-size: .82rem; font-weight: 600; }
.content { padding: 14px 12px 64px; max-width: 1480px; }
@media (min-width: 576px) { .content { padding: 18px 20px 64px; } .topbar { padding: 10px 20px; } }
@media (min-width: 992px) {
  .sidebar { transform: none; }
  .sidebar-close, .menu-btn, .scrim { display: none !important; }
  .main { margin-left: var(--sidebar-w); }
  .content { padding: 22px 28px 72px; }
  .topbar { padding: 12px 28px; }
  .page-title { font-size: 1.3rem; }
}

/* ---------------------------------------------------------------- Panels & sections */
.pane { animation: pane-in .16s ease-out; }
@keyframes pane-in { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pane, .toast-x, .sidebar, .scrim { animation: none; transition: none; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; margin-bottom: 14px; }
@media (min-width: 576px) { .panel { padding: 18px; } }
.panel-flush { padding: 0; overflow: hidden; }
.panel h2 { margin-bottom: .25rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: 6px 0 12px; }
.section-head h2 { font-size: 1.1rem; margin: 0; }
.section-head .hint { margin-top: .2rem; max-width: 70ch; }
.empty { text-align: center; padding: 40px 20px; }
.empty h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 1rem; }

/* KPI strip: one bordered band divided into cells, not separate cards */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 14px; overflow: hidden; }
.kpi { padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 1.45rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
.kpi-sub { font-size: .76rem; color: var(--faint); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .kpi-value { font-size: 1.65rem; } }

/* ---------------------------------------------------------------- Toolbars, filters, chips */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar-end { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 240px; min-width: 0; max-width: 460px; }
.search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .85rem; pointer-events: none; }
.search input { width: 100%; font: inherit; font-size: .9rem; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: .55rem .75rem .55rem 2.1rem; min-height: 40px; background: var(--surface); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
@media (max-width: 575.98px) {
  .search { flex-basis: 100%; max-width: none; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar-end .btn { flex: 1; }
  .toolbar > .filter-toggle { flex: 1; }
}
.filter-count { background: var(--accent); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .4rem; }
.filters { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: .85rem; }
.filters.open { display: grid; }
.f { display: flex; flex-direction: column; gap: .25rem; min-width: 0; margin: 0; }
.f > span { font-size: .76rem; font-weight: 600; color: var(--muted); }
.f-reset { align-self: end; justify-self: start; }
@media (min-width: 768px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) {
  .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .filter-toggle { display: none !important; }
}
.w-auto-md { width: 100%; }
@media (min-width: 576px) { .w-auto-md { width: auto; max-width: 200px; } }
.chips { display: flex; gap: .4rem; flex-wrap: nowrap; overflow-x: auto; margin-top: .85rem; padding-bottom: 2px; scrollbar-width: thin; }
.chips-inline { margin-top: 0; }
.chips-pick { flex-wrap: wrap; overflow: visible; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  border-radius: 99px; padding: .3rem .8rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-sm { padding: .15rem .6rem; font-size: .78rem; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check small { color: var(--faint); font-weight: 600; }
.chip-check:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-check:has(input:checked) small { color: var(--ink-3); }
.chip-check:has(input:focus-visible) { box-shadow: var(--focus); }

/* ---------------------------------------------------------------- Pills, tags, status */
.pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .12rem .55rem; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-quiet::before, .pill-role-salesman::before, .pill-role-manager::before, .pill-role-admin::before, .pill-role-super::before { display: none; }
.pill-running, .pill-sent { background: var(--green-soft); color: var(--green); border-color: #c7e5d3; }
.pill-paused, .pill-pending { background: var(--amber-soft); color: var(--amber); border-color: #f1dca8; }
.pill-completed { background: var(--blue-soft); color: var(--blue); border-color: #cfdcf5; }
.pill-failed { background: var(--red-soft); color: var(--red); border-color: #f5c6c0; }
.pill-skipped, .pill-cancelled { background: #f1f3f6; color: var(--muted); border-color: var(--line-2); }
.pill-hot { background: var(--accent-soft); color: var(--accent-2); border-color: #fbd3bb; }
.pill-role-super { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill-role-admin { background: var(--blue-soft); color: var(--blue); border-color: #cfdcf5; }
.pill-role-manager { background: var(--teal-soft); color: var(--teal); border-color: #c4e5e2; }
.tag { display: inline-block; font-size: .76rem; font-weight: 700; color: var(--teal); background: var(--teal-soft); border-radius: var(--r-s); padding: .08rem .45rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag[role=button] { cursor: pointer; }
.tag[role=button]:hover { background: var(--teal); color: #fff; }
.outcome-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; background: var(--oc, var(--faint)); flex-shrink: 0; }
.o-interested .outcome-dot, .outcome-dot.o-interested { background: var(--green); }
.outcome-dot.o-call-back { background: var(--blue); }
.outcome-dot.o-no-response { background: var(--amber); }
.outcome-dot.o-not-interested { background: var(--red); }

/* ---------------------------------------------------------------- Tables (become cards on phones) */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-x { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-x th { text-align: left; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--sunken); padding: .65rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-x td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr:hover td { background: #fafbfd; }
.table-x .num { text-align: right; white-space: nowrap; }
.col-check { width: 40px; }
.col-act { width: 1%; white-space: nowrap; text-align: right; }
.row-muted td { opacity: .6; }
.row-click { cursor: pointer; }
.cell-title { font-weight: 700; color: var(--ink); display: block; }
.cell-sub { color: var(--muted); font-size: .82rem; display: block; overflow-wrap: anywhere; }
.cell-email { overflow-wrap: anywhere; }
.cell-note { max-width: 300px; }
.cell-note .note-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
.eng { display: inline-flex; min-width: 2rem; justify-content: flex-end; font-weight: 700; }
.eng.zero { color: var(--faint); font-weight: 500; }
.phone-link { white-space: nowrap; font-weight: 600; }
.person { display: flex; gap: .6rem; align-items: center; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.form-check-input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

@media (max-width: 1199.98px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: .2rem 0; display: flex; gap: .75rem; align-items: baseline; min-width: 0; }
  .rtable td::before { content: attr(data-label); flex: 0 0 96px; font-size: .76rem; font-weight: 600; color: var(--muted); }
  .rtable td[data-label=""]::before { display: none; }
  .rtable td[data-label=""] { display: block; }
  .rtable tr.row-click::after { content: '\203A'; position: absolute; right: 16px; bottom: 12px; font-size: 1.4rem; color: var(--faint); line-height: 1; }
  .rtable td > * { min-width: 0; }
  .rtable td.num { text-align: left; }
  .rtable tbody tr:hover td { background: none; }
  .rtable .col-check { position: absolute; top: 14px; right: 14px; width: auto; padding: 0; }
  .rtable .col-check + td { padding-right: 32px; }
  .rtable .col-act { width: 100%; text-align: left; margin-top: .4rem; }
  .rtable .col-act .row-actions { justify-content: flex-start; }
  .rtable .cell-note { max-width: none; }
  .clamp-3 { max-width: none; }
  .rtable .hide-sm { display: none; }
}

/* Pager & bulk bar */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--sunken); font-size: .84rem; color: var(--muted); }
.pager:empty { display: none; }
.pager-pages { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.pg { min-width: 34px; height: 34px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-s); font: inherit; font-size: .84rem; font-weight: 600; color: var(--text); cursor: pointer; padding: 0 .55rem; }
.pg:hover:not(:disabled) { border-color: var(--ink-3); }
.pg.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pg:disabled { opacity: .4; cursor: default; }
.pager select { width: auto; display: inline-block; }
.bulkbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 10px 14px; background: var(--accent-soft); border-bottom: 1px solid #fbd3bb; }
.bulkbar .input { width: auto; flex: 1 1 160px; max-width: 260px; }
.bulk-count { font-size: .88rem; color: var(--ink); margin-right: .25rem; }
@media (max-width: 575.98px) { .bulkbar .input { max-width: none; flex-basis: 100%; } }

/* ---------------------------------------------------------------- Lead drawer */
.lead-drawer { --bs-offcanvas-width: 460px; border-left: 1px solid var(--line) !important; }
@media (max-width: 575.98px) { .lead-drawer { --bs-offcanvas-width: 100vw; } }
.lead-drawer .offcanvas-header { align-items: flex-start; border-bottom: 1px solid var(--line); padding: 16px 18px; gap: .5rem; }
.h-drawer { font-size: 1.15rem; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.drawer-title { min-width: 0; flex: 1; }
.lead-drawer .offcanvas-body { padding: 16px 18px 40px; }
.call-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.call-row .btn { width: 100%; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin: 0 0 1rem; }
.facts div { min-width: 0; }
.facts dt { font-size: .76rem; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.facts .full { grid-column: 1 / -1; }
.drawer-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.drawer-section h3 { margin-bottom: .6rem; }
.outcomes { display: flex; flex-wrap: wrap; gap: .4rem; }
.outcome { position: relative; }
.outcome input { position: absolute; opacity: 0; }
.outcome span { display: inline-block; border: 1px solid var(--line-2); border-radius: 99px; padding: .35rem .75rem; font-size: .84rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.outcome input:focus-visible + span { box-shadow: var(--focus); }
.outcome input:checked + span { color: #fff; border-color: transparent; background: var(--oc, var(--ink)); }
.o-interested input:checked + span { background: var(--green); }
.o-call-back input:checked + span { background: var(--blue); }
.o-no-response input:checked + span { background: var(--amber); }
.o-not-interested input:checked + span { background: var(--red); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.1rem; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline .t-head { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; font-size: .82rem; color: var(--muted); }
.timeline .t-head strong { color: var(--ink); font-size: .86rem; }
.timeline .t-body { margin: .2rem 0 .15rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .t-act button { font-size: .8rem; padding: 0; margin-right: .75rem; }

/* ---------------------------------------------------------------- Compose */
.compose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1200px) { .compose { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } .compose-side { position: sticky; top: 76px; } }
.compose-side .panel { margin-bottom: 0; }
@media (max-width: 1199.98px) { .compose-side { display: none; } }
.step-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem; }
.step-head h2 { margin: 0; }
.step-no { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-m); padding: 3px; gap: 2px; max-width: 100%; }
.seg label, .seg button { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span, .seg button { display: inline-block; padding: .45rem .9rem; border-radius: 7px; font-size: .86rem; font-weight: 700; color: var(--muted); cursor: pointer; border: 0; background: transparent; font-family: inherit; }
.seg input:checked + span, .seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,33,61,.12); }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.seg-sm span { padding: .35rem .75rem; font-size: .82rem; }
.seg-xs button { padding: .25rem .6rem; font-size: .76rem; }
.step .seg + div, .step .seg + [data-mode-panel] { margin-top: .25rem; }
.pick-list { display: grid; gap: .4rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .pick-list { grid-template-columns: 1fr 1fr; } }
.pick { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: .55rem .7rem; cursor: pointer; margin: 0; min-width: 0; }
.pick input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.pick-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-meta { color: var(--muted); font-size: .8rem; font-weight: 700; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
@media (max-width: 575.98px) { .form-actions .btn { flex: 1 1 100%; } }
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.preview-label { display: block; font-size: .76rem; font-weight: 600; color: var(--muted); }
.preview-subject { display: block; color: var(--ink); overflow-wrap: anywhere; }
.preview-frame-wrap { background: #e9ecf2; border-radius: var(--r-s); display: flex; justify-content: center; overflow: hidden; }
.preview-frame-wrap iframe, .preview-body iframe { width: 100%; height: 560px; border: 0; background: #fff; transition: width .2s; display: block; }
.preview-body { padding: 0; background: #e9ecf2; display: flex; justify-content: center; }
.preview-body iframe { height: min(75vh, 760px); }

/* ---------------------------------------------------------------- Campaign list */
.camp-list { display: flex; flex-direction: column; gap: 10px; }
.camp {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px;
  display: grid; gap: .9rem 1.5rem; grid-template-columns: minmax(0, 1fr); border-left: 3px solid var(--line-2);
}
.camp[data-status=running] { border-left-color: var(--green); }
.camp[data-status=paused] { border-left-color: #e3b341; }
.camp[data-status=completed] { border-left-color: var(--blue); }
.camp.flash { box-shadow: 0 0 0 2px var(--accent); }
.camp-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.camp-title { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.camp-subject { margin: .25rem 0 0; color: var(--text); overflow-wrap: anywhere; }
.camp-meta { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .15rem .9rem; font-size: .8rem; color: var(--muted); }
.camp-meta span { min-width: 0; overflow-wrap: anywhere; }
.bar { display: flex; height: 8px; border-radius: 99px; background: #e9ecf2; overflow: hidden; }
.bar-sent { background: var(--green); }
.bar-fail { background: var(--red); }
.bar-text { margin: .4rem 0 0; font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.bar-text strong { color: var(--ink); }
.camp-rates { display: flex; gap: 1.5rem; margin: 0; }
.camp-rates div { display: flex; flex-direction: column; }
.camp-rates dt { font-size: .76rem; font-weight: 600; color: var(--muted); }
.camp-rates dd { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.camp-rates small { color: var(--faint); font-size: .76rem; font-weight: 600; }
.camp-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
@media (min-width: 768px) {
  .camp { grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); padding: 16px 18px; }
  .camp-main { grid-column: 1; }
  .camp-progress { grid-column: 2; grid-row: 1; align-self: center; }
  .camp-rates { grid-column: 1; }
  .camp-actions { grid-column: 2; justify-content: flex-end; }
}
@media (min-width: 1300px) {
  .camp { grid-template-columns: minmax(0, 1.6fr) minmax(200px, 1fr) auto auto; align-items: center; }
  .camp-main, .camp-progress, .camp-rates, .camp-actions { grid-column: auto; grid-row: auto; }
  .camp-actions { justify-content: flex-end; flex-wrap: nowrap; }
}

/* ---------------------------------------------------------------- Templates & audiences */
.tpl-grid, .aud-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
@media (min-width: 640px) { .tpl-grid, .aud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .aud-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .aud-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tpl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; display: flex; flex-direction: column; }
.tpl-thumb { display: block; height: 190px; overflow: hidden; background: #eef1f6; border: 0; border-bottom: 1px solid var(--line); padding: 0; cursor: zoom-in; position: relative; width: 100%; }
.tpl-thumb iframe { width: 250%; height: 250%; transform: scale(.4); transform-origin: 0 0; border: 0; pointer-events: none; background: #fff; }
.tpl-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.tpl-name { font-size: .98rem; overflow-wrap: anywhere; }
.tpl-subject { margin: 0; color: var(--text); font-size: .88rem; overflow-wrap: anywhere; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: auto; padding-top: .6rem; }
.aud { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.aud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.aud-top h3 { overflow-wrap: anywhere; }
.aud-desc { margin: 0; color: var(--muted); font-size: .86rem; }
.aud-count { margin: .2rem 0 0; color: var(--muted); }
.aud-count strong { color: var(--ink); font-size: 1.2rem; }

/* ---------------------------------------------------------------- Template editor */
.editor { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.editor .label:first-child { margin-top: 0; }
.editor-preview .preview-frame-wrap iframe { height: 520px; }
@media (max-width: 1199.98px) { .editor-preview .preview-frame-wrap iframe { height: 420px; } }

/* ---------------------------------------------------------------- Team & permissions */
.perm-editor { margin-top: 1rem; }
.perm-fieldset { border: 1px solid var(--line); border-radius: var(--r-s); padding: .3rem .8rem .6rem; margin: .6rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
@media (min-width: 640px) { .perm-fieldset { grid-template-columns: 1fr 1fr; } }
.perm-fieldset legend { float: none; width: auto; font-size: .8rem; font-weight: 700; color: var(--ink); padding: 0 .3rem; margin: 0 0 0 -.3rem; }
.perm { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; cursor: pointer; margin: 0; font-size: .88rem; font-weight: 600; }
.perm input { margin-top: .15rem; flex-shrink: 0; }
.perm small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.perm-locked { opacity: .55; cursor: not-allowed; }
.roles-explainer h3 { margin-bottom: .6rem; }
.roles-dl { display: grid; gap: .6rem 1.5rem; grid-template-columns: minmax(0, 1fr); margin: 0; }
@media (min-width: 768px) { .roles-dl { grid-template-columns: 1fr 1fr; } }
.roles-dl dt { font-weight: 700; color: var(--ink); font-size: .9rem; }
.roles-dl dd { margin: 0; color: var(--muted); font-size: .86rem; }
.account-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .account-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.account-grid .panel { margin: 0; }
.perm-group { font-size: .82rem; margin: 1rem 0 .3rem; color: var(--muted); }
.perm-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.perm-list li { padding: .2rem 0; display: flex; gap: .55rem; align-items: baseline; }
.perm-list i { width: 14px; font-size: .78rem; }
.perm-list .yes i { color: var(--green); }
.perm-list .no { color: var(--faint); }

/* ---------------------------------------------------------------- Settings */
.settings-block { display: grid; gap: .5rem 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .settings-block { grid-template-columns: 260px minmax(0, 1fr); padding: 22px; } }
.settings-intro h2 { margin-bottom: .3rem; }
.settings-intro .hint { margin-bottom: .75rem; }
.settings-fields > .label:first-child, .settings-fields > .grid-2:first-child .label, .settings-fields > .grid-3:first-child .label { margin-top: 0; }
@media (max-width: 991.98px) { .settings-fields > .label:first-child, .settings-fields > .grid-2:first-child .label { margin-top: .95rem; } }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--paper) 35%); display: flex; justify-content: flex-end; }
@media (max-width: 575.98px) { .sticky-save .btn { width: 100%; } }

/* ---------------------------------------------------------------- Bootstrap modal & dropdown tuning */
.modal-content { border: 1px solid var(--line); border-radius: var(--r-l); font-family: var(--font); }
.modal-header { border-bottom: 1px solid var(--line); padding: 14px 18px; gap: .5rem; }
.modal-title { font-size: 1.08rem; font-weight: 800; color: var(--ink); margin: 0; }
.modal-body { padding: 4px 18px 18px; }
.modal-body > .label:first-child, .modal-body > .grid-2:first-child .label, .modal-body > .grid-3:first-child .label, .modal-body > .grid-2.grid-2-wide:first-child .label { margin-top: .9rem; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 18px; gap: .5rem; }
.modal-footer > * { margin: 0; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { border-radius: 0; } .modal-footer .btn { flex: 1; } }
.confirm-text { margin: 14px 0 0; font-weight: 600; color: var(--ink); }
.dropdown-menu { font-size: .88rem; border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: 0 10px 30px rgba(20,33,61,.12); padding: 4px; }
.dropdown-item { border-radius: 5px; padding: .45rem .75rem; font-weight: 600; }
.dropdown-item:active { background: var(--ink); }
.dropdown-menu form { margin: 0; }
.offcanvas { font-family: var(--font); }

.only-sm { display: none; }
@media (max-width: 1199.98px) { .only-sm { display: inline; } .rtable td.hide-sm, .rtable .hide-sm { display: none !important; } }
@media (min-width: 768px) and (max-width: 1199.98px) {
  .rtable tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.5rem; }
  .rtable td[data-label=""]:not(.col-check) { grid-column: 1 / -1; }
  .rtable td.cell-note, .rtable td[data-label="Note"], .rtable td[data-label="Message"], .rtable td[data-label="Reply"] { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- 2.1 additions */
.m-0 { margin: 0 !important; } .mt-m { margin-top: 1rem; } .mb-3 { margin-bottom: 1rem; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; background: #fff; flex-shrink: 0; }
.auth-brand .brand-logo { width: 38px; height: 38px; }
.check-row { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.input-suffix { display: flex; align-items: center; gap: .5rem; }
.input-suffix span { color: var(--muted); font-size: .84rem; }

/* Settings */
.settings-tabs { margin-bottom: 14px; }
.settings-tabs button { padding: .5rem 1rem; }
@media (max-width: 575.98px) { .settings-tabs { display: flex; width: 100%; } .settings-tabs button { flex: 1 1 auto; padding: .45rem .5rem; font-size: .8rem; } }
.color-field { display: flex; align-items: center; gap: .6rem; }
.color-field input[type=color], .oc-row input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.logo-preview { display: inline-flex; padding: 6px; background: var(--ink); border-radius: 12px; }
.oc-list { display: flex; flex-direction: column; gap: .5rem; }
.oc-row { display: flex; gap: .5rem; align-items: center; }
.oc-row .input { flex: 1; min-width: 0; }
.health { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.health li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r-s); font-size: .86rem; }
.health li div { min-width: 0; }
.health li strong { display: block; color: var(--ink); }
.health li span { color: var(--muted); overflow-wrap: anywhere; }
.health li.ok i { color: var(--green); margin-top: .2rem; }
.health li.bad { background: var(--amber-soft); border-color: #f1dca8; }
.health li.bad i { color: var(--amber); margin-top: .2rem; }
.tips { margin: .6rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .86rem; }
.tips li { margin-bottom: .35rem; }

/* Resend & unsubscribed */
.resend-summary { display: flex; gap: 1rem; align-items: center; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-m); padding: .8rem 1rem; margin-top: .9rem; }
.resend-summary p { margin: 0; }
.resend-count { font-size: 2rem; font-weight: 800; color: var(--accent-2); line-height: 1; min-width: 3ch; text-align: center; }
.unsub-panel summary { cursor: pointer; }
.unsub-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .unsub-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.unsub-list li { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: var(--r-s); font-size: .86rem; }
.unsub-list li:nth-child(odd) { background: var(--sunken); }
.unsub-list li .cell-email { flex: 1; min-width: 0; }
.unsub-list form { margin: 0; }

/* ---------------------------------------------------------------- Message editor */
.rte { border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); position: relative; }
.rte:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--sunken); border-radius: var(--r-m) var(--r-m) 0 0; position: sticky; top: 0; z-index: 2; }
.rte-mode-label { font-size: .78rem; font-weight: 700; color: var(--muted); padding: 0 .3rem; }
.rte-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.rte-btn { position: relative; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: .82rem; padding: 0; }
.rte-btn:hover { background: var(--surface); border-color: var(--line-2); }
.rte-btn-text { width: auto; padding: 0 .55rem; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.rte-color input { position: absolute; inset: auto 3px 3px 3px; width: auto; height: 4px; opacity: 1; border: 0; padding: 0; cursor: pointer; }
.rte-color input::-webkit-color-swatch-wrapper { padding: 0; } .rte-color input::-webkit-color-swatch { border: 0; }
.rte-select { height: 32px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); font: inherit; font-size: .8rem; padding: 0 .4rem; }
.rte-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; }
.rte-menu-wrap { position: relative; }
.rte-menu { position: absolute; top: 36px; left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: 0 10px 30px rgba(20,33,61,.14); padding: 4px; min-width: 170px; }
.rte-menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; border-radius: 5px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.rte-menu-item:hover { background: var(--sunken); }
.rte-frame { display: block; width: 100%; height: 340px; border: 0; background: #fff; border-radius: 0 0 var(--r-m) var(--r-m); }
.rte-code { border: 0; border-radius: 0 0 var(--r-m) var(--r-m); min-height: 340px; font-size: .8rem; line-height: 1.55; background: #fbfcfe; }
.rte-code:focus { box-shadow: none; }
.rte-pop { position: absolute; z-index: 30; top: 48px; right: 8px; left: 8px; max-width: 360px; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 14px 40px rgba(20,33,61,.18); padding: 12px 14px; }
.rte-pop .label { margin-top: .6rem; }
.rte-pop-title { margin: 0 0 .3rem; font-weight: 800; color: var(--ink); }
.rte-pop-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .8rem; }
.rte-pop input[type=color] { height: 36px; padding: 2px; }
@media (max-width: 575.98px) { .rte-sep { display: none; } .rte-btn { width: 34px; height: 34px; } }

/* ---------------------------------------------------------------- Inbox-style preview */
.mail-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.preview-modal .mail-preview { border: 0; border-radius: 0; }
.mp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mp-note { font-size: .78rem; color: var(--faint); font-weight: 600; }
.mp-stage { background: linear-gradient(180deg, #eef1f6, #e4e8ef); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mp-inbox { width: 100%; max-width: 720px; display: flex; align-items: center; gap: .7rem; background: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 1px 2px rgba(20,33,61,.08); border-left: 3px solid var(--accent); }
.mp-inbox-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-inbox .mp-from { font-size: .86rem; color: var(--ink); }
.mp-line { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-line b { color: var(--text); font-weight: 700; }
.mp-time { font-size: .76rem; color: var(--faint); font-weight: 700; }
.mp-av { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 800; flex-shrink: 0; }
.mp-av-lg { width: 38px; height: 38px; }
.mp-device { width: 100%; max-width: 720px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,33,61,.12); overflow: hidden; transition: max-width .25s ease; }
.mp-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.mp-subject { font-size: 1.15rem; font-weight: 800; margin: 0 0 .7rem; overflow-wrap: anywhere; }
.mp-meta { display: flex; gap: .7rem; align-items: center; font-size: .84rem; min-width: 0; }
.mp-meta > div { min-width: 0; overflow-wrap: anywhere; }
.mp-addr { color: var(--muted); }
.mp-frame { display: block; width: 100%; height: 480px; border: 0; background: #fff; }
.mail-preview.is-mobile .mp-device, .mail-preview.is-mobile .mp-inbox { max-width: 390px; }
.mail-preview.is-mobile .mp-device { border-radius: 36px; border: 10px solid #1b2333; box-shadow: 0 18px 40px rgba(20,33,61,.25); position: relative; }
.mail-preview.is-mobile .mp-device::before { content: ''; display: block; width: 90px; height: 18px; margin: 6px auto 0; border-radius: 99px; background: #1b2333; }
.mail-preview.is-mobile .mp-head { padding: 10px 14px; }
.mail-preview.is-mobile .mp-subject { font-size: 1rem; }
.compose-side .mail-preview { position: relative; }
.compose-side .mp-stage { padding: 14px; max-height: calc(100vh - 170px); overflow-y: auto; }
@media (max-width: 575.98px) { .mp-stage { padding: 10px; } .mail-preview.is-mobile .mp-device { border-width: 6px; border-radius: 24px; } .mp-head { padding: 12px; } }

.health-compact { margin: 0 0 1rem; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
@media (min-width: 520px) { .health-compact { grid-template-columns: 1fr 1fr; } }
.health-compact li { padding: .4rem .6rem; font-size: .8rem; }
.health li.warn { background: var(--sunken); }
.hc-mark { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; margin-top: .1rem; color: #fff; background: var(--green); }
.health li.bad .hc-mark { background: var(--red); }
.health li.warn .hc-mark { background: var(--faint); }

/* ---------------------------------------------------------------- 2.3: import wizard */
.pill-no_email, .pill-new { background: var(--blue-soft); color: var(--blue); border-color: #cfdcf5; }
.pill-no_email::before, .pill-new::before { display: none; }
.wizard-steps { display: flex; gap: 1rem; list-style: none; margin: .3rem 0 0; padding: 0; font-size: .8rem; font-weight: 700; color: var(--faint); counter-reset: ws; }
.wizard-steps li { counter-increment: ws; display: flex; align-items: center; gap: .35rem; }
.wizard-steps li::before { content: counter(ws); width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
.wizard-steps li.current { color: var(--ink); } .wizard-steps li.current::before { background: var(--accent); color: var(--on-accent, #fff); }
.wizard-steps li.done { color: var(--ink); } .wizard-steps li.done::before { content: '✓'; background: var(--ink); color: #fff; }
.import-dest .label:first-child, .import-dest p.label { margin-top: .9rem; }
.import-paste { min-height: 180px; white-space: pre; overflow-x: auto; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center; border: 2px dashed var(--line-2); border-radius: var(--r-m); padding: 34px 16px; margin: .9rem 0 0; cursor: pointer; background: var(--sunken); }
.dropzone i { font-size: 1.6rem; color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { color: var(--ink); overflow-wrap: anywhere; }
.sum-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 .3rem; }
.sum { border: 1px solid var(--line); background: var(--sunken); border-radius: 99px; padding: .3rem .75rem; font-size: .84rem; color: var(--muted); }
.sum b { color: var(--ink); }
.sum.ok { background: var(--green-soft); border-color: #c7e5d3; } .sum.ok b { color: var(--green); }
.sum.warn { background: var(--amber-soft); border-color: #f1dca8; } .sum.warn b { color: var(--amber); }
.sum.bad { background: var(--red-soft); border-color: #f5c6c0; } .sum.bad b { color: var(--red); }
.map-grid { display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr); margin-top: .6rem; }
@media (min-width: 768px) { .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.map-col { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: var(--r-s); padding: .5rem .6rem; background: var(--surface); }
.map-col.is-mapped { border-color: #c7e5d3; background: #fbfefc; }
.map-src { min-width: 0; display: flex; flex-direction: column; }
.map-src strong { font-size: .86rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-arrow { color: var(--faint); font-size: .8rem; }
.import-preview { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-s); margin-top: .6rem; }
.import-preview th { position: sticky; top: 0; z-index: 1; }
.import-preview td { font-size: .82rem; }
.toolbar-end.m-0 { margin-left: auto; }
@media (max-width: 575.98px) { .section-head .toolbar-end { width: 100%; } .section-head .toolbar-end .btn { flex: 1; } }

/* ---------------------------------------------------------------- Sales report */
.panel-head { padding: 14px 16px 6px; }
.panel-head h2 { margin: 0; }
.report-filters { margin-top: .75rem; }
@media (min-width: 768px) { .report-filters { grid-template-columns: repeat(3, minmax(0, 220px)); } }
.report-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
.report-grid .panel { margin: 0; }
@media (min-width: 992px) { .report-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.daychart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 18px; overflow-x: auto; }
.dc-col { flex: 1 0 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 14px; }
.dc-bar { width: 100%; max-width: 28px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.dc-n { font-size: .68rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.dc-d { font-size: .66rem; color: var(--faint); margin-top: 3px; }
.outcome-bars { display: flex; flex-direction: column; gap: .6rem; }
.ob-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) auto; gap: .6rem; align-items: center; font-size: .86rem; }
.ob-label { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-track { height: 10px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.ob-fill { display: block; height: 100%; border-radius: 99px; }
.ob-n { font-weight: 800; color: var(--ink); min-width: 4.5ch; text-align: right; }
.ob-n small { color: var(--faint); font-weight: 600; }

@media print {
  .sidebar, .topbar, .scrim, .toolbar, .toast-stack, .flash-stack, .filter-toggle, .report-filters .f-reset { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; max-width: none; }
  .pane[hidden] { display: none !important; }
  .panel, .kpis { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

.cell-outcomes { min-width: 200px; }
.mini-stack { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #eef1f6; max-width: 240px; }
.mini-stack span { display: block; }
.mini-legend { display: flex; flex-wrap: wrap; gap: .1rem .7rem; margin-top: .35rem; font-size: .78rem; color: var(--muted); }
.mini-legend span { white-space: nowrap; }

/* --- 2.3.1: campaign "Sent" state, next-batch button, notes on contacts --- */
.pill-done { font-weight: 700; }
.pill-done::before { display: none; }
.pill-done i { font-size: .7rem; }
.btn-next-batch { display: inline-flex; align-items: center; gap: .4rem; }
.btn-next-batch i { font-size: .78rem; }
.cell-note { min-width: 180px; max-width: 280px; }
.cell-note .note-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--sunken); border: 1px solid var(--line); border-radius: 99px; padding: .05rem .5rem; margin-bottom: .2rem; }
.cell-note .note-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.import-preview .cell-note { font-size: .82rem; color: var(--muted); white-space: normal; }
@media (max-width: 1199.98px) { .cell-note { max-width: none; min-width: 0; } }
.camp[data-status=sent] { border-left-color: var(--green); }
@media (min-width: 1300px) {
  .camp { grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr) auto fit-content(440px); }
  .camp-actions { flex-wrap: wrap; }
}
@media (min-width: 1200px) { #aeTable .row-actions { flex-wrap: wrap; justify-content: flex-end; width: 176px; margin-left: auto; } #aeTable .cell-note { min-width: 160px; } #aeTable .cell-email { overflow-wrap: normal; word-break: normal; } }
@media (max-width: 1199.98px) { #aeTable td.cell-note.is-empty { display: none; } #aeTable .cell-note > div { min-width: 0; } }
