/* Soarmlich Outreach Portal — self-contained stylesheet (no external fonts/CDN). */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e2e6ee;
  --border-strong: #cbd3e1;
  --text: #16202f;
  --text-muted: #5f6b80;
  --text-faint: #8b95a7;
  --brand: #1f5f8b;
  --brand-dark: #17475f;
  --brand-light: #e8f1f8;
  --nav-bg: #10202f;
  --nav-text: #a9b8c9;
  --nav-active: #ffffff;

  --ok: #1a7f56;
  --ok-bg: #e6f5ee;
  --warn: #a76b04;
  --warn-bg: #fdf3e0;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --info: #24608f;
  --info-bg: #e8f1f8;
  --neutral: #5f6b80;
  --neutral-bg: #eef1f5;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 47, .06), 0 1px 3px rgba(16, 32, 47, .04);
  --shadow-lg: 0 4px 16px rgba(16, 32, 47, .1);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- layout */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand strong { color: #fff; font-size: 15px; display: block; letter-spacing: .2px; }
.brand span { font-size: 11px; color: #6f8398; text-transform: uppercase; letter-spacing: .8px; }

.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; margin-bottom: 2px;
  border-radius: 6px; color: var(--nav-text);
  font-size: 13.5px; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: var(--brand); color: var(--nav-active); font-weight: 500; }
.nav .nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: #5d7086; padding: 14px 11px 5px;
}
.nav svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .9; }

