/* Riverbend Outbound. Colors from the Riverbend brand guide (PMS 3035, 3025, 631, 310, 121). */
:root {
  --brand: #004F71; --brand-strong: #003E51; --brand-soft: #E3F1F5; --on-brand: #ffffff; --accent: #3EB1C8;
  --bg: #F5F8F9; --surface: #ffffff; --surface-2: #EEF3F5; --border: #D6E1E5; --text: #10252D; --muted: #50656D;
  --warn-bg: #FDF3CB; --warn-text: #5E4500; --danger: #B3261E; --ok: #1F7A3A; --vip-bg: #FDD757; --vip-text: #3A2C00;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --brand: #6AD1E3; --brand-strong: #8EDDEA; --brand-soft: #133A47; --on-brand: #00293A; --accent: #3EB1C8;
  --bg: #0A1A20; --surface: #10242C; --surface-2: #163039; --border: #234350; --text: #E6F0F3; --muted: #9DB5BE;
  --warn-bg: #3A2F10; --warn-text: #FDD757; --danger: #FF8A80; --ok: #7FD394; --vip-bg: #4A3B0A; --vip-text: #FDE58A;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #6AD1E3; --brand-strong: #8EDDEA; --brand-soft: #133A47; --on-brand: #00293A; --accent: #3EB1C8;
  --bg: #0A1A20; --surface: #10242C; --surface-2: #163039; --border: #234350; --text: #E6F0F3; --muted: #9DB5BE;
  --warn-bg: #3A2F10; --warn-text: #FDD757; --danger: #FF8A80; --ok: #7FD394; --vip-bg: #4A3B0A; --vip-text: #FDE58A;
  color-scheme: dark;
}

