/* ==========================================================================
   BP CRM theme (2026-11-15) — same look as mgmt.bpstrategists.com:
   GrowHi palette (cobalt on cool white / navy dark), Gabarito + Onest,
   1rem soft cards, light/dark switch, animated hero on the dashboard.
   Loaded AFTER app.css; app.css is untouched. Remove the <link> to roll back.
   ========================================================================== */

/* ---- Tokens: dark (default) ---- */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080e1a; --panel: #101929; --panel2: #16213a; --elev: #1a2640;
  --border: #1f2b42; --border2: #2b3a57;
  --text: #eef2f8; --text2: #c3cddd; --muted: #8d9ab3;
  --accent: #5b8cff; --accent2: #86a9ff; --accent-dim: rgba(91,140,255,.14);
  --green: #47cf86; --green-dim: rgba(71,207,134,.14);
  --amber: #f0b44c; --amber-dim: rgba(240,180,76,.14);
  --danger: #ff7b70; --danger-dim: rgba(255,123,112,.13);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.35);
  --card-shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -20px rgba(0,0,0,.7);
  --pop-shadow: 0 18px 40px -12px rgba(0,0,0,.6);
  --nav-bg: rgba(16,25,41,.82);
  --on-accent: #ffffff;
  --font-body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Gabarito", "Onest", system-ui, sans-serif;
}

/* ---- Tokens: light ---- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb; --panel: #ffffff; --panel2: #eef2f8; --elev: #ffffff;
  --border: #e2e8f1; --border2: #cfd8e6;
  --text: #0b1524; --text2: #33415a; --muted: #5f6c83;
  --accent: #1d4ed8; --accent2: #1d4ed8; --accent-dim: rgba(29,78,216,.09);
  --green: #0f9f55; --green-dim: rgba(15,159,85,.1);
  --amber: #b26b00; --amber-dim: rgba(194,122,0,.11);
  --danger: #d63a2f; --danger-dim: rgba(214,58,47,.09);
  --shadow: 0 1px 2px rgba(15,23,42,.06);
  --card-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -16px rgba(15,23,42,.18);
  --pop-shadow: 0 18px 40px -12px rgba(15,23,42,.22);
  --nav-bg: rgba(255,255,255,.85);
}

/* ---- Type ---- */
html, body { font-family: var(--font-body); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, #login-form h1, .tn-brand span, .ha-n, .ht-n, .fn-n, .hot-co {
  font-family: var(--font-head); letter-spacing: -.01em; }
h2, h2.view-title, #home-top h2 { font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; }
h3 { font-weight: 700; }
textarea, input, select, button { font-family: inherit; }

/* ---- Shell: sticky blurred top bar, pill nav ---- */
#topnav { background: var(--nav-bg); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  height: 56px; box-shadow: 0 1px 0 var(--border); border-bottom-color: transparent; }
.rail-btn, .tn-gbtn, .tn-item-plain { border-radius: 999px; }
.tn-dd .rail-btn, .tn-dd .tn-item-plain { border-radius: 10px; }
.rail-btn.active, .tn-group.has-active > .tn-gbtn { background: var(--accent-dim); color: var(--accent2); font-weight: 600; }
.tn-dd { border-radius: 14px; box-shadow: var(--pop-shadow); }
#sidebar { background: var(--panel); }
#sb-results, #home-q-results { box-shadow: var(--pop-shadow) !important; border-radius: 12px; }

/* theme switch */
#theme-toggle { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  margin-left: .35rem; border: 1px solid var(--border2); border-radius: 999px; background: var(--panel2); color: var(--text2);
  cursor: pointer; transition: background .2s, color .2s, transform .2s; }