.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px;
}
.sidebar-foot .who { color: #fff; font-weight: 500; }
.sidebar-foot .role { color: #6f8398; text-transform: uppercase; font-size: 10px; letter-spacing: .7px; }
.sidebar-foot form { margin-top: 8px; }
.sidebar-foot button {
  width: 100%; background: rgba(255, 255, 255, .08); border: 0; color: var(--nav-text);
  padding: 6px; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.sidebar-foot button:hover { background: rgba(255, 255, 255, .15); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar .sub { color: var(--text-muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }

.content { padding: 22px 24px 60px; max-width: 1600px; width: 100%; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-head .hint { color: var(--text-faint); font-size: 12px; font-weight: 400; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px)  { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- stat tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.tile .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-faint); font-weight: 600; margin-bottom: 6px;
}
.tile .value { font-size: 25px; font-weight: 600; line-height: 1.1; letter-spacing: -.5px; }
.tile .value.sm { font-size: 20px; }
.tile .foot { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.tile.accent-ok .value { color: var(--ok); }
.tile.accent-bad .value { color: var(--bad); }
.tile.accent-warn .value { color: var(--warn); }
.tile.accent-brand .value { color: var(--brand); }

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 9px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.data th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data th a:hover { color: var(--brand); text-decoration: none; }
table.data th .arrow { color: var(--brand); font-size: 10px; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--text-faint); }
.cell-strong { font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ pills */

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral);
}
.pill.replied  { background: var(--ok-bg);      color: var(--ok); }
.pill.sent     { background: var(--info-bg);    color: var(--info); }
.pill.bounced  { background: var(--bad-bg);     color: var(--bad); }
.pill.failed   { background: var(--bad-bg);     color: var(--bad); }
.pill.queued   { background: var(--warn-bg);    color: var(--warn); }
.pill.unsubscribed, .pill.suppressed { background: #f0eefc; color: #5b45a8; }
.pill.not_contacted { background: var(--neutral-bg); color: var(--text-faint); }
.pill.active   { background: var(--ok-bg);   color: var(--ok); }
.pill.paused   { background: var(--warn-bg); color: var(--warn); }
.pill.blocked  { background: var(--bad-bg);  color: var(--bad); }
.pill.archived { background: var(--neutral-bg); color: var(--neutral); }
.pill.admin    { background: var(--brand-light); color: var(--brand); }
.pill.editor   { background: var(--info-bg); color: var(--info); }
.pill.viewer   { background: var(--neutral-bg); color: var(--neutral); }
.pill.priority { background: #fdf0e3; color: #9a5b06; }
.pill.warn     { background: var(--warn-bg); color: var(--warn); }
.pill.ok       { background: var(--ok-bg);   color: var(--ok); }

/* ---------------------------------------------------------------- filters */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: #fff; color: var(--text); min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-light); border-color: var(--brand); outline-offset: 0;
}
select[multiple] { min-height: 96px; padding: 4px; }
textarea { resize: vertical; font-family: inherit; }

.searchbar { position: relative; flex: 1 1 320px; min-width: 240px; }
.searchbar input { width: 100%; padding-left: 32px; }
.searchbar svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-faint); pointer-events: none;
}

.btn {
  font: inherit; font-weight: 500; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #e9c4c1; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.checkline { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.checkline input { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--brand-light);
  color: var(--brand-dark); border-radius: 20px; padding: 3px 6px 3px 10px; font-size: 12px;
}
.chip a { color: var(--brand-dark); font-weight: 700; line-height: 1; padding: 0 3px; }
.chip a:hover { text-decoration: none; color: var(--bad); }

/* ------------------------------------------------------------- pagination */

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.pager .count { color: var(--text-muted); font-size: 13px; }
.pager a, .pager span.cur {
  padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff; font-size: 13px;
}
.pager span.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager .disabled { opacity: .4; pointer-events: none; }

/* ----------------------------------------------------------------- charts */

.chart { width: 100%; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar-label { width: 190px; flex: 0 0 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; background: var(--neutral-bg); border-radius: 3px; height: 9px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.bar-row .bar-value { width: 84px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }

.funnel { display: flex; flex-direction: column; gap: 3px; }
.funnel-step { display: flex; align-items: center; gap: 12px; }
.funnel-bar { height: 30px; border-radius: 4px; display: flex; align-items: center; padding: 0 10px; color: #fff; font-weight: 600; font-size: 12.5px; min-width: 46px; }

/* --------------------------------------------------------------- timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline .dot {
  position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid #fff; background: var(--neutral);
}
.timeline .dot.sent { background: var(--info); }
.timeline .dot.replied { background: var(--ok); }
.timeline .dot.bounced, .timeline .dot.failed { background: var(--bad); }
.timeline .dot.queued { background: var(--warn); }
.timeline .when { font-size: 11.5px; color: var(--text-faint); }
.timeline .what { font-weight: 500; }
.timeline .detail { font-size: 12.5px; color: var(--text-muted); word-break: break-word; }

/* ------------------------------------------------------------- definition */

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 0; font-size: 13.5px; }
.dl dt { color: var(--text-muted); padding: 7px 0; border-bottom: 1px solid var(--border); }
.dl dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--border); word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* ------------------------------------------------------------------ login */

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #10202f 0%, #1f5f8b 100%); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; padding: 32px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card .tag { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }

/* ------------------------------------------------------------------ misc */

.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.alert.error { background: var(--bad-bg); border-color: #f0c9c6; color: #8c1d18; }
.alert.ok { background: var(--ok-bg); border-color: #bfe3d2; color: #14603f; }
.alert.info { background: var(--info-bg); border-color: #c5dcee; color: #1b4c73; }
.alert.warn { background: var(--warn-bg); border-color: #f0dcb4; color: #7d4f03; }

.empty { padding: 46px 20px; text-align: center; color: var(--text-faint); }
.empty strong { display: block; color: var(--text-muted); font-size: 15px; margin-bottom: 4px; }

code, .mono { font-family: var(--mono); font-size: 12.5px; }
pre.log {
  background: #0f1b26; color: #cfe0ee; padding: 14px; border-radius: 6px;
  overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.55;
  max-height: 460px; overflow-y: auto; margin: 0;
}
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint); font-weight: 600; margin: 0 0 10px; }
.row-actions { display: flex; gap: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.stack > * + * { margin-top: 14px; }
.inline-form { display: inline; }

/* ----------------------------------------------------------- call script */

.modal {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: flex-start; justify-content: center;
  background: rgba(16, 32, 47, .55); padding: 24px 16px; overflow-y: auto;
}
/* MUST come after the rule above. The `hidden` attribute only works through
   the UA stylesheet's `[hidden] { display: none }`, which any author
   `display` declaration outranks — without this the modal is permanently
   open over every page, showing its "Loading…" placeholder. */
.modal[hidden] { display: none; }
.modal-card {
  position: relative; background: #fff; border-radius: 10px;
  box-shadow: 0 18px 50px rgba(16, 32, 47, .3);
  width: 100%; max-width: 760px; padding: 22px 24px 26px;
}
.modal-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: none;
  font-size: 26px; line-height: 1; color: var(--text-faint); cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--neutral-bg); color: var(--text); }

.script-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
  justify-content: space-between; padding-right: 30px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 4px;
}
.script-company { font-size: 17px; font-weight: 700; }
.script-langs { display: flex; gap: 6px; flex-wrap: wrap; }

.script-block { padding: 14px 0; border-bottom: 1px solid var(--border); }
.script-block:last-child { border-bottom: 0; }
.script-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-faint); font-weight: 700; margin-bottom: 8px;
}

/* Lines you actually say are set larger and quoted — on a call you are
   reading these aloud at a glance, not studying them. */
.script-say {
  margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; color: var(--text);
  border-left: 3px solid var(--brand); padding-left: 12px;
}
.script-ask { margin: 0; padding-left: 20px; }
.script-ask li { font-size: 14.5px; line-height: 1.55; margin-bottom: 7px; }
.script-note { margin: 0; padding-left: 18px; }
.script-note li {
  font-size: 13px; line-height: 1.55; margin-bottom: 5px; color: var(--text-muted);
}
.script-obj { margin: 0; }
.script-obj dt { font-weight: 700; font-size: 13.5px; margin-top: 10px; }
.script-obj dt:first-child { margin-top: 0; }
.script-obj dd {
  margin: 4px 0 0; font-size: 14.5px; line-height: 1.55;
  border-left: 3px solid var(--ok); padding-left: 12px;
}
.script-block.log { background: var(--neutral-bg); margin: 8px -24px -26px;
  padding: 16px 24px 20px; border-radius: 0 0 10px 10px; }

@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100vh; padding: 20px 16px 24px; }
  .script-block.log { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* ------------------------------------------------------ waiting on you */

.card.decisions { border-color: var(--warn); }
.decision {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.decision:last-child { border-bottom: 0; }
.decision > div:first-child { flex: 1; min-width: 0; }
.decision .btn { flex: 0 0 auto; }
.decision-title { font-weight: 600; font-size: 14px; }
.decision-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 8px; vertical-align: middle;
  background: var(--neutral);
}
.decision.high .decision-title::before { background: var(--warn); }
.decision-why { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
