/* AIstap Workspace: styles.css
   Calm light theme (dark follows the system setting). Accent #2a78d6.
   Status colours always come with an icon and a text label (never colour alone). */

:root {
  color-scheme: light dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --border: #dde3ea;
  --border-strong: #c3ccd7;
  --text: #16202b;
  --text-2: #465261;
  --muted: #5a6574;
  --accent: #2a78d6;
  --accent-ink: #1c5fae;
  --accent-soft: #e9f1fc;
  --btn-primary: #1f69c2;
  --btn-primary-hover: #1a5aa8;
  --focus: #2a78d6;
  --call: #157a3c;
  --call-hover: #11652f;
  --danger: #b42318;
  --danger-ink: #8f1c13;
  --danger-soft: #fdeceb;
  --ok-ink: #17602f;
  --ok-soft: #e6f5ea;
  --ok-border: #b5dfc1;
  --warn-ink: #7a4a00;
  --warn-soft: #fff5de;
  --warn-border: #f0d49a;
  --free-bg: #e5f5e9;
  --free-border: #93cfa5;
  --free-fg: #165f35;
  --booked-bg: #e6effb;
  --booked-border: #9dc0ee;
  --booked-fg: #154c8e;
  --nl-bg: #f7f9fc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .22);
  --topbar-h: 56px;

  /* status: background / text / border */
  --st-new-bg: #eef2f7;        --st-new-fg: #334155;        --st-new-bd: #cfd8e3;
  --st-no_answer-bg: #fff4e0;  --st-no_answer-fg: #7a4800;  --st-no_answer-bd: #efd29b;
  --st-callback-bg: #f1ecfd;   --st-callback-fg: #5635bd;   --st-callback-bd: #d8ccf8;
  --st-interested-bg: #e1f5ef; --st-interested-fg: #0d6252; --st-interested-bd: #aee0d2;
  --st-booked-bg: #e6effb;     --st-booked-fg: #1c5fae;     --st-booked-bd: #b9d2f3;
  --st-not_interested-bg: #f1f2f4; --st-not_interested-fg: #4b5563; --st-not_interested-bd: #d7dbe1;
  --st-wrong_number-bg: #fff0e5;   --st-wrong_number-fg: #973a00;   --st-wrong_number-bd: #f3cba9;
  --st-client-bg: #e4f5e8;     --st-client-fg: #196b31;     --st-client-bd: #b3dfbf;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1319;
    --surface: #151c24;
    --surface-2: #1b242e;
    --border: #28333f;
    --border-strong: #3a4756;
    --text: #e6ebf1;
    --text-2: #b8c2ce;
    --muted: #9ba7b5;
    --accent-ink: #86b9f6;
    --accent-soft: rgba(42, 120, 214, .16);
    --btn-primary: #2468bc;
    --btn-primary-hover: #2f78d0;
    --call: #1c8445;
    --call-hover: #22964f;
    --danger: #c9302c;
    --danger-ink: #ffb4ab;
    --danger-soft: rgba(201, 48, 44, .16);
    --ok-ink: #8fe0a8;
    --ok-soft: rgba(34, 160, 80, .14);
    --ok-border: rgba(80, 200, 120, .35);
    --warn-ink: #f7cd7d;
    --warn-soft: rgba(245, 170, 30, .12);
    --warn-border: rgba(245, 170, 30, .35);
    --free-bg: rgba(40, 170, 90, .16);
    --free-border: rgba(90, 200, 130, .45);
    --free-fg: #9be3b3;
    --booked-bg: rgba(42, 120, 214, .22);
    --booked-border: rgba(110, 165, 235, .5);
    --booked-fg: #b9d5fb;
    --nl-bg: #18212a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
    --st-new-bg: rgba(148, 163, 184, .14);       --st-new-fg: #cfd8e3;       --st-new-bd: rgba(148, 163, 184, .35);
    --st-no_answer-bg: rgba(245, 158, 11, .14);  --st-no_answer-fg: #f6c877; --st-no_answer-bd: rgba(245, 158, 11, .4);
    --st-callback-bg: rgba(139, 92, 246, .18);   --st-callback-fg: #cbbdfd;  --st-callback-bd: rgba(139, 92, 246, .45);
    --st-interested-bg: rgba(20, 184, 166, .15); --st-interested-fg: #86e3d3; --st-interested-bd: rgba(20, 184, 166, .4);
    --st-booked-bg: rgba(42, 120, 214, .2);      --st-booked-fg: #a9cbf8;    --st-booked-bd: rgba(90, 150, 230, .45);
    --st-not_interested-bg: rgba(148, 163, 184, .1); --st-not_interested-fg: #b3bdc9; --st-not_interested-bd: rgba(148, 163, 184, .3);
    --st-wrong_number-bg: rgba(249, 115, 22, .15);   --st-wrong_number-fg: #fdbb85;   --st-wrong_number-bd: rgba(249, 115, 22, .4);
    --st-client-bg: rgba(34, 197, 94, .15);      --st-client-fg: #8feaae;    --st-client-bd: rgba(34, 197, 94, .4);
  }
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; color: var(--text); }
p { margin: 0 0 .6em; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.page-title:focus, .script-h:focus, main:focus { outline: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }
.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em;
}
.icon-xs { width: .95em; height: .95em; }

