/* =====================================================================
   Lumière — brown colour system (light + dark)
   Every page style references these tokens (var(--c-*)), so switching
   html[data-theme="dark"] re-colours the whole application at once.
   ===================================================================== */
:root{
  color-scheme:light;
  --c-bg:#F6F1EA;
  --c-surface:#FFFFFF;
  --c-surface-2:#FAF6F1;
  --c-sunken:#F2EBE2;
  --c-hover:#F5EDE4;
  --c-line:#E8DDD0;
  --c-line-strong:#D5C4B0;
  --c-ink:#2A1F17;
  --c-ink-2:#4E3F33;
  --c-muted:#76665A;
  --c-muted-2:#A8998B;
  --c-accent:#CABDAC;
  --c-accent-hover:#BCAD99;
  --c-accent-ink:#6B5C4B;
  --c-accent-soft:#F1ECE5;
  --c-accent-soft-2:#E3DACE;
  --c-on-accent:#291F15;
  --c-ring:rgba(202,189,172,.45);
  --c-success:#2F7A55;--c-success-bg:#E7F3EC;--c-success-line:#BFDCCB;
  --c-warning:#8A5D0C;--c-warning-bg:#FBF1DC;--c-warning-line:#EED9AE;
  --c-danger:#A13A3A;--c-danger-bg:#FBEAEA;--c-danger-line:#EBC3C3;
  --c-danger-solid:#B03A3A;--c-danger-solid-hover:#932E2E;
  --c-overlay:rgba(32,22,14,.55);
  --c-header:rgba(255,255,255,.92);
  --c-logo-tile:#CABDAC;
  --c-scroll:#D5C4B0;
  --c-shadow:0 1px 2px rgba(42,31,23,.05),0 6px 18px rgba(42,31,23,.06);
  --c-shadow-pop:0 18px 44px rgba(42,31,23,.18),0 2px 6px rgba(42,31,23,.08);
  /* chart palette */
  --chart-1:#CABDAC;--chart-2:#A39380;--chart-3:#291F15;--chart-4:#8F8170;--chart-5:#6B7F5E;
  --chart-6:#C9785B;--chart-7:#5E5245;--chart-8:#CABDAC;--chart-9:#5C6F82;--chart-10:#8E6C8A;
  --chart-text:#6B5B4E;--chart-grid:#EFE6DA;--chart-neg:#B84747;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --c-bg:#14100D;
  --c-surface:#1E1813;
  --c-surface-2:#241D17;
  --c-sunken:#191410;
  --c-hover:#2B231C;
  --c-line:#382D24;
  --c-line-strong:#4B3D31;
  --c-ink:#F2E9DF;
  --c-ink-2:#D9CABA;
  --c-muted:#A8988A;
  --c-muted-2:#7D6E61;
  --c-accent:#CABDAC;
  --c-accent-hover:#DCD2C4;
  --c-accent-ink:#CABDAC;
  --c-accent-soft:#2E2822;
  --c-accent-soft-2:#40372E;
  --c-on-accent:#291F15;
  --c-ring:rgba(202,189,172,.30);
  --c-success:#86D2A8;--c-success-bg:#16291F;--c-success-line:#2C4A39;
  --c-warning:#EBC27A;--c-warning-bg:#33280F;--c-warning-line:#5A4520;
  --c-danger:#F0A0A0;--c-danger-bg:#3A1C1C;--c-danger-line:#5E2D2D;
  --c-danger-solid:#B5473F;--c-danger-solid-hover:#C9584F;
  --c-overlay:rgba(0,0,0,.62);
  --c-header:rgba(30,24,19,.92);
  --c-logo-tile:#CABDAC;
  --c-scroll:#4B3D31;
  --c-shadow:0 1px 2px rgba(0,0,0,.3),0 6px 18px rgba(0,0,0,.22);
  --c-shadow-pop:0 18px 44px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.35);
  --chart-1:#CABDAC;--chart-2:#8F8574;--chart-3:#F1E9DF;--chart-4:#E3D9CB;--chart-5:#9DB38A;
  --chart-6:#E09A7B;--chart-7:#B8A698;--chart-8:#CABDAC;--chart-9:#8FA6BC;--chart-10:#BFA0BB;
  --chart-text:#BFAE9F;--chart-grid:#33291F;--chart-neg:#F08C8C;
}

