/* The finishing layer (loaded last): mission ring, up-next card, lead rows with avatars and coloured status, call timeline, watermark. */

/* ---------- background: a huge, faint compass rose turning slowly behind everything ---------- */
.ambient::before { content: ''; position: absolute; right: -38vmin; bottom: -30vmin; width: 118vmin; height: 118vmin; background: url(/logo.png) center / contain no-repeat;
  opacity: .055; filter: grayscale(.2); animation: turnSlow 240s linear infinite; will-change: transform; }
@keyframes turnSlow { to { transform: rotate(360deg); } }
@media (prefers-color-scheme: light) { .ambient::before { opacity: .09; } }
@media (prefers-reduced-motion: reduce) { .ambient::before { animation: none !important; } }
body.talking .ambient::before { animation-play-state: paused; }

/* ---------- talk: the next call, one tap away ---------- */
.upnext { flex: none; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--glow), .14), rgba(var(--glow), .03) 55%), var(--surface); border: 1px solid rgba(var(--glow), .3); box-shadow: var(--shadow); }
.upnext .eyebrow { color: var(--teal2); }
.upnext .chead h3 { font-size: 16px; }
.upnext .row { gap: 8px; }
.upnext .row .btn { flex: 1; text-align: center; }
.upnext.due { border-color: rgba(242, 187, 92, .55); background: linear-gradient(135deg, rgba(242, 187, 92, .14), rgba(242, 187, 92, .02) 55%), var(--surface); }
.upnext.due .eyebrow { color: var(--warn); }
.talk.active .upnext { display: none; }

/* ---------- desk: mission ring ---------- */
.mission { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 22px; box-shadow: var(--shadow);
  background: radial-gradient(120% 140% at 0% 0%, rgba(var(--glow), .16), transparent 60%), var(--surface); border: 1px solid var(--line2); }
.ringbox { position: relative; width: 98px; height: 98px; }
.ring-svg { width: 100%; height: 100%; display: block; }
.rg-bg { fill: none; stroke: var(--line2); stroke-width: 8; }
.rg-fg { fill: none; stroke: var(--teal); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(var(--glow), .7)); transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.ringnum { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ringnum b { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.ringnum span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-top: 3px; }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ms { text-align: center; }
.ms b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ms span { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin-top: 4px; font-weight: 600; line-height: 1.25; }
.ms.hot b { color: var(--warn); }
.ms.won b { color: var(--good); }
.pipehead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.bar2 { height: 12px; border-radius: 6px; }
.bar2 span { border-radius: 3px; }

/* ---------- lead cards: one clear main action ---------- */
.card { position: relative; }
.card[data-prio="High"]::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--gold), rgba(232, 184, 75, .2)); }
.card.due[data-prio]::before { background: linear-gradient(var(--warn), rgba(242, 187, 92, .2)); }
.card .row > .btn.ghost { opacity: .9; }

/* ---------- leads list: avatars and coloured status ---------- */
.lead-row { grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.lead-row .av { width: 40px; height: 40px; border-radius: 13px; font-size: 18px; }
.lr-main { min-width: 0; }
.lr-main b { display: block; font-size: 15.5px; line-height: 1.25; }
.lr-main .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-row[data-prio="High"] .lr-main b::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: 7px; vertical-align: middle; box-shadow: 0 0 8px rgba(232, 184, 75, .7); }
select.st { appearance: none; -webkit-appearance: none; border: 1px solid var(--line2); border-radius: 99px; padding: 7px 26px 7px 12px; font-size: 13px; font-weight: 600; background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2384848f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 10px 6px no-repeat; color: var(--ink2); max-width: 128px; }
select.st-interested, select.st-quote-sent { color: var(--teal2); border-color: rgba(var(--glow), .45); background-color: rgba(var(--glow), .12); }
select.st-callback, select.st-voicemail, select.st-no-answer { color: var(--warn); border-color: rgba(242, 187, 92, .4); }
select.st-won { color: #04140f; background-color: var(--good); border-color: transparent; }
select.st-closed, select.st-bad-number { color: var(--ink3); opacity: .8; }

/* ---------- log: a timeline ---------- */
#log { position: relative; }
.day { display: flex; align-items: center; gap: 10px; }
.day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.logrow { position: relative; margin-left: 14px; }
.logrow::before { content: ''; position: absolute; left: -14px; top: 0; bottom: -12px; width: 1px; background: var(--line2); }
.logrow::after { content: ''; position: absolute; left: -18px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--bg); }
.logrow[data-o="interested"]::after, .logrow[data-o="quote"]::after { background: var(--teal); }
.logrow[data-o="won"]::after { background: var(--good); }
.logrow[data-o="not-interested"]::after, .logrow[data-o="wrong-number"]::after { background: var(--ink3); }
.logrow[data-o="no-answer"]::after, .logrow[data-o="voicemail"]::after, .logrow[data-o="callback"]::after { background: var(--warn); }

