/* Shared landing language; overrides legacy dashboard chrome, not status semantics. */
:root, body[data-theme="dark"] {
  --bg:var(--color-canvas); --bg2:var(--color-surface); --bg3:#141414;
  --bg-glass:#0a0a0af5; --bg-glass2:#141414;
  --text:var(--color-ink); --text2:var(--color-muted); --text3:#969696;
  --border:#242424; --border-hi:#414141; --border2:#ffffff0a;
  --green:var(--color-accent); --green-dim:#99ee0214; --on-accent:#000;
  --ui-card:var(--color-surface); --ui-nav:#050505; --ui-border:#242424;
  --ui-shadow:inset 0 1px 0 #ffffff06; --surface-hover:#ffffff08;
  --font-sans:var(--font-ui); --radius:18px; --radius-sm:10px;
  --top-glow:transparent; --bottom-glow:transparent;
  --brand-action:var(--color-accent); --brand-action-ink:#000;
}
body[data-theme="light"] {
  --bg:#f5f6f2; --bg2:#fff; --bg3:#eef0e9; --bg-glass:#fffffff5; --bg-glass2:#f5f6f2;
  --text:#151713; --text2:#4c5048; --text3:#64695f; --border:#d9ddd3; --border-hi:#a0a996;
  --ui-card:#fff; --ui-nav:#fafbf8; --ui-border:#d9ddd3; --ui-shadow:inset 0 1px 0 #fff;
  --green:#426d00; --green-dim:#78ad0912; --on-accent:#000;
  --font-sans:var(--font-ui); --surface-hover:#426d0009;
  --brand-action:var(--color-accent); --brand-action-ink:#000;
}
html, body, body[data-theme="light"] { background:var(--bg); font-family:var(--font-sans); }
body[data-theme] :is(.sidebar, #app > header, .sidebar-health, .system-health-card) { background:var(--ui-nav); border-color:var(--border); box-shadow:none; }
body[data-theme] :is(.kpi-card,.settings-card,.chart-card,.crm-stat-card,.table-wrap,.log-panel,.mailing-overview,.network-balance-panel,.login-box,.modal,.modal-content,.notification-panel) { background:var(--ui-card); border-color:var(--border); border-radius:var(--radius-card); color:var(--text); box-shadow:var(--ui-shadow); }
body[data-theme] #tab-leads .kpi-grid > .kpi-card { background:linear-gradient(135deg,#ffffff04,transparent 65%),var(--ui-card); border-color:var(--border); box-shadow:var(--ui-shadow); }
body[data-theme] #tab-leads .kpi-card { --today-surface:var(--ui-card); --today-border:var(--border); --today-progress:var(--green); --unique-surface:var(--ui-card); }
body[data-theme] :is(.header-user,.header-range,.status-badge,.theme-toggle,.btn-logout,.notification-bell,.mailing-metrics > div,.sidebar-subnav,.sidebar-nav-reference button) { background:var(--ui-card); border-color:var(--border); color:var(--text2); }
body[data-theme] .sidebar-nav-reference button.active { background:var(--green-dim); color:var(--green); border-color:var(--green); }
body[data-theme] .sidebar-nav-reference button:hover { background:var(--surface-hover); color:var(--text); }
body[data-theme] .sidebar-nav-reference button.active .nav-ref-icon { color:var(--green); }
body[data-theme] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { background:var(--bg2); color:var(--text); border-color:var(--border-hi); border-radius:var(--radius-control); font-family:var(--font-sans); }
body[data-theme] :is(input,textarea)::placeholder { color:var(--text3); }
body[data-theme] :is(.btn-sm,.btn-action,.btn-stop,.theme-toggle,.btn-logout,.header-range,.header-user) { border-radius:var(--radius-control); }
body[data-theme] :is(.btn-action.primary,.btn-primary,.btn-login) { background:var(--brand-action); color:var(--brand-action-ink); border-color:transparent; text-shadow:none; box-shadow:inset 0 1px 0 #ffffff40,0 0 20px #99ee0212; }
body[data-theme] :is(.btn-action.primary,.btn-primary,.btn-login):hover:not(:disabled) { background:#adff22; color:#000; box-shadow:0 0 24px #99ee0224; }
body[data-theme] :is(button,a,input,select,textarea):focus-visible { outline:2px solid var(--green); outline-offset:3px; }
body[data-theme] :is(button,input,select,textarea):disabled { opacity:.5; cursor:not-allowed; }
body[data-theme] :is(.log-header,.mailing-recent__head,.mailing-overview__summary,.mailing-table-head,th,td) { border-color:var(--border); }
body[data-theme] :is(th,.log-body,.mailing-donut::before) { background:var(--bg2); }
body[data-theme] tbody tr:hover { background:var(--surface-hover); }
body[data-theme] .active-offers-panel { --offer-surface:var(--ui-card); --offer-border:var(--border); --offer-ink:var(--text); --offer-muted:var(--text2); --offer-data:var(--green); border-radius:var(--radius-card); }
body[data-theme] .active-offer-card { background:var(--ui-card); }
body[data-theme] .active-offer-avatar { background:var(--green-dim); color:var(--green); }
body[data-theme] .active-offers-header button { color:var(--green); }
body[data-theme] #tab-leads .dashboard-actions { --action-surface:var(--ui-card); --action-border:var(--border); --action-ink:var(--text); }
body[data-theme="dark"] #tab-crm-funnels .funnel-flow { --funnel-surface:#0a0a0a; --funnel-border:#181818; --funnel-data:#86d600; --funnel-ink:#dedede; }
body[data-theme="light"] #tab-crm-funnels .funnel-flow { --funnel-surface:var(--ui-card); --funnel-border:var(--border); --funnel-ink:var(--text); }
body[data-theme] :is(.page-title,.section-title,.login-box h1) { font-family:var(--font-ui); letter-spacing:-.035em; }
@media(prefers-reduced-motion:reduce) { body[data-theme] :is(button,a,.kpi-card) { transition:none; } body[data-theme] .kpi-card:hover { transform:none; } }
body[data-theme] #app, body[data-theme] #app main, body[data-theme] .main { background:var(--bg); }
body[data-theme] #tab-leads .dashboard-actions .btn-action.primary { background:var(--brand-action); color:var(--brand-action-ink); border-color:transparent; filter:none; }
body[data-theme] #tab-leads .dashboard-actions .btn-action.primary:hover:not(:disabled) { background:#adff22; }
body[data-theme] #tab-leads .kpi-label-icon { background:var(--green-dim); border-color:var(--border); }
.job-progress-panel[hidden] { display:none; }
.job-progress-panel { display:flex; align-items:center; gap:22px; padding:22px 24px; margin:18px 0; border:1px solid var(--border-hi); border-radius:18px; background:linear-gradient(120deg,var(--green-dim),transparent 40%),var(--ui-card); box-shadow:inset 0 1px 0 #ffffff0c,0 10px 28px #0002; }
.job-progress-beacon { width:16px; height:16px; border-radius:50%; flex:none; background:var(--green); box-shadow:0 0 0 9px var(--green-dim),0 0 20px var(--green-dim); }
.job-progress-copy { display:flex; flex-direction:column; gap:5px; min-width:180px; }
.job-progress-copy strong { font-size:16px; font-weight:700; }
.job-progress-copy span,.job-progress-count { color:var(--text2); font-size:13px; }
.job-progress-meter { display:flex; align-items:center; gap:14px; flex:1; min-width:150px; }
.job-progress-track { flex:1; height:12px; overflow:hidden; background:var(--bg3); border:1px solid var(--border-hi); border-radius:99px; }
#job-progress-fill { display:block; height:100%; border-radius:inherit; background:var(--green); transition:width 220ms ease-out; }
.job-progress-meter strong,#job-progress-time,.job-progress-count { font-variant-numeric:tabular-nums; white-space:nowrap; }
#job-progress-time { color:var(--text2); padding-left:18px; border-left:1px solid var(--border-hi); }
#job-progress-stop { min-height:44px; white-space:nowrap; color:var(--red); background:var(--red-dim); border:1px solid var(--red); }
.is-indeterminate #job-progress-fill { animation:job-progress-travel 1.8s ease-in-out infinite alternate; }
.job-progress-panel[data-state="error"] .job-progress-beacon { background:var(--red); }
@keyframes job-progress-travel { from {transform:translateX(-100%)} to {transform:translateX(333%)} }
@media(max-width:1180px) { .job-progress-panel { flex-wrap:wrap; gap:16px; } .job-progress-meter { flex-basis:35%; } }
@media(max-width:600px) { .job-progress-panel { padding:18px; } .job-progress-copy { flex:1; min-width:0; } .job-progress-meter { flex-basis:100%; } #job-progress-stop { margin-left:auto; } }
@media(prefers-reduced-motion:reduce) { #job-progress-fill { transition:none; animation:none; } }
@media(prefers-reduced-motion:reduce) { .is-indeterminate #job-progress-fill { animation:none; } }

/* Fixed-height lead rows; complete values retained in title attributes. */
#leads-table-wrap .leads-data-table tbody td {
 height:60px; padding-block:8px; line-height:20px; vertical-align:middle;
 white-space:nowrap; overflow-wrap:normal; overflow:hidden; text-overflow:ellipsis;
}
#leads-table-wrap .leads-data-table .lead-cell-status { padding-right:18px; }
#leads-table-wrap .leads-data-table .lead-cell-date { padding-left:18px; }
#leads-table-wrap .leads-data-table .lead-cell-status .badge {
  max-width:100%; box-sizing:border-box; overflow:hidden; text-overflow:ellipsis; vertical-align:middle;
}
#leads-table-wrap .leads-data-table .lead-cell-action { overflow:visible; }

/* Funnel cards share one rhythm; neutralize obsolete positional KPI variants. */
body[data-theme] #tab-leads .kpi-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi {
  grid-column:auto; grid-row:auto; box-sizing:border-box; width:100%; max-width:100%;
  height:158px; min-height:158px; min-width:0; padding:16px;
  align-self:stretch; justify-self:stretch; border-radius:14px; transform:none;
  display:flex; flex-direction:column; gap:12px;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi:hover { transform:none; box-shadow:var(--ui-shadow); }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi::before,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi::after,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label::before,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label::after,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-comparison::before { content:none; display:none; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label {
  display:flex; align-items:center; gap:10px; height:32px; min-height:32px;
  margin:0; padding:0; color:var(--text2); font-size:11px;
  font-weight:600; letter-spacing:0; line-height:1.2;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-label-icon {
  box-sizing:border-box; flex:0 0 32px; width:32px; height:32px;
  margin:0; padding:6px; border:1px solid var(--border); border-radius:8px;
  background:var(--green-dim); color:var(--green); stroke-width:2;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value {
  margin:0; color:var(--green); font-size:clamp(24px,2.1vw,36px);
  font-weight:700; line-height:1.1; letter-spacing:0; font-variant-numeric:tabular-nums;
  text-shadow:none; overflow-wrap:anywhere;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-comparison {
  position:static; margin-top:auto; color:var(--text3); font-size:11px;
  line-height:1.2; letter-spacing:0;
}
@media(max-width:1100px) { body[data-theme] #tab-leads .kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:650px) { body[data-theme] #tab-leads .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:380px) { body[data-theme] #tab-leads .kpi-grid { grid-template-columns:1fr; } }

.funnel-period { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:16px 0 0; }
.funnel-period button { min-height:40px; padding:0 16px; border:1px solid var(--border); border-radius:10px; background:var(--ui-card); color:var(--text2); font:inherit; cursor:pointer; }
.funnel-period button[aria-pressed="true"] { background:var(--green-dim); color:var(--green); border-color:var(--green); }
#funnel-period-status { margin-left:8px; color:var(--text3); font-size:12px; }
@media(max-width:650px) { .funnel-period button { min-height:44px; } }

body[data-theme] #tab-leads .page-head { flex-wrap:wrap; gap:16px; align-items:center; }
.overview-command-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
body[data-theme] .overview-command-bar :is(button,summary) { min-height:40px; padding:0 14px; font-size:13px; font-weight:600; text-transform:none; letter-spacing:0; white-space:nowrap; }
body[data-theme] .overview-command-bar .overview-start { min-height:44px; padding-inline:18px; gap:8px; }
.overview-export { position:relative; }
.overview-export summary { display:flex; align-items:center; gap:10px; list-style:none; cursor:pointer; border:1px solid var(--border); border-radius:10px; background:var(--ui-card); color:var(--text2); }
.overview-export summary::-webkit-details-marker { display:none; }
.overview-export-options { position:absolute; top:calc(100% + 6px); right:0; z-index:30; width:180px; padding:6px; display:grid; gap:4px; background:var(--ui-card); border:1px solid var(--border-hi); border-radius:12px; box-shadow:0 10px 30px #0005; }
.overview-export-options button { width:100%; text-align:left; }
.overview-export summary:focus-visible { outline:2px solid var(--green); outline-offset:3px; }
.overview-command-bar #mailing-panel-toggle[aria-expanded="true"] { color:var(--green); border-color:var(--green); }
.overview-command-bar #btn-stop:disabled { display:none; }
body[data-theme] .overview-command-bar .overview-refresh { width:40px; padding:0; font-size:20px; }
@media(max-width:650px) { .overview-command-bar { width:100%; } body[data-theme] .overview-command-bar :is(button,summary) { min-height:44px; } .overview-export-options { left:0; right:auto; } }

.overview-offers-attention { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,2fr) minmax(280px,1fr); gap:14px; min-width:0; align-items:start; }
.overview-offers-attention .active-offers-panel { grid-column:auto; }
.overview-offers-attention .active-offers-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.attention-panel { padding:12px 14px; border:1px solid var(--border); border-radius:18px; background:var(--ui-card); min-width:0; }
.attention-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.attention-head h2 { margin:0; font-size:14px; font-weight:600; }
.attention-row { display:flex; align-items:center; gap:12px; padding:12px 2px; border-bottom:1px solid var(--border); }
.attention-icon { color:var(--yellow); width:24px; font-size:22px; text-align:center; flex:none; }
.attention-row.errors .attention-icon,.attention-row.errors b { color:var(--red); }
.attention-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:3px; }
.attention-copy strong { font-size:13px; font-weight:500; }.attention-copy small,.attention-note { color:var(--text3); font-size:11px; }
.attention-row b { color:var(--yellow); font-variant-numeric:tabular-nums; }.attention-note { padding-top:12px; }
@media(max-width:1000px) { .overview-offers-attention { grid-template-columns:1fr; } }
@media(max-width:600px) { .overview-offers-attention .active-offers-grid { grid-template-columns:1fr; } }

/* Shared alignment for the overview work area. */
.overview-icon { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
body[data-theme] .overview-offers-attention { align-items:stretch; gap:16px; }
body[data-theme] .overview-offers-attention > :is(.active-offers-panel,.attention-panel) { padding:16px; border-radius:20px; display:flex; flex-direction:column; }
body[data-theme] .overview-offers-attention :is(.active-offers-header,.attention-head) { padding:0; min-height:40px; margin:0 0 12px; }
body[data-theme] .overview-offers-attention h2 { display:flex; align-items:center; gap:8px; font-size:14px; line-height:20px; font-weight:600; }
.overview-offers-attention h2 .overview-icon { color:var(--text2); width:18px; height:18px; }
body[data-theme] .overview-offers-attention .active-offers-header button { min-height:40px; }
body[data-theme] .overview-offers-attention .active-offers-grid { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; flex:1; }
body[data-theme] .overview-offers-attention .active-offer-card { padding:12px; border-radius:12px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; }
body[data-theme] .active-offer-card h3 { font-size:14px; }
#attention-items { flex:1; display:flex; flex-direction:column; }
.attention-row { flex:1; min-height:64px; box-sizing:border-box; gap:12px; }
.attention-icon { display:flex; align-items:center; justify-content:center; width:28px; height:28px; }
.attention-note { margin-top:auto; line-height:1.5; }
body[data-theme] .overview-command-bar { gap:8px; }
body[data-theme] .overview-command-bar :is(button,summary) { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; border-radius:10px; }
.overview-command-bar .overview-icon { width:18px; height:18px; }
.attention-head button { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0; }
@media (min-width:1001px) and (max-width:1300px) { body[data-theme] .overview-offers-attention .active-offers-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } body[data-theme] .overview-offers-attention .active-offer-card:last-child:nth-child(odd) { grid-column:1/-1; } }
@media (max-width:700px) { body[data-theme] .overview-offers-attention .active-offers-grid { grid-template-columns:1fr; } .attention-head button { width:44px; height:44px; } }

/* Six-item navigation with native disclosure groups. */
.sidebar-nav-group { margin:0; }
.sidebar-nav-group > summary { box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; min-height:40px; padding:8px 10px; border:1px solid transparent; border-radius:9px; color:var(--text2); cursor:pointer; list-style:none; font-size:13px; font-weight:600; }
.sidebar-nav-group > summary::-webkit-details-marker { display:none; }
.sidebar-nav-group > summary:hover { background:var(--surface-hover); border-color:var(--border2); color:var(--text); }
.sidebar-nav-group > summary:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.sidebar-group-chevron { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; transition:transform .16s ease; }
.sidebar-nav-group[open] > summary .sidebar-group-chevron { transform:rotate(180deg); }
.sidebar-nav-group:has(button.active) > summary { color:var(--green); background:var(--green-dim); border-color:var(--green); }
.sidebar-nav-group:has(button.active) > summary .nav-ref-icon { color:var(--green); }
.sidebar-nav-children { display:grid; gap:3px; padding:4px 0 5px 14px; }
body[data-theme] .sidebar-nav-children > button { min-height:36px; padding-left:14px; font-size:12px; }
body[data-theme] .sidebar-nav-children > button .nav-ref-icon { width:17px; height:17px; flex-basis:17px; }
@media(max-width:980px) { .sidebar-nav-group > summary { min-height:44px; } body[data-theme] .sidebar-nav-children > button { min-height:44px; } }
@media(prefers-reduced-motion:reduce) { .sidebar-group-chevron { transition:none; } }
.sidebar-nav-group:not(:has(.sidebar-nav-children > button:not([hidden]))) { display:none; }

/* Reference-matched solid KPI pictograms; scoped to the four funnel icons only. */
body[data-theme] #tab-leads .kpi-label-icon--solid .kpi-icon-fill { fill:currentColor; stroke:none; }
body[data-theme] #tab-leads .kpi-label-icon--solid .kpi-icon-detail { fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
body[data-theme] #tab-leads .kpi-label-icon--solid .kpi-icon-cut { fill:none; stroke:var(--ui-card); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
body[data-theme] #tab-leads .kpi-label-icon--fingerprint .kpi-icon-detail { stroke-width:1.65; }

/* KPI icon system measured from supplied overview reference. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi {
  display:grid; grid-template-columns:52px minmax(0,1fr); grid-template-rows:22px 38px 1fr;
  column-gap:14px; row-gap:0;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label { display:contents; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label > span {
  grid-column:2; grid-row:1; align-self:end; min-width:0;
  color:var(--text2); font-size:11px; font-weight:600; line-height:1.2;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-label-icon {
  grid-column:1; grid-row:1 / span 2; align-self:start;
  box-sizing:border-box; width:52px; height:52px; padding:9px; margin:0;
  border:1px solid color-mix(in srgb,var(--green) 14%,var(--border)); border-radius:14px;
  background:radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--green) 11%,transparent),transparent 72%);
  color:var(--green); overflow:visible;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value { grid-column:2; grid-row:2; align-self:end; min-width:0; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-comparison { grid-column:1 / -1; grid-row:3; align-self:end; margin:0; }
body[data-theme] #tab-leads .kpi-label-icon--new { background:color-mix(in srgb,var(--green) 12%,var(--ui-card)); border-color:transparent; }
body[data-theme] #tab-leads :is(.kpi-label-icon--fingerprint,.kpi-label-icon--sent,.kpi-label-icon--approved) { border-radius:50%; }
body[data-theme] #tab-leads .kpi-label-icon--solid :is(.kpi-icon-fill,.kpi-icon-detail) { filter:drop-shadow(0 0 3px color-mix(in srgb,var(--green) 38%,transparent)); }
body[data-theme] #tab-leads .kpi-label-icon--fingerprint .kpi-icon-detail { stroke-width:1.55; }
body[data-theme] #tab-leads .kpi-label-icon--approved .kpi-icon-detail { stroke-width:1.9; }
body[data-theme] #tab-leads .kpi-label-icon--revenue { border-radius:12px; }
body[data-theme] #tab-leads .kpi-label-icon--revenue .kpi-icon-wallet-dot { filter:none; }
@media(max-width:650px) {
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi { grid-template-columns:48px minmax(0,1fr); }
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-label-icon { width:48px; height:48px; padding:8px; }
}

/* Fidelity pass: fuller silhouettes and reference depth. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi {
  background:radial-gradient(ellipse at 76% 118%,color-mix(in srgb,var(--green) 12%,transparent),transparent 38%),var(--ui-card);
  border-color:color-mix(in srgb,var(--border) 90%,white 10%);
}
body[data-theme] #tab-leads .kpi-label-icon--new { padding:7px; }
body[data-theme] #tab-leads .kpi-label-icon--new .kpi-icon-secondary { opacity:.86; }
body[data-theme] #tab-leads .kpi-label-icon--sent { padding:8px; }
body[data-theme] #tab-leads .kpi-label-icon--sent .kpi-icon-shade { fill:color-mix(in srgb,var(--green) 62%,#183500); stroke:none; }
body[data-theme] #tab-leads .kpi-label-icon--approved { padding:7px; }
body[data-theme] #tab-leads .kpi-label-icon--approved .kpi-icon-detail { stroke-width:2.15; }
body[data-theme] #tab-leads .kpi-label-icon--revenue { padding:7px; }
body[data-theme] #tab-leads .kpi-label-icon--revenue .kpi-icon-cut { stroke-width:1.5; }

/* Unique KPI close-up calibration from supplied crop. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
  grid-template-columns:60px minmax(0,1fr); grid-template-rows:24px 40px 1fr;
  column-gap:16px;
  background:radial-gradient(ellipse at 78% 116%,color-mix(in srgb,var(--green) 20%,transparent),transparent 42%),linear-gradient(135deg,color-mix(in srgb,white 2.5%,var(--ui-card)),var(--ui-card));
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-label-icon--fingerprint {
  width:60px; height:60px; padding:7px;
  border-color:color-mix(in srgb,var(--green) 25%,var(--border));
  background:radial-gradient(circle at 50% 46%,color-mix(in srgb,var(--green) 15%,transparent),transparent 72%);
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-label-icon--fingerprint .kpi-icon-detail {
  stroke-width:1.8; filter:drop-shadow(0 0 4px color-mix(in srgb,var(--green) 55%,transparent));
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .label > span { color:var(--text); font-size:12px; font-weight:650; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { font-size:40px; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-comparison { color:var(--text2); font-size:12px; }
@media(max-width:650px) {
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique { grid-template-columns:54px minmax(0,1fr); }
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-label-icon--fingerprint { width:54px; height:54px; padding:7px; }
}

/* Exact KPI pictograms extracted from user-supplied reference. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
  grid-template-columns:72px minmax(0,1fr); grid-template-rows:28px 44px 1fr;
  column-gap:14px;
}
body[data-theme] #tab-leads .kpi-reference-icon {
  grid-column:1; grid-row:1 / span 2; align-self:start;
  display:block; width:72px; height:72px; max-width:none; object-fit:contain;
  border:0; outline:0; border-radius:0; background:none; box-shadow:none;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label > span,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .label > span {
  color:var(--text); font-size:12px; font-weight:650;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { font-size:40px; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-comparison,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-comparison { color:var(--text2); font-size:12px; }
@media(max-width:650px) {
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique { grid-template-columns:64px minmax(0,1fr); grid-template-rows:26px 38px 1fr; }
  body[data-theme] #tab-leads .kpi-reference-icon { width:64px; height:64px; }
}

/* Sharp reconstructed KPI ink; container depth remains CSS-native. */
body[data-theme] #tab-leads .kpi-reference-icon {
  box-sizing:border-box; padding:10px; object-fit:contain;
  border:1px solid color-mix(in srgb,var(--green) 20%,var(--border));
  background:radial-gradient(circle at 50% 46%,color-mix(in srgb,var(--green) 14%,transparent),color-mix(in srgb,var(--green) 4%,var(--ui-card)) 72%);
}
body[data-theme] #tab-leads .funnel-kpi:first-child .kpi-reference-icon {
  padding:9px; border-color:transparent; border-radius:16px;
  background:linear-gradient(145deg,color-mix(in srgb,var(--green) 15%,var(--ui-card)),color-mix(in srgb,var(--green) 8%,var(--ui-card)));
}
body[data-theme] #tab-leads .funnel-kpi:nth-child(2) .kpi-reference-icon,
body[data-theme] #tab-leads .funnel-kpi:nth-child(3) .kpi-reference-icon,
body[data-theme] #tab-leads .funnel-kpi:nth-child(4) .kpi-reference-icon { border-radius:50%; }
body[data-theme] #tab-leads .funnel-kpi:nth-child(5) .kpi-reference-icon { padding:9px; border-radius:15px; }
@media(max-width:650px) { body[data-theme] #tab-leads .kpi-reference-icon { padding:9px; } }

/* Compact interface pass: denser rhythm without shrinking usable hit areas. */
:root {
  --compact-sidebar:184px;
  --compact-header:54px;
  --compact-gap:10px;
  --compact-card-radius:14px;
}
body[data-theme] #app > header {
  min-height:var(--compact-header); height:var(--compact-header);
  margin-left:var(--compact-sidebar); padding-inline:14px;
}
body[data-theme] .app-shell { margin-left:var(--compact-sidebar); }
body[data-theme] .sidebar {
  width:var(--compact-sidebar); flex-basis:var(--compact-sidebar);
  padding:10px 9px; gap:6px;
}
body[data-theme] .sidebar-brand { min-height:38px; padding:2px 6px 6px; gap:8px; }
body[data-theme] .sidebar-brand__icon { width:28px; height:28px; }
body[data-theme] .sidebar-brand__name { font-size:17px; }
body[data-theme] .sidebar-nav-reference { gap:2px; padding:5px 1px; }
body[data-theme] .sidebar-nav-reference button,
body[data-theme] .sidebar-nav-group > summary { min-height:38px; padding:7px 9px; font-size:12px; border-radius:8px; }
body[data-theme] .sidebar-nav-reference .nav-label { gap:9px; }
body[data-theme] .sidebar-nav-reference .nav-ref-icon { width:17px; height:17px; flex-basis:17px; }
body[data-theme] .sidebar-nav-children { gap:1px; padding:2px 0 3px 11px; }
body[data-theme] .sidebar-nav-children > button { min-height:34px; padding-left:11px; font-size:11px; }
body[data-theme] main { padding:13px 16px 20px; }
body[data-theme] .page-head { margin-bottom:10px; gap:10px; }
body[data-theme] .page-title { font-size:22px; }
body[data-theme] .page-subtitle { margin-top:2px; }
body[data-theme] .funnel-period { margin-top:10px; gap:5px; }
body[data-theme] .funnel-period button { min-height:40px; padding-inline:13px; border-radius:8px; }
body[data-theme] #tab-leads .kpi-grid { gap:10px; margin:12px 0; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
  height:132px; min-height:132px; padding:12px;
  grid-template-columns:58px minmax(0,1fr); grid-template-rows:23px 35px 1fr;
  column-gap:10px; border-radius:var(--compact-card-radius);
}
body[data-theme] #tab-leads .kpi-reference-icon {
  width:58px; height:58px; padding:8px;
}
body[data-theme] #tab-leads .funnel-kpi:first-child .kpi-reference-icon,
body[data-theme] #tab-leads .funnel-kpi:nth-child(5) .kpi-reference-icon { padding:8px; border-radius:13px; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label > span,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .label > span { font-size:11px; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { font-size:34px; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-comparison,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-comparison { font-size:11px; }
body[data-theme] .overview-command-bar { gap:6px; }
body[data-theme] .overview-command-bar :is(button,summary) { min-height:40px; padding-inline:12px; border-radius:8px; font-size:12px; }
body[data-theme] .overview-command-bar .overview-start { min-height:40px; padding-inline:15px; }
body[data-theme] .overview-offers-attention { gap:10px; }
body[data-theme] .overview-offers-attention > :is(.active-offers-panel,.attention-panel) {
  padding:12px; border-radius:var(--compact-card-radius);
}
body[data-theme] .overview-offers-attention :is(.active-offers-header,.attention-head) { min-height:34px; margin-bottom:8px; }
body[data-theme] .overview-offers-attention .active-offer-card { padding:9px 10px; gap:5px; border-radius:10px; }
body[data-theme] .active-offer-card .active-offer-heading { height:34px; gap:9px; }
body[data-theme] .active-offer-avatar { width:28px; height:28px; font-size:11px; }
body[data-theme] .active-offer-card h3 { font-size:13px; }
body[data-theme] .active-offer-stats span { font-size:11px; }
body[data-theme] .active-offer-stats strong { font-size:16px; line-height:20px; }
body[data-theme] .active-offer-stats > div + div { padding-left:10px; }
body[data-theme] .active-offer-spark { height:20px; }
body[data-theme] .active-offer-spark svg { height:19px; }
body[data-theme] .attention-row { min-height:54px; padding:8px 2px; gap:9px; }
body[data-theme] .attention-icon { width:24px; height:24px; font-size:19px; }
body[data-theme] .attention-copy { gap:1px; }
body[data-theme] .attention-copy strong { font-size:12px; }
body[data-theme] .attention-copy small,
body[data-theme] .attention-note { font-size:10px; }
body[data-theme] .attention-note { padding-top:8px; }
body[data-theme] .job-progress-panel { gap:16px; margin:12px 0; padding:14px 16px; border-radius:14px; }
body[data-theme] .job-progress-copy { gap:2px; min-width:165px; }
body[data-theme] .job-progress-copy strong { font-size:14px; }
body[data-theme] .job-progress-copy span,
body[data-theme] .job-progress-count { font-size:12px; }
body[data-theme] .job-progress-track { height:9px; }
body[data-theme] #tab-leads .dashboard-actions { gap:8px; }
body[data-theme] #tab-leads .dashboard-actions .action-reference,
body[data-theme] #tab-leads .dashboard-actions .action-reference:first-child {
  min-width:0; min-height:40px; height:40px; padding-inline:15px; gap:8px;
  border-radius:9px; font-size:12px;
}
body[data-theme] #tab-leads .dashboard-actions .action-reference__icon { width:18px; height:18px; }
body[data-theme] .settings-card,
body[data-theme] .chart-card,
body[data-theme] .crm-stat-card { border-radius:var(--compact-card-radius); }
body[data-theme] .table-wrap th { padding:8px 10px; }
body[data-theme] .table-wrap td { padding:8px 10px; }
body[data-theme] #leads-table-wrap .leads-data-table tbody td { height:52px; padding-block:6px; }
body[data-theme] #tab-crm-funnels .funnel-flow { --funnel-gap:12px; --funnel-height:88px; margin-bottom:9px; }
body[data-theme] #tab-crm-funnels .funnel-flow__card { padding:10px 13px; }
body[data-theme] #tab-crm-funnels .funnel-flow__card:not(:last-child)::after { right:-12px; }
@media(max-width:980px) {
  body[data-theme] #app > header,
  body[data-theme] .app-shell { margin-left:0; }
  body[data-theme] .sidebar { width:216px; }
}
@media(max-width:700px), (pointer:coarse) {
  body[data-theme] #app > header button,
  body[data-theme] main button,
  body[data-theme] main summary,
  body[data-theme] .sidebar-nav-reference button,
  body[data-theme] .sidebar-nav-group > summary,
  body[data-theme] .sidebar-nav-children > button { min-width:44px!important; min-height:44px!important; }
  body[data-theme] .funnel-period button,
  body[data-theme] .overview-command-bar :is(button,summary),
  body[data-theme] #tab-leads .dashboard-actions .action-reference,
  body[data-theme] #tab-leads .dashboard-actions .action-reference:first-child { min-height:44px; height:44px; }
}
@media(max-width:650px) {
  body[data-theme] main { padding:11px 10px 18px; }
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
    height:124px; min-height:124px; padding:11px;
    grid-template-columns:52px minmax(0,1fr); grid-template-rows:21px 31px 1fr;
  }
  body[data-theme] #tab-leads .kpi-reference-icon { width:52px; height:52px; padding:7px; }
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value,
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { font-size:30px; }
  body[data-theme] .overview-offers-attention > :is(.active-offers-panel,.attention-panel) { padding:10px; }
}


/* KPI reference finish: compact hierarchy and period trend. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
  position:relative; overflow:hidden;
  height:130px; min-height:130px; padding:13px 14px 12px;
  grid-template-columns:58px minmax(0,1fr); grid-template-rows:22px 36px 1fr;
  column-gap:11px; border-color:rgba(255,255,255,.11);
  background:radial-gradient(120% 75% at 78% 112%,rgba(137,255,0,.14),transparent 48%),linear-gradient(145deg,rgba(18,20,23,.98),rgba(10,11,12,.99));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label > span,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .label > span { color:#b9bcc2; font-size:11px; line-height:16px; font-weight:700; letter-spacing:.01em; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { color:#f5f7f2; font-size:32px; line-height:36px; font-weight:700; letter-spacing:-.035em; text-shadow:none; }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .kpi-card-footer,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .kpi-card-footer { grid-column:1 / -1; grid-row:3; align-self:end; display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; color:#91959c; font-size:11px; line-height:16px; }
body[data-theme] #tab-leads .funnel-period-caption { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body[data-theme] #tab-leads .funnel-trend { flex:0 0 auto; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
body[data-theme] #tab-leads .funnel-trend.is-positive { color:var(--green); }
body[data-theme] #tab-leads .funnel-trend.is-negative { color:#ff525d; }
body[data-theme] #tab-leads .funnel-trend.is-neutral { color:#8c9097; }
@media(max-width:650px) {
 body[data-theme] #tab-leads .kpi-grid > .funnel-kpi, body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique { height:122px; min-height:122px; padding:11px 12px 10px; grid-template-columns:52px minmax(0,1fr); grid-template-rows:20px 32px 1fr; }
 body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value, body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value { font-size:29px; line-height:32px; }
}

/* KPI card polish: stable figures, crisp artwork, restrained surface depth. */
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
  border-color:oklch(1 0 0 / .10);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / .035),
    inset 0 -1px 0 oklch(0 0 0 / .24),
    0 10px 28px oklch(0 0 0 / .16);
}
body[data-theme] #tab-leads .kpi-reference-icon {
  outline:1px solid oklch(1 0 0 / .10);
  outline-offset:-1px;
  filter:drop-shadow(0 0 7px rgba(137,255,0,.16));
  image-rendering:auto;
}
body[data-theme] #tab-leads .funnel-kpi:nth-child(3) .kpi-reference-icon { transform:translateX(1px); }
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .value,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .value {
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:'tnum' 1,'lnum' 1;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi .label > span,
body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique .label > span {
  align-self:end;
  text-wrap:balance;
  -webkit-font-smoothing:antialiased;
}
body[data-theme] #tab-leads .kpi-card-footer {
  padding-top:8px;
  border-top:1px solid oklch(1 0 0 / .045);
}
@media(prefers-reduced-motion:no-preference) {
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi,
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique {
    transition-property:border-color,box-shadow;
    transition-duration:140ms;
    transition-timing-function:cubic-bezier(.2,0,0,1);
  }
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi:hover,
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--unique:hover {
    border-color:oklch(1 0 0 / .15);
    box-shadow:inset 0 1px 0 oklch(1 0 0 / .05),inset 0 -1px 0 oklch(0 0 0 / .22),0 12px 30px oklch(0 0 0 / .20);
  }
}

