/* Usama CRM design system (loaded last; scoped to body.crmPremium so the old layers stay inert).
   One font, one type scale, one spacing scale, one radius and one accent across every page. */
/* fonts are loaded once from index.html (an @import here held up the first paint) */

:root{
  --c-bg:#0b0f17;--c-surface:#111723;--c-surface-2:#161e2d;--c-raised:#1b2435;
  --c-border:rgba(148,163,184,.14);--c-border-strong:rgba(148,163,184,.26);
  --c-text:#e8edf5;--c-muted:#8a96aa;--c-faint:#5f6b7e;
  --c-accent:#5260e6;--c-accent-soft:rgba(91,108,255,.14);--c-accent-text:#aab4ff;
  --c-success:#22c55e;--c-warning:#f59e0b;--c-danger:#ef4444;
  --r-sm:8px;--r-md:12px;--r-lg:16px;
  --s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-5:24px;--s-6:32px;
  --t-xs:12px;--t-sm:13px;--t-base:14px;--t-lg:16px;--t-xl:20px;--t-2xl:24px;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.18);
  --sidebar:248px;
}

body.crmPremium{font-family:Poppins,system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:var(--t-base)!important;background:var(--c-bg)!important;color:var(--c-text)!important;letter-spacing:0!important;-webkit-font-smoothing:antialiased}
body.crmPremium button,body.crmPremium input,body.crmPremium select,body.crmPremium textarea{font-family:inherit!important}
body.crmPremium h1,body.crmPremium h2,body.crmPremium h3{letter-spacing:-.01em}

/* ---------------------------------------------------------------- sidebar (desktop) */
@media (min-width:1100px){
  body.crmPremium:has(#v7Topbar:not(.hidden)){padding:0 0 0 var(--sidebar)!important}
  body.crmPremium #v7Topbar{inset:0 auto 0 0!important;width:var(--sidebar)!important;height:100vh!important;flex-direction:column!important;align-items:stretch!important;gap:var(--s-5)!important;padding:var(--s-5) var(--s-3)!important;background:var(--c-surface)!important;border-right:1px solid var(--c-border)!important;border-bottom:0!important;overflow-y:auto}
  body.crmPremium #v7Topbar .v7Brand{padding:0 var(--s-3);font-size:var(--t-xl)!important}
  body.crmPremium #v7Topbar .v7Nav{flex-direction:column!important;align-self:stretch!important;gap:2px!important;overflow:visible!important;flex:1}
  body.crmPremium #v7Topbar .v7Nav button{height:40px!important;justify-content:flex-start!important;border:0!important;border-radius:var(--r-sm)!important;padding:0 var(--s-3)!important}
  body.crmPremium #v7Topbar .v7TopActions{flex-direction:column!important;align-items:stretch!important;gap:var(--s-2)!important;margin:0!important}
  body.crmPremium #v7Topbar .v7Divider{display:none!important}
  body.crmPremium .crmMenuToggle,body.crmPremium .crmNavScrim{display:none!important}
}
body.crmPremium #v7Topbar .v7Brand strong{color:var(--c-text)!important;font-weight:700}
body.crmPremium #v7Topbar .v7Brand span{color:var(--c-accent)!important;font-weight:700}
body.crmPremium #v7Topbar .v7Nav button{display:flex!important;align-items:center!important;gap:var(--s-3)!important;color:var(--c-muted)!important;font-size:var(--t-base)!important;font-weight:500!important;background:transparent!important;transition:background .15s,color .15s}
body.crmPremium #v7Topbar .v7Nav button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
body.crmPremium #v7Topbar .v7Nav button:hover{color:var(--c-text)!important;background:var(--c-surface-2)!important}
body.crmPremium #v7Topbar .v7Nav button.active{color:var(--c-text)!important;background:var(--c-accent-soft)!important;box-shadow:inset 3px 0 0 var(--c-accent)}
body.crmPremium .v7ExportBtn{border-radius:var(--r-sm)!important}

/* ---------------------------------------------------------------- top bar + drawer (tablet / phone) */
@media (max-width:1099px){
  body.crmPremium:has(#v7Topbar:not(.hidden)){padding-top:60px!important}
  /* backdrop-filter would make the header the containing block of the fixed drawer and clip it. */
  body.crmPremium #v7Topbar{height:60px!important;gap:var(--s-2)!important;padding:0 var(--s-3)!important;background:var(--c-surface)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  body.crmPremium #v7Topbar .v7Brand{display:flex!important;gap:6px!important;min-width:0!important;font-size:var(--t-lg)!important}
  body.crmPremium #v7Topbar .v7Brand strong{display:inline!important}
  body.crmPremium .crmMenuToggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--c-text);cursor:pointer;flex:none}
  body.crmPremium .crmMenuToggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  body.crmPremium #v7Topbar .v7Nav{position:fixed!important;top:60px;left:0;bottom:0;width:min(300px,84vw);flex-direction:column!important;gap:2px!important;padding:var(--s-3)!important;background:var(--c-surface)!important;border-right:1px solid var(--c-border);transform:translateX(-102%);transition:transform .2s ease;overflow-y:auto!important;z-index:1002}
  body.crmPremium.crmNavOpen #v7Topbar .v7Nav{transform:none}
  body.crmPremium #v7Topbar .v7Nav button{height:48px!important;border:0!important;border-radius:var(--r-sm)!important;padding:0 var(--s-3)!important}
  body.crmPremium .crmNavScrim{position:fixed;inset:60px 0 0 0;background:rgba(0,0,0,.5);z-index:999;display:none}
  body.crmPremium.crmNavOpen .crmNavScrim{display:block}
  body.crmPremium #v7Topbar .v7ExportBtn,body.crmPremium #v7Topbar .v7ProfileText{display:none!important}
}

/* ---------------------------------------------------------------- page scaffolding */
body.crmPremium .crmPage{max-width:1440px!important;margin:0 auto!important;padding:var(--s-6)!important}
body.crmPremium .crmPageHead{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--s-4);flex-wrap:wrap;margin-bottom:var(--s-5)}
body.crmPremium .crmPageHead h1{margin:0;font-size:var(--t-2xl);font-weight:400;color:var(--c-muted);line-height:1.2}
body.crmPremium .crmPageHead h1 strong{color:var(--c-text);font-weight:700}
body.crmPremium #usersView .crmPageHead h1{color:var(--c-text);font-weight:700}
body.crmPremium .crmPageHead p{margin:var(--s-2) 0 0;color:var(--c-muted);font-size:var(--t-base)}
body.crmPremium .crmHeadActions{display:flex;gap:var(--s-2);flex-wrap:wrap}
body.crmPremium .crmSectionTitle h2{margin:var(--s-5) 0 var(--s-3);font-size:var(--t-xs);font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--c-muted)}
body.crmPremium .crmFootnote{margin-top:var(--s-5);color:var(--c-faint);font-size:var(--t-xs)}
body.crmPremium .crmLoadingLine{padding:var(--s-5);color:var(--c-muted)}
body.crmPremium .crmEmpty{padding:var(--s-4) 0;color:var(--c-muted);font-size:var(--t-sm)}
body.crmPremium .crmSub{display:block;color:var(--c-muted);font-size:var(--t-xs);margin-top:2px}