/* ---------- Base ---------- */
html,html body{background:var(--c-bg);color:var(--c-ink)}
html body{transition:background-color .2s ease,color .2s ease}
::selection{background:var(--c-accent-soft-2);color:var(--c-ink)}
*{scrollbar-color:var(--c-scroll) transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--c-scroll);border-radius:10px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-track{background:transparent}
a{color:var(--c-accent-ink)}
code{background:var(--c-sunken);color:var(--c-ink-2);border-radius:4px;padding:1px 5px;font-size:.92em}
hr{border:0;border-top:1px solid var(--c-line)}
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]),textarea){background-color:var(--c-surface);color:var(--c-ink);border:1px solid var(--c-line-strong);border-radius:9px}
:where(input,textarea)::placeholder{color:var(--c-muted-2);opacity:1}
:where(input,textarea):focus{outline:none;border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
:where(input[type=search])::-webkit-search-cancel-button{filter:sepia(1) saturate(2) hue-rotate(-20deg);opacity:.6}
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-text-fill-color:var(--c-ink);-webkit-box-shadow:0 0 0 1000px var(--c-surface) inset;caret-color:var(--c-ink);transition:background-color 9999s}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--c-accent);outline-offset:2px}
input[type=checkbox],input[type=radio],progress{accent-color:var(--c-accent)}

/* ---------- App shell ---------- */
html body .app-header{background:var(--c-header);border-bottom-color:var(--c-line)}
html body .app-sidebar{background:var(--c-surface);border-right-color:var(--c-line)}
html body .sidebar-brand,html body .sidebar-brand img{background:var(--c-logo-tile)}
html body .lr-side-profile{border-bottom:1px solid var(--c-line);margin:0 12px 6px;padding-left:8px;padding-right:8px}
html body .sidebar-link{color:var(--c-ink-2)}
html body .sidebar-link .lr-icon{color:var(--c-muted);transition:color .15s}
html body .sidebar-link:hover{background:var(--c-hover);color:var(--c-accent-ink)}
html body .sidebar-link:hover .lr-icon{color:var(--c-accent-ink)}
html body .sidebar-link.active{background:var(--c-accent);color:var(--c-on-accent);box-shadow:0 6px 14px -6px rgba(41,31,21,.28)}
html[data-theme="dark"] body .sidebar-link.active{box-shadow:0 6px 16px -8px rgba(0,0,0,.8)}
html body .sidebar-link.active .lr-icon{color:var(--c-on-accent)}
html body .lr-avatar{background:var(--c-accent-soft);border-color:var(--c-accent-soft-2);color:var(--c-accent-ink)}
html body .lr-header-userbox{background:var(--c-surface);border-color:var(--c-line);color:var(--c-ink);transition:border-color .15s,background .15s}
html body .lr-header-userbox:hover,html body .lr-admin-menu.open .lr-header-userbox{border-color:var(--c-line-strong);background:var(--c-surface-2)}
html body .lr-header-usertext strong{color:var(--c-ink)}
html body .lr-admin-dropdown{background:var(--c-surface);border-color:var(--c-line);box-shadow:var(--c-shadow-pop)}
html body .lr-admin-dropdown a,html body .lr-admin-dropdown button{color:var(--c-ink);background:transparent}
html body .lr-admin-dropdown a:hover,html body .lr-admin-dropdown button:hover{background:var(--c-hover);color:var(--c-accent-ink)}
html body .lr-admin-dropdown svg{color:var(--c-muted)}
html body .lr-admin-dropdown a:hover svg,html body .lr-admin-dropdown button:hover svg{color:var(--c-accent-ink)}
html body .menu-toggle.lr-menu,html body .lr-nav-close{background:var(--c-surface);border-color:var(--c-line);color:var(--c-ink-2)}
html body .menu-toggle.lr-menu:hover,html body .lr-nav-close:hover{background:var(--c-hover);color:var(--c-accent-ink)}
html body .lr-overlay{background:var(--c-overlay)}
.lr-theme-switch-track{margin-left:auto;width:30px;height:17px;border-radius:20px;background:var(--c-line-strong);position:relative;flex:0 0 30px;transition:background .2s}
.lr-theme-switch-track:after{content:"";position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:var(--c-surface);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .2s}
html[data-theme="dark"] .lr-theme-switch-track{background:var(--c-accent)}
html[data-theme="dark"] .lr-theme-switch-track:after{transform:translateX(13px)}

