/* Shared theme control. Public and staff preferences are stored independently. */
button.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:9px;flex-shrink:0;min-height:38px;height:auto;margin:0;padding:9px 13px;border:1px solid var(--shell-line,var(--line,#d8d2c9));border-radius:999px;background:var(--shell-soft,var(--surface,#fffaf1));color:var(--shell-ink,var(--text,#241915));font-family:inherit;font-size:12.5px;font-weight:600;line-height:1.4;box-shadow:none;cursor:pointer;white-space:nowrap;transition:background .15s ease}
button.theme-toggle:hover{background:var(--shell-panel,var(--panel,#f2e5d5));transform:none}
button.theme-toggle:focus-visible{outline:2px solid #c99c69;outline-offset:3px}
.theme-toggle svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun,html[data-theme=night] .theme-toggle .theme-moon{display:none}
html[data-theme=night] .theme-toggle .theme-sun{display:block}
.tabs-footer .theme-toggle{justify-content:flex-start;width:100%;padding-inline:14px;border-color:transparent;background:transparent;color:var(--shell-muted);border-radius:12px}
.tabs-footer .theme-toggle:hover{background:var(--shell-soft);color:var(--shell-ink)}
.login-card>.theme-toggle{float:right;margin:-8px -8px 0 8px}
html[data-theme=night]{color-scheme:dark;--night-canvas:#181614;--night-panel:#24211e;--night-soft:#302b26;--night-field:#37312b;--night-text:#f4eade;--night-muted:#c3b3a3;--night-line:#e6cdb52b;--night-accent:#95543e;
  --shell-canvas:var(--night-canvas);--shell-panel:var(--night-panel);--shell-soft:var(--night-soft);--shell-ink:var(--night-text);--shell-muted:var(--night-muted);--shell-line:var(--night-line);--shell-accent:var(--night-accent);--shell-accent-strong:#ad634a;--shell-shadow:0 20px 55px #0005;
  --ink:var(--night-text);--muted:var(--night-muted);--paper:var(--night-panel);--panel:var(--night-panel);--line:var(--night-line);--brick:#e3a38c;--gold:#dfb273;--green:#94c8a5;--shadow:0 20px 55px #0005;--control-fill:var(--night-field);
  --bg:var(--night-canvas);--surface:var(--night-soft);--text:var(--night-text);--accent:#e4bf91;--accent-dark:#403328}
html[data-theme=night] body{color:var(--night-text);background:var(--night-canvas)}
html[data-theme=night] :is(input,textarea)::placeholder{color:#b5a492;opacity:1}
html[data-theme=night] :is(input,select,textarea){border-color:var(--night-line);accent-color:#cf9c67}
html[data-theme=night] :is(button,a,input,textarea,select):focus-visible{outline-color:#e4b87f}
html[data-theme=night] :is(.nav-brand-logo,.brand img){filter:brightness(0) invert(.94) sepia(.12)}
html[data-theme=night] :is(.admin-select__menu,.admin-date__panel){box-shadow:0 16px 45px #0008}
html[data-theme=night] :is(.admin-select__search,.admin-select__options){scrollbar-color:#75614e transparent}
html[data-theme=night] :is(.data-table,.ops-table,.record-dialog-body,.admin-assistant-thread){scrollbar-color:#75614e transparent}
/* Public reception */
html[data-theme=night][data-theme-scope=public] body{background:radial-gradient(ellipse at 25% 20%,#a3743820,transparent 55%),radial-gradient(ellipse at 90% 5%,#a1583b17,transparent 45%),#181614}
html[data-theme=night] .page-header{background:#24211e80;border-color:var(--line)}
html[data-theme=night] .brand span{border-color:var(--line)}
html[data-theme=night] :is(.location-button,.secondary-button,.copy-conversation){background:var(--night-soft);border-color:var(--line);color:var(--text)}
html[data-theme=night] .primary-button{background:#e4bf91;border-color:#e4bf91;color:#241915}
html[data-theme=night] .primary-button:hover{background:#f0d2aa}
html[data-theme=night] .suggestions button{background:#302b2670;color:var(--text)}
html[data-theme=night] .suggestions button:hover{background:var(--surface)}
html[data-theme=night] :is(.composer-note,footer,footer a){color:var(--muted)}
html[data-theme=night] .message-body{background:#302b26}
html[data-theme=night] .message.user .message-body{background:#493829;color:#f7eadb}
html[data-theme=night] .composer{background:var(--night-field);border-color:var(--line)}
html[data-theme=night] .composer button{color:#241915}
html[data-theme=night] .chat-panel{box-shadow:0 20px 60px #0005}
html[data-theme=night] :is(.icon-button:hover,.copy-conversation:hover){background:#493a2b}
html[data-theme=night] .receipt{background:#2d2823;color:var(--text);border-color:var(--line)}
html[data-theme=night] .receipt .reference{color:var(--muted);border-color:var(--line)}
html[data-theme=night] .receipt button{background:#e4bf91;color:#241915}
html[data-theme=night] .location-option[aria-pressed=true]{background:#443428;border-color:#ca9b68}
html[data-theme=night] .location-dialog{border-color:var(--line);box-shadow:0 24px 70px #0008}
html[data-theme=night] .location-dialog::backdrop{background:#090806b3}
html[data-theme=night] .error{background:#4b2923;border-color:#9c5846;color:#ffd3bf}
/* Staff workspace: replace remaining fixed light surfaces. */
html[data-theme=night] :is(.admin-assistant-suggestions button,.admin-assistant-header-button,.admin-assistant-composer>div){background:var(--night-soft);border-color:var(--night-line);color:var(--night-text)}
html[data-theme=night] :is(.report-mode,.report-bar-track,.report-vbar-track){background:var(--night-soft)}
html[data-theme=night] .report-mode button{color:var(--night-muted)}
html[data-theme=night] .report-mode button.active{background:#4b392c;color:var(--night-text)}
html[data-theme=night] #reportsContent .report-kpis .ops-metric{background:var(--night-field)}
html[data-theme=night] #reportsContent .report-kpis .ops-metric>:is(span,small){color:var(--night-muted)}
html[data-theme=night] .report-legend small{color:var(--night-muted)}
html[data-theme=night] .report-source-badge{background:#233f31;color:#b5dfc2}
html[data-theme=night] .is-demo .report-source-badge{background:#45371f;color:#efd19c}
html[data-theme=night] :is(.intake-review-facts,#appointmentDrawer .appointment-editor .admin-datetime){background:var(--night-field)}
html[data-theme=night] .assistant-report-chart svg text{fill:var(--night-text)}
html[data-theme=night] .report-ring svg circle[fill="#e9e3dd"]{fill:var(--night-soft)}
html[data-theme=night] #hoursExceptionError{color:#f2b6a6}
html[data-theme=night] button.app-refresh-button{background:#e5c7a2;color:#241915;border-color:#e5c7a2}
html[data-theme=night] button.app-refresh-button:hover{background:#f2d9b9;color:#241915}
/* Keep the base action distinct from text, without changing secondary controls. */
:where(html[data-theme=night][data-theme-scope=admin]) button{background:var(--shell-accent);color:#fffaf1}
html[data-theme=night] #dashboardView .filters{background:var(--night-soft);border-color:var(--night-line)}
html[data-theme=night] .detail-tab{color:var(--night-muted)}
html[data-theme=night] .detail-tab.active{color:#efb59d}
html[data-theme=night] .table-secondary{color:var(--night-muted)}
html[data-theme=night] .table-pill{background:#4e3e28;color:#f2ce96}
html[data-theme=night] .table-pill:is(.green,.active,.confirmed,.bookable,.completed,.read,.resolved){background:#2b4434;color:#b5dfc2}
html[data-theme=night] .table-pill:is(.red,.inactive,.cancelled,.failed,.no_show){background:#4e2e27;color:#f5b5a5}
html[data-theme=night] .table-pill:is(.blue,.web_chat,.web_call,.in_progress){background:#2d3f4e;color:#b8d8f1}
html[data-theme=night] .table-pill:is(.gray,.ended,.no-transcript){background:#443c35;color:#d4c6b9}
html[data-theme=night] .table-pill:is(.unread,.new,.voicemail){background:#45344f;color:#ddc0ef}
html[data-theme=night] .table-pill.needs_callback{color:#f2ce96}
html[data-theme=night] :is(.report-card .data-table td,.ops-table td){color:var(--night-text)}
html[data-theme=night] :is(.report-text-button,.ops-card-top>strong){color:#efb59d}
html[data-theme=night] :is(.schedule-day-card,.row-card,.communication-inbox-tabs button){background:var(--night-soft);border-color:var(--night-line)}
html[data-theme=night] .row-card:hover{background:var(--night-field)}
html[data-theme=night] .appointment-capacity-strip .metric-card{--metric-accent:#8bc49e;box-shadow:none}
html[data-theme=night] .appointment-capacity-strip .metric-card:nth-child(2){--metric-accent:#e3b86e}
html[data-theme=night] .appointment-capacity-strip .metric-card:nth-child(3){--metric-accent:#92bfdf}
html[data-theme=night] .appointment-capacity-strip .metric-card:nth-child(4){--metric-accent:#eba68e}
html[data-theme=night] .communication-inbox-tabs button.active{background:var(--shell-accent);border-color:var(--shell-accent);color:#fffaf1;box-shadow:none}
html[data-theme=night] :is(.badge,.badge.completed,.badge.booked,.badge.no_answer,.badge.voicemail,.badge.failed,.badge.skipped,.badge.not_interested){background:#443c35;color:#d4c6b9}
html[data-theme=night] .badge:is(.active,.scheduled,.confirmed){background:#2b4434;color:#b5dfc2}
html[data-theme=night] .badge:is(.paused,.draft,.calling,.queued){background:#4e3e28;color:#f2ce96}
html[data-theme=night] .badge:is(.opted_out,.archived,.cancelled,.inactive){background:#4e2e27;color:#f5b5a5}
html[data-theme=night] button.danger,html[data-theme=night] button.secondary.danger{background:#4e2e27;color:#f5b5a5}
html[data-theme=night] :is(.record-history-item small,.appointment-capacity-strip .metric-detail){color:var(--night-muted)}
html[data-theme=night] :is(.customer-detail-table,.customer-vehicle-card,.record-stat,.record-history-item,.schedule-item,.check-option){background:var(--night-soft);border-color:var(--night-line)}
html[data-theme=night] .schedule-row .closed-toggle{background:var(--night-field);border-color:var(--night-line)}
html[data-theme=night] .schedule-row .closed-toggle:checked{background:var(--shell-accent)}
html[data-theme=night] .schedule-row .closed-toggle:checked::before{border-color:#fffaf1}
/* Staff sign-in follows the staff preference. */
html[data-theme=night] .login-card{background:var(--night-panel);border-color:var(--night-line);box-shadow:var(--shadow)}
html[data-theme=night] .login-card :is(label,.login-heading>p:last-child,.security-note){color:var(--night-muted)}
html[data-theme=night] .login-card input{background:var(--night-field);color:var(--night-text);border-color:var(--night-line)}
html[data-theme=night] .login-card :is(.eyebrow,.status){color:#e7ad91}
html[data-theme=night] .login-card .status[data-state=success]{color:#a2d8ac}
html[data-theme=night] .security-note svg{fill:var(--night-muted)}
@media(max-width:860px){.page-header .header-actions{gap:8px}.page-header .theme-toggle{width:36px;min-width:36px;min-height:36px;padding:8px}.page-header .theme-toggle [data-theme-label]{display:none}.page-header .location-button{max-width:min(180px,44vw)}html[data-theme=night] .chat-panel{box-shadow:0 0 0 100vmax #08070699}}
@media(min-width:901px){.admin-shell[data-chat-wide=true]:not([data-assistant-collapsed=true]):not([data-view=assistant])>.tabs:not(:hover):not(:has(:focus-visible)) .theme-toggle [data-theme-label]{display:none}.admin-shell[data-chat-wide=true]:not([data-assistant-collapsed=true]):not([data-view=assistant])>.tabs:not(:hover):not(:has(:focus-visible)) .theme-toggle{justify-content:center;padding:9px}}
@media print{.theme-toggle{display:none!important}html[data-theme=night]{color-scheme:light;--shell-ink:#241915;--shell-muted:#735f55;--shell-panel:#fff;--shell-soft:#f5eee5;--shell-line:#ddd;--control-fill:#fff;--ink:#241915;--muted:#735f55;--night-text:#241915;--night-muted:#735f55;--night-panel:#fff;--night-field:#fff;--night-soft:#f5eee5;--night-line:#ddd}html[data-theme=night] body{color:#241915;background:#fff}}