/* ---------------------------------------------------------------- buttons + fields */
body.crmPremium .crmBtn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-2);height:40px;padding:0 var(--s-4);border:1px solid var(--c-border-strong);border-radius:var(--r-sm);background:var(--c-surface-2);color:var(--c-text);font-size:var(--t-sm);font-weight:600;cursor:pointer;transition:background .15s,border-color .15s;white-space:nowrap}
body.crmPremium .crmBtn:hover{background:var(--c-raised)}
body.crmPremium .crmBtn:focus-visible,body.crmPremium .crmKpi:focus-visible,body.crmPremium .crmBarRow:focus-visible{outline:2px solid var(--c-accent);outline-offset:2px}
body.crmPremium .crmBtn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
body.crmPremium .crmBtnPrimary{background:var(--c-accent);border-color:var(--c-accent);color:#fff}
body.crmPremium .crmBtnPrimary:hover{background:#4c5cf0}
body.crmPremium .crmBtnDanger{color:#fca5a5;border-color:rgba(239,68,68,.4)}
body.crmPremium .crmBtnSm{height:32px;padding:0 var(--s-3);font-size:var(--t-xs)}
body.crmPremium .crmBtn:disabled{opacity:.55;cursor:wait}
body.crmPremium .crmIconBtn{width:36px;height:36px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--c-muted);font-size:22px;cursor:pointer}
body.crmPremium .crmIconBtn:hover{background:var(--c-surface-2);color:var(--c-text)}
body.crmPremium .crmModal input:not([type=checkbox]),body.crmPremium .crmModal select{width:100%;height:42px;margin-top:6px;padding:0 var(--s-3);border:1px solid var(--c-border-strong);border-radius:var(--r-sm);background:var(--c-bg);color:var(--c-text);font-size:var(--t-base)}
body.crmPremium .crmModal input:focus,body.crmPremium .crmModal select:focus{outline:none;border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-accent-soft)}
body.crmPremium .crmCheck{display:flex!important;align-items:center;gap:var(--s-2);font-size:var(--t-sm);color:var(--c-text);cursor:pointer}
body.crmPremium .crmCheck input{width:16px;height:16px;accent-color:var(--c-accent)}
body.crmPremium .crmCheck small{color:var(--c-faint);margin-left:auto}

/* ---------------------------------------------------------------- cards, KPIs, charts */
body.crmPremium .crmKpiGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:var(--s-3)}
body.crmPremium .crmKpi{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:112px;padding:var(--s-4) var(--s-5);border:1px solid var(--c-border);border-radius:var(--r-lg);background:var(--c-surface);color:var(--c-text);text-align:left;cursor:pointer;transition:border-color .15s,transform .15s}
body.crmPremium .crmKpi:hover:not(:disabled){border-color:var(--c-border-strong);transform:translateY(-1px)}
body.crmPremium .crmKpi:disabled{cursor:default}
body.crmPremium .crmKpiLabel{color:var(--c-muted);font-size:var(--t-sm);font-weight:500}
body.crmPremium .crmKpiValue{font-size:var(--t-2xl);font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}
body.crmPremium .crmKpiHint{color:var(--c-faint);font-size:var(--t-xs)}
body.crmPremium .crmCardGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-4);margin-top:var(--s-5)}
body.crmPremium .crmCard{padding:var(--s-5);border:1px solid var(--c-border);border-radius:var(--r-lg);background:var(--c-surface);min-width:0}
body.crmPremium .crmCardWide{grid-column:span 2}
body.crmPremium .crmCard>header{display:flex;align-items:baseline;justify-content:space-between;gap:var(--s-3);margin-bottom:var(--s-4)}
body.crmPremium .crmCard h3{margin:0;font-size:var(--t-lg);font-weight:600}
body.crmPremium .crmCard>header span{color:var(--c-muted);font-size:var(--t-xs)}
body.crmPremium .crmBars{display:flex;flex-direction:column;gap:2px}
body.crmPremium .crmBarRow{display:grid;grid-template-columns:minmax(140px,180px) minmax(0,1fr) 84px;align-items:center;gap:var(--s-3);width:100%;padding:7px var(--s-2);border:0;border-radius:var(--r-sm);background:transparent;color:var(--c-text);font-size:var(--t-sm);text-align:left;cursor:pointer}
body.crmPremium .crmBarRow:hover:not(:disabled){background:var(--c-surface-2)}
body.crmPremium .crmBarRow:disabled{cursor:default}
body.crmPremium .crmBarLabel{min-width:0;white-space:normal;overflow-wrap:normal}
body.crmPremium .crmBarTrack{height:8px;border-radius:99px;background:var(--c-surface-2);overflow:hidden}
body.crmPremium .crmBarFill{display:block;height:100%;border-radius:99px;background:var(--c-accent)}
body.crmPremium .crmBarValue{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
body.crmPremium .crmBarValue small{margin-left:6px;color:var(--c-faint);font-weight:500}
body.crmPremium .crmWeekChart{width:100%;height:auto}
body.crmPremium .crmWeekChart rect{fill:var(--c-accent)}
body.crmPremium .crmWeekChart g:hover rect{fill:#8590ff}
body.crmPremium .crmWeekChart text{fill:var(--c-faint);font-size:11px}
body.crmPremium .crmActivity{list-style:none;margin:0;padding:0}
body.crmPremium .crmActivity li{display:grid;grid-template-columns:64px 1fr auto;gap:var(--s-3);align-items:start;padding:var(--s-3) 0;border-top:1px solid var(--c-border)}
body.crmPremium .crmActivity li:first-child{border-top:0}
body.crmPremium .crmActivity strong{font-size:var(--t-sm);font-weight:600}
body.crmPremium .crmActivity p{margin:2px 0 0;color:var(--c-muted);font-size:var(--t-sm);overflow-wrap:anywhere}
body.crmPremium .crmActivity time{color:var(--c-faint);font-size:var(--t-xs);white-space:nowrap}
body.crmPremium .crmTag{display:inline-flex;align-items:center;justify-content:center;height:22px;padding:0 var(--s-2);border-radius:99px;background:var(--c-surface-2);color:var(--c-muted);font-size:11px;font-weight:600}
body.crmPremium .crmTagLead{background:var(--c-accent-soft);color:var(--c-accent-text)}
body.crmPremium .crmStatus{display:inline-flex;height:22px;align-items:center;padding:0 var(--s-2);border-radius:99px;font-size:11px;font-weight:600}
body.crmPremium .crmStatus.on{background:rgba(34,197,94,.14);color:#86efac}
body.crmPremium .crmStatus.off{background:rgba(239,68,68,.14);color:#fca5a5}
body.crmPremium .crmAssignee{display:block;margin-top:4px;color:var(--c-accent-text);font-size:var(--t-xs)}
body.crmPremium .crmAssignee.none{color:var(--c-faint)}

/* ---------------------------------------------------------------- tables */
body.crmPremium .crmTableWrap{overflow-x:auto}
body.crmPremium .crmTable{width:100%!important;min-width:0!important;table-layout:auto!important;border-collapse:collapse;font-size:var(--t-sm)}
body.crmPremium .crmTable th{position:sticky;top:0;padding:var(--s-3);text-align:left;color:var(--c-muted);font-size:var(--t-xs);font-weight:600;text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--c-border);background:var(--c-surface)}
body.crmPremium .crmTable td{padding:var(--s-3);border-bottom:1px solid var(--c-border);vertical-align:top;text-align:left!important;overflow-wrap:anywhere}
body.crmPremium .crmTable th{text-align:left!important}
body.crmPremium .crmAccessCell{max-width:260px;color:var(--c-muted)}
body.crmPremium .crmTable td:first-child{width:240px;overflow-wrap:normal}
body.crmPremium .crmTable strong,body.crmPremium .crmTable .crmSub{display:block;max-width:none!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important}
body.crmPremium .crmRowActions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap;min-width:150px}
body.crmPremium #ownersTable,body.crmPremium #leadsView .leadsTable{font-size:var(--t-sm)!important}
body.crmPremium #ownersTable th,body.crmPremium #leadsView .leadsTable th{background:var(--c-surface)!important;color:var(--c-muted)!important;font-size:var(--t-xs)!important;font-weight:600!important;letter-spacing:.05em!important}
body.crmPremium #ownersTable td,body.crmPremium #leadsView .leadsTable td{background:var(--c-bg)!important;color:var(--c-text)!important;border-bottom-color:var(--c-border)!important}
body.crmPremium #ownersTable tr:hover td,body.crmPremium #leadsView .leadsTable tr:hover td{background:var(--c-surface)!important}

/* The sidebar already links Dashboard and Leads; drop the duplicate buttons from the Owners header. */
body.crmPremium :is(#appView,#leadsView) .mainHeader .headerBtns button:is([onclick="showChoiceView()"],[onclick="showLeadsView()"],[onclick="showOwnersView()"]):not(#__){display:none!important}
body.crmPremium #leadsView .leadsTable td:first-child,body.crmPremium #leadsView .leadsTable th:first-child{text-align:left!important}

/* ---------------------------------------------------------------- owner profile history */
body.crmPremium .crmHistory{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-4);margin-top:var(--s-5)}
body.crmPremium .crmTimeline{list-style:none;margin:0;padding:0}
body.crmPremium .crmTimeline li{display:grid;grid-template-columns:110px 1fr;column-gap:var(--s-3);row-gap:2px;padding:var(--s-3) 0;border-top:1px solid var(--c-border)}
body.crmPremium .crmTimeline li:first-child{border-top:0}
body.crmPremium .crmTimeline time{grid-row:span 2;color:var(--c-muted);font-size:var(--t-xs)}
body.crmPremium .crmTimeline strong{font-size:var(--t-sm)}
body.crmPremium .crmTimeline span{color:var(--c-muted);font-size:var(--t-xs)}

/* ---------------------------------------------------------------- modals + toasts */
/* Every existing popup (owner profile, lead detail, editors) sits above the sidebar. */
body.crmPremium .modalOverlay,body.crmPremium #u10OwnerEditor{z-index:2000!important}
body.crmPremium #leadModal{z-index:2100!important}
body.crmPremium .crmModalScrim{position:fixed;inset:0;z-index:3000;display:flex;align-items:center;justify-content:center;padding:var(--s-4);background:rgba(3,6,12,.7)}
body.crmPremium .crmModal{display:flex;flex-direction:column;width:min(720px,100%);max-height:calc(100vh - 32px);border:1px solid var(--c-border-strong);border-radius:var(--r-lg);background:var(--c-surface);box-shadow:var(--shadow)}
body.crmPremium .crmModal>header,body.crmPremium .crmModal>footer{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);padding:var(--s-4) var(--s-5)}
body.crmPremium .crmModal>header{border-bottom:1px solid var(--c-border)}
body.crmPremium .crmModal>footer{justify-content:flex-end;border-top:1px solid var(--c-border)}
body.crmPremium .crmModal h2{margin:0;font-size:var(--t-lg);font-weight:600}
body.crmPremium .crmModalBody{padding:var(--s-5);overflow-y:auto}
body.crmPremium .crmModalBody label{display:block;color:var(--c-muted);font-size:var(--t-sm);font-weight:500}
body.crmPremium .crmFormGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-4)}
body.crmPremium .crmFormError{margin:0 var(--s-5) var(--s-3);color:#fca5a5;font-size:var(--t-sm)}
body.crmPremium .crmAccessPicker{margin-top:var(--s-5)}
body.crmPremium .crmAccessPicker h4{margin:0;font-size:var(--t-base)}
body.crmPremium .crmAccessSearch{margin:var(--s-3) 0!important}
body.crmPremium .crmCommunity{border:1px solid var(--c-border);border-radius:var(--r-md);margin-bottom:var(--s-2);background:var(--c-bg)}
body.crmPremium .crmCommunity summary{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);min-height:48px;padding:0 var(--s-4);cursor:pointer;font-weight:600}
body.crmPremium .crmClusterGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:var(--s-2) var(--s-4);padding:var(--s-2) var(--s-4) var(--s-4)}
body.crmPremium .crmToast{position:fixed;left:50%;bottom:24px;z-index:3100;transform:translateX(-50%);padding:var(--s-3) var(--s-4);border-radius:var(--r-sm);background:var(--c-raised);border:1px solid var(--c-border-strong);color:var(--c-text);font-size:var(--t-sm);box-shadow:var(--shadow)}
body.crmPremium .crmToastError{border-color:rgba(239,68,68,.5);color:#fecaca}

/* ---------------------------------------------------------------- responsive */
@media (max-width:900px){
  body.crmPremium .crmCardGrid,body.crmPremium .crmHistory{grid-template-columns:1fr}
  body.crmPremium .crmCardWide{grid-column:auto}
}
@media (max-width:640px){
  body.crmPremium .crmPage{padding:var(--s-4)!important}
  body.crmPremium .crmPageHead h1{font-size:var(--t-xl)}
  body.crmPremium .crmKpiGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-2)}
  body.crmPremium .crmKpi{min-height:96px;padding:var(--s-3) var(--s-4)}
  body.crmPremium .crmKpiValue{font-size:var(--t-xl)}
  body.crmPremium .crmCard{padding:var(--s-4)}
  body.crmPremium .crmBarRow{grid-template-columns:minmax(0,1fr) 70px;gap:var(--s-2)}
  body.crmPremium .crmActivity li{grid-template-columns:1fr;gap:4px}
  body.crmPremium .crmFormGrid{grid-template-columns:1fr}
  body.crmPremium .crmModalScrim{padding:0;align-items:stretch}
  body.crmPremium .crmModal{max-height:100vh;border-radius:0}
  body.crmPremium .crmTimeline li{grid-template-columns:1fr}
  body.crmPremium .crmTimeline time{grid-row:auto}
  /* Users table becomes stacked cards on phones. */
  body.crmPremium .crmTable thead{display:none}
  body.crmPremium .crmTable tr{display:block;padding:var(--s-3) 0;border-bottom:1px solid var(--c-border)}
  body.crmPremium .crmTable td{display:flex;justify-content:space-between;gap:var(--s-3);padding:6px 0;border:0}
  body.crmPremium .crmTable td[data-label]::before{content:attr(data-label);color:var(--c-muted);font-size:var(--t-xs)}
  body.crmPremium .crmTable td{width:auto!important;max-width:none!important;min-width:0!important}
  body.crmPremium .crmTable td:first-child{display:block}
  body.crmPremium .crmTable td:first-child::before{content:none}
  body.crmPremium .crmRowActions{justify-content:flex-start}
  body.crmPremium .crmBtn{min-height:44px}
}

