/* theme-v2.css — LeadPilot 1.14.0: the approved v2 design (navy sidebar, cobalt actions, Inter, Lucide icons).
   Presentation only. Loaded last, after clean-ui.css / crm-ui.css / filters-ui.css: it redefines their tokens and the
   shell; it does not change element ids, handlers or the CRM's logic. shell-v2.js builds the sidebar modules. */

/* ---- tokens ---- */
:root { --bg: #F6F8FB; --surface: #FFFFFF; --raise: #F8FAFC; --ink: #13243A; --muted: #64748B; --faint: #94A3B8; --line: #E2E8F0; --line2: #CBD5E1;
  --brand: #1565D8; --brand-bg: #EFF5FF; --brand-line: #C9DAFB; --go: #1565D8; --go-bg: #EFF5FF; --warn: #B45309; --warn-bg: #FFF4E0;
  --navy: #10243A; --navy-2: #173B63; --navy-line: #1E3A58; --navy-ink: #D5DFEB; --navy-icon: #B8C6DA; --navy-muted: #8FA3BC;
  --ok: #15803D; --ok-bg: #E7F6EC; --bad: #B91C1C; --bad-bg: #FDECEC; --r: 8px; --r-sm: 6px; }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/Inter-Regular.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/Inter-Medium.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/Inter-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/Inter-Bold.woff2) format("woff2"); }
html, body, body.full, .crm-ui { font-family: "Inter", "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gujarati", Arial, sans-serif; }
body, body.full { background: var(--bg); color: var(--ink); font-size: 14px; }
svg.lp-i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.lp-i.sm { width: 16px; height: 16px; }

/* ---- shell: 208 px navy sidebar with expandable modules; 64 px rail when collapsed ---- */
body.full { grid-template-columns: 208px minmax(0, 1fr); }
body.full.rail { grid-template-columns: 64px minmax(0, 1fr); }
body.full .side { width: auto; background: var(--navy); color: var(--navy-ink); border-right: 0; padding: 14px 10px 12px; gap: 10px; scrollbar-color: #294354 var(--navy); }
body.full .side .brand { color: #fff; font-size: 16px !important; font-weight: 700; }
body.full .side .logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; display: grid; place-items: center; }
body.full .side .logo svg { visibility: visible; stroke: var(--navy); }
.lp-collapse { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; color: var(--navy-icon); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; }
.lp-collapse:hover { background: var(--navy-2); color: #fff; }
body.full .tabs { gap: 2px; }
body.full .tabs .nav-group { display: none; }
.lp-mod { margin-bottom: 2px; }
.lp-mod + .lp-mod { border-top: 1px solid var(--navy-line); padding-top: 8px; margin-top: 6px; }
body.full .tabs .lp-modhead, body.full .tabs .lp-mod > button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; font-weight: 600; font-size: 13px; letter-spacing: .02em; color: #fff !important; padding: 9px 8px; border-radius: var(--r); cursor: pointer; text-align: left; min-height: 42px; box-shadow: none; }
body.full .tabs .lp-modhead:hover { background: var(--navy-2); }
body.full .tabs .lp-modhead.on, body.full .tabs .lp-mod.open > .lp-modhead { background: transparent; box-shadow: none; }
.lp-modrow { display: flex; align-items: center; gap: 2px; }
.lp-modrow .lp-modhead { flex: 1; min-width: 0; }
.lp-fold { width: 32px; height: 36px; border: 0; background: transparent; color: var(--navy-muted); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; flex: none; }
.lp-fold:hover { background: var(--navy-2); color: #fff; }
.lp-fold .lp-chev { transition: transform .15s; }
.lp-mod.open .lp-fold .lp-chev { transform: rotate(90deg); }
body.full .tabs .lp-modhead.lp-on { background: var(--navy-2); }
.lp-mod .lp-kids { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.lp-mod.open .lp-kids { display: flex; }
.lp-ic { width: 24px; height: 24px; display: grid; place-items: center; flex: none; color: var(--navy-icon); }
/* children: the bot's tab buttons and the CRM's sub-navigation, both moved into the modules */
body.full .tabs .lp-kids button, body.full .crm-subnav button { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; margin-left: 10px; width: calc(100% - 10px); min-height: 40px; border: 0; border-radius: var(--r); background: transparent; color: var(--navy-ink) !important; font-size: 14px; font-weight: 500; cursor: pointer; position: relative; line-height: 1.3; text-align: left; box-shadow: none; }
body.full .tabs .lp-kids button:hover, body.full .crm-subnav button:hover { background: var(--navy-2); color: #fff !important; }
body.full .tabs .lp-kids button.on, body.full .crm-subnav button.on { background: var(--navy-2); color: #fff !important; font-weight: 600; box-shadow: none; }
body.full .tabs .lp-kids button.on::before, body.full .crm-subnav button.on::before { content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--brand); }
body.full .tabs .lp-kids button.on .lp-ic, body.full .crm-subnav button.on .lp-ic { color: #fff; }
body.full .crm-subnav { display: flex; flex-direction: column; gap: 2px; background: transparent; border: 0; padding: 0; width: auto; }
body.full .crm-subnav button .n { margin-left: auto; background: transparent; color: var(--navy-muted); font-size: 12px; font-weight: 600; padding: 0; }
body.full .crm-subnav button.on .n { color: #fff; }
body.full .crm-subnav button .n.hot { color: #FCA5A5; }
body.full .sidelic { background: transparent; border: 0; border-top: 1px solid var(--navy-line); border-radius: 0; padding: 12px 6px 0; color: var(--navy-muted); margin-top: auto; }
body.full .sidelic .eyebrow, body.full .sidelic .mono { color: var(--navy-muted) !important; }
body.full .sidelic b, body.full .sidelic strong { color: #fff; }
/* rail */
body.full.rail .side { padding: 14px 10px 12px; align-items: center; }
body.full.rail .side .brand, body.full.rail .side .sidelic, body.full.rail .lp-modhead .lp-l, body.full.rail .lp-fold, body.full.rail .lp-kids button .lp-l, body.full.rail .crm-subnav button .lp-l, body.full.rail .crm-subnav button .n { display: none; }
body.full.rail .side > div:first-child { flex-direction: column; gap: 8px; }
body.full.rail .lp-collapse { margin: 0; }
body.full.rail .tabs .lp-modhead { justify-content: center; padding: 9px 0; }
body.full.rail .tabs .lp-kids button, body.full.rail .crm-subnav button { margin-left: 0; width: 100%; justify-content: center; padding: 9px 0; }
body.full.rail .tabs .lp-kids button.on::before, body.full.rail .crm-subnav button.on::before { left: 2px; }

/* ---- header / page frame ---- */
body.full .top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 20px 0; }
body.full .pagehead h1 { font-size: 26px !important; line-height: 32px; font-weight: 700 !important; letter-spacing: -.3px !important; }
body.full .pagehead .eyebrow { color: var(--faint); font-family: inherit; letter-spacing: .04em; }
body.full .views { padding: 20px; }
body.full.crm-mode .views { padding-top: 20px; }
.group, body.full .stage, body.full .ltable-wrap, body.full .clean-scroll, .crm-ui .group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
body.full .stage { background: var(--surface); border-top: 1px solid var(--line); }
body.full .stage b { color: var(--ink); } body.full .stage.final b { color: var(--brand); }
.viewtitle, h2.viewtitle { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.eyebrow { font-family: inherit; letter-spacing: .05em; font-size: 11px; color: var(--muted); }

/* ---- controls ---- */
.btn { border-radius: var(--r); border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn:hover { background: var(--raise); }
.btn.primary, .btn.go, .btn.primary:hover, .btn.go:hover { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: none; }
.btn.primary:hover, .btn.go:hover { background: #1056BC; border-color: #1056BC; }
.btn.stop { color: var(--bad); border-color: #F5C2C2; background: var(--surface); }
input, select, textarea { border-radius: var(--r) !important; border-color: var(--line2) !important; font-family: inherit; }
body.full .mode { background: var(--raise); border-color: var(--line); border-radius: var(--r); }
.mode button.on { background: var(--navy); color: #fff; }
.mode button.live.on { background: var(--warn); }
.limbar { background: var(--line); }
.feedpick-chips button, #feedPickChips button { border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 500; }
#feedPickChips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chipbtn { border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 500; }
.chipbtn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.source-tab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.source-tab.selected { background: var(--brand-bg); border: 1px solid var(--brand); color: var(--ink); box-shadow: none; }
body .ltable th, .clean-table th { background: var(--raise); color: var(--muted); border-color: var(--line); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; height: 40px; }
body .ltable td, .clean-table td { border-color: var(--line); color: var(--ink); font-size: 14px; padding: 10px 12px; }
body .ltable tr.row:hover td { background: var(--raise); }
body .ltable tr.open td { background: var(--brand-bg); }
body .lead { background: var(--surface) !important; border-color: var(--line); box-shadow: none; border-radius: var(--r); }
body.full .sumrow, body .log > * { border-color: var(--line); }

/* ---- CRM workspace ---- */
/* 1.14.0 default look (the "warm" slot): white workspace, navy, cobalt. Enterprise / Fresh / Midnight keep their own palettes from crm-ui.css. */
.crm-ui, #tab-crm[data-crm-theme="warm"] .crm-ui, .crm-drawer, .crm-drawer[data-crm-theme="warm"] { --crm-ink: #13243A; --crm-muted: #64748B; --crm-line: #E2E8F0; --crm-surface: #FFFFFF; --crm-raise: #F8FAFC; --crm-brand: #1565D8; --crm-brand-bg: #EFF5FF; --crm-navy: #10243A; --crm-gold: #B45309; --crm-red: #B91C1C; --crm-red-bg: #FDECEC; --crm-amber: #B45309; --crm-amber-bg: #FFF4E0; --crm-blue: #1565D8; --crm-blue-bg: #EFF5FF; --crm-tile-bg: #fff; --crm-tile-shadow: none; --crm-col-bg: #EEF2F7; --crm-col-line: #E2E8F0; --crm-col-over: #EFF5FF; --crm-card-bg: #fff; --crm-card-line: #E2E8F0; --crm-nav-on: #fff; --crm-nav-ink: #334155; --crm-hover: #F1F5F9; --crm-input-bg: #fff; --crm-radius: 8px; --crm-font: inherit; }
#tab-crm[data-crm-theme="midnight"] { background: transparent; padding: 0 !important; }
.crm-head { grid-template-columns: auto 1fr auto auto; grid-template-areas: 'title . search action'; margin-bottom: 18px; }
.crm-head .crm-look { display: none; } /* theme choice lives under CRM → Settings → Appearance (moved by shell-v2.js) */
.crm-head .crm-title { font-size: 26px; font-weight: 700; letter-spacing: -.3px; line-height: 32px; }
.crm-head .crm-title small { font-size: 13px; color: var(--faint); margin-top: 2px; }
.crm-head .btn.primary { height: 38px; padding: 0 14px; border-radius: var(--r); }
.crm-search input { border-radius: var(--r) !important; height: 38px; }
.crm-summary { display: none !important; } /* no tiles or stage graphics on working screens */
.crm-kpis { display: none !important; }
.crm-board-bar .seg { border-radius: var(--r); }
.crm-board { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
.crm-col { min-width: 240px; scroll-snap-align: start; border-radius: var(--r); background: var(--crm-col-bg); }
.crm-card { border-radius: var(--r); border-left-width: 1px; box-shadow: none; }
.crm-card:hover { border-color: var(--line2); }
.crm-pane .group, .crm-pane .ltable-wrap { border-radius: var(--r); box-shadow: none; }
.crm-avatar { background: #E3E9F2; color: #334155; }
.crm-flag.value { background: var(--brand-bg); color: var(--brand); }
#crmFilter .chipbtn.on { background: var(--navy); border-color: var(--navy); }
/* the lead panel: docked when the content area has room for 800 px of table + 16 px + the 360 px panel (body.dock,
   measured by workspace-v3.js from the real content width — sidebar state and padding included); a slide-in drawer
   with a scrim otherwise */
.crm-drawer { width: 360px; border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(16, 36, 58, .18); border-radius: 0; }
.crm-drawer header { border-bottom: 1px solid var(--line); }
body.full.dock .crm-drawer { box-shadow: none; top: 0; }
body.full.dock .crm-drawer-scrim.open { display: none; }
body.full.dock.drawer-open .views { padding-right: 376px; }
body.full.dock.drawer-open .top { padding-right: 376px; }
/* documents: title row, then the section bar on its own row */
.qi-nav { margin: 0 0 12px; }
.qi-tabs { border-radius: var(--r); background: var(--raise); border: 1px solid var(--line); }
.qi-tabs button.on { color: var(--brand); background: var(--surface); box-shadow: 0 1px 2px #0f172a1a, 0 0 0 1px var(--line); }
.qi-doc, .qi-a4, .qi-preview .qi-a4 { border-radius: var(--r); box-shadow: none; border-color: var(--line); }
.qi-chip { border-radius: 999px; }
.wt-send, .wt-facts, .wt-templates, .wt-menu { border-radius: var(--r); border-color: var(--line); background: var(--surface); }
.wt-pill.on { background: var(--ok-bg); color: var(--ok); }
.wt-item.on { border-color: var(--brand); background: var(--brand-bg); }
.wt-langs .btn.on { background: var(--navy); border-color: var(--navy); }
.crm-stage-pill, .qi-status { border-radius: 999px; }
.crm-kpi.k-brand { --k: var(--brand); }
/* settings & misc groups keep their spacing but drop the warm gradients */
.lp-rule { background: var(--surface); border-color: var(--line); }
.combination-chips span { background: var(--brand-bg); border-color: var(--brand-line); color: var(--brand); }
.activity-records { border-color: var(--line); background: var(--surface); border-radius: var(--r); }

/* ---- 1.14.0 sidebar module headers: always white on navy, even while the page is "on" ---- */
body.full .tabs button.lp-modhead, body.full .tabs button.lp-modhead.on, body.full .tabs button.lp-modhead:hover { color: #fff !important; font-weight: 600; box-shadow: none; }
body.full .tabs button.lp-modhead.on { background: transparent; }
body.full .tabs button.lp-modhead.lp-on, body.full .tabs button.lp-modhead:hover { background: var(--navy-2); }

/* ---- 1.14.0 Leads table: denser rows, actions in one wrapping strip, wider action column ---- */
#tab-crm .ltable col:nth-child(1) { width: 25% !important; }
#tab-crm .ltable col:nth-child(2) { width: 12% !important; }
#tab-crm .ltable col:nth-child(3) { width: 13% !important; }
#tab-crm .ltable col:nth-child(4) { width: 12% !important; }
#tab-crm .ltable col:nth-child(5) { width: 9% !important; }
#tab-crm .ltable col:nth-child(6) { width: 29% !important; }
#crmList td { vertical-align: top; padding: 9px 10px; font-size: 13px; }
#crmList td > .actions[style] { flex-direction: row !important; flex-wrap: wrap; align-items: center !important; gap: 4px !important; }
#crmList td .actions .actions { gap: 4px !important; }
#crmList .btn.small { padding: 4px 8px; font-size: 12px; min-height: 26px; border-radius: 6px; }
#crmList .btn.small.wa { flex: 0 0 auto; }
#crmList select { padding: 4px 6px; font-size: 12px; min-height: 26px; border-radius: 6px; max-width: 130px; }
#crmList textarea[data-act="notes"] { font-size: 12.5px; }
#crmList .t strong, #crmList td.t b { font-size: 13.5px; }
#tab-crm .feedbar:has(> #crmSearch) { display: none; } /* the page header search box filters the same list (kept in step by panel-crm-ui.js) */
#crmList td.t { cursor: pointer; }
#crmList td.t:hover > b, #crmList td.t:hover > strong, #crmList tr.row:hover td.t { color: var(--brand); }

/* ---- narrow windows (≤ 820 px): the sidebar sits on top; modules stack and their pages wrap as chips ---- */
@media (max-width: 820px) {
  body.full .tabs { flex-direction: column; flex-wrap: nowrap; overflow: visible; gap: 6px; }
  body.full .tabs .lp-mod { width: 100%; }
  body.full .tabs .lp-kids, body.full .tabs .lp-kids .crm-subnav { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 4px !important; padding-left: 0 !important; margin: 0 !important; }
  body.full .tabs .lp-kids button, body.full .tabs .crm-subnav button { width: auto !important; white-space: nowrap; min-height: 36px !important; padding: 6px 10px !important; box-shadow: none !important; }
  body.full .tabs .lp-kids button .n { margin-left: 6px; }
  body.full .lp-collapse { display: none; }
}