/* ---------- free mode ---------- */
.pill.free { color: var(--gold); border-color: rgba(232, 184, 75, .4); }
.pill.free::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.cardmsg.tip { border-left-color: var(--teal); }
.cardmsg.tip .line { grid-template-columns: 56px 1fr; }
.cardmsg.tip .k { color: var(--teal2); }

/* ---------- sheets: after the call, quote and receipt, edit ---------- */
#callsheet .sheet, #docsheet .sheet, #editsheet .sheet { gap: 12px; }
.ditem { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ditem .check { flex: 1; align-items: center; }
.ditem .dp { width: 96px; text-align: right; padding: 8px 10px; }
.total { font-family: var(--serif); font-size: 26px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
textarea.in { font-size: 16px; }
.in { font-size: 16px; } /* 16px stops iPhone zooming the page when a field is tapped */
.lr-main[role="button"] { cursor: pointer; }

/* ---------- five tabs ---------- */
.tabbar { grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px 4px; }
.tab { font-size: 10.5px; letter-spacing: .01em; }
@media (min-width: 900px) { .tabbar { width: 540px; } }

/* ---------- money ---------- */
.mhero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 22px; box-shadow: var(--shadow);
  background: radial-gradient(120% 140% at 0% 0%, rgba(var(--glow), .18), transparent 60%), var(--surface); border: 1px solid var(--line2); }
.mhero .ringbox { width: 104px; height: 104px; }
.mk { display: grid; gap: 8px; }
.mk div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.mk div:last-child { border-bottom: 0; padding-bottom: 0; }
.mk b { font-family: var(--serif); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; order: 2; }
.mk span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.mk .hot b { color: var(--warn); }
.mgoal { margin: -4px 4px 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpis div, .kpis3 div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpis b, .kpis3 b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpis span, .kpis3 span { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin-top: 4px; font-weight: 600; }
.kpis3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.kpis3 div { box-shadow: none; background: var(--surface2); }
.ops { display: flex; flex-direction: column; gap: 8px; }
.op { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); border-left: 4px solid var(--teal); }
.op-collect { border-left-color: var(--warn); } .op-chase { border-left-color: var(--gold); } .op-review { border-left-color: var(--tide); } .op-upsell { border-left-color: var(--good); }
.opmain b { display: block; font-size: 15.5px; line-height: 1.3; }
.chart { width: 100%; height: auto; display: block; }
.chart .cb { fill: rgba(var(--glow), .28); } .chart .cb.now { fill: rgba(var(--glow), .5); } .chart .ct { fill: var(--teal); }
.chart text { fill: var(--ink3); font-size: 8px; font-family: var(--font); } .chart text.cv { fill: var(--ink2); font-size: 8.5px; }
.chart .ctarget { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; } .sw-ct { background: var(--teal); } .sw-cb { background: rgba(var(--glow), .35); }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.dhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dhead b { font-size: 16px; }
.dmoney { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink3); }
.dmoney b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 3px; }
.dmoney .hot b { color: var(--warn); } .dmoney .ok b { color: var(--good); }
.meter { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--btn); border-radius: 3px; }
select.stage { max-width: none; }
.vrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vrow b { display: block; font-size: 15px; }
.sheet h2:focus, .sheet h2:focus-visible { outline: none; }