#theme-toggle:hover { color: var(--accent2); transform: rotate(-12deg); }
#theme-toggle svg { width: 18px; height: 18px; }
#theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] #theme-toggle .ic-sun, :root:not([data-theme]) #theme-toggle .ic-sun { display: block; }
html[data-theme="dark"] #theme-toggle .ic-moon, :root:not([data-theme]) #theme-toggle .ic-moon { display: none; }
@media (max-width: 1100px) { #theme-toggle { width: 40px; height: 40px; margin-left: .2rem; } }
@media (max-width: 600px) { #theme-toggle { width: 36px; height: 36px; margin-left: 0; } }

/* ---- Cards: 1rem radius + soft shadow everywhere ---- */
.home-tile, .home-act, .home-fin, .fn-step, .hot-row, .up-list, .home-ads, .home-search input,
.board-col, .bcard, .pl-card, .dl-needs, .set-wrap > *, .q-row, .cl-row, .td-card, .pc-card, .apo-card,
.msg, .ar-card, .fin-card, .an-card, .scr-card {
  border-radius: var(--radius); }
.home-tile, .home-fin, .fn-step, .hot-row, .up-list, .home-ads, .bcard, .pl-card, .dl-needs, .msg {
  box-shadow: var(--card-shadow); }
.hot-row, .home-tile, .bcard, .fn-step { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.hot-row:hover, .home-tile:hover, .bcard:hover { transform: translateY(-1px); }
.home-search input { padding: .8rem 1rem; background: var(--panel); box-shadow: var(--card-shadow); }

/* Buttons: primary = solid cobalt pill */
.primary, #btn-send, .home-quick button.primary, .bm-actions button.primary, .pwork-actions button.primary,
.pc-actions button.primary, #login-form button, .pb-work, .fin-btn, .ps-sendall, .dial-restart {
  color: var(--on-accent) !important; box-shadow: 0 6px 16px -8px var(--accent); }
.home-quick button { border-radius: 999px; padding: .5rem 1rem; }

/* Funnel: numbers in the display face, step bar */
.fn-step { position: relative; overflow: hidden; padding: .9rem .7rem; }
.fn-step::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--green)); opacity: .7; }
.fn-step .fn-n { font-size: 1.7rem; }

/* ---- Dashboard hero: the action strip (same treatment as mgmt results hero) ---- */
.home-actions {
  --hero-bg: linear-gradient(125deg, #ffffff 0%, #eef3ff 45%, #dbe6ff 100%);
  --hero-border: #d5e0f5; --hero-text: #0b1524; --hero-muted: rgba(11,21,36,.62);
  --hero-tile: rgba(255,255,255,.75); --hero-tile-border: #dbe4f3;
  --hero-glow-a: rgba(29,78,216,.22); --hero-glow-b: rgba(15,159,85,.14);
  --hero-shadow: 0 24px 50px -30px rgba(29,78,216,.45);
  position: relative; overflow: hidden; isolation: isolate; padding: 1.1rem; border-radius: 1.25rem;
  border: 1px solid var(--hero-border); background: var(--hero-bg); box-shadow: var(--hero-shadow); }
html[data-theme="dark"] .home-actions, :root:not([data-theme]) .home-actions {
  --hero-bg: linear-gradient(125deg, #0b1524 0%, #13285e 45%, #1d4ed8 100%);
  --hero-border: rgba(255,255,255,.08); --hero-text: #ffffff; --hero-muted: rgba(255,255,255,.74);
  --hero-tile: rgba(255,255,255,.08); --hero-tile-border: rgba(255,255,255,.15);
  --hero-glow-a: rgba(134,169,255,.45); --hero-glow-b: rgba(71,207,134,.18);
  --hero-shadow: 0 24px 50px -28px rgba(29,78,216,.7); }
.home-actions::before, .home-actions::after { content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 9999px; filter: blur(8px); }
.home-actions::before { right: -7rem; top: -11rem; width: 420px; height: 420px;
  background: radial-gradient(circle, var(--hero-glow-a), transparent 65%); animation: hero-drift-a 14s ease-in-out infinite alternate; }
.home-actions::after { left: 20%; bottom: -14rem; width: 380px; height: 380px;
  background: radial-gradient(circle, var(--hero-glow-b), transparent 65%); animation: hero-drift-b 18s ease-in-out infinite alternate; }
.home-act { background: var(--hero-tile); border: 1px solid var(--hero-tile-border); color: var(--hero-text);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 14px; box-shadow: none;
  animation: hero-tile-in .5s cubic-bezier(.2,.7,.2,1) both; transition: transform .2s ease, box-shadow .2s ease; }
.home-act:nth-child(2) { animation-delay: .06s; } .home-act:nth-child(3) { animation-delay: .12s; }
.home-act:nth-child(4) { animation-delay: .18s; } .home-act:nth-child(5) { animation-delay: .24s; }
.home-act:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(11,21,36,.35); border-color: var(--hero-tile-border); }
.home-act.hot { border-left: 1px solid var(--hero-tile-border); }
.home-act.hot::after { content: ""; position: absolute; top: .8rem; right: .8rem; width: 8px; height: 8px; border-radius: 50%;
  background: #47cf86; box-shadow: 0 0 0 0 rgba(71,207,134,.6); animation: hadPulse 1.8s infinite; }
.home-act { position: relative; }
.home-act .ha-n { color: var(--hero-text); font-size: 1.9rem; letter-spacing: -.02em; }
.home-act .ha-l { color: var(--hero-muted); font-weight: 500; }
@keyframes hero-drift-a { from { transform: translate(0,0) scale(1); } to { transform: translate(-90px,50px) scale(1.15); } }
@keyframes hero-drift-b { from { transform: translate(0,0) scale(1); } to { transform: translate(120px,-40px) scale(1.1); } }
@keyframes hero-tile-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .home-actions::before, .home-actions::after, .home-act, .home-act.hot::after { animation: none; }
}

/* ---- Login ---- */
#login { background:
  radial-gradient(600px 400px at 85% 10%, var(--accent-dim), transparent 70%),
  radial-gradient(500px 380px at 10% 90%, var(--green-dim), transparent 70%), var(--bg); }