/* Approved KPI uses the reference's shield tile, not a circular badge. */
body[data-theme] #tab-leads .funnel-kpi:nth-child(4) .kpi-reference-icon {
  border-radius:13px;
  padding:7px 8px 8px;
  transform:translateY(-1px);
  background:radial-gradient(circle at 50% 43%,rgba(137,255,0,.16),rgba(137,255,0,.035) 72%);
}
@media(max-width:650px) {
  body[data-theme] #tab-leads .funnel-kpi:nth-child(4) .kpi-reference-icon {
    border-radius:12px;
    padding:7px;
  }
}

/* Approved KPI: crisp vector shield inside the reference's circular halo. */
body[data-theme] #tab-leads .funnel-kpi--approved .kpi-reference-icon--approved {
  color:var(--green);
  border-color:transparent;
  outline:none;
  border-radius:50%;
  padding:8px;
  transform:translateY(5px);
  overflow:visible;
  background:radial-gradient(circle at 50% 48%,rgba(137,255,0,.16),rgba(137,255,0,.045) 70%,transparent 72%);
  filter:drop-shadow(0 0 6px rgba(137,255,0,.18));
}
body[data-theme] #tab-leads .funnel-kpi--approved .approved-shield,
body[data-theme] #tab-leads .funnel-kpi--approved .approved-check {
  fill:none;
  stroke:currentColor;
  stroke-width:2.4;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
body[data-theme] #tab-leads .funnel-kpi--approved .approved-check { stroke-width:2.6; }
body[data-theme] #tab-leads .funnel-kpi--approved .value { transform:translateY(8px); }
@media(max-width:650px) {
  body[data-theme] #tab-leads .funnel-kpi--approved .kpi-reference-icon--approved { padding:7px; border-radius:50%; transform:translateY(4px); }
}

body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--approved .kpi-reference-icon--approved {
  border-radius:50%;
  padding:8px;
  transform:translateY(5px);
  background:radial-gradient(circle at 50% 48%,rgba(137,255,0,.16),rgba(137,255,0,.045) 70%,transparent 72%);
}
@media(max-width:650px) {
  body[data-theme] #tab-leads .kpi-grid > .funnel-kpi--approved .kpi-reference-icon--approved { border-radius:50%; padding:7px; transform:translateY(4px); }
}