/* ---------- Surfaces, cards, panels, tables ---------- */
html body :is(.panel,.card,.roi-panel,.viz-card,.um-panel,.conv-panel,.assign-panel,.mk-box,.mk-kpi){box-shadow:var(--c-shadow)}
html body .filters{box-shadow:var(--c-shadow)}
html body .data th,html body .roi-table th,html body .roi-audit-table th,html body .conv-table th,html body .assign-table th,html body .um-table th,html body .roi-evidence-table th{background:var(--c-surface-2);color:var(--c-muted)}
html body .data td{border-bottom-color:var(--c-line)}
html body .data tbody tr:hover td{background:var(--c-hover)}
html body .campaign-main:hover td{background:var(--c-hover)!important}
html body .pill{background:var(--c-sunken);color:var(--c-ink-2)}
html body .pill.blue{background:var(--c-accent-soft);color:var(--c-accent-ink)}
html body .pill.green{background:var(--c-success-bg);color:var(--c-success)}
html body .pill.amber{background:var(--c-warning-bg);color:var(--c-warning)}
html body .tag{background:var(--c-surface-2);color:var(--c-muted);border-color:var(--c-line)}
html body .platform-nav a{background:var(--c-surface);color:var(--c-ink-2);border-color:var(--c-line);transition:border-color .15s,color .15s,background .15s}
html body .platform-nav a:hover{border-color:var(--c-accent);color:var(--c-accent-ink)}
html body .platform-nav a.active{background:var(--c-accent);border-color:var(--c-accent);color:var(--c-on-accent)}
html body .platform-nav a strong{opacity:.85}
html body .page-btn{background:var(--c-surface);color:var(--c-ink-2);border-color:var(--c-line-strong)}
html body .page-btn:hover:not(:disabled):not(.active){border-color:var(--c-accent);color:var(--c-accent-ink)}
html body .page-btn.active{background:var(--c-accent);border-color:var(--c-accent);color:var(--c-on-accent)}
html body .roi-table td,html body .roi-table .roi-tree-cell{background:var(--c-surface)}
html body .roi-table .roi-depth-1 td{background:var(--c-surface-2)}
html body .roi-table tbody tr:hover td{background:var(--c-hover)}
html body .roi-table tfoot td,html body .roi-table tfoot .roi-tree-cell{background:var(--c-accent-soft)}
html body .roi-segment button.is-active{background:var(--c-surface);color:var(--c-accent-ink);box-shadow:0 1px 4px rgba(0,0,0,.12)}
html body .roi-kpi-accent{background:var(--c-accent-soft);border-color:var(--c-accent-soft-2)}
html body .roi-summary{background:linear-gradient(100deg,var(--c-accent-soft),var(--c-surface))}
html body .roi-tabs a{color:var(--c-muted)}
html body .roi-tabs a:hover{color:var(--c-accent-ink)}
html body .roi-untracked .roi-node-name{color:var(--c-muted-2)}
html body .lr-btn{background:var(--c-surface);color:var(--c-ink-2);border-color:var(--c-line-strong)}
html body .lr-btn:hover{border-color:var(--c-accent);background:var(--c-hover);color:var(--c-accent-ink)}
html body .lr-btn.lr-btn-primary{background:var(--c-accent);border-color:var(--c-accent);color:var(--c-on-accent)}
html body .lr-btn.lr-btn-primary:hover{background:var(--c-accent-hover);border-color:var(--c-accent-hover);color:var(--c-on-accent)}
html body .lr-btn.lr-btn-text{background:transparent;border-color:transparent;color:var(--c-accent-ink)}
html body .top-btn.primary,html body .apply,html body .conv-btn,html body .assign-btn,html body .ads-btn,html body .um-btn-primary{background:var(--c-accent)!important;border-color:var(--c-accent)!important;color:var(--c-on-accent)!important}
html body .top-btn.primary:hover,html body .apply:hover,html body .conv-btn:hover,html body .assign-btn:hover,html body .ads-btn:hover,html body .um-btn-primary:hover{background:var(--c-accent-hover)!important;border-color:var(--c-accent-hover)!important}
html body :is(.apply,.conv-btn,.assign-btn,.um-btn,.lr-btn,.secondary,.top-btn,.page-btn,.clear-lead-filters,.mk-btn,.mk-ghost){transition:background-color .15s,border-color .15s,color .15s,box-shadow .15s}
html body .secondary{background:var(--c-surface);color:var(--c-ink-2);border-color:var(--c-line-strong)}
html body .secondary:hover{border-color:var(--c-accent);color:var(--c-accent-ink);background:var(--c-hover)}
html body .clear-lead-filters{background:var(--c-surface);border-color:var(--c-line-strong);color:var(--c-ink-2)}
html body .clear-lead-filters:hover{border-color:var(--c-accent);color:var(--c-accent-ink)}
html body :is(.assign-btn,.conv-btn,.apply,.lr-btn,.um-btn):disabled{opacity:.5;cursor:not-allowed}
html body .jump-leads{color:var(--c-accent-ink)}
html body .um-btn-danger-ghost{background:var(--c-surface);color:var(--c-danger);border-color:var(--c-danger-line)}
html body .um-btn-danger-ghost:hover{background:var(--c-danger-bg);color:var(--c-danger);border-color:var(--c-danger-line)}
html body .assign-table button{background:var(--c-danger-bg);color:var(--c-danger);border-color:var(--c-danger-line)}
html body .um-dialog{background:var(--c-surface);color:var(--c-ink);border-color:var(--c-line);box-shadow:var(--c-shadow-pop)}
html body .um-dialog::backdrop{background:var(--c-overlay)}
html body .um-dialog.is-fallback[open]{box-shadow:0 0 0 100vmax var(--c-overlay)}
html body .lr-skip{background:var(--c-surface);color:var(--c-accent-ink)}
html body .live,html body .header-live{background:var(--c-success-bg);border-color:var(--c-success-line);color:var(--c-success)}

