/* Call Desk - styles. A "call sheet" look: ruled lines, one big number, one big green button. */
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --paper: #e8ecf2;
  --sheet: #ffffff;
  --sheet-2: #f3f5f9;
  --ink: #14203a;
  --ink-2: #3f4b66;
  --ink-3: #58647e;
  --line: #c9d1de;
  --line-2: #dde3ec;
  --indigo: #2b4c9b;
  --indigo-d: #1f3977;
  --indigo-bg: #e3e9f7;
  --brass: #8a5d14;
  --brass-bg: #f6ebd3;
  --dial: #15704d;
  --dial-d: #0f573b;
  --dial-bg: #dcefe6;
  --red: #a7322a;
  --red-bg: #f8e3e0;
  --amber-bg: #fbf0d5;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); font-variant-numeric: tabular-nums; min-height: 100vh; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
a { color: var(--indigo); }
a:hover { color: var(--indigo-d); }
:focus-visible { outline: 3px solid #7d9be0; outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.boot { padding: 3rem; text-align: center; color: var(--ink-3); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { background: var(--ink); color: #fff; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); display: grid; grid-template-columns: auto 1fr auto; gap: .5rem 1.25rem; align-items: center; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: flex; align-items: baseline; gap: .6rem; white-space: nowrap; }
.brand .mark { display: inline-block; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 3px solid #fff; border-right-color: #d8a24a; align-self: center; }
.brand small { font: 400 .8rem var(--body); color: #aab6d3; }
.tabs { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #c9d3ea; text-decoration: none; padding: .45rem .8rem; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { background: #24345a; color: #fff; }
.tabs a[aria-current="page"] { background: #fff; color: var(--ink); }
.acct { background: transparent; border: 1px solid #44537a; color: #dfe6f7; padding: .4rem .8rem; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.acct:hover { background: #24345a; }
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; }
  .tabs { grid-column: 1 / -1; order: 3; margin: 0 -.25rem; }
  .brand small { display: none; }
}
.banner { padding: .7rem 1rem; background: var(--red); color: #fff; display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; }
.banner .btn { background: #fff; color: var(--red); border-color: #fff; }

main { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 4rem; padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead p { margin: .25rem 0 0; color: var(--ink-3); }

/* ---------- surfaces ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.sheet > h2:first-child, .sheet > h3:first-child { margin-bottom: .75rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 2.25rem 1rem; color: var(--ink-2); }
.empty h3 { margin-bottom: .4rem; }

/* ---------- buttons & forms ---------- */
.btn { font: 500 .95rem var(--body); min-height: 42px; padding: .5rem 1rem; border-radius: 9px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn:hover { background: var(--sheet-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.primary:hover { background: var(--indigo-d); }
.btn.danger { color: var(--red); border-color: #d9a8a3; }
.btn.danger:hover { background: var(--red-bg); }
.btn.small { min-height: 34px; padding: .25rem .7rem; font-size: .85rem; }
.btn.call { background: var(--dial); border-color: var(--dial); color: #fff; font: 700 1.3rem var(--display); min-height: 64px; width: 100%; border-radius: 14px; letter-spacing: .01em; }
.btn.call:hover { background: var(--dial-d); }
.btn.call:disabled { background: #9fb6ab; border-color: #9fb6ab; opacity: 1; }
label.f { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--ink-3); font-size: .85rem; margin: .25rem 0 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; min-height: 44px; padding: .5rem .7rem; border: 1px solid #aeb8ca; border-radius: 9px; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #a9bcea; border-color: var(--indigo); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.stack > * + * { margin-top: .9rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--line-2); }
.check:first-of-type { border-top: 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--indigo); flex: 0 0 auto; }
.check b { display: block; font-weight: 600; }
.check span { color: var(--ink-3); font-size: .875rem; }

/* ---------- chips ---------- */
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 99px; background: var(--sheet-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip.new { background: var(--amber-bg); border-color: #e4cc8f; color: #6b4a0b; }
.chip.ready, .chip.interested, .chip.sold { background: var(--dial-bg); border-color: #a8d3c0; color: var(--dial-d); }
.chip.callback, .chip.maybe { background: var(--indigo-bg); border-color: #b5c3e6; color: var(--indigo-d); }
.chip.dnc, .chip.bad_number { background: var(--red-bg); border-color: #e2b4af; color: var(--red); }
.chip.open { background: var(--dial-bg); border-color: #a8d3c0; color: var(--dial-d); }
.chip.closed { background: var(--red-bg); border-color: #e2b4af; color: var(--red); }
.prio { font-family: var(--display); font-weight: 700; color: var(--brass); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.filters a { text-decoration: none; color: var(--ink-2); background: var(--sheet); border: 1px solid var(--line); padding: .3rem .75rem; border-radius: 99px; font-size: .9rem; font-weight: 500; }
.filters a b { font-family: var(--display); margin-left: .35rem; color: var(--ink); }
.filters a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters a[aria-current="true"] b { color: #fff; }

/* ---------- ledger (Today) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger a, .ledger div.lr { display: flex; align-items: baseline; gap: .5rem; padding: .5rem 0; text-decoration: none; color: var(--ink); }
.ledger a:hover .lbl { text-decoration: underline; }
.ledger .dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); min-width: 1rem; }
.ledger .val { font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.ledger .val.brass { color: var(--brass); }
.ledger .sub { color: var(--ink-3); font-size: .85rem; }
.ledger li + li { border-top: 1px solid var(--line-2); }
.ledger h3 { margin-bottom: .35rem; }

.nextup { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; border-left: 6px solid var(--dial); }
.nextup .who { font: 700 1.6rem var(--display); }
.nextup .meta { color: var(--ink-2); }
@media (max-width: 600px) { .nextup { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--ink-3); padding: .5rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: .65rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr[data-go] { cursor: pointer; }
.tbl tr[data-go]:hover td { background: var(--sheet-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .who { font-weight: 600; }
.tbl .who a { color: var(--ink); text-decoration: none; }
.tbl .who a:hover { text-decoration: underline; }
.tbl .who .muted { font-weight: 400; }
.tblwrap { overflow-x: auto; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--indigo); vertical-align: middle; min-width: 2px; }
.faint td { color: var(--ink-3); }
.faint .bar { background: #aeb8ca; }
@media (max-width: 760px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .6rem; padding: .5rem .75rem; background: #fff; }
  .tbl.cards td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .tbl.cards td::before { content: attr(data-label); color: var(--ink-3); font-size: .85rem; text-align: left; flex: 0 0 auto; }
  .tbl.cards td.who { display: block; text-align: left; font-size: 1.05rem; }
  .tbl.cards td.who::before { display: none; }
}

/* ---------- call console ---------- */
.console { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .console { grid-template-columns: 1fr; } }
.agent h1 { font-size: 2.1rem; }
.agent .brok { color: var(--ink-2); font-size: 1.05rem; margin-top: .15rem; }
.agent .chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.phone { font: 700 2.4rem/1.1 var(--display); margin: .9rem 0 .2rem; letter-spacing: .01em; }
.timeline { color: var(--ink-2); margin-bottom: .9rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.timeline .chip { white-space: normal; }
.console > div { min-width: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.beats { margin: 0; padding: 0; list-style: none; }
.beats li { padding: .7rem 0 .7rem 1rem; border-left: 4px solid var(--indigo-bg); margin-bottom: .35rem; }
.beats li:nth-child(4) { border-left-color: #d8a24a; }
.beats .tag { display: block; font-size: .8rem; font-weight: 700; color: var(--indigo-d); margin-bottom: .1rem; }
.beats li:nth-child(4) .tag { color: var(--brass); }
.beats p { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.trans { margin: .3rem 0 0; font-size: .95rem; line-height: 1.45; color: var(--ink-3); font-style: italic; }
.beats p.trans { font-size: .95rem; }
.langsw { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.langsw button { border: 0; background: #fff; padding: .3rem .8rem; font: 600 .85rem var(--body); cursor: pointer; color: var(--ink-2); min-height: 34px; }
.langsw button[aria-pressed="true"] { background: var(--ink); color: #fff; }
details.qr { border-top: 1px solid var(--line-2); margin-top: .75rem; padding-top: .5rem; }
details.qr summary { cursor: pointer; font-weight: 600; padding: .35rem 0; }
.qr dl { margin: .4rem 0 0; }
.qr dt { font-weight: 600; margin-top: .55rem; color: var(--ink-2); }
.qr dd { margin: .1rem 0 0; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.outcomes .btn { min-height: 52px; font-weight: 600; }
.outcomes .btn.good { background: var(--dial-bg); border-color: #a8d3c0; color: var(--dial-d); }
.outcomes .btn.maybe { background: var(--indigo-bg); border-color: #b5c3e6; color: var(--indigo-d); }
.outcomes .btn.bad { background: var(--red-bg); border-color: #e2b4af; color: var(--red); }
.outcomes .btn[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 1px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: .5rem 0; border-top: 1px solid var(--line-2); }
.hist li:first-child { border-top: 0; }
.notice { background: var(--amber-bg); border: 1px solid #e4cc8f; padding: .65rem .8rem; border-radius: 9px; margin-bottom: .9rem; color: #5b3f07; }
.notice.red { background: var(--red-bg); border-color: #e2b4af; color: var(--red); }
.notice.green { background: var(--dial-bg); border-color: #a8d3c0; color: var(--dial-d); }
.pre { white-space: pre-wrap; background: var(--sheet-2); border: 1px solid var(--line); border-radius: 9px; padding: .7rem .8rem; font-size: .9rem; }

/* ---------- sign in ---------- */
.auth { max-width: 400px; margin: 12vh auto 0; padding: 0 1rem; }
.auth .sheet { padding: 1.5rem; }
.auth h1 { margin-bottom: .25rem; }
.auth .brand { color: var(--ink); margin-bottom: 1.2rem; }
.auth .brand .mark { border-color: var(--ink); border-right-color: #d8a24a; }

/* ---------- toasts & modal ---------- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: .5rem; z-index: 50; width: min(92vw, 460px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 6px 24px rgba(20, 32, 58, .3); }
.toast.err { background: var(--red); }
#modal { position: fixed; inset: 0; background: rgba(20, 32, 58, .55); display: grid; place-items: center; padding: 1rem; z-index: 40; }
#modal .box { background: #fff; border-radius: 14px; width: min(94vw, 460px); padding: 1.25rem; max-height: 90vh; overflow: auto; }
#modal .box h2 { margin-bottom: .8rem; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