/* ---------------- forms ---------------- */
input, select, textarea, button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=url],
input[type=datetime-local], select, textarea {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  min-height: 42px;
  width: 100%;
  max-width: 100%;
}
select { width: auto; min-width: 150px; }
textarea { resize: vertical; line-height: 1.5; }
input[readonly], textarea[readonly] { background: var(--surface-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .label-like, fieldset.field > legend { font-weight: 650; font-size: 15px; }
.optional { font-weight: 400; color: var(--muted); }
.btn-inline { justify-self: start; text-align: left; padding-left: 4px; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.form-error { color: var(--danger); font-weight: 600; margin: 4px 0 0; min-height: 0; }
.form-error:empty { display: none; }
.form-ok { color: var(--ok-ink); font-weight: 600; margin: 8px 0 0; }
.form-ok:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
fieldset { min-width: 0; }
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; min-height: 40px; }
.radio input { width: 20px; height: 20px; accent-color: var(--btn-primary); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--btn-primary); }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--warn-ink); font-weight: 600; margin: 0 0 12px; }
.hint-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text); margin-bottom: 16px; }
.hint-box p { margin: 0; }
.hint-box .icon { color: var(--accent-ink); margin-top: 2px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 16px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn-primary { background: var(--btn-primary); color: #fff; }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent-ink); border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-call { background: var(--call); color: #fff; }
.btn-call:hover { background: var(--call-hover); }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 18px; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 14px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------------- badges, tags, pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid;
  font-size: 14px; font-weight: 650; white-space: nowrap; line-height: 1.35;
}
.badge-lg { font-size: 15px; padding: 5px 13px; }
.status-new { background: var(--st-new-bg); color: var(--st-new-fg); border-color: var(--st-new-bd); }
.status-no_answer { background: var(--st-no_answer-bg); color: var(--st-no_answer-fg); border-color: var(--st-no_answer-bd); }
.status-callback { background: var(--st-callback-bg); color: var(--st-callback-fg); border-color: var(--st-callback-bd); }
.status-interested { background: var(--st-interested-bg); color: var(--st-interested-fg); border-color: var(--st-interested-bd); }
.status-booked { background: var(--st-booked-bg); color: var(--st-booked-fg); border-color: var(--st-booked-bd); }
.status-not_interested { background: var(--st-not_interested-bg); color: var(--st-not_interested-fg); border-color: var(--st-not_interested-bd); }
.status-wrong_number { background: var(--st-wrong_number-bg); color: var(--st-wrong_number-fg); border-color: var(--st-wrong_number-bd); }
.status-client { background: var(--st-client-bg); color: var(--st-client-fg); border-color: var(--st-client-bd); }
.status-unknown { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
/* Do not contact: solid red, everywhere. */
.status-do_not_contact { background: var(--danger); color: #fff; border-color: var(--danger); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 650; white-space: nowrap; line-height: 1.4;
}
.tag-muted { background: var(--surface-2); color: var(--text-2); }
.tag-gap { margin-left: 8px; }
.import-note { margin-top: 12px; }
.tag-batch-a { background: var(--st-booked-bg); color: var(--st-booked-fg); border-color: var(--st-booked-bd); }
.tag-batch-b { background: var(--st-new-bg); color: var(--st-new-fg); border-color: var(--st-new-bd); }
.tag-nl { background: var(--st-wrong_number-bg); color: var(--st-wrong_number-fg); border-color: var(--st-wrong_number-bd); }
.tag-owner { background: var(--st-callback-bg); color: var(--st-callback-fg); border-color: var(--st-callback-bd); }
.tag-new { background: var(--st-client-bg); color: var(--st-client-fg); border-color: var(--st-client-bd); }
.bstat-booked { background: var(--st-booked-bg); color: var(--st-booked-fg); border-color: var(--st-booked-bd); }
.bstat-done { background: var(--st-client-bg); color: var(--st-client-fg); border-color: var(--st-client-bd); }
.bstat-no_show { background: var(--st-no_answer-bg); color: var(--st-no_answer-fg); border-color: var(--st-no_answer-bd); }
.bstat-cancelled { background: var(--st-not_interested-bg); color: var(--st-not_interested-fg); border-color: var(--st-not_interested-bd); text-decoration: line-through; }
.fit { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.fit strong { font-size: 16px; color: var(--text); }
.fit-high strong { color: var(--ok-ink); }
.fit-low strong { color: var(--muted); }
.fit-reason { color: var(--text-2); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.due-over { color: var(--danger); }
.dnc-text { color: var(--danger); font-weight: 700; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.dnc-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; margin: 12px 0; border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 2px solid var(--danger); color: var(--danger-ink);
}
.dnc-banner .icon { width: 1.4em; height: 1.4em; color: var(--danger); margin-top: 1px; }
.unsafe-url { color: var(--text-2); overflow-wrap: anywhere; }
.ext { overflow-wrap: anywhere; }
.ext .icon { margin-left: 3px; }

/* ---------------- shell ---------------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px;
  background: var(--btn-primary); color: #fff; border: 0; font-weight: 700; }
.skip:focus { top: 10px; }
.mock-banner {
  background: #fff0b3; color: #4d3900; border-bottom: 1px solid #e3c65a;
  text-align: center; padding: 6px 14px; font-size: 14px; font-weight: 650;
}
@media (prefers-color-scheme: dark) { .mock-banner { background: #3a2f07; color: #f7dd84; border-color: #6b561b; } }
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; }
.brand-sub { font-weight: 500; color: var(--muted); }
.me { display: flex; align-items: center; gap: 12px; }
.me-name { font-weight: 650; }
/* The first column is painted full height, so the sidebar colour never stops on long pages. */
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h));
  background: linear-gradient(90deg, var(--surface) 0 223px, var(--border) 223px 224px, transparent 224px); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { margin: 12px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
main { padding: 26px 34px 80px; min-width: 0; max-width: 1360px; width: 100%; }

/* ---------------- page pieces ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 28px; margin: 0; letter-spacing: -.015em; }
.page-sub { color: var(--text-2); margin: 4px 0 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; min-width: 0;
}
.card-title { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.loading { display: flex; align-items: center; gap: 12px; padding: 40px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { scroll-behavior: auto !important; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; color: var(--muted); text-align: center; }
.empty .icon { width: 26px; height: 26px; }
.empty p { margin: 0; max-width: 46ch; }
.error-box { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--danger); background: var(--danger-soft); color: var(--text); }
.error-box .icon { color: var(--danger); width: 22px; height: 22px; }
.error-title { font-weight: 700; }
.flash {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 18px; border-radius: var(--radius);
  background: var(--ok-soft); border: 1px solid var(--ok-border); color: var(--ok-ink);
}
.flash > .icon { width: 22px; height: 22px; }
.flash p { margin: 0; flex: 1 1 240px; font-weight: 650; }
.label-sm { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* ---------------- Today ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
}
.stat-link:hover { border-color: var(--accent); }
.stat-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-num { font-size: 28px; font-weight: 750; line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--text-2); font-weight: 600; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr); gap: 20px; align-items: start; }
.next-call { border: 2px solid var(--accent); padding: 24px 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow-due { color: var(--danger); }
.nc-name { font-size: 30px; margin: 6px 0 10px; letter-spacing: -.02em; }
.nc-name a { color: var(--text); text-decoration: none; }
.nc-name a:hover { text-decoration: underline; }
.nc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--text-2); margin-bottom: 12px; }
.nc-next, .nc-dm, .nc-hook { margin: 0 0 8px; }
.nc-dm { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-weight: 600; }
.nc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.opener {
  margin: 12px 0; padding: 14px 18px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0;
  font-size: 18px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere;
}
.opener-lg { font-size: 19px; }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li + li { border-top: 1px solid var(--border); }
.q-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: 8px; color: inherit; text-decoration: none;
}
.q-row:hover { background: var(--surface-2); }
.q-num { color: var(--muted); font-weight: 700; text-align: right; }
.q-main { display: grid; min-width: 0; }
.q-name { font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blist { list-style: none; margin: 0; padding: 0; }
.blist li + li { border-top: 1px solid var(--border); }
.b-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 2px 12px; align-items: start;
  width: 100%; padding: 10px 6px; border: 0; border-radius: 8px; background: none; color: inherit; text-align: left; cursor: pointer;
}
.b-row:hover { background: var(--surface-2); }
.b-when { grid-row: 1 / span 2; font-weight: 700; font-size: 14px; padding-top: 2px; }
.b-row > .tag { grid-column: 2; justify-self: start; }
.b-main { display: grid; min-width: 0; }
.b-company { font-weight: 650; overflow-wrap: anywhere; }
.b-sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.later { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.later a { display: flex; gap: 12px; padding: 8px 6px; border-radius: 8px; color: var(--text); text-decoration: none; }
.later a:hover { background: var(--surface-2); }
.later-time { font-weight: 700; color: var(--st-callback-fg); min-width: 48px; }

/* ---------------- Companies ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 18px; }
.filter { display: grid; gap: 4px; }
.filter > label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.filter-search { flex: 1 1 260px; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 38px; }
.filter-check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.filter-check label { font-weight: 600; font-size: 15px; color: var(--text); }
.table-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.table-top .count { margin: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--st-callback-bd);
  background: var(--st-callback-bg); color: var(--st-callback-fg); font-weight: 650; font-size: 14px; cursor: pointer; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table-compact th, .table-compact td { padding: 7px 10px; font-size: 14px; }
.table-caption { caption-side: top; text-align: left; font-size: 14px; color: var(--muted); padding: 8px 0; }
.sort-btn { background: none; border: 0; padding: 0; color: inherit; font-weight: 700; cursor: pointer; }
.sort-btn:hover { color: var(--accent-ink); }
.col-name { min-width: 230px; width: 25%; }
.co-link { font-weight: 650; color: var(--text); text-decoration: none; }
.co-link:hover { color: var(--accent-ink); text-decoration: underline; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.row-tags:empty { display: none; }
.col-next { min-width: 190px; }
.next-cell { display: grid; gap: 2px; }
.next-text { font-size: 14px; color: var(--text-2); }
.col-phone { white-space: nowrap; }
.tel { font-weight: 600; text-decoration: none; }
.tel:hover { text-decoration: underline; }
.row-dnc td { background: var(--danger-soft); }
.row-archived td { color: var(--muted); }

/* ---------------- Company page ---------------- */
.co-head { margin-bottom: 18px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; text-decoration: none; margin-bottom: 10px; }
.co-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.co-title-row .page-title { font-size: 30px; }
.co-meta { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--text-2); }
.co-meta li { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.co-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.co-next { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.co-col { min-width: 0; }
.info { margin: 0; display: grid; gap: 12px; }
.info-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.info-row dt { color: var(--text-2); font-weight: 650; font-size: 14px; padding-top: 2px; }
.info-row dd { margin: 0; overflow-wrap: anywhere; }
.info-strong dd { font-weight: 650; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: 14px; overflow-wrap: anywhere; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.log-call .outcomes-fs { border: 0; padding: 0; margin: 0 0 12px; }
.outcomes-fs legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.outcome {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-weight: 650; text-align: left; cursor: pointer; line-height: 1.25;
}
.outcome:hover { border-color: var(--accent); }
.outcome[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.outcome-book { color: var(--st-booked-fg); }
.outcome-danger { color: var(--danger); }
.outcome-danger[aria-pressed=true] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); background: var(--danger-soft); color: var(--danger); }
.when-box { display: grid; gap: 8px; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.when-box > label { font-weight: 700; }
.when-box input { max-width: 280px; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-picks .btn { border: 1px solid var(--border-strong); background: var(--surface); }
.counter { font-size: 13px; color: var(--muted); justify-self: end; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 11px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--border); }
.tl-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.tl-booking .tl-icon { background: var(--st-booked-bg); color: var(--st-booked-fg); }
.tl-head { margin: 0; }
.tl-meta { color: var(--muted); font-weight: 400; font-size: 14px; }
.tl-notes { white-space: pre-wrap; margin: 4px 0 0; overflow-wrap: anywhere; color: var(--text); }
.manage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; align-items: start; }
.manage-grid .field { margin: 0; }
.manage .btn-ghost { justify-self: start; }

/* ---------------- dialogs ---------------- */
.dlg {
  border: 0; padding: 0; border-radius: 16px;
  width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dlg-wide { width: min(1120px, calc(100vw - 28px)); }
.dlg::backdrop { background: rgba(15, 23, 42, .5); }
.dlg-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px 14px 22px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.dlg-title { margin: 0; font-size: 20px; }
.dlg-body { padding: 18px 22px 22px; }
.dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dlg-actions.wrap { justify-content: flex-start; }
.confirm-msg { font-size: 17px; }
.bk-company { font-size: 17px; margin-bottom: 12px; }
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.bk-grid h3 { font-size: 17px; margin: 0 0 10px; }
.bk-slots { max-height: min(60vh, 560px); overflow-y: auto; padding-right: 6px; }
.slot-day { border: 0; padding: 0; margin: 0 0 14px; }
.slot-day legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.slot-chip { position: relative; }
.slot-chip span {
  display: inline-block; min-width: 72px; text-align: center; padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--free-border); background: var(--free-bg); color: var(--free-fg); font-weight: 700; cursor: pointer;
}
.slot-chip:hover span { border-color: var(--free-fg); }
.slot-chip input:checked + span { background: var(--btn-primary); border-color: var(--btn-primary); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--btn-primary); }
.slot-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.lang-fs { border: 0; padding: 0; margin: 0 0 14px; }
.lang-fs legend { padding: 0; margin-bottom: 4px; }
.tamara-note { display: flex; gap: 8px; align-items: center; margin: 6px 0 0; padding: 9px 12px; border-radius: 9px;
  background: var(--st-wrong_number-bg); color: var(--st-wrong_number-fg); border: 1px solid var(--st-wrong_number-bd); }
.confirm-summary { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px;
  background: var(--ok-soft); border: 1px solid var(--ok-border); }
.confirm-summary > .icon { width: 26px; height: 26px; color: var(--ok-ink); }
.cs-main { font-size: 18px; font-weight: 700; margin: 0 0 2px; }
.cs-sub { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.mail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.mail-col h3 { margin: 0 0 10px; font-size: 17px; }
.mail-body { font-size: 14.5px; line-height: 1.5; min-height: 340px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.details .info-row { grid-template-columns: 120px minmax(0, 1fr); }
.pick-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; display: grid; gap: 4px; }
.pick-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-align: left; cursor: pointer; }
.pick-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.pick-name { font-weight: 650; }
.pick-sub { grid-row: 2; font-size: 14px; color: var(--muted); }
.pick-item .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* ---------------- toasts ---------------- */
/* Bottom-left and click-through, so a toast never hides or blocks a button (dialog actions sit bottom-right). */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 1000; display: grid; gap: 8px; max-width: min(440px, calc(100vw - 40px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px;
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600;
  transition: opacity .3s, transform .3s;
}
.toast .icon { margin-top: 2px; }
.toast-error { background: var(--danger); color: #fff; }
.toast-out { opacity: 0; transform: translateY(6px); }

/* ---------------- Calendar ---------------- */
.cal-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.cal-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 11px; padding: 3px; margin: 0; background: var(--surface); gap: 3px; }
.seg label span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-weight: 650; cursor: pointer; color: var(--text-2); }
.seg input:checked + span { background: var(--btn-primary); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.cal-help { color: var(--text-2); margin: 0 0 8px; }
.legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-grid; place-items: center; width: 22px; height: 18px; border-radius: 5px; border: 1px solid var(--border); }
.sw-free { background: var(--free-bg); border-color: var(--free-border); color: var(--free-fg); }
.sw-booked { background: var(--booked-bg); border-color: var(--booked-border); color: var(--booked-fg); }
.sw-empty { background: var(--surface); }
.sw-past { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, var(--border) 4px 5px); }
.cal-wrap { padding: 6px; overflow-x: auto; }
.cal { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cal th, .cal td { padding: 2px 3px; border-bottom: 1px solid var(--border); }
.cal td + td, .cal th + th { border-left: 1px solid var(--border); }
.cal tbody tr:last-child td, .cal tbody tr:last-child th { border-bottom: 0; }
.cal-corner { width: 62px; }
.cal-day { text-align: left; padding: 8px 10px !important; }
.cal-dow { display: block; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-date { display: block; font-size: 16px; font-weight: 700; }
.cal-today .cal-date { color: var(--accent-ink); }
.cal-today-tag { display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--accent); color: #fff; }
.col-today { background: var(--accent-soft); }
.cal-time { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; padding-right: 10px !important; vertical-align: middle; white-space: nowrap; }
.half-row .cal-time { font-weight: 400; opacity: .75; }
.hour-row td, .hour-row th { border-top: 1px solid var(--border-strong); }
.cell {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 8px;
  border-radius: 6px; border: 1px solid transparent; background: none; color: inherit;
  font-size: 13px; line-height: 1; text-align: left; overflow: hidden;
}
button.cell { cursor: pointer; }
.cell-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cell-free { background: var(--free-bg); border-color: var(--free-border); color: var(--free-fg); font-weight: 700; }
.cell-free:hover { border-color: var(--free-fg); }
.cell-cta { margin-left: auto; font-size: 12px; text-decoration: underline; }
.cell-booked { background: var(--booked-bg); border-color: var(--booked-border); color: var(--booked-fg); font-weight: 700; }
.cell-booked:hover { border-color: var(--booked-fg); }
.cell-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cell-tag { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; padding: 2px 5px; border-radius: 4px;
  background: var(--st-wrong_number-bg); color: var(--st-wrong_number-fg); }
.cell-past-booked { opacity: .7; }
.cell-past { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--surface-2) 5px 7px); }
.cell-addable { color: transparent; }
.cell-addable:hover, .cell-addable:focus-visible { color: var(--muted); border: 1px dashed var(--border-strong); background: var(--surface-2); }

/* ---------------- Script ---------------- */
.script-toc { position: sticky; top: var(--topbar-h); z-index: 5; background: var(--bg); padding: 8px 0 10px; margin-bottom: 6px; }
.script-toc ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.toc-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 650; font-size: 15px; cursor: pointer; }
.toc-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.script-sec { font-size: 18px; line-height: 1.6; scroll-margin-top: 120px; padding: 22px 0 10px; }
.script-sec > .script-h, .script-sec > .script-sub, .script-sec > .field, .script-sec > .muted { margin-left: 24px; margin-right: 24px; }
.script-h { font-size: 24px; margin: 0 0 4px; scroll-margin-top: 120px; }
.script-sub { color: var(--text-2); margin: 0 0 14px; font-size: 16px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pair > div { padding: 12px 24px; min-width: 0; overflow-wrap: anywhere; }
.pair > .col-nl { background: var(--nl-bg); border-left: 1px solid var(--border); }
.pair-head > div { padding-top: 6px; padding-bottom: 6px; font-size: 13px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); }
.pre > div { white-space: pre-line; }
.mail-text > div { font-size: 16px; }
.lead { color: var(--accent-ink); }
.pairs-num { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.pairs-num > li { counter-increment: n; border-top: 1px solid var(--border); }
.pairs-num > li .pair > div::before { content: counter(n) ". "; font-weight: 700; color: var(--muted); }
.steps, .situations, .objections { list-style: none; margin: 0; padding: 0; }
.step { border-top: 1px solid var(--border); padding: 18px 0 16px; }
.step-title { font-size: 21px; margin: 0 24px 4px; }
.step-goal { margin: 0 24px 10px; color: var(--text-2); font-size: 17px; }
.say > div { font-size: 19px; }
.branches { display: grid; gap: 8px; margin: 12px 24px 0; }
.branch { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 17px; }
.branch-label { font-weight: 750; display: inline-flex; align-items: center; gap: 5px; }
.branch-yes { background: var(--ok-soft); }
.branch-yes .branch-label { color: var(--ok-ink); }
.branch-no { background: var(--warn-soft); }
.branch-no .branch-label { color: var(--warn-ink); }
.situations > li { border-top: 1px solid var(--border); padding: 14px 0 4px; }
.situation { font-size: 18px; margin: 0 24px 6px; }
.obj-filter { max-width: 560px; }
.objection { border-top: 1px solid var(--border); padding: 6px 0; }
.obj-q { font-weight: 750; margin: 0; }

/* ---------------- Admin ---------------- */
.form-card { max-width: 980px; }
.kvs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.kv { display: grid; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 120px; }
.kv-num { font-size: 26px; font-weight: 750; }
.kv-label { font-size: 14px; color: var(--text-2); font-weight: 600; }
.kv-groups { display: flex; flex-wrap: wrap; gap: 12px 48px; margin-bottom: 12px; }
.kv-groups h3 { font-size: 15px; margin: 0 0 4px; }
.plain { list-style: none; margin: 0; padding: 0; }
.issues { margin: 8px 0; }
.issues summary { cursor: pointer; font-weight: 650; }
.issues ul { margin: 6px 0 0; }

/* ---------------- Login ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.is-mock .login { min-height: calc(100vh - 36px); }
.login-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-lg); }
.login-card .brand { margin-bottom: 18px; }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.login-lead { color: var(--text-2); margin: 0 0 18px; }
.notice { padding: 11px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--warn-ink); font-weight: 650; margin: 0 0 16px; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 14px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .co-grid { grid-template-columns: minmax(0, 1fr); }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-grid, .form-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: sticky; top: var(--topbar-h); z-index: 20; height: auto; overflow-x: auto;
    padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .nav ul { display: flex; gap: 4px; }
  .nav a { padding: 8px 9px; gap: 7px; white-space: nowrap; }
  .nav-sep { display: none; }
  .script-toc { top: calc(var(--topbar-h) + 52px); }
  main { padding: 18px 16px 64px; }
  .bk-grid, .mail-cols { grid-template-columns: minmax(0, 1fr); }
  .bk-slots { max-height: none; }
  .q-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .q-row .fit, .q-row .badge { display: none; }
}
@media (max-width: 640px) {
  .brand-sub, .me-role, #pwBtn { display: none; }
  .info-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .outcomes { grid-template-columns: minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair > .col-nl { border-left: 0; border-top: 1px dashed var(--border); }
  .stats { grid-template-columns: minmax(0, 1fr); }
}