#login-form { border-radius: 1.25rem; box-shadow: var(--pop-shadow); padding: 2.2rem; }
#login-form input { border-radius: 10px; }
#login-form button { border-radius: 999px; padding: .7rem; }

/* ---- Light-mode fix-ups for things app.css hard-codes for dark ---- */
html[data-theme="light"] #tn-scrim, html[data-theme="light"] #bm-overlay, html[data-theme="light"] #wa-overlay { background: rgba(15,23,42,.35); }
html[data-theme="light"] .tn-brand img, html[data-theme="light"] .bp-logo { filter: none; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c7d0de; }
html[data-theme="light"] #reply-alert { background: #fff6e5; border-bottom-color: #f2d49b; }
html[data-theme="light"] .rail-badge.wa { color: #06240f; }

/* Phone: hero tiles two-up, tighter */
@media (max-width: 600px) {
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: .7rem; }
  .home-act { padding: .8rem .85rem; }
  .home-act .ha-n { font-size: 1.5rem; }
  .home-act .ha-l { font-size: .78rem; }
  h2, h2.view-title, #home-top h2 { font-size: 1.35rem; }
}
/* ---- auto-generated light overrides (gen_light.py) ---- */
html[data-theme="light"] .tn-dd { box-shadow: var(--pop-shadow); }
html[data-theme="light"] #sb-results { box-shadow: var(--pop-shadow); }
html[data-theme="light"] .att-st.bad { color: #c2352b; }
html[data-theme="light"] #reply-suggest .rs-use { color: #fff; }
html[data-theme="light"] .dc-call { color: #fff; }
html[data-theme="light"] .cal-ev.ev-meeting { color: #0e7490; }
html[data-theme="light"] .cal-ev.ev-reengage { color: #4f46e5; }
html[data-theme="light"] .cal-legend .ev-meeting { color: #0e7490; }
html[data-theme="light"] .cal-legend .ev-reengage { color: #4f46e5; }
html[data-theme="light"] .stage-pill.s-proposal { color: #4f46e5; }
html[data-theme="light"] .stage-pill.s-meeting { color: #0e7490; }
html[data-theme="light"] .stage-select.s-proposal { color: #4f46e5; }
html[data-theme="light"] .stage-select.s-meeting { color: #0e7490; }
html[data-theme="light"] .wa-dot { color: #15803d; }
html[data-theme="light"] #home-q-results { box-shadow: var(--pop-shadow); }
html[data-theme="light"] .stage-pill.s-maybe_later { color: #0369a1; }
html[data-theme="light"] .board-col[data-stage="maybe_later"] .bc-head { color: #0369a1; }
html[data-theme="light"] button.assignee-select.claim { color: #0f9f55; }
html[data-theme="light"] .dial-call { color: #fff; }
html[data-theme="light"] .dial-out-btns .do-meeting { border-color: #0e7490; color: #0e7490; }
html[data-theme="light"] .lm-kind.k-domain { color: #0e7490; }
html[data-theme="light"] .lm-del:hover { color: #c2352b; }
html[data-theme="light"] .act-block { color: #c2352b !important; }
html[data-theme="light"] .m-chan.stop { color: #c2352b; }
html[data-theme="light"] .bcard-assignee { color: #a16207; }
html[data-theme="light"] .assignee-select.assigned { color: #a16207; }
html[data-theme="light"] .dial-bridge { color: #a16207; }
html[data-theme="light"] .dc-bridge { color: #a16207 !important; }
html[data-theme="light"] .prog.fail { color: #c2352b; }
html[data-theme="light"] .qm-cancel { color: #c2352b; }
html[data-theme="light"] .q-chip.q-wait { color: #a16207; }
html[data-theme="light"] .q-chip.q-fail { color: #c2352b; }
html[data-theme="light"] .pwork-outcomes .do-noans { color: #a16207; }
html[data-theme="light"] .pwork-outcomes .do-meeting { color: #0e7490; }
html[data-theme="light"] .pwork-outcomes .do-no { color: #c2352b; }
html[data-theme="light"] .bm-actions button.primary { color: #fff; }
html[data-theme="light"] .pd-go { color: #fff; }
html[data-theme="light"] .pd-status.pd-ringing, html[data-theme="light"] .pd-status.pd-waiting-agent { color: #a16207; }
html[data-theme="light"] .cl-dir.out { color: #4f46e5; }
html[data-theme="light"] .cl-res.r-missed, html[data-theme="light"] .cl-res.r-failed { color: #c2352b; }
html[data-theme="light"] .cl-res.r-voicemail { color: #a16207; }
html[data-theme="light"] .pd-status.pd-waiting-browser { color: #a16207; }
html[data-theme="light"] .cl-res.r-voicemail_left { color: #a16207; }
html[data-theme="light"] .reply-ch button.on { color: #fff; }
html[data-theme="light"] .aud-email { color: #1d4ed8; }
html[data-theme="light"] .aud-call { color: #0f9f55; }
html[data-theme="light"] .shift-in { color: #fff; }
html[data-theme="light"] .shift-out { color: #fff; }
html[data-theme="light"] .shift-nudge button { color: #fff; }
html[data-theme="light"] .td-act .td-call { color: #fff; }
html[data-theme="light"] .msg.call-card { border-left: 3px solid #0e7490; }
html[data-theme="light"] .msg.call-card .m-when { color: #0e7490; }
html[data-theme="light"] .dl-needs { border-left: 3px solid #a16207; }
html[data-theme="light"] .dl-need { color: #a16207; }
html[data-theme="light"] .home-quick button.primary { color: #fff; }
html[data-theme="light"] .th-ch button.on { color: #fff; }
html[data-theme="light"] .th-ch button.wa.on { border-color: #15803d; }
html[data-theme="light"] .msg.wa-bub .wb-head { color: #15803d; }
html[data-theme="light"] #reply-form.ch-wa #btn-send { border-color: #15803d; }
html[data-theme="light"] .wa-call .wa-call-btn { border-color: #15803d; }
html[data-theme="light"] .wa-ring { border: 1px solid #15803d; box-shadow: var(--pop-shadow); }
html[data-theme="light"] .wa-ring .wr-t { color: #15803d; }
html[data-theme="light"] .wa-ring .wr-yes { border-color: #15803d; }
html[data-theme="light"] .wa-ring .wr-no { color: #c2352b; }
html[data-theme="light"] .list-ch button.on { color: #fff; }
html[data-theme="light"] .list-ch button[data-ch="whatsapp"].on { border-color: #15803d; }
@media (max-width: 1100px) { html[data-theme="light"] .tn-primary .tn-inbox > .tn-dd { box-shadow: var(--pop-shadow); } }
html[data-theme="light"] .wa-av { color: #15803d; }
html[data-theme="light"] .wa-unread { color: #15803d; }
html[data-theme="light"] .lead-item.wa-row .li-when.unread { color: #15803d; }
html[data-theme="light"] .had-call { color: #fff; }
html[data-theme="light"] .al-src.al-wa { color: #15803d; }