/* =====================================================================================
   Existing pages (Owners, Leads, Calendar, popups, login) on the same design system.
   Every rule is scoped to body.crmPremium and only restyles; no markup or behaviour changes.
   ===================================================================================== */
body.crmPremium #appView,body.crmPremium #leadsView,body.crmPremium #calendarModuleView{max-width:1440px!important;margin:0 auto!important;padding:var(--s-6)!important;background:transparent!important}

/* headers */
body.crmPremium .mainHeader,body.crmPremium .compactPageHeader,body.crmPremium #leadsView>.mainHeader{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:var(--s-4)!important;flex-wrap:wrap!important;margin:0 0 var(--s-5)!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;min-height:0!important}
body.crmPremium .mainHeader h1,body.crmPremium .compactPageHeader h1{margin:0!important;font-size:var(--t-2xl)!important;font-weight:600!important;letter-spacing:-.01em!important;color:var(--c-text)!important;text-align:left!important}
body.crmPremium .mainHeader .sub,body.crmPremium .compactPageHeader .sub{color:var(--c-muted)!important;font-size:var(--t-base)!important}
body.crmPremium .headerBtns{display:flex!important;gap:var(--s-2)!important;flex-wrap:wrap!important}

/* buttons: one shape, two weights, no gradients or glows */
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor) :is(.primaryBtn,.darkBtn,.reset,.headerBtns button,.actionsRow button,#prevBtn,#nextBtn,#leadPrevBtn,#leadNextBtn,.pagination button,.calendarModuleToolbar button){display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;height:38px!important;min-height:38px!important;padding:0 var(--s-4)!important;border:1px solid var(--c-border-strong)!important;border-radius:var(--r-sm)!important;background:var(--c-surface-2)!important;background-image:none!important;color:var(--c-text)!important;font-size:var(--t-sm)!important;font-weight:600!important;line-height:1!important;box-shadow:none!important;text-shadow:none!important;transform:none!important;white-space:nowrap!important;cursor:pointer!important;transition:background .15s,border-color .15s!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor) :is(.primaryBtn,.darkBtn,.reset,.headerBtns button,.actionsRow button,#prevBtn,#nextBtn,#leadPrevBtn,#leadNextBtn):hover{background:var(--c-raised)!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor) :is(.primaryBtn,.reset){background:var(--c-accent)!important;border-color:var(--c-accent)!important;color:#fff!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor) :is(.primaryBtn,.reset):hover{background:#4c5cf0!important}
body.crmPremium :is(#appView,#leadsView) .reset{background:transparent!important;border-color:var(--c-border-strong)!important;color:var(--c-muted)!important}
body.crmPremium :is(#prevBtn,#nextBtn,#leadPrevBtn,#leadNextBtn):disabled{opacity:.4!important;cursor:default!important}

/* fields */
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor,#profileModal) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){height:40px!important;min-height:40px!important;padding:0 var(--s-3)!important;border:1px solid var(--c-border-strong)!important;border-radius:var(--r-sm)!important;background:var(--c-bg)!important;background-image:none!important;color:var(--c-text)!important;font-size:var(--t-base)!important;font-weight:400!important;box-shadow:none!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor,#profileModal) select:not([multiple]):not([size="2"]){padding-right:32px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96aa' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;-webkit-appearance:none!important;appearance:none!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor,#profileModal) textarea{height:auto!important;min-height:84px!important;padding:var(--s-3)!important;line-height:1.5!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor,#profileModal) :is(input,select,textarea):focus{outline:none!important;border-color:var(--c-accent)!important;box-shadow:0 0 0 3px var(--c-accent-soft)!important}
body.crmPremium :is(#appView,#leadsView,#calendarModuleView,.modal,#u10OwnerEditor,#profileModal) :is(input,textarea)::placeholder{color:var(--c-muted)!important}
body.crmPremium :is(.modal,#u10OwnerEditor) label{display:block!important;margin:0 0 6px!important;color:var(--c-muted)!important;font-size:var(--t-sm)!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important}

/* filter panel = one card: search + selects grid, quick status chips, sort + actions */
body.crmPremium #appView>.card,body.crmPremium #leadsView .card{padding:var(--s-5)!important;border:1px solid var(--c-border)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:none!important}
body.crmPremium #appView .filters{display:grid!important;grid-template-columns:2fr repeat(5,minmax(0,1fr))!important;gap:var(--s-2)!important;margin:0 0 var(--s-3)!important}
body.crmPremium #appView .filters>*{width:100%!important;min-width:0!important;margin:0!important}
body.crmPremium .quickFilters{display:flex!important;flex-wrap:wrap!important;gap:6px!important;margin:0 0 var(--s-3)!important}
body.crmPremium .quickFilters>*{height:30px!important;min-height:30px!important;padding:0 12px!important;border:1px solid var(--c-border)!important;border-radius:99px!important;background:var(--c-surface-2)!important;color:var(--c-muted)!important;font-size:var(--t-xs)!important;font-weight:600!important;box-shadow:none!important}
body.crmPremium .quickFilters>*:hover{color:var(--c-text)!important;border-color:var(--c-border-strong)!important}
body.crmPremium #appView :is(.actionsRow,.sortControls){display:flex!important;align-items:center!important;gap:var(--s-2)!important;flex-wrap:wrap!important}
body.crmPremium #appView .topInfo{margin:var(--s-4) 0 var(--s-2)!important;color:var(--c-muted)!important;font-size:var(--t-sm)!important}

/* owner KPI tiles match the dashboard */
body.crmPremium .dashboardCards{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;gap:var(--s-3)!important;margin:0 0 var(--s-4)!important}
body.crmPremium .kpiCard{padding:var(--s-4) var(--s-5)!important;border:1px solid var(--c-border)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:none!important;min-height:0!important}
body.crmPremium .kpiLabel{color:var(--c-muted)!important;font-size:var(--t-sm)!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important}
body.crmPremium .kpiValue{color:var(--c-text)!important;font-size:var(--t-2xl)!important;font-weight:600!important;line-height:1.15!important}
body.crmPremium .kpiHint{color:var(--c-faint)!important;font-size:var(--t-xs)!important}

/* data tables */
body.crmPremium :is(#ownersTable,#leadsView .leadsTable){border:1px solid var(--c-border)!important;border-radius:var(--r-lg)!important;overflow:hidden!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) th{height:44px!important;padding:0 var(--s-3)!important;text-transform:uppercase!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) td{height:auto!important;padding:var(--s-3)!important;font-size:var(--t-sm)!important;line-height:1.4!important;text-align:left!important;vertical-align:middle!important}
body.crmPremium #ownersTable td.owner-col-unit{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:normal!important;font-weight:600!important;font-variant-numeric:tabular-nums!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) td:nth-child(n){font-family:inherit!important}
body.crmPremium #ownersTable td[class*="owner"]:not(.owner-col-unit),body.crmPremium #ownersTable td{word-break:normal!important}
/* chips inside rows: one size */
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) :is(.profileBtn,.moreUnitBtn,.copyBtn,.callBtn){height:24px!important;min-height:24px!important;padding:0 10px!important;border-radius:99px!important;border:1px solid var(--c-border-strong)!important;background:var(--c-surface-2)!important;color:var(--c-text)!important;font-size:11px!important;font-weight:600!important;box-shadow:none!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) .moreUnitBtn{color:var(--c-accent-text)!important;border-color:rgba(91,108,255,.35)!important;background:var(--c-accent-soft)!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) .waBtn{height:30px!important;min-height:30px!important;padding:0 12px!important;border-radius:var(--r-sm)!important;border:1px solid rgba(34,197,94,.35)!important;background:rgba(34,197,94,.12)!important;color:#86efac!important;font-size:var(--t-xs)!important;font-weight:600!important;box-shadow:none!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) .waBtn:hover{background:rgba(34,197,94,.2)!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable) select{height:32px!important;min-height:32px!important;border-radius:99px!important;font-size:var(--t-xs)!important;font-weight:600!important;padding:0 28px 0 12px!important;background-position:right 10px center!important}

/* popups */
body.crmPremium .modalOverlay{background:rgba(3,6,12,.72)!important;backdrop-filter:blur(4px)!important}
body.crmPremium .modal{border:1px solid var(--c-border-strong)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:var(--shadow)!important;color:var(--c-text)!important}
body.crmPremium .modal h2{font-size:var(--t-xl)!important;font-weight:700!important}
body.crmPremium #profileContent{background:var(--c-surface)!important}
body.crmPremium .u6DetailTitle{font-size:var(--t-xl)!important;font-weight:700!important;letter-spacing:-.01em!important}
body.crmPremium .u6DetailSubtitle{color:var(--c-muted)!important;font-size:var(--t-sm)!important}
body.crmPremium .u6StageBar{display:flex!important;flex-wrap:wrap!important;gap:6px!important}
body.crmPremium .u6Stage{height:30px!important;padding:0 12px!important;border-radius:99px!important;border:1px solid var(--c-border)!important;background:var(--c-surface-2)!important;color:var(--c-muted)!important;font-size:var(--t-xs)!important;font-weight:600!important;box-shadow:none!important}
body.crmPremium .u6Stage.active{background:var(--c-accent)!important;border-color:var(--c-accent)!important;color:#fff!important}

/* leads extras */
body.crmPremium #followupDashboard{padding:var(--s-5)!important;border:1px solid var(--c-border)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:none!important;margin-bottom:var(--s-4)!important}
body.crmPremium #followupCards>*{border-radius:var(--r-md)!important;background:var(--c-bg)!important;box-shadow:none!important}

/* login */
body.crmPremium #loginView,#loginView.loginBox{max-width:400px!important;margin:12vh auto 0!important;padding:var(--s-6)!important;border:1px solid var(--c-border-strong)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:var(--shadow)!important;font-family:Poppins,system-ui,sans-serif!important}
#loginView h1{font-size:var(--t-2xl)!important;font-weight:600!important;margin:0 0 4px!important}
#loginView input{width:100%!important;height:44px!important;margin:var(--s-3) 0 0!important;padding:0 var(--s-3)!important;border:1px solid var(--c-border-strong)!important;border-radius:var(--r-sm)!important;background:var(--c-bg)!important;color:var(--c-text)!important;font-size:var(--t-base)!important}
#loginView .primaryBtn{width:100%!important;height:44px!important;margin-top:var(--s-4)!important;border:0!important;border-radius:var(--r-sm)!important;background:var(--c-accent)!important;background-image:none!important;color:#fff!important;font-weight:600!important;box-shadow:none!important}

@media (max-width:1100px){
  body.crmPremium #appView .filters{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body.crmPremium #appView .filters>:first-child{grid-column:1/-1!important}
}
@media (max-width:640px){
  body.crmPremium #appView,body.crmPremium #leadsView,body.crmPremium #calendarModuleView{padding:var(--s-4)!important}
  body.crmPremium #appView .filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.crmPremium .quickFilters{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:4px!important}
  body.crmPremium .quickFilters>*{flex:none!important}
  body.crmPremium #appView :is(.actionsRow,.sortControls)>*{flex:1 1 calc(50% - 8px)!important}
}

/* Phone: page headers stack (title, then a two-column grid of actions); less nesting padding. */
@media (max-width:640px){
  body.crmPremium :is(#appView,#leadsView) .mainHeader{flex-direction:column!important;align-items:stretch!important;gap:var(--s-3)!important}
  body.crmPremium :is(#appView,#leadsView) .mainHeader h1{text-align:left!important}
  body.crmPremium :is(#appView,#leadsView) .mainHeader .headerBtns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
  body.crmPremium :is(#appView,#leadsView) .mainHeader .headerBtns button{width:100%!important}
  body.crmPremium #appView>.card,body.crmPremium #leadsView .card,body.crmPremium #followupDashboard{padding:var(--s-3)!important}
}

/* owner profile: property facts + inline forms */
body.crmPremium .crmFacts{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:var(--s-3);margin:0}
body.crmPremium .crmFacts dt{color:var(--c-muted);font-size:var(--t-xs)}
body.crmPremium .crmFacts dd{margin:2px 0 0;font-size:var(--t-base);font-weight:600}
body.crmPremium .crmInlineForm{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-3);margin-bottom:var(--s-4)}
body.crmPremium .crmInlineForm label{display:block;color:var(--c-muted);font-size:var(--t-xs);font-weight:500}
body.crmPremium .crmInlineForm :is(input,select){width:100%;height:38px;margin-top:4px;padding:0 var(--s-3);border:1px solid var(--c-border-strong);border-radius:var(--r-sm);background:var(--c-bg);color:var(--c-text);font-size:var(--t-sm)}
body.crmPremium .crmInlineForm .crmWide,body.crmPremium .crmInlineActions{grid-column:1/-1}
body.crmPremium .crmInlineActions{display:flex;justify-content:flex-end;gap:var(--s-2)}
body.crmPremium .crmCard>header .crmBtnSm{height:28px}

/* ---------------------------------------------------------------- calendar */
body.crmPremium .crmCalLayout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:var(--s-4);align-items:start}
body.crmPremium .crmCalMain{padding:var(--s-4)}
body.crmPremium .crmCalToolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);flex-wrap:wrap;margin-bottom:var(--s-4)}
body.crmPremium .crmCalNav{display:flex;align-items:center;gap:6px}
body.crmPremium .crmCalTitle{margin:0 0 0 var(--s-2);font-size:var(--t-lg);font-weight:600}
body.crmPremium .crmSeg{display:inline-flex;padding:3px;border:1px solid var(--c-border);border-radius:var(--r-sm);background:var(--c-bg)}
body.crmPremium .crmSeg button{height:30px;padding:0 var(--s-3);border:0;border-radius:6px;background:transparent;color:var(--c-muted);font-size:var(--t-sm);font-weight:600;cursor:pointer}
body.crmPremium .crmSeg button.active{background:var(--c-surface-2);color:var(--c-text);box-shadow:var(--shadow)}
body.crmPremium .crmMonthHead{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:6px}
body.crmPremium .crmMonthHead span{padding:0 6px;color:var(--c-muted);font-size:var(--t-xs);font-weight:600;text-transform:uppercase;letter-spacing:.05em}
body.crmPremium .crmMonthGrid{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:minmax(104px,auto);border-top:1px solid var(--c-border);border-left:1px solid var(--c-border)}
body.crmPremium .crmDay{display:flex;flex-direction:column;gap:3px;min-width:0;padding:6px;border-right:1px solid var(--c-border);border-bottom:1px solid var(--c-border);cursor:pointer;transition:background .15s}
body.crmPremium .crmDay:hover{background:var(--c-surface-2)}
body.crmPremium .crmDay.is-out{opacity:.45}
body.crmPremium .crmDayNum{font-size:var(--t-xs);font-weight:600;color:var(--c-muted)}
body.crmPremium .crmDay.is-today .crmDayNum{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--c-accent);color:#fff}
body.crmPremium .crmEv{display:flex;gap:6px;align-items:center;width:100%;min-width:0;padding:3px 6px;border:0;border-left:3px solid var(--ev,var(--c-accent));border-radius:5px;background:color-mix(in srgb,var(--ev,var(--c-accent)) 14%,transparent);color:var(--c-text);font-size:11px;text-align:left;cursor:pointer}
body.crmPremium .crmEvTime{color:var(--c-muted);font-variant-numeric:tabular-nums;flex:none}
body.crmPremium .crmEvTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
body.crmPremium .crmEv-call{--ev:#38bdf8}body.crmPremium .crmEv-follow{--ev:#5b6cff}body.crmPremium .crmEv-meet{--ev:#a78bfa}
body.crmPremium .crmEv-view{--ev:#22c55e}body.crmPremium .crmEv-remind{--ev:#f59e0b}body.crmPremium .crmEv-task{--ev:#94a3b8}body.crmPremium .crmEv-other{--ev:#64748b}
body.crmPremium .crmEv.is-overdue{--ev:#ef4444}
body.crmPremium .crmEv.is-completed .crmEvTitle,body.crmPremium .crmEv.is-cancelled .crmEvTitle{text-decoration:line-through;opacity:.6}
body.crmPremium .crmMore{border:0;background:none;color:var(--c-accent-text);font-size:11px;text-align:left;cursor:pointer;padding:0 6px}
body.crmPremium .crmAgendaHead,body.crmPremium .crmAgendaGrid{display:grid;grid-template-columns:56px repeat(var(--cols),minmax(0,1fr))}
body.crmPremium .crmAgendaHead span{padding:6px;color:var(--c-muted);font-size:var(--t-xs);font-weight:600}
body.crmPremium .crmAgendaHead span.is-today{color:var(--c-accent-text)}
body.crmPremium .crmHour{padding:6px 6px 0 0;color:var(--c-faint);font-size:11px;text-align:right;border-top:1px solid var(--c-border)}
body.crmPremium .crmSlot{min-height:48px;padding:3px;border-top:1px solid var(--c-border);border-left:1px solid var(--c-border);display:flex;flex-direction:column;gap:3px;cursor:pointer}
body.crmPremium .crmSlot:hover{background:var(--c-surface-2)}
body.crmPremium .crmCalSide{display:flex;flex-direction:column;gap:var(--s-3)}
body.crmPremium .crmSideGroup{padding:var(--s-4)}
body.crmPremium .crmSideGroup>header{margin-bottom:var(--s-2)!important}
body.crmPremium .crmSideGroup>header span{min-width:22px;height:22px;display:inline-grid;place-items:center;border-radius:99px;background:var(--c-surface-2);font-weight:700}
body.crmPremium .crmSideGroup.is-overdue>header span{background:rgba(239,68,68,.16);color:#fca5a5}
body.crmPremium .crmSideGroup ul,body.crmPremium .crmEvList,body.crmPremium .crmNoteList{list-style:none;margin:0;padding:0}
body.crmPremium :is(.crmSideGroup,.crmEvList,.crmNoteList) li button{display:grid;gap:2px;width:100%;padding:8px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--c-text);text-align:left;cursor:pointer}
body.crmPremium :is(.crmSideGroup,.crmEvList,.crmNoteList) li button:hover{background:var(--c-surface-2)}
body.crmPremium :is(.crmSideGroup,.crmEvList,.crmNoteList) li strong{font-size:var(--t-sm)}
body.crmPremium :is(.crmSideGroup,.crmEvList,.crmNoteList) li span,body.crmPremium .crmEvList time{color:var(--c-muted);font-size:var(--t-xs)}
body.crmPremium .crmEventMeta{display:flex;gap:var(--s-2);align-items:center;margin-bottom:var(--s-4)}
body.crmPremium .crmModal textarea{width:100%;margin-top:6px;padding:var(--s-3);border:1px solid var(--c-border-strong);border-radius:var(--r-sm);background:var(--c-bg);color:var(--c-text);font-size:var(--t-base);resize:vertical}
body.crmPremium .crmModal .crmWide{grid-column:1/-1}
body.crmPremium .crmModal footer .crmSpacer{flex:1}
body.crmPremium .crmLeadPick{position:relative}
body.crmPremium .crmLeadResults{position:absolute;z-index:5;left:0;right:0;top:calc(100% + 4px);padding:4px;border:1px solid var(--c-border-strong);border-radius:var(--r-sm);background:var(--c-raised);box-shadow:var(--shadow)}
body.crmPremium .crmLeadResults button{display:grid;width:100%;padding:8px;border:0;border-radius:6px;background:transparent;color:var(--c-text);text-align:left;cursor:pointer}
body.crmPremium .crmLeadResults button:hover{background:var(--c-surface-2)}
body.crmPremium .crmLeadResults span{color:var(--c-muted);font-size:var(--t-xs)}
body.crmPremium .crmLeadEvents{margin-top:var(--s-4)}
body.crmPremium .crmLeadEvCols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-4)}
body.crmPremium .crmLeadEvCols h4{margin:0 0 6px;color:var(--c-muted);font-size:var(--t-xs);text-transform:uppercase;letter-spacing:.06em}
body.crmPremium .crmOver{font-style:normal;color:#fca5a5;font-size:11px;margin-left:4px}
body.crmPremium .crmNotePanel{width:min(460px,100%)}
body.crmPremium .crmNoteList li.is-unread button{background:var(--c-accent-soft)}
body.crmPremium .crmNoteKind{font-size:11px!important;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
body.crmPremium .crmNoteList li.is-overdue .crmNoteKind{color:#fca5a5!important}
body.crmPremium .crmNoteList li.is-due_soon .crmNoteKind{color:#fcd34d!important}
@media (max-width:1000px){body.crmPremium .crmCalLayout{grid-template-columns:1fr}body.crmPremium .crmLeadEvCols{grid-template-columns:1fr}}
@media (max-width:640px){
  body.crmPremium .crmMonthGrid{grid-auto-rows:minmax(64px,auto)}
  body.crmPremium .crmDay .crmEv .crmEvTime{display:none}
  body.crmPremium .crmCalTitle{font-size:var(--t-base)}
}

/* =====================================================================================
   LIGHT THEME (html[data-theme="light"], saved in localStorage "crm_theme").
   Tokens first, then components whose old styles hard-code dark colours.
   ===================================================================================== */
html[data-theme="light"]{
  --c-bg:#f4f6fa;--c-surface:#ffffff;--c-surface-2:#f0f2f7;--c-raised:#ffffff;
  --c-border:rgba(15,23,42,.09);--c-border-strong:rgba(15,23,42,.17);
  --c-text:#0f172a;--c-muted:#5b6474;--c-faint:#8a93a4;
  --c-accent:#4f5bd5;--c-accent-soft:rgba(79,91,213,.10);--c-accent-text:#3c48c0;
  --shadow:0 1px 2px rgba(15,23,42,.06),0 8px 24px rgba(15,23,42,.06);
  color-scheme:light;
}
html[data-theme="light"] body,html[data-theme="light"] body.crmPremium{background:var(--c-bg)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium #v7Topbar{background:var(--c-surface)!important;border-color:var(--c-border)!important}
html[data-theme="light"] body.crmPremium #v7Topbar .v7Brand strong,html[data-theme="light"] body.crmPremium .v7ProfileName{color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(.v7TopIcon,.v7Profile,.v7ExportBtn,.crmMenuToggle){background:var(--c-surface-2)!important;border-color:var(--c-border)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(.v7TopIcon,.v7ExportBtn) svg{stroke:currentColor!important}
html[data-theme="light"] body.crmPremium .crmCard,html[data-theme="light"] body.crmPremium .crmKpi{box-shadow:var(--shadow)}
/* old components with hard-coded dark backgrounds */
html[data-theme="light"] body.crmPremium :is(.modal,.profileModal,#profileContent,#leadDetailContent,.u6DetailShell,.u6DetailLeft,.u6DetailRight,[class*="u6Detail"],[class*="u6Activity"],.notificationModal,.kanbanColumn,[class*="kanban"],[class*="Mobile"],[class*="mobileCard"],.u6FieldCard,.profileCard,.leadCard,.statusChip,.activityItem,.activityTimeline>div,#followupCards>*,.remarkBox,.calendarModuleContent,.broadcastQueueRow){background:var(--c-surface)!important;color:var(--c-text)!important;border-color:var(--c-border)!important;box-shadow:none!important}
html[data-theme="light"] body.crmPremium :is(.u6DetailRight,[class*="u6Activity"],.activityItem,#followupCards>*){background:var(--c-surface-2)!important}
html[data-theme="light"] body.crmPremium :is([class*="u6Field"] span,[class*="u6Field"] small,.sub,.kpiHint,.profileSub,.muted,[class*="Label"],[class*="label"]):not(button){color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium :is(h1,h2,h3,h4,strong,.profileTitle,.u6DetailTitle){color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(#ownersTable,#leadsView .leadsTable) td{background:var(--c-surface)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(#ownersTable,#leadsView .leadsTable) tr:hover td{background:var(--c-surface-2)!important}
html[data-theme="light"] body.crmPremium :is(#ownersTable,#leadsView .leadsTable) th{background:var(--c-surface-2)!important;color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium :is(#ownersTable,#leadsView .leadsTable) .waBtn,html[data-theme="light"] body.crmPremium .crmStatus.on{color:#15803d!important;background:rgba(22,163,74,.10)!important;border-color:rgba(22,163,74,.28)!important}
html[data-theme="light"] body.crmPremium .crmStatus.off,html[data-theme="light"] body.crmPremium .crmBtnDanger{color:#b91c1c!important}
html[data-theme="light"] body.crmPremium .crmToastError,html[data-theme="light"] body.crmPremium .crmFormError,html[data-theme="light"] body.crmPremium .crmOver{color:#b91c1c!important}
html[data-theme="light"] body.crmPremium .crmNoteList li.is-overdue .crmNoteKind{color:#b91c1c!important}
html[data-theme="light"] body.crmPremium .crmNoteList li.is-due_soon .crmNoteKind{color:#b45309!important}
html[data-theme="light"] body.crmPremium .crmSideGroup.is-overdue>header span{color:#b91c1c}
html[data-theme="light"] body.crmPremium .modalOverlay,html[data-theme="light"] body.crmPremium .crmModalScrim{background:rgba(15,23,42,.35)!important}
html[data-theme="light"] body.crmPremium .modalRow{color:var(--c-text)!important;border-top-color:var(--c-border)!important}
html[data-theme="light"] body.crmPremium [data-crm-status]{background:var(--c-surface-2)!important;color:var(--c-text)!important;border-color:var(--c-border-strong)!important}
html[data-theme="light"] #loginView{background:#fff!important;color:#0f172a!important}
html[data-theme="light"] #loginView input{background:#f4f6fa!important;color:#0f172a!important}

/* ---------------------------------------------------------------- Owners / Leads workspace */
body.crmPremium .crmPageSub{margin:4px 0 0!important;color:var(--c-muted);font-size:var(--t-base)}
body.crmPremium .crmWorkspace .mainHeader{align-items:flex-end!important}
body.crmPremium .crmMore{position:relative}
body.crmPremium .crmMenu{position:absolute;right:0;top:calc(100% + 6px);z-index:50;min-width:200px;padding:6px;border:1px solid var(--c-border-strong);border-radius:var(--r-md);background:var(--c-raised);box-shadow:var(--shadow)}
body.crmPremium .crmMenu .crmMenuItem{display:flex!important;width:100%!important;height:36px!important;padding:0 var(--s-3)!important;border:0!important;border-radius:6px!important;background:transparent!important;color:var(--c-text)!important;font-size:var(--t-sm)!important;font-weight:500!important;justify-content:flex-start!important;text-align:left!important}
body.crmPremium .crmMenu .crmMenuItem:hover{background:var(--c-surface-2)!important}
body.crmPremium .crmWorkspace .filters{grid-template-columns:minmax(220px,2fr) repeat(3,minmax(140px,1fr)) auto auto!important;align-items:center!important}
body.crmPremium #leadsView .filters{grid-template-columns:minmax(220px,2fr) minmax(160px,1fr) minmax(160px,1fr) auto auto!important}
body.crmPremium .crmFilterToggle{height:40px!important;gap:6px!important}
body.crmPremium .crmFilterToggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
body.crmPremium .crmFilterToggle b{display:inline-grid;place-items:center;min-width:18px;height:18px;border-radius:99px;background:var(--c-accent);color:#fff;font-size:11px}
body.crmPremium .crmFilterToggle.active{border-color:var(--c-accent)!important}
body.crmPremium .crmLinkBtn{height:40px;padding:0 var(--s-2);border:0;background:none;color:var(--c-muted);font-size:var(--t-sm);font-weight:600;cursor:pointer}
body.crmPremium .crmLinkBtn:hover{color:var(--c-text)}
body.crmPremium .crmAdvFilters{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:var(--s-3);margin:0 0 var(--s-3);padding:var(--s-3);border:1px dashed var(--c-border-strong);border-radius:var(--r-md);background:var(--c-bg)}
body.crmPremium .crmAdvFilters[hidden]{display:none}
body.crmPremium .crmAdvField{display:flex;flex-direction:column;gap:4px;color:var(--c-muted);font-size:var(--t-xs);font-weight:600}
body.crmPremium .crmAdvField>:is(input,select){width:100%!important}
body.crmPremium .crmChipLabel{align-self:center;margin-right:4px;color:var(--c-faint);font-size:var(--t-xs);font-weight:600;text-transform:uppercase;letter-spacing:.06em}
body.crmPremium .kpiCard.is-clickable{cursor:pointer;transition:border-color .15s,transform .15s}
body.crmPremium .kpiCard.is-clickable:hover{border-color:var(--c-border-strong)!important;transform:translateY(-1px)}
body.crmPremium .kpiCard.is-clickable:focus-visible{outline:2px solid var(--c-accent);outline-offset:2px}
body.crmPremium #ownersTable td.owner-col-owner,body.crmPremium #ownersTable td[data-col="owner"]{font-weight:600}
body.crmPremium #ownersTable td.owner-col-unit{min-width:110px}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable){border-color:var(--c-border)!important;box-shadow:none!important}
/* stage bar */
body.crmPremium .crmStageBar{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px;margin:0 0 var(--s-4)}
body.crmPremium .crmStage{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px;border:1px solid var(--c-border);border-radius:var(--r-md);background:var(--c-bg);color:var(--c-muted);text-align:left;cursor:pointer;position:relative;overflow:hidden;transition:border-color .15s,background .15s}
body.crmPremium .crmStage::before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--st,var(--c-border-strong))}
body.crmPremium .crmStage span{font-size:var(--t-xs);font-weight:600}
body.crmPremium .crmStage b{color:var(--c-text);font-size:var(--t-xl);font-weight:700;font-variant-numeric:tabular-nums}
body.crmPremium .crmStage:hover{border-color:var(--c-border-strong)}
body.crmPremium .crmStage.active{border-color:var(--c-accent);background:var(--c-accent-soft);color:var(--c-text)}
body.crmPremium .crmStage-0{--st:#94a3b8}body.crmPremium .crmStage-1{--st:#f59e0b}body.crmPremium .crmStage-2{--st:#38bdf8}body.crmPremium .crmStage-3{--st:#a78bfa}
body.crmPremium .crmStage-4{--st:#c084fc}body.crmPremium .crmStage-5{--st:#5b6cff}body.crmPremium .crmStage-6{--st:#22c55e}body.crmPremium .crmStage-7{--st:#ef4444}
body.crmPremium .crmNext{display:block;margin-top:4px;color:var(--c-accent-text);font-size:var(--t-xs);font-weight:600}
body.crmPremium .crmNext.none{color:var(--c-faint);font-weight:500}
body.crmPremium .crmNext.late{color:#fca5a5}
html[data-theme="light"] body.crmPremium .crmNext.late{color:#b91c1c}
body.crmPremium .crmFollowStrip{padding:var(--s-3) var(--s-4)!important}
body.crmPremium .crmFollowStrip h2,body.crmPremium .crmFollowStrip h3{font-size:var(--t-base)!important}
body.crmPremium .crmLogout{height:36px;border:1px solid var(--c-border);border-radius:var(--r-sm);background:transparent;color:var(--c-muted);font-size:var(--t-sm);font-weight:600;cursor:pointer}
body.crmPremium .crmLogout:hover{color:var(--c-text);background:var(--c-surface-2)}
@media (max-width:1100px){
  body.crmPremium .crmWorkspace .filters,body.crmPremium #leadsView .filters{grid-template-columns:repeat(2,minmax(0,1fr)) auto auto!important}
  body.crmPremium .crmWorkspace .filters>:first-child{grid-column:1/-1!important}
  body.crmPremium .crmStageBar{grid-template-columns:repeat(5,minmax(0,1fr))}
}
@media (max-width:640px){
  body.crmPremium .crmStageBar{display:flex;overflow-x:auto;padding-bottom:4px}
  body.crmPremium .crmStage{flex:0 0 110px}
  body.crmPremium .crmWorkspace .mainHeader .headerBtns{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* workspace fixes */
body.crmPremium .tablebox{border:1px solid var(--c-border)!important;border-radius:var(--r-lg)!important;background:var(--c-surface)!important;box-shadow:none!important;overflow:auto!important}
body.crmPremium :is(#ownersTable,#leadsView .leadsTable){border:0!important;border-radius:0!important}
body.crmPremium #ownersTable{table-layout:fixed!important}
body.crmPremium #ownersTable td.owner-col-unit{min-width:0!important}
body.crmPremium #ownersTable td.owner-col-owner{min-width:220px!important}
body.crmPremium #ownersTable td.owner-col-remarks{min-width:220px!important;color:var(--c-muted)!important}
body.crmPremium .crmOwnerName{display:block;font-weight:600;color:var(--c-text);line-height:1.35}
body.crmPremium .quickFilters>.crmChipLabel{height:auto!important;min-height:0!important;padding:0 4px 0 0!important;border:0!important;background:none!important;color:var(--c-faint)!important}
body.crmPremium .crmWorkspace .mainHeader .headerBtns>.crmBtnPrimary,body.crmPremium .crmWorkspace .mainHeader .headerBtns>button.crmBtnPrimary:not(#__){background:var(--c-accent)!important;border-color:var(--c-accent)!important;color:#fff!important}

body.crmPremium #crmAddOwnerBtn,body.crmPremium #crmAddLeadBtn{background:var(--c-accent)!important;background-image:none!important;border-color:var(--c-accent)!important;color:#fff!important}
body.crmPremium #crmAddOwnerBtn:hover,body.crmPremium #crmAddLeadBtn:hover{filter:brightness(1.08)}
body.crmPremium #ownersTable th{width:auto!important}
/* leads table: old layers hard-code colours on cells, the notes preview and the sticky actions column */
body.crmPremium #leadsView .leadsTable thead th{background:var(--c-surface-2)!important;color:var(--c-muted)!important}
body.crmPremium #leadsView .leadsTable td,body.crmPremium #leadsView .leadsTable td :is(div,span,a,p):not(.crmNext):not(.crmAssignee){color:var(--c-text)!important}
body.crmPremium #leadsView .leadsTable td:nth-child(2),body.crmPremium #leadsView .leadsTable td:nth-child(3),body.crmPremium #leadsView .leadsTable td:nth-child(4){color:var(--c-text)!important;opacity:1!important}
body.crmPremium #leadsView .leadsTable td :is(.notePreview,.leadNotePreview,[class*="note"],[class*="Note"]):not(.crmNext){background:var(--c-surface-2)!important;border:1px solid var(--c-border)!important;color:var(--c-muted)!important;border-radius:var(--r-sm)!important}
body.crmPremium #leadsView .leadsTable :is(td,th):last-child{background:var(--c-surface)!important}
body.crmPremium #leadsView .leadsTable thead th:last-child{background:var(--c-surface-2)!important}
body.crmPremium #leadsView .leadsTable td:last-child button{background:var(--c-surface-2)!important;border:1px solid var(--c-border-strong)!important;color:var(--c-text)!important}
body.crmPremium .crmAssignee{color:var(--c-muted)!important}
/* leads table in light mode (old layers paint these cells dark with id-level rules) */
html[data-theme="light"] body.crmPremium #leadsView :is(#leadsView .leadsTable,#leadsView .leadsTableHead) th{background:var(--c-surface-2)!important;color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium #leadsView .leadsTable td,html[data-theme="light"] body.crmPremium #leadsView .leadsTable td.actionsSticky,html[data-theme="light"] body.crmPremium #leadsView .leadsTable th.actionsSticky{background:var(--c-surface)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium #leadsView .leadsTable .leadReadValue{color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium #leadsView .leadsTable .leadLatestNote{background:var(--c-surface-2)!important;color:var(--c-muted)!important;border-color:var(--c-border)!important}
html[data-theme="light"] body.crmPremium #leadsView .leadsTable tr:hover td{background:var(--c-surface-2)!important}
html[data-theme="light"] body.crmPremium #appView #ownersTable td{background:var(--c-surface)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium #appView #ownersTable tr:hover td{background:var(--c-surface-2)!important}
/* light mode: owner profile + lead detail internals (old layers hard-code near-white text and dark boxes) */
html[data-theme="light"] body.crmPremium :is(#leadDetailContent,#profileContent) :is(div,span,p,small,li,dd,dt,td):not([class*="Btn"]):not([class*="btn"]):not(.u6Stage):not(.crmStatus):not(.crmTag){color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(#leadDetailContent,#profileContent) :is([class*="Label"],[class*="label"],[class*="Meta"],[class*="meta"],[class*="Subtitle"],time,dt,.crmSub,.crmEmpty,.crmTimeline span,.crmTimeline time,.crmEvList span){color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium :is(.u6NotesBox,.u6Composer,.u10DateButton,.u6CloseButton,.u6TimelineItem,[class*="u6Notes"]){background:var(--c-surface-2)!important;border-color:var(--c-border)!important;color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium .u6Stage{color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium .u6Stage.active{color:#fff!important}
html[data-theme="light"] body.crmPremium :is(#leadDetailContent,#profileContent) :is(.waBtn,.callBtn){color:#fff!important}
/* light mode: phone card lists for leads and owners */
html[data-theme="light"] body.crmPremium :is(#leadMobileCards,#ownerMobileCards,[id*="MobileCards"],[class*="mobileCards"]) :is(div,span,p,small,b,strong):not([class*="Btn"]):not([class*="btn"]){color:var(--c-text)!important}
html[data-theme="light"] body.crmPremium :is(#leadMobileCards,#ownerMobileCards,[id*="MobileCards"],[class*="mobileCards"]) :is([class*="abel"],[class*="Label"]){color:var(--c-muted)!important}
html[data-theme="light"] body.crmPremium :is(#leadMobileCards,#ownerMobileCards,[id*="MobileCards"],[class*="mobileCards"]) :is([class*="Note"],[class*="note"],[class*="emark"]){background:var(--c-surface-2)!important;border:1px solid var(--c-border)!important}
html[data-theme="light"] body.crmPremium :is(#leadMobileCards,#ownerMobileCards,[id*="MobileCards"],[class*="mobileCards"])>*{background:var(--c-surface)!important;border-color:var(--c-border)!important}
body.crmPremium .crmTable td{color:var(--c-text)!important}
/* broadcast: custom range + send queue */
body.crmPremium .crmRangeBox{display:flex;gap:8px;align-items:flex-end;margin-top:8px}
body.crmPremium .crmRangeBox label{display:grid;gap:4px;font-size:var(--t-xs);color:var(--c-muted);font-weight:600}
body.crmPremium .crmRangeBox input{width:96px!important}
body.crmPremium .crmPickNo{display:inline-block;min-width:34px;color:var(--c-accent-text);font-variant-numeric:tabular-nums}
body.crmPremium .crmSendQueue{margin:12px 0}
body.crmPremium .crmQHead{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;color:var(--c-muted);font-size:var(--t-sm);font-weight:600}
body.crmPremium .crmQApp{display:flex;align-items:center;gap:6px}
body.crmPremium .crmQApp select{height:32px!important;min-height:32px!important;width:auto!important}
body.crmPremium .crmQCard{padding:14px 16px;border:1px solid var(--c-border);border-radius:var(--r-md);background:var(--c-bg)}
body.crmPremium .crmQCard strong{display:block;font-size:var(--t-lg)}
body.crmPremium .crmQCard span{color:var(--c-muted);font-size:var(--t-sm)}
body.crmPremium .crmQCard p{margin:10px 0 0;white-space:pre-wrap;font-size:var(--t-sm)}
body.crmPremium .crmQActions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
body.crmPremium .crmQDone{padding:14px 16px;border-radius:var(--r-md);background:var(--c-accent-soft)}

/* profile / lead detail: each side scrolls inside the window (the grid row grew to full content height and was clipped) */
@media (min-width:801px){.u6DetailShell>.u6DetailLeft,.u6DetailShell>.u6DetailRight{max-height:90vh!important;overflow-y:auto!important;overscroll-behavior:contain}}
body.crmPremium #profileContent .crmHistory.crmUnitPanel{grid-template-columns:1fr!important}

@media(max-width:800px){body.crmPremium .crmBarTrack{grid-row:2;grid-column:1/-1}body.crmPremium .crmBarValue{grid-column:2;grid-row:1}body.crmPremium .crmBarRow{grid-template-columns:minmax(0,1fr) 70px;row-gap:7px;padding:9px 8px}}

/* More Units modal: keep the title and Close button visible while the unit list scrolls */
body.crmPremium #propertiesModal .modal{padding-top:0!important;padding-bottom:0!important}
body.crmPremium #propertiesModal #modalTitle{position:sticky;top:0;z-index:1;margin:0!important;padding:var(--s-4,16px) 0 var(--s-3,12px);background:var(--c-surface)}
body.crmPremium #propertiesModal .modalActions{position:sticky;bottom:0;margin:0!important;padding:var(--s-3,12px) 0 var(--s-4,16px);background:var(--c-surface);border-top:1px solid var(--c-border)}
body.crmPremium #propertiesModal .modalRow{color:var(--c-text)}
