/* UNISOL 360° — consistência final de tema claro/escuro
   Camada visual incremental. Não altera estrutura, dados, rotas ou lógica. */

:root,
html[data-theme="light"] {
  --theme-page: #F5F6F8;
  --theme-surface: #FFFFFF;
  --theme-surface-raised: #FFFFFF;
  --theme-surface-muted: #F7F8FA;
  --theme-control: #FAFBFC;
  --theme-text: #1C1E24;
  --theme-text-secondary: #69717D;
  --theme-text-muted: #8B929C;
  --theme-placeholder: #8A929E;
  --theme-disabled: #9BA2AC;
  --theme-border: rgba(20,24,30,.10);
  --theme-border-strong: rgba(20,24,30,.16);
  --theme-hover: rgba(20,24,30,.035);
  --theme-active: rgba(245,130,31,.10);
  --theme-shadow: 0 10px 30px rgba(20,24,30,.07);
  --theme-backdrop: rgba(15,18,22,.34);
  --theme-success-surface: rgba(18,153,106,.10);
  --theme-danger-surface: rgba(220,63,69,.10);
}

html[data-theme="dark"] {
  --theme-page: #090B0E;
  --theme-page-top: #0D1116;
  --theme-page-deep: #07090C;
  --theme-surface: #1A1C21;
  --theme-surface-raised: #20242B;
  --theme-surface-muted: #17191E;
  --theme-control: #20242B;
  --theme-text: #F5F7FA;
  --theme-text-secondary: rgba(245,247,250,.78);
  --theme-text-muted: rgba(245,247,250,.55);
  --theme-placeholder: rgba(245,247,250,.48);
  --theme-disabled: rgba(245,247,250,.36);
  --theme-border: rgba(255,255,255,.07);
  --theme-border-strong: rgba(255,255,255,.12);
  --theme-hover: rgba(255,255,255,.045);
  --theme-active: rgba(245,130,31,.14);
  --theme-shadow: 0 16px 36px rgba(0,0,0,.30);
  --theme-backdrop: rgba(5,7,9,.76);
  --theme-success-surface: rgba(46,203,139,.10);
  --theme-danger-surface: rgba(240,113,120,.10);
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

.u-shell { color: var(--theme-text); }

.u-shell :where(.input,.select,.textarea,.u-input) {
  color: var(--theme-text);
  background-color: var(--theme-control);
  border-color: var(--theme-border);
}

.u-shell :where(.input,.select,.textarea,.u-input):focus,
.u-shell :where(.input,.select,.textarea,.u-input):focus-visible {
  background-color: var(--theme-surface-raised);
  border-color: rgba(245,130,31,.55);
}

.u-shell :where(input,textarea)::placeholder {
  color: var(--theme-placeholder) !important;
  -webkit-text-fill-color: var(--theme-placeholder) !important;
  opacity: 1 !important;
}

.u-shell select option {
  color: var(--theme-text);
  background: var(--theme-surface-raised);
}

html[data-theme="dark"] .u-shell input:-webkit-autofill,
html[data-theme="dark"] .u-shell input:-webkit-autofill:hover,
html[data-theme="dark"] .u-shell input:-webkit-autofill:focus,
html[data-theme="dark"] .u-shell textarea:-webkit-autofill,
html[data-theme="dark"] .u-shell select:-webkit-autofill {
  -webkit-text-fill-color: var(--theme-text) !important;
  caret-color: var(--theme-text);
  -webkit-box-shadow: 0 0 0 1000px var(--theme-control) inset !important;
  transition: background-color 9999s ease-out 0s;
}

.u-shell :where(.u-user-dropdown,.u-search-dd,.u-notif-pop,.u-kebab-menu,[role="menu"],[role="listbox"]) {
  color: var(--theme-text);
  border-color: var(--theme-border);
}

.u-shell :where(.u-page-sub,.u-muted,.u-field-label,.label) {
  color: var(--theme-text-secondary);
}

/* COLABORADORES — o layout mobile aprovado permanece igual; apenas muda de material por tema. */
@media (max-width: 768px) {
  html[data-theme="dark"] .u-colab-overlay,
  html[data-theme="dark"] .u-colab-drawer,
  html[data-theme="dark"] .u-colab-drawer-head,
  html[data-theme="dark"] .u-colab-tabs,
  html[data-theme="dark"] .u-colab-drawer-body,
  html[data-theme="dark"] form.u-colab-drawer-body > .u-colab-section:first-child > .u-colab-section-title {
    background: var(--theme-page) !important;
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] .u-colab-drawer-head {
    border-bottom-color: var(--theme-border) !important;
  }

  html[data-theme="dark"] .u-colab-drawer-title,
  html[data-theme="dark"] .u-colab-view-hero .font-bold,
  html[data-theme="dark"] .u-colab-tab-edit {
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] .u-colab-drawer-head .text-xs,
  html[data-theme="dark"] .u-colab-section-title,
  html[data-theme="dark"] form.u-colab-drawer-body > .u-colab-section:first-child > .u-colab-section-title,
  html[data-theme="dark"] .u-colab-view-hero .text-sm,
  html[data-theme="dark"] .u-colab-tab {
    color: var(--theme-text-secondary) !important;
  }

  html[data-theme="dark"] .u-colab-drawer-head .u-btn-ghost,
  html[data-theme="dark"] .u-colab-tab-edit,
  html[data-theme="dark"] .u-colab-view-hero {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
  }

  html[data-theme="dark"] .u-colab-view-hero {
    box-shadow: var(--theme-shadow) !important;
  }

  html[data-theme="dark"] .u-colab-tab {
    background: transparent !important;
  }

  html[data-theme="dark"] .u-colab-tab-active {
    color: var(--orange) !important;
    border-bottom-color: var(--orange) !important;
  }
}

/* CRÉDITO HABITACIONAL — tema escuro sem transformar o hero aprovado. */
html[data-theme="dark"] .ch-page { color: var(--theme-text); }

html[data-theme="dark"] .ch-page :where(
  .ch-card,.ch-result-section,.ch-ai-card,.ch-analysis-card,.ch-empty,
  .ch-search-results,.ch-search-results button,.ch-choice,.ch-bank-select,
  .ch-review div,.ch-insights article,.ch-bank-card,.ch-config-card,
  .ch-eligibility-card,.ch-index-suggestions,.ch-client-suggestion
) {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .ch-page :where(
  .ch-person-selected,.ch-property-selected,.ch-money-input,.ch-bank-metrics div,
  .ch-ai-grid div,.ch-real-rules,.ch-eligibility-data span,.ch-index-loading,
  .ch-new-client
) {
  background: var(--theme-surface-muted) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .ch-page :where(
  .ch-search input,.ch-field input,.ch-field select,.ch-form-grid input,
  .ch-form-grid select,.ch-form-grid textarea,.ch-config-card input,
  .ch-config-card textarea,.ch-compose-row-real > select,.ch-proposal-form input[type="file"]
) {
  background: var(--theme-control) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] .ch-page :where(
  .ch-search input,.ch-field input,.ch-field select,.ch-form-grid input,
  .ch-form-grid select,.ch-form-grid textarea,.ch-config-card input,
  .ch-config-card textarea,.ch-compose-row-real > select
):focus {
  background: var(--theme-surface-raised) !important;
  border-color: rgba(245,130,31,.62) !important;
}

html[data-theme="dark"] .ch-btn-secondary {
  background: var(--theme-surface-raised) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .ch-segment {
  background: var(--theme-surface-muted) !important;
}

html[data-theme="dark"] .ch-segment button {
  color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .ch-segment button.is-active {
  background: var(--theme-surface-raised) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] .ch-page :where(
  .ch-search span,.ch-field > span,.ch-form-grid label > span,.ch-analysis-main span,
  .ch-analysis-values span,.ch-analysis-meta,.ch-empty p,.ch-section-head p,
  .ch-search-results em,.ch-person-selected span,.ch-property-selected span,
  .ch-person-selected em,.ch-section-subhead span,.ch-compose-row span,
  .ch-total-line span,.ch-index-loading,.ch-eligibility-data span
) {
  color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .ch-page :where(
  .ch-analysis-values strong,.ch-analysis-main strong,.ch-search-results strong,
  .ch-person-selected strong,.ch-property-selected strong,.ch-section-head h3,
  .ch-total-line strong
) {
  color: var(--theme-text) !important;
}

/* MENSAGENS — mantém linguagem iOS, com paleta equivalente no dark. */
html[data-theme="dark"] .u-message-page {
  --msg-ink: #EEF1F5;
  --msg-secondary: #A8B1BE;
  --msg-fill: #242B35;
  --msg-line: rgba(255,255,255,.09);
  --msg-soft: #1A2028;
  --msg-smoke: #D8DEE7;
  background: var(--theme-page) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] :where(
  .u-message-page,.u-ios-msg-header,.u-ios-conversations,.u-ios-thread,
  .u-ios-thread-main,.u-ios-compose,.u-ios-contact-list,.u-ios-contact
) {
  background: var(--theme-page) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .u-ios-filter-popover {
  background: rgba(28,34,44,.98) !important;
  border-color: var(--theme-border) !important;
  box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] .u-ios-filter-popover button,
html[data-theme="dark"] .u-ios-filter-menu summary,
html[data-theme="dark"] .u-ios-compose-head button,
html[data-theme="dark"] .u-ios-thread-actions a,
html[data-theme="dark"] .u-ios-thread-actions button {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .u-ios-filter-popover button:active,
html[data-theme="dark"] .u-ios-filter-popover button.is-active,
html[data-theme="dark"] .u-ios-thread-main:active,
html[data-theme="dark"] .u-ios-contact:active {
  background: var(--theme-hover) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .u-ios-search {
  background: var(--theme-control) !important;
  color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .u-ios-search input,
html[data-theme="dark"] .u-ios-recipient-line input,
html[data-theme="dark"] .u-ios-thread-top strong,
html[data-theme="dark"] .u-ios-empty h2,
html[data-theme="dark"] .u-ios-contact strong {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] :where(
  .u-ios-thread-top time,.u-ios-thread-preview,.u-ios-context,.u-ios-empty p,
  .u-ios-recipient-line > span,.u-ios-contact small,.u-ios-contact-empty
) {
  color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .u-ios-compose-head,
html[data-theme="dark"] .u-ios-recipient-line,
html[data-theme="dark"] .u-ios-contact > span,
html[data-theme="dark"] .u-ios-thread-actions {
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .u-ios-recipient-token {
  background: var(--theme-surface-raised) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .u-ios-system-avatar {
  background: var(--theme-surface-raised) !important;
  color: var(--theme-text-secondary) !important;
}


/* MENSAGENS — topbar mobile no dark */
@media (max-width: 980px) {
  html[data-theme="dark"] body:has(.u-message-page) .u-topbar {
    background: rgba(18,22,30,.96) !important;
    border-bottom-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"] body:has(.u-message-page) #u-nav-open,
  html[data-theme="dark"] body:has(.u-message-page) .u-global-back {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"] body:has(.u-message-page) #u-nav-open svg,
  html[data-theme="dark"] body:has(.u-message-page) .u-global-back svg {
    color: var(--theme-text) !important;
    stroke: currentColor !important;
  }

  html[data-theme="dark"] body:has(.u-message-page) .u-page-title,
  html[data-theme="dark"] body:has(.u-message-page) .u-page-title::after {
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] body:has(.u-message-page) .u-page-sub,
  html[data-theme="dark"] body:has(.u-message-page) .u-page-sub::after {
    color: var(--theme-text-secondary) !important;
  }

  html[data-theme="dark"] body:has(.u-message-page) .u-user-trigger {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface) !important;
  }
}


/* ANÁLISE DOCUMENTAL — topbar mobile no dark */
@media (max-width: 980px) {
  html[data-theme="dark"] body:has(.dix-page) .u-topbar {
    background: rgba(18,22,30,.96) !important;
    border-bottom-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"] body:has(.dix-page) #u-nav-open,
  html[data-theme="dark"] body:has(.dix-page) .u-global-back {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"] body:has(.dix-page) #u-nav-open svg,
  html[data-theme="dark"] body:has(.dix-page) .u-global-back svg {
    color: var(--theme-text) !important;
    stroke: currentColor !important;
  }

  html[data-theme="dark"] body:has(.dix-page) .u-page-title {
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] body:has(.dix-page) .u-page-sub {
    color: var(--theme-text-secondary) !important;
  }

  html[data-theme="dark"] body:has(.dix-page) .u-user-trigger {
    border-color: var(--theme-border) !important;
    background: var(--theme-surface) !important;
  }
}

/* NEGOCIAÇÕES MOBILE — a referência clara continua intacta; dark recebe equivalente próprio. */
@media (max-width: 767px) {
  html[data-theme="dark"] body:has(.u-vx) {
    background: var(--theme-page) !important;
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] body:has(.u-vx) .u-topbar {
    background: var(--theme-page) !important;
    border-bottom-color: var(--theme-border) !important;
  }

  html[data-theme="dark"] body:has(.u-vx) #u-nav-open,
  html[data-theme="dark"] body:has(.u-vx) .u-global-back {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] body:has(.u-vx) .u-page-title::after,
  html[data-theme="dark"] .u-vx-kpi-label,
  html[data-theme="dark"] .u-vx-kpi-value {
    color: var(--theme-text) !important;
  }

  html[data-theme="dark"] body:has(.u-vx) .u-page-sub::after,
  html[data-theme="dark"] .u-vx-ref-copy,
  html[data-theme="dark"] .u-vx-ref-copy span,
  html[data-theme="dark"] .u-vx-kpi-top + div,
  html[data-theme="dark"] .u-vx-kpi-sub,
  html[data-theme="dark"] .u-vx-kpi-trend > span:last-child,
  html[data-theme="dark"] .u-vx-kpi-main + div {
    color: var(--theme-text-secondary) !important;
  }

  html[data-theme="dark"] .u-vx-kpi-wrap > div:first-child,
  html[data-theme="dark"] .u-vx-kpi,
  html[data-theme="dark"] .u-vx-kpi-trend > span:first-child strong {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
  }

  html[data-theme="dark"] .u-vx-ref {
    background: rgba(245,130,31,.07) !important;
    border-color: rgba(245,130,31,.18) !important;
  }

  html[data-theme="dark"] .u-vx-kpi-main + div,
  html[data-theme="dark"] .u-vx-kpi-foot {
    border-color: var(--theme-border) !important;
  }
}

/* Estados globais: mesmo significado visual nos dois temas. */
html[data-theme="dark"] .u-shell :where([disabled],[aria-disabled="true"]) {
  color: var(--theme-disabled);
}

html[data-theme="dark"] .u-shell :where(.u-btn-ghost,.btn-ghost,.u-icon-btn) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .u-shell :where(.u-btn-ghost,.btn-ghost,.u-icon-btn):hover {
  background: var(--theme-hover);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] * {
    transition-duration: .01ms !important;
  }
}


/* DARK PREMIUM 2026-10-03 — camada final global, isolada do modo claro. */
html[data-theme="dark"] body,
html[data-theme="dark"] .u-shell {
  background: linear-gradient(180deg, var(--theme-page-top) 0%, var(--theme-page) 45%, var(--theme-page-deep) 100%) !important;
  color: var(--theme-text);
}

html[data-theme="dark"] .u-shell :where(
  .u-card,.u-kpi,.u-liq-card,.u-painel,.u-empty,.u-ops-card,.u-ops-grupo,.u-rel-card,.u-kcard,
  .u-stage-panel,.u-hist,.u-sheet,.u-tabs,.u-fila-card,.u-cmd,.u-notif-pop,.u-bloco,.u-folha,
  .u-cal,.u-search-dd,.panel,.u-segmented,.u-money,.u-extra,.u-transfer,.drv-items-card,
  .u-pendencias-sheet,.wa-sheet,.wa-confirm-wrap
) {
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .u-shell :where(
  .u-card,.u-kpi,.u-liq-card,.u-painel,.u-empty,.u-ops-card,.u-rel-card,.u-kcard,
  .u-stage-panel,.u-hist,.u-sheet,.u-tabs,.u-fila-card,.u-cmd,.u-notif-pop,.u-bloco,.u-folha,
  .u-cal,.u-search-dd,.panel,.u-segmented,.u-money,.u-extra,.u-transfer
) {
  background-color: var(--theme-surface) !important;
  box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .u-shell :where(
  .input,.select,.textarea,.u-input,input[type="text"],input[type="search"],input[type="email"],
  input[type="tel"],input[type="number"],input[type="date"],select,textarea
) {
  background-color: var(--theme-control);
  color: var(--theme-text);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .u-sidebar,
html[data-theme="dark"] .u-topbar,
html[data-theme="dark"] .u-bottom-desktop {
  background-color: rgba(11,13,16,.94) !important;
  border-color: var(--theme-border) !important;
  -webkit-backdrop-filter: blur(18px) saturate(116%);
  backdrop-filter: blur(18px) saturate(116%);
}

html[data-theme="dark"] .u-imv-filter-sheet,
html[data-theme="dark"] .u-pendencias-sheet,
html[data-theme="dark"] .wa-sheet,
html[data-theme="dark"] .wa-confirm-wrap,
html[data-theme="dark"] .u-ios-filter-popover,
html[data-theme="dark"] .drv-status-menu-panel {
  background: rgba(23,25,30,.98) !important;
  border-color: var(--theme-border) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
}

html[data-theme="dark"] .u-pendencias-item,
html[data-theme="dark"] .u-pendencias-ciente,
html[data-theme="dark"] .u-pendencias-all {
  background: var(--theme-surface-raised) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .drv-search-wrap .input,
html[data-theme="dark"] .drv-items-card {
  background: rgba(26,28,33,.90) !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .drv-preview-modal,
html[data-theme="dark"] .drv-preview-header {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .drv-preview-body,
html[data-theme="dark"] .drv-preview-body > .u-drv-preview {
  background: var(--theme-page) !important;
}


/* ==============================================================
   UNISOL 360° — EXECUTIVE LIGHT & EXECUTIVE DARK · 09/10/2026
   Paletas oficiais aprovadas. Atributo data-theme é definido a
   partir da preferência persistida do usuário por App\Support\Theme.
   Compatibilidade com a API existente de variáveis CSS.
   ============================================================== */
:root, html[data-theme="light"] {
  color-scheme:light;
  --brand-page:#F7F5F2;--brand-card:#FFFFFF;--brand-soft:#EEEAE4;
  --brand-accent:#9B572F;--brand-copper:#C57943;--brand-copper-deep:#9B572F;
  --brand-ink:#20272E;--brand-muted:#5D6670;--brand-line:#DDD7D0;
  --brand-border:1px solid var(--brand-line);--brand-on-accent:#FFFFFF;
  --brand-focus:0 0 0 3px rgba(155,87,47,.22);
  --bg:var(--brand-page);--white:var(--brand-card);
  --ink:var(--brand-ink);--graphite:var(--brand-ink);--graphite-2:var(--brand-ink);
  --muted:var(--brand-muted);--line:var(--brand-line);--line-2:var(--brand-soft);
  --orange:var(--brand-accent);--orange-dk:var(--brand-accent);
  --orange-fill:var(--brand-accent);--orange-fill-hover:var(--brand-copper-deep);
  --orange-lt:rgba(155,87,47,.10);--blue:var(--brand-accent);
  --blue-lt:rgba(155,87,47,.10);--amber:var(--brand-copper);
  --surface:var(--brand-card);--surface-2:var(--brand-soft);
  --glass:var(--brand-card);--glass-2:var(--brand-soft);
  --glass-border:var(--brand-line);--glass-hover:var(--brand-soft);
  --glass-active:linear-gradient(90deg,rgba(155,87,47,.10),rgba(155,87,47,.025));
  --sidebar-glass:var(--brand-ink);--topbar-glass:var(--brand-card);
  --focus-ring:var(--brand-focus);
  --text-primary:var(--brand-ink);--text-secondary:var(--brand-muted);
  --text-emphasis:var(--brand-ink);--text-placeholder:var(--brand-muted);
  --text-disabled:var(--brand-muted);--icon-muted:var(--brand-muted);
  --border-default:var(--brand-line);--border-subtle:var(--brand-soft);
  --theme-page:var(--brand-page);--theme-surface:var(--brand-card);
  --theme-surface-raised:var(--brand-card);--theme-surface-muted:var(--brand-soft);
  --theme-control:var(--brand-card);--theme-text:var(--brand-ink);
  --theme-text-secondary:var(--brand-muted);--theme-text-muted:var(--brand-muted);
  --theme-placeholder:var(--brand-muted);--theme-disabled:var(--brand-muted);
  --theme-border:var(--brand-line);--theme-border-strong:var(--brand-line);
  --theme-hover:var(--brand-soft);--theme-active:rgba(155,87,47,.10);
  --theme-shadow:0 3px 18px rgba(32,39,46,.045);
  --u-ink:var(--brand-ink);--u-muted:var(--brand-muted);
  --u-orange:var(--brand-accent);--u-orange-dark:var(--brand-accent);
  --u-surface:var(--brand-card);--u-surface-soft:var(--brand-soft);
  --u-focus:var(--brand-focus);
}
html[data-theme="dark"] {
  color-scheme:dark;
  --brand-page:#09111A;--brand-card:#1B2229;--brand-soft:#2A3037;
  --brand-accent:#C57943;--brand-copper:#C57943;--brand-copper-deep:#9B572F;
  --brand-ink:#F5F3F0;--brand-muted:#A5ADB5;
  --brand-line:rgba(165,173,181,.12);
  --brand-border:1px solid var(--brand-line);--brand-on-accent:#FFFFFF;
  --brand-focus:0 0 0 3px rgba(197,121,67,.25);
  --bg:var(--brand-page);--white:var(--brand-card);
  --ink:var(--brand-ink);--graphite:var(--brand-card);--graphite-2:var(--brand-card);
  --muted:var(--brand-muted);--line:var(--brand-line);--line-2:rgba(165,173,181,.12);
  --orange:var(--brand-accent);--orange-dk:var(--brand-accent);
  --orange-fill:var(--brand-accent);--orange-fill-hover:var(--brand-copper-deep);
  --orange-lt:rgba(197,121,67,.12);--blue:var(--brand-accent);
  --blue-lt:rgba(197,121,67,.12);--amber:var(--brand-copper-deep);
  --surface:var(--brand-card);--surface-2:var(--brand-soft);
  --glass:var(--brand-card);--glass-2:var(--brand-soft);
  --glass-border:var(--brand-line);--glass-hover:rgba(165,173,181,.08);
  --glass-active:linear-gradient(90deg,rgba(197,121,67,.14),rgba(197,121,67,.025));
  --sidebar-glass:var(--brand-page);--topbar-glass:var(--brand-card);
  --focus-ring:var(--brand-focus);
  --text-primary:var(--brand-ink);--text-secondary:var(--brand-muted);
  --text-emphasis:var(--brand-ink);--text-placeholder:var(--brand-muted);
  --text-disabled:var(--brand-muted);--icon-muted:var(--brand-muted);
  --border-default:var(--brand-line);--border-subtle:rgba(165,173,181,.12);
  --theme-page:var(--brand-page);--theme-page-top:#101419;
  --theme-page-deep:var(--brand-page);--theme-surface:var(--brand-card);
  --theme-surface-raised:var(--brand-soft);--theme-surface-muted:var(--brand-soft);
  --theme-control:var(--brand-soft);--theme-text:var(--brand-ink);
  --theme-text-secondary:var(--brand-muted);--theme-text-muted:var(--brand-muted);
  --theme-placeholder:var(--brand-muted);--theme-disabled:var(--brand-muted);
  --theme-border:var(--brand-line);--theme-border-strong:var(--brand-line);
  --theme-hover:rgba(165,173,181,.08);--theme-active:rgba(197,121,67,.12);
  --theme-shadow:0 6px 22px rgba(0,0,0,.16);
  --u-ink:var(--brand-ink);--u-muted:var(--brand-muted);
  --u-orange:var(--brand-accent);--u-orange-dark:var(--brand-accent);
  --u-surface:var(--brand-card);--u-surface-soft:var(--brand-soft);
  --u-focus:var(--brand-focus);
}
/* Plano de fundo e superfície do shell, sem fundos azulados ou fotografia. */
html[data-theme] .u-shell,
html[data-theme] .u-main,
html[data-theme] .u-content,
html[data-theme] .login-shell {background-color:var(--brand-page);}
html[data-theme] .u-shell {background-image:none!important;}
html[data-theme] .u-topbar,
html[data-theme] .u-user-dropdown {background:var(--brand-card)!important;border-color:var(--brand-line)!important;color:var(--brand-ink);}
html[data-theme] .u-shell :where(.u-card,.u-painel,.u-kpi,.u-liq-card,.u-ops-card,.u-ops-grupo,.u-sheet,.u-empty,.u-rel-card,.u-kcard,.u-stage-panel,.u-hist,.u-tabs,.u-bloco,.u-folha,.u-cal,.u-cmd,.u-notif-pop,.panel,.u-segmented,.u-money,.u-extra,.u-transfer){
  background:var(--brand-card)!important;border-color:var(--brand-line)!important;color:var(--brand-ink);
  box-shadow:var(--theme-shadow);backdrop-filter:none;-webkit-backdrop-filter:none;
}
html[data-theme] .u-shell :where(.input,.select,.textarea,.u-input,select,textarea) {
  background-color:var(--theme-control);color:var(--brand-ink);border-color:var(--brand-line);
}
html[data-theme] .u-shell :where(.input,.select,.textarea,.u-input,select,textarea):focus-visible{
  border-color:var(--brand-accent);box-shadow:var(--brand-focus);
}
html[data-theme] .u-shell :where(button,a,[role="button"]):focus-visible{
  outline-color:var(--brand-accent);
}
/* Em todos os módulos o cobre (e não azul/roxo) indica a mesma função. */
html[data-theme] .u-shell :where(.btn-primary,.u-btn-primary,.u-btn-primario,.u-switch input:checked + .u-switch-track){
  background:var(--brand-accent)!important;border-color:var(--brand-accent)!important;color:var(--brand-on-accent)!important;
}
html[data-theme] .u-shell :where(.u-page-title,.u-section-title,.u-kpi-value,.u-liq-value){
  color:var(--brand-ink);
}
html[data-theme] .u-shell :where(.u-page-sub,.u-kpi-label,.u-kpi-hint,.u-liq-label){
  color:var(--brand-muted);
}
/* Desktop e mobile: sidebar grafite em ambas as versões; menu inferior harmônico. */
html[data-theme] .u-sidebar {background:#20272E!important;box-shadow:none!important;border-color:var(--brand-line)!important;}
html[data-theme="dark"] .u-sidebar {background:#101419!important;}
html[data-theme] .u-shell > nav.u-bottom,
html[data-theme] .u-shell > nav.u-bottom-desktop {background:var(--brand-card)!important;border-color:var(--brand-line)!important;}
html[data-theme] .u-shell > nav.u-bottom .u-bottom-item.u-bottom-ativo,
html[data-theme] .u-shell > nav.u-bottom .u-bottom-item.u-bottom-ativo .u-bottom-ico,
html[data-theme] .u-shell > nav.u-bottom-desktop .u-bottom-item.u-bottom-ativo {
  color:var(--brand-accent)!important;stroke:currentColor!important;
}
/* Home executiva: a superfície acompanha o modo de cada usuário. */
html[data-theme] body .u-main-360 .u-weather-shell .u-approved-visual-zone{
  background:var(--brand-page)!important;background-image:none!important;
}
html[data-theme] body .u-main-360 .u-weather-shell .u-home-notice{
  background:var(--brand-card)!important;border-color:var(--brand-line)!important;
  color:var(--brand-ink)!important;box-shadow:var(--theme-shadow)!important;
}
html[data-theme] body .u-main-360 .u-weather-shell .u-home-notice-icon{
  color:var(--brand-accent)!important;background:var(--brand-soft)!important;
}
/* Análise geral: títulos de Vendas, Locação e Administração sempre cobre.
   Legendas do gráfico distinguem frentes por tons aprovados, sem azul ou roxo. */
html[data-theme] .u-overview.u-executive{
  --ov-bg:var(--brand-page);--ov-panel:var(--brand-card);
  --ov-card:var(--brand-card);--ov-card-2:var(--brand-soft);
  --ov-line:var(--brand-line);--ov-text:var(--brand-ink);
  --ov-muted:var(--brand-muted);--ov-orange:var(--brand-copper);
  --ov-blue:var(--brand-copper-deep);--ov-purple:var(--brand-muted);
}
html[data-theme] .u-overview.u-executive .u-overview-result,
html[data-theme] .u-overview.u-executive .u-exec-hero,
html[data-theme] .u-overview.u-executive .u-exec-front,
html[data-theme] .u-overview.u-executive .u-exec-metric{
  background:var(--brand-card)!important;border-color:var(--brand-line)!important;
  box-shadow:var(--theme-shadow)!important;color:var(--brand-ink);
}
html[data-theme] .u-overview.u-executive .u-exec-front:is(.is-rentals,.is-administration) .u-exec-front-top{
  color:var(--brand-accent)!important;
}
html[data-theme] .u-overview.u-executive .u-exec-progress>span{
  background:var(--brand-accent)!important;
}
html[data-theme] .u-overview.u-executive .u-exec-metric-head svg{
  color:var(--brand-accent)!important;
}
/* Preferência em todo dispositivo e contraste de campos nativos. */
html[data-theme] {accent-color:var(--brand-accent);}
html[data-theme] :where(input,select,textarea) {color-scheme:inherit;}
@media (max-width:820px){
  html[data-theme] .u-shell {overflow-x:clip;}
  html[data-theme] .u-shell .u-content {max-width:100vw;min-width:0;}
}