/* ---------- Charts ---------- */
html body canvas{background:transparent}
.viz-empty,.mk-empty{color:var(--c-muted)}

/* =====================================================================
   Unified custom dropdown (used by every <select> in the app plus the
   page-specific dropdown widgets, which are restyled to match)
   ===================================================================== */
.lr-sel{position:relative;display:block;width:100%;min-width:0}
.lr-sel>select{position:absolute!important;left:0;bottom:0;width:100%!important;height:100%!important;opacity:0!important;pointer-events:none!important;margin:0!important;padding:0!important;border:0!important}
.lr-sel-btn{width:100%;min-height:42px;height:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 12px;border:1px solid var(--c-line-strong);border-radius:9px;background:var(--c-surface);color:var(--c-ink);font:inherit;font-size:13px;line-height:1.3;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s}
.lr-sel-btn:hover:not(:disabled){border-color:var(--c-accent)}
.lr-sel.is-open .lr-sel-btn{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
.lr-sel-btn:disabled{opacity:.55;cursor:not-allowed}
.lr-sel-label{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lr-sel-label.is-placeholder{color:var(--c-muted-2)}
.lr-chev{flex:0 0 auto;width:8px;height:8px;border-right:1.8px solid var(--c-muted);border-bottom:1.8px solid var(--c-muted);transform:translateY(-2px) rotate(45deg);transition:transform .18s}
.lr-sel.is-open .lr-chev{transform:translateY(2px) rotate(225deg);border-color:var(--c-accent-ink)}

.lr-pop{position:fixed;z-index:3000;background:var(--c-surface);color:var(--c-ink);border:1px solid var(--c-line);border-radius:12px;box-shadow:var(--c-shadow-pop);padding:6px;opacity:0;transform:translateY(-4px);transition:opacity .14s ease,transform .14s ease;font-size:13px;line-height:1.4}
.lr-pop.is-up{transform:translateY(4px)}
.lr-pop.is-shown{opacity:1;transform:none}
.lr-pop[hidden]{display:none!important}
.lr-sel-search{display:flex;align-items:center;gap:8px;padding:0 10px;margin:0 0 6px;height:36px;border:1px solid var(--c-line-strong);border-radius:8px;background:var(--c-surface-2);color:var(--c-muted)}
.lr-sel-search:focus-within{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
.lr-sel-search svg{flex:0 0 15px;width:15px;height:15px}
.lr-pop .lr-sel-search input{flex:1;min-width:0;height:100%;border:0!important;background:transparent!important;box-shadow:none!important;outline:0!important;padding:0!important;color:var(--c-ink);font:inherit;font-size:13px}
.lr-sel-list{max-height:280px;overflow:auto;overscroll-behavior:contain}
.lr-sel-opt{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--c-ink);font:inherit;font-size:13px;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.lr-sel-opt span{flex:1;min-width:0}
.lr-sel-opt:after{content:"";flex:0 0 9px;width:9px;height:5px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg) translateY(-2px)}
.lr-sel-opt.is-focus,.lr-sel-opt:hover{background:var(--c-hover)}
.lr-sel-opt.is-selected{background:var(--c-accent-soft);color:var(--c-accent-ink);font-weight:650}
.lr-sel-opt.is-selected:after{border-color:var(--c-accent-ink)}
.lr-sel-opt:disabled{opacity:.42;cursor:not-allowed;background:transparent}
.lr-sel-group{padding:8px 10px 4px;font-size:10.5px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--c-muted)}
.lr-sel-empty{padding:12px 10px;color:var(--c-muted);font-size:12px}

/* --- legacy dashboard dropdown (.custom/.menu/.option) --- */
html body .custom .control,html body .control{background:var(--c-surface);color:var(--c-ink);border:1px solid var(--c-line-strong);border-radius:9px;transition:border-color .15s,box-shadow .15s}
html body .custom .control:hover{border-color:var(--c-accent)}
html body .custom.open>.control{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
html body .custom .chev{border-color:var(--c-muted);transition:transform .18s}
html body .custom.open .chev{transform:rotate(225deg);margin-top:4px}
html body .custom .menu{background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;box-shadow:var(--c-shadow-pop);padding:6px;top:calc(100% + 6px)}
html body .custom .option{color:var(--c-ink);border-radius:8px;padding:9px 10px;min-height:36px}
html body .custom .option:hover{background:var(--c-hover)}
html body .custom .option.active{background:var(--c-accent-soft);color:var(--c-accent-ink);font-weight:650}
html body .search-input,html body .lead-search{background:var(--c-surface);color:var(--c-ink);border:1px solid var(--c-line-strong);border-radius:9px}
html body .search-input:focus,html body .lead-search:focus{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring);outline:none}
html body .cal-icon{color:var(--c-muted);display:inline-grid;place-items:center}

/* --- assignments dropdown (.ad-dd) --- */
html body .ad-dd-btn{background:var(--c-surface);border-color:var(--c-line-strong);color:var(--c-ink);border-radius:9px;font-weight:500}
html body .ad-dd-btn:after{border-color:var(--c-muted)}
html body .ad-dd.open .ad-dd-btn{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
html body .ad-dd-panel{background:var(--c-surface);border-color:var(--c-line);box-shadow:var(--c-shadow-pop);border-radius:12px}
html body .ad-dd-opt{color:var(--c-ink);border-radius:8px}
html body .ad-dd-opt:hover,html body .ad-dd-opt:focus-visible{background:var(--c-hover);color:var(--c-ink)}
html body .ad-dd-opt.selected{background:var(--c-accent-soft);color:var(--c-accent-ink);box-shadow:inset 3px 0 0 var(--c-accent)}
html body .assign-form .ad-dd-search{background:var(--c-surface-2);border-color:var(--c-line-strong);color:var(--c-ink)}

/* --- role picker leftovers --- */
html body .lr-role-trigger,html body .lr-role-menu{background:var(--c-surface);color:var(--c-ink);border-color:var(--c-line-strong)}
html body .lr-role-menu button:hover{background:var(--c-hover);color:var(--c-accent-ink)}

/* =====================================================================
   Unified calendar (native date inputs, dashboard and ad-studio pickers)
   Only the real days of the shown month are rendered (1–28/29/30/31).
   ===================================================================== */
.lr-date{position:relative;display:block;width:100%;min-width:0}
.lr-date>input[type=date]{position:absolute!important;left:0;bottom:0;width:100%!important;height:100%!important;opacity:0!important;pointer-events:none!important;margin:0!important;padding:0!important;border:0!important}
.lr-date-btn{width:100%;min-height:42px;height:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 12px;border:1px solid var(--c-line-strong);border-radius:9px;background:var(--c-surface);color:var(--c-ink);font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.lr-date-btn:hover:not(:disabled){border-color:var(--c-accent)}
.lr-date.is-open .lr-date-btn{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
.lr-date-btn svg{flex:0 0 16px;width:16px;height:16px;color:var(--c-muted)}
.lr-date-btn .is-placeholder{color:var(--c-muted-2)}
.lr-date-btn span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.lr-cal{width:296px;max-width:calc(100vw - 24px);padding:12px}
.lr-cal-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:10px}
.lr-cal-title{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--c-ink);font:inherit;font-size:13.5px;font-weight:750;cursor:pointer}
.lr-cal-title:hover{background:var(--c-hover)}
.lr-cal-title i{width:6px;height:6px;border-right:1.6px solid var(--c-muted);border-bottom:1.6px solid var(--c-muted);transform:rotate(45deg) translateY(-2px)}
.lr-cal-nav{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border:1px solid var(--c-line);border-radius:8px;background:var(--c-surface);color:var(--c-ink-2);cursor:pointer;padding:0}
.lr-cal-nav svg{width:15px;height:15px}
.lr-cal-nav:hover:not(:disabled){border-color:var(--c-accent);color:var(--c-accent-ink)}
.lr-cal-nav:disabled{opacity:.35;cursor:not-allowed}
.lr-cal-week,.lr-cal-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
.lr-cal-week span{text-align:center;font-size:10.5px;font-weight:750;letter-spacing:.03em;color:var(--c-muted);padding:2px 0 6px}
.lr-cal-days i{display:block}
.lr-cal-day{height:34px;min-width:0;border:0;border-radius:8px;background:transparent;color:var(--c-ink);font:inherit;font-size:12.5px;font-variant-numeric:tabular-nums;cursor:pointer;padding:0;transition:background .12s}
.lr-cal-day:hover:not(:disabled){background:var(--c-hover)}
.lr-cal-day.is-today{box-shadow:inset 0 0 0 1px var(--c-accent);font-weight:700}
.lr-cal-day.is-range{background:var(--c-accent-soft);border-radius:0}
.lr-cal-day.is-selected{background:var(--c-accent);color:var(--c-on-accent);font-weight:750;border-radius:8px;box-shadow:none}
.lr-cal-day:disabled{opacity:.28;cursor:not-allowed}
.lr-cal-months{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.lr-cal-month{height:40px;border:1px solid var(--c-line);border-radius:9px;background:var(--c-surface);color:var(--c-ink);font:inherit;font-size:12.5px;cursor:pointer}
.lr-cal-month:hover:not(:disabled){border-color:var(--c-accent);color:var(--c-accent-ink)}
.lr-cal-month.is-selected{background:var(--c-accent);border-color:var(--c-accent);color:var(--c-on-accent);font-weight:700}
.lr-cal-month:disabled{opacity:.3;cursor:not-allowed}
.lr-cal-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--c-line);font-size:11.5px;color:var(--c-muted)}
.lr-cal-foot button{border:0;background:transparent;color:var(--c-accent-ink);font:inherit;font-size:12px;font-weight:700;cursor:pointer;padding:5px 8px;border-radius:7px}
.lr-cal-foot button:hover:not(:disabled){background:var(--c-accent-soft)}
.lr-cal-foot button:disabled{opacity:.4;cursor:not-allowed}

/* dashboard calendar (.date-menu) matched to the unified look */
html body .date-menu{background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;box-shadow:var(--c-shadow-pop);padding:12px;width:296px}
html body .cal-head{margin-bottom:10px}
html body .cal-title{color:var(--c-ink);font-size:13.5px;font-weight:750}
html body .cal-nav{width:32px;height:32px;border:1px solid var(--c-line);border-radius:8px;background:var(--c-surface);color:var(--c-ink-2);font-size:16px;line-height:1;cursor:pointer}
html body .cal-nav:hover{border-color:var(--c-accent);color:var(--c-accent-ink)}
html body .cal-grid{gap:3px}
html body .cal-dow{color:var(--c-muted);font-size:10.5px;font-weight:750}
html body .cal-day{height:34px;border-radius:8px;color:var(--c-ink);font-size:12.5px;background:transparent;font-variant-numeric:tabular-nums}
html body .cal-day:hover{background:var(--c-hover)}
html body .cal-day.is-today{box-shadow:inset 0 0 0 1px var(--c-accent);font-weight:700}
html body .cal-day.selected{background:var(--c-accent);color:var(--c-on-accent);font-weight:750}
html body .cal-blank{display:block}

@media(max-width:600px){
  .lr-cal-day,html body .cal-day{height:38px;font-size:13px}
  .lr-sel-opt{min-height:42px}
  .lr-sel-btn,.lr-date-btn{font-size:16px;min-height:44px}
}

/* =====================================================================
   Layout fixes
   ===================================================================== */
html body .dashboard-shell .filters .field{min-width:0}
html body .filters .field>label{color:var(--c-ink-2)}
html body .dashboard-shell .grid .card .value{line-height:1.15}
html body .panel-head h2{color:var(--c-ink)}
html body .panel .sub,html body .card .hint{color:var(--c-muted)}
html body .roi-field .lr-sel,html body .roi-field .lr-date{height:auto}
html body .roi-field .lr-sel-btn,html body .roi-field .lr-date-btn{height:44px;min-height:44px}
html body .conv-filters .lr-sel-btn,html body .conv-filters .lr-date-btn{height:44px}
html body .um-field .lr-sel-btn{height:44px;font-size:14px}
html body .um-list-tools .lr-sel{width:150px;flex:0 0 150px}
@media(max-width:767px){html body .um-list-tools .lr-sel{width:100%;flex:auto}}
html body .conv-filters input,html body .assign-toolbar input{height:44px;padding:0 12px}
html body .conv-filters label{color:var(--c-ink-2)}
html body .assign-form label{color:var(--c-ink-2)}
html body .assign-toolbar .assign-btn{height:44px}
html body .roi-search,html body .um-search,html body .mk-search{background:var(--c-surface)}
html body .roi-search input,html body .um-search input{background:transparent;border:0;box-shadow:none}
html body .roi-search:focus-within{border-color:var(--c-accent);box-shadow:0 0 0 3px var(--c-ring)}
html body .foot{color:var(--c-muted-2)}
html body .roi-footer{color:var(--c-muted)}
html body details>summary{color:inherit}
@media(max-width:767px){
  html body .dashboard-shell :is(.leads-table,.source-table) tbody tr{background:var(--c-surface);border-color:var(--c-line)}
  html body .dashboard-shell :is(.leads-table,.source-table) td{border-bottom-color:var(--c-line)}
  html body .dashboard-shell :is(.leads-table,.source-table) td:before{color:var(--c-muted)}
  html body .roi-table tr{background:var(--c-surface);border-color:var(--c-line)}
  html body .roi-table td{border-bottom-color:var(--c-line)}
  html body .roi-table .roi-tree-cell{background:var(--c-surface-2)!important}
  html body .um-table tr.um-user-row{background:var(--c-surface);border-color:var(--c-line)}
  html body .um-table .um-user-row td:first-child{background:var(--c-surface-2)}
}

/* =====================================================================
   Sign-in page
   ===================================================================== */
.lr-login{min-height:100vh;min-height:100svh;display:grid;place-items:center;padding:24px;background:
  radial-gradient(1200px 600px at 10% -10%,var(--c-accent-soft),transparent 60%),
  radial-gradient(900px 500px at 110% 110%,var(--c-accent-soft),transparent 60%),var(--c-bg)}
.lr-login-card{width:100%;max-width:420px;background:var(--c-surface);border:1px solid var(--c-line);border-radius:18px;box-shadow:var(--c-shadow-pop);overflow:hidden}
.lr-login-logo{display:block;background:var(--c-logo-tile);padding:22px 30px;border-bottom:1px solid var(--c-line)}
.lr-login-logo img{display:block;width:100%;max-width:240px;height:auto;margin:0 auto}
.lr-login-body{padding:28px 30px 30px}
.lr-login-body h1{margin:0 0 6px;font-size:21px;line-height:1.3;color:var(--c-ink);letter-spacing:-.01em}
.lr-login-body .sub{margin:0 0 22px;color:var(--c-muted);font-size:13px;line-height:1.6}
.lr-login-field{margin:0 0 16px}
.lr-login-field label{display:block;margin:0 0 7px;font-size:12px;font-weight:650;color:var(--c-ink-2)}
.lr-login-field input{display:block;width:100%;height:46px;padding:0 14px;font:inherit;font-size:15px;border:1px solid var(--c-line-strong);border-radius:10px;background:var(--c-surface);color:var(--c-ink)}
.lr-login-pass{position:relative}
.lr-login-pass input{padding-right:72px}
.lr-login-reveal{position:absolute;right:4px;top:4px;bottom:4px;min-width:62px;border:0;border-radius:8px;background:transparent;color:var(--c-accent-ink);font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.lr-login-reveal:hover{background:var(--c-accent-soft)}
.lr-login-submit{display:block;width:100%;height:46px;margin-top:6px;border:0;border-radius:10px;background:var(--c-accent);color:var(--c-on-accent);font:inherit;font-size:14px;font-weight:700;cursor:pointer;transition:background .15s,transform .1s}
.lr-login-submit:hover{background:var(--c-accent-hover)}
.lr-login-submit:active{transform:translateY(1px)}
.lr-login-err{display:flex;gap:9px;align-items:flex-start;background:var(--c-danger-bg);border:1px solid var(--c-danger-line);color:var(--c-danger);padding:10px 12px;border-radius:10px;font-size:13px;line-height:1.5;margin:0 0 18px;overflow-wrap:anywhere}
.lr-login-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;padding-top:16px;border-top:1px solid var(--c-line);font-size:11.5px;color:var(--c-muted)}
.lr-login-theme{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 10px;border:1px solid var(--c-line);border-radius:8px;background:var(--c-surface);color:var(--c-ink-2);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.lr-login-theme:hover{border-color:var(--c-accent);color:var(--c-accent-ink)}
.lr-login-theme svg{width:15px;height:15px}
.lr-login-theme .is-dark{display:none}
html[data-theme="dark"] .lr-login-theme .is-dark{display:inline}
html[data-theme="dark"] .lr-login-theme .is-light{display:none}
@media(max-width:479px){.lr-login{padding:14px}.lr-login-body{padding:22px 20px 24px}.lr-login-logo{padding:18px 22px}}
@media(max-height:560px){.lr-login{place-items:start center}.lr-login-logo{padding:12px 30px}.lr-login-logo img{max-width:170px}}

@media(prefers-reduced-motion:reduce){.lr-pop,.lr-chev,.lr-sel-btn,.lr-date-btn,html body{transition:none!important}}
@media print{.lr-pop{display:none!important}}
.lr-live{display:inline-flex;align-items:center;gap:4px;margin-right:6px;padding:1px 6px;border:1px solid var(--c-success-line);border-radius:5px;background:var(--c-success-bg);color:var(--c-success);font-size:9.5px;font-weight:750;letter-spacing:.05em;vertical-align:1px}
.lr-live:before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
/* KPI grid: no orphan card on any width */
html body .dashboard-shell .grid{grid-template-columns:repeat(4,minmax(0,1fr))}
html body .dashboard-shell .grid .card:nth-child(7):last-child{grid-column:span 2}
@media(min-width:1500px){html body .dashboard-shell .grid{grid-template-columns:repeat(7,minmax(0,1fr))}html body .dashboard-shell .grid .card:nth-child(7):last-child{grid-column:auto}}
@media(max-width:767px){html body .dashboard-shell .grid{grid-template-columns:repeat(2,minmax(0,1fr))}html body .dashboard-shell .grid .card:last-child{grid-column:1/-1}}
html body .roi-kpi-value{font-size:clamp(21px,1.75vw,30px);letter-spacing:-.5px}
@media(max-width:767px){html body .roi-kpi-value{font-size:22px}}
html body .assign-toolbar input{font-size:13px}
html body .ad-dd-btn{font-size:13px;min-height:44px}