/* Logo swaps to the inverse version in dark mode, per the brand guide. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--brand-strong); }
button, select, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--surface); border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 46px; width: auto; }
.brand-sub {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-left: 1px solid var(--border); padding-left: 10px;
}
.login-logo { width: 220px; max-width: 100%; margin-bottom: 16px; }
.login-card { text-align: center; }
.progress { flex: 1; display: flex; gap: 18px; justify-content: center; color: var(--muted); font-size: 14px; }
.progress strong { color: var(--text); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-quiet { background: none; color: var(--text); font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.btn-quiet:hover { background: var(--surface-2); }
select { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }

/* Login */
.login { flex: 1; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: min(420px, 100%); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-list { display: grid; gap: 8px; margin-top: 18px; }
.login-list button {
  text-align: left; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; display: flex; justify-content: space-between;
}
.login-list button:hover { border-color: var(--brand); }

/* Layout */
.layout { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.list-pane { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.detail-pane { overflow-y: auto; padding: 22px 28px 60px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* List */
.list-section h3 {
  margin: 0; padding: 14px 16px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.item {
  display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid transparent;
  background: none; padding: 10px 14px 10px 13px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.item:hover { background: var(--surface-2); }
.item.active { background: var(--brand-soft); border-left-color: var(--brand); }
.item.done { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-left-color: var(--ok); }
.item.done .item-top > span:first-child { color: var(--muted); }
.item.done.active { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.item .did { color: var(--ok); font-weight: 600; }
.sec-count { font-weight: 500; text-transform: none; letter-spacing: 0; }
.item-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.item-sub { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.vip { background: var(--vip-bg); color: var(--vip-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.score { background: var(--brand-soft); color: var(--brand-strong); }

/* Detail */
.cust-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cust-head h2 { margin: 0; font-size: 24px; }
.banner { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card + .card, .grid2 + .card, .card + .grid2 { margin-top: 16px; }
.grid2 > .card { margin-top: 0; }
.phone { font-size: 18px; font-weight: 600; text-decoration: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.reasons li:last-child { border-bottom: 0; }
.pts { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ok); }
.pts.neg { color: var(--danger); }
.proposal { padding: 8px 0; border-bottom: 1px solid var(--border); }
.proposal:last-child { border-bottom: 0; }
.notes { white-space: pre-wrap; max-height: 180px; overflow-y: auto; font-size: 14px; }

/* Outcome form */
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.outcomes label {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; cursor: pointer; background: var(--surface-2);
  display: flex; gap: 8px; align-items: center;
}
.outcomes input { accent-color: var(--brand); }
.outcomes label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.checks { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.checks label { display: flex; gap: 6px; align-items: center; }
.checks .na { color: var(--muted); }
.req { color: var(--danger); font-size: 13px; }
textarea, input[type=date] {
  width: 100%; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface);
}
input[type=date] { width: auto; }
.save {
  margin-top: 14px; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 8px;
  padding: 10px 20px; font-weight: 600; cursor: pointer;
}
.save:hover { background: var(--brand-strong); }
.save:disabled { opacity: .6; cursor: default; }
.form-error { color: var(--danger); margin-top: 8px; }
.history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .list-pane { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .detail-pane { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .progress { display: none; }
  .brand-logo { height: 36px; }
  .brand-sub { display: none; }
}

/* Links out to ArborGold */
.ag-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.ag-link:hover { text-decoration: underline; }
.proposal .ag-link { display: inline-block; margin-top: 4px; }

/* Left rail filter */
.seg { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 1; }
.seg { flex-wrap: wrap; }
.seg button { flex: 1 1 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.seg button .n { color: var(--muted); font-size: 12px; }
.seg button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.seg button.on .n { color: var(--on-brand); opacity: .85; }

/* Team view */
.pill.ok { background: var(--surface-2); color: var(--ok); }
.btn-quiet { color: var(--text); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.team-grid .card { margin-top: 0; }
.team-card.flagged { border-color: var(--warn-text); }
.team-top { display: flex; align-items: center; gap: 8px; }
.team-top h3 { margin: 0; font-size: 18px; }
.team-top .btn-quiet { margin-left: auto; }
.team-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 10px; }
.team-stats div { display: flex; flex-direction: column; }
.team-stats strong { font-size: 20px; color: var(--text); }
.team-stats span { font-size: 12px; color: var(--muted); }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.team-meta { font-size: 13px; margin-top: 8px; line-height: 1.5; }
.flag-line { margin-top: 8px; padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; }
@media (max-width: 800px) { .team-grid { grid-template-columns: 1fr; } }
.item .cover { color: var(--brand); font-weight: 600; }

/* Settings */
.sec-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.sec-nav a { font-size: 13px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--surface); }
.sec-nav a:hover { border-color: var(--brand); color: var(--brand); }
.settings-sec h3 { margin: 0 0 4px; font-size: 18px; }
.settings-sec > p { margin: 0 0 8px; }
.field { padding: 12px 0; border-top: 1px solid var(--border); }
.field-label { font-weight: 600; margin-bottom: 6px; }
.field-input input[type=number] { width: 110px; }
.field-input input, .field-input select, .field-input textarea, .add-csr input, .dayoff-add input {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.field-input textarea { width: 100%; max-width: 520px; display: block; }
.field-help, .field-meta { font-size: 13px; margin-top: 4px; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.field-error:empty { display: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 6px 0; }
.mix { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.mix input { width: 70px !important; }
table.rows { border-collapse: collapse; margin-bottom: 6px; }
table.rows th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 2px 8px 4px 0; }
table.rows td { padding: 3px 8px 3px 0; vertical-align: middle; }
table.rows input[type=text] { width: 220px; }
table.roster { width: 100%; }
table.roster tr.inactive td { opacity: .6; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.dayoff-add { display: inline-flex; gap: 6px; align-items: center; }
.add-csr { display: flex; gap: 8px; margin-top: 12px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--surface); border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) { table.roster thead { display: none; } table.roster td { display: block; } }
.seg[hidden] { display: none; }
.pill.nudge { background: var(--brand-soft); color: var(--brand-strong); }
.dp-status { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); margin: 8px 0 12px; font-size: 14px; }

/* Claude's two-sentence call summary under a Dialpad call */
.call-summary { margin: 4px 0 2px; padding-left: 10px; border-left: 3px solid var(--accent); color: inherit; }

/* Before you call: Claude's talking points and sample text */
.prep { border-left: 4px solid var(--accent); }
.prep-points { margin: 4px 0 8px; padding-left: 20px; }
.prep-points li { margin: 3px 0; }
.prep-text { margin-top: 6px; }
.prep-msg { margin: 4px 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); color: inherit; white-space: pre-wrap; }

/* Call with Dialpad */
.phone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0; }
.btn-call { padding: 5px 10px; border: 0; border-radius: 6px; background: var(--brand); color: var(--on-brand); font: inherit; font-size: 0.9em; cursor: pointer; }
.btn-call:disabled { opacity: 0.6; cursor: wait; }

/* Light / dark toggle in the top bar */
.theme-btn { margin-left: auto; white-space: nowrap; }
.theme-btn + .who { margin-left: 8px; }

/* Spoke with someone at Riverbend recently (Dialpad) */
.pill.talk { background: var(--brand-soft); color: var(--text); border: 1px solid var(--accent); }
.banner.talk { background: var(--brand-soft); color: var(--text); border-left: 4px solid var(--accent); }
.banner.talk div { margin-top: 4px; }

/* Sign in with Google */
.btn-google { display: block; text-align: center; padding: 12px 16px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; }
.btn-google:hover { filter: brightness(1.08); }
.email-in { margin-top: 4px; width: 100%; min-width: 170px; max-width: 220px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.85em; }
