/* MapaOn 4.0.23 — tema claro/escuro global com preferência manual.
 * O tema é aplicado em <html data-theme="dark"> e usa !important porque
 * este arquivo é carregado pelo bootstrap antes do CSS-base legado.
 */
html{color-scheme:light}

/* Modo claro explícito. A escolha manual deve vencer o tema do sistema e
 * qualquer estilo escuro que tenha ficado aplicado na tela do mapa. */
html[data-theme="light"]{
    color-scheme:light!important;
    --bg:#f3f7fb;
    --panel:#ffffff;
    --text:#10213a;
    --muted:#64748b;
    --border:#dce5ef;
    --primary:#0d5bd7;
    --primary-dark:#0849af;
    --success:#16a765;
    --warning:#e8a117;
    --danger:#d93b4b;
    --shadow:0 12px 28px rgba(15,23,42,.08);
}
html[data-theme="light"] body{background:#f3f7fb!important;color:#10213a!important}
html[data-theme="light"] .page,
html[data-theme="light"] .page-narrow{color:#10213a!important}
html[data-theme="light"] .card,
html[data-theme="light"] .metric,
html[data-theme="light"] .vehicle-card,
html[data-theme="light"] .setup-step,
html[data-theme="light"] .vehicle-alias-row,
html[data-theme="light"] .byd-vehicle,
html[data-theme="light"] .byd-diag{background:#fff!important;border-color:#dce5ef!important;color:#10213a!important}
html[data-theme="light"] .vehicle-card.premium-vehicle-card{background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%)!important;color:#10213a!important;border-color:#dce5ef!important;box-shadow:0 12px 30px rgba(15,23,42,.08),inset 0 3px 0 var(--vehicle-card-color,#0d5bd7)!important}
html[data-theme="light"] .premium-status-bar,
html[data-theme="light"] .premium-battery-panel,
html[data-theme="light"] .premium-info-tile,
html[data-theme="light"] .premium-maintenance-panel{background:#fff!important;border-color:#dce5ef!important;color:#10213a!important}
html[data-theme="light"] .premium-online-block{background:linear-gradient(90deg,#eafaf2 0%,#f6fffa 100%)!important}
html[data-theme="light"] .premium-online-block.is-offline{background:#f6f8fb!important}
html[data-theme="light"] .premium-car-title h3,
html[data-theme="light"] .premium-status-item strong,
html[data-theme="light"] .premium-online-block b,
html[data-theme="light"] .premium-battery-head strong,
html[data-theme="light"] .premium-battery-detail strong,
html[data-theme="light"] .premium-tile-copy strong,
html[data-theme="light"] .premium-maintenance-row strong{color:#10213a!important}
html[data-theme="light"] .premium-car-title .vehicle-registration-line,
html[data-theme="light"] .premium-status-item small,
html[data-theme="light"] .premium-online-block span,
html[data-theme="light"] .premium-battery-head small,
html[data-theme="light"] .premium-battery-detail small,
html[data-theme="light"] .premium-tile-copy span,
html[data-theme="light"] .premium-maintenance-row span{color:#64748b!important}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea{background:#fff!important;color:#10213a!important;border-color:#cdd8e5!important}
html[data-theme="light"] .notification-panel,
html[data-theme="light"] .premium-user-popover{background:#fff!important;border-color:#dce5ef!important;color:#10213a!important}
html[data-theme="light"] .notification-item{background:#fff!important;border-color:#e3eaf2!important;color:#10213a!important}
html[data-theme="light"] #map{background:#eaf1f7!important;border-color:#dce5ef!important}
html[data-theme="light"] .map-panel:fullscreen,
html[data-theme="light"] .map-panel:-webkit-full-screen,
html[data-theme="light"] .map-panel.map-fullscreen-fallback{background:#f3f7fb!important}
html[data-theme="dark"]{
    color-scheme:dark;
    --bg:#07111f;
    --panel:#0d1829;
    --text:#e7eef8;
    --muted:#94a6bd;
    --border:#26364d;
    --primary:#2f80ff;
    --primary-dark:#1d63d9;
    --success:#36d27d;
    --warning:#f5b43c;
    --danger:#ff6b78;
    --shadow:0 14px 34px rgba(0,0,0,.34);
}
html[data-theme="dark"] body{background:#07111f!important;color:#e7eef8!important}
html[data-theme="dark"] a{color:#6aa7ff}
html[data-theme="dark"] .page,
html[data-theme="dark"] .page-narrow{color:#e7eef8}
html[data-theme="dark"] .card,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .vehicle-card,
html[data-theme="dark"] .setup-step,
html[data-theme="dark"] .vehicle-alias-row,
html[data-theme="dark"] .byd-vehicle,
html[data-theme="dark"] .byd-diag{background:#0d1829!important;border-color:#26364d!important;color:#e7eef8!important;box-shadow:0 12px 28px rgba(0,0,0,.25)!important}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] strong{color:#f2f7ff}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .help,
html[data-theme="dark"] th{color:#94a6bd!important}
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] .report-table th,
html[data-theme="dark"] .report-table td{border-color:#26364d!important}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#101d31!important;color:#eef5ff!important;border-color:#34465f!important}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#73859d!important}
html[data-theme="dark"] .btn-secondary{background:#17263a!important;color:#d9e7f7!important;border-color:#30435c!important}
html[data-theme="dark"] .btn-secondary:hover{background:#20334b!important}
html[data-theme="dark"] .btn-danger{background:#3b1b25!important;color:#ff9ca5!important}
html[data-theme="dark"] .status-pill{background:#17263a!important;color:#b8c8da!important}
html[data-theme="dark"] .status-pill.online{background:#0f2d23!important;color:#54dd93!important}
html[data-theme="dark"] .status-pill.offline{background:#351c25!important;color:#ff8f9a!important}
html[data-theme="dark"] .status-pill.connecting{background:#352a14!important;color:#f8c866!important}
html[data-theme="dark"] .alert-success{background:#0c2a20!important;border-color:#245c48!important;color:#7ee4b4!important}
html[data-theme="dark"] .alert-warning{background:#332814!important;border-color:#635024!important;color:#f7cf78!important}
html[data-theme="dark"] .alert-danger{background:#321922!important;border-color:#63303d!important;color:#ff9ba5!important}
html[data-theme="dark"] .alert-info{background:#102640!important;border-color:#31547a!important;color:#9ec9ff!important}
html[data-theme="dark"] .payecto-token-box,
html[data-theme="dark"] .code-box{background:#08111f!important;border-color:#2d4059!important;color:#dbeafe!important}
html[data-theme="dark"] #map{border-color:#26364d!important;background:#0b1422!important}
html[data-theme="dark"] .map-panel:fullscreen,
html[data-theme="dark"] .map-panel:-webkit-full-screen,
html[data-theme="dark"] .map-panel.map-fullscreen-fallback{background:#07111f!important}
html[data-theme="dark"] .map-toolbar,
html[data-theme="dark"] .map-style-control{color:#dbe7f5!important}
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .premium-user-popover{background:#0b1729!important;border-color:#29405f!important;color:#e8f0fa!important;box-shadow:0 20px 50px rgba(0,0,0,.42)!important}
html[data-theme="dark"] .notification-item{border-color:#263a55!important;background:#101e32!important;color:#e8f0fa!important}
html[data-theme="dark"] .notification-empty{color:#94a6bd!important}

/* Card premium: mantém a hierarquia visual no tema escuro. */
html[data-theme="dark"] .vehicle-card.premium-vehicle-card{background:linear-gradient(180deg,#0d192b 0%,#091522 100%)!important;color:#e8f0fa!important;border-color:#2a3b53!important;box-shadow:0 12px 30px rgba(0,0,0,.32),inset 0 3px 0 var(--vehicle-card-color,#2f80ff)!important}
html[data-theme="dark"] .premium-car-title h3,
html[data-theme="dark"] .premium-status-item strong,
html[data-theme="dark"] .premium-online-block b,
html[data-theme="dark"] .premium-battery-head strong,
html[data-theme="dark"] .premium-battery-detail strong,
html[data-theme="dark"] .premium-tile-copy strong,
html[data-theme="dark"] .premium-maintenance-row strong{color:#f4f8ff!important}
html[data-theme="dark"] .premium-car-title .vehicle-registration-line,
html[data-theme="dark"] .premium-status-item small,
html[data-theme="dark"] .premium-online-block span,
html[data-theme="dark"] .premium-battery-head small,
html[data-theme="dark"] .premium-battery-detail small,
html[data-theme="dark"] .premium-tile-copy span,
html[data-theme="dark"] .premium-maintenance-row span{color:#9fb0c5!important}
html[data-theme="dark"] .premium-status-bar,
html[data-theme="dark"] .premium-battery-panel,
html[data-theme="dark"] .premium-info-tile,
html[data-theme="dark"] .premium-maintenance-panel{background:#101d30!important;border-color:#293a52!important;box-shadow:none!important}
html[data-theme="dark"] .premium-status-bar>div+div,
html[data-theme="dark"] .premium-battery-details,
html[data-theme="dark"] .premium-maintenance-row{border-color:#293a52!important}
html[data-theme="dark"] .premium-online-block{background:linear-gradient(90deg,#0c2a22 0%,#10251f 100%)!important}
html[data-theme="dark"] .premium-online-block.is-offline{background:#111d2c!important}
html[data-theme="dark"] .premium-battery-track,
html[data-theme="dark"] .premium-maintenance-track{background:#25344a!important}
html[data-theme="dark"] .premium-map-action{background:#0f1d31!important;border-color:#3779df!important;color:#7fb2ff!important}
html[data-theme="dark"] .premium-map-action:hover{background:#142846!important}
html[data-theme="dark"] .premium-warning-tile{background:#2f171b!important;border-color:#6a2c34!important}

/* Login e instalação também acompanham o tema salvo do navegador. */
html[data-theme="dark"] .login-card{background:#0d1829!important;border-color:#26364d!important}
html[data-theme="dark"] .logo-large{box-shadow:0 10px 24px rgba(47,128,255,.25)}

/* Controle do tema no cabeçalho premium. */
.premium-theme-button{width:40px;height:40px;min-width:40px;border:1px solid rgba(150,181,226,.20);border-radius:13px;display:grid;place-items:center;background:rgba(3,18,44,.20);color:#e7eef9;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.035);transition:background .18s ease,border-color .18s ease,transform .18s ease}
.premium-theme-button:hover{background:rgba(24,68,126,.36);border-color:rgba(118,170,244,.38)}
.premium-theme-button:active{transform:scale(.97)}
.premium-theme-button svg{width:18px!important;height:18px!important}
.premium-theme-button .theme-icon-sun{display:none}
html[data-theme="dark"] .premium-theme-button .theme-icon-moon{display:none}
html[data-theme="dark"] .premium-theme-button .theme-icon-sun{display:block}
@media(max-width:720px){.premium-theme-button{width:36px;height:36px;min-width:36px;border-radius:11px}}
