/* ══════════════════════════════════════════════════════════════════
   MAQLOGREBOQUE · TEMA CLARO  (v1.3.0)
   Substitui o tema escuro. Carregado por ÚLTIMO em todas as páginas,
   depois de style.css e admin.css. Preocupação central: NENHUM texto
   pode ficar da mesma cor do fundo — todos os pares testados com
   contraste ≥ 4.5:1 (WCAG AA).
   ══════════════════════════════════════════════════════════════════ */

:root{
  --mq-bg:          #f4f6fb;   /* cinza-azulado bem claro */
  --mq-bg-2        : #eef2f8;
  --mq-surface:     #ffffff;
  --mq-surface-2:   #f8fafc;
  --mq-surface-3:   #eef2f7;
  --mq-text:        #0f172a;   /* 16.9:1 sobre branco */
  --mq-text-2:      #1e293b;
  --mq-muted:       #475569;   /* 7.5:1 sobre branco */
  --mq-muted-2:     #64748b;   /* 5.0:1 sobre branco */
  --mq-border:      #cbd5e1;
  --mq-border-soft: #e2e8f0;
  --mq-accent:      #e11d48;   /* 4.6:1 sobre branco */
  --mq-accent-2:    #be123c;   /* 5.7:1 — texto de link no hover */
  --mq-accent-soft: #ffe4e6;
  --mq-ok:          #047857;
  --mq-warn:        #92400e;
  --mq-info:        #0369a1;
  color-scheme: light;
}

/* ── base: fundo claro e texto escuro ─────────────────────────── */
html{ background:#eef2f8 !important; }
body{
  background: var(--mq-bg) !important;
  color: var(--mq-text) !important;
}
body, p, li, dd, dt, span, div, td, th, label, legend, address, blockquote, small, em{
  color: var(--mq-text);
}
h1,h2,h3,h4,h5,h6,strong,b{ color: var(--mq-text-2); }

/* as camadas decorativas do tema escuro somem no claro */
.bg-wrap{ display:none !important; }
.bg-gradient, .bg-orb, .bg-orb-1, .bg-orb-2, .bg-grid{ display:none !important; }

/* ── links sempre visíveis ────────────────────────────────────── */
a{ color: var(--mq-accent); }
a:hover, a:focus{ color: var(--mq-accent-2); }
a.btn-primary, a.btn-ghost, .btn-primary, .btn-ghost,
.topbar-brand, .adm-brand, .atalho, .adm-nav-i, .app-tab, .btn-sair{
  text-decoration:none !important;
}
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible{
  outline:2px solid var(--mq-accent); outline-offset:2px;
}

/* ── topo do login / hub ──────────────────────────────────────── */
.topbar{ border-bottom:1px solid var(--mq-border-soft); padding-bottom:14px; }
.brand-name{ color:#0f172a !important; }
.brand-name span{ color: var(--mq-accent) !important; }
.brand-sub{ color: var(--mq-muted-2) !important; }
.topbar-badge{
  color:#334155 !important; background:#ffffff !important;
  border:1px solid var(--mq-border) !important;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.badge-dot{ background:#10b981 !important; box-shadow:0 0 0 3px rgba(16,185,129,.18) !important; }
.brand-mark, .card-icon{
  background:linear-gradient(135deg,#e11d48,#fb7185) !important;
  color:#fff !important; box-shadow:0 8px 20px rgba(225,29,72,.28) !important;
}

/* ── login ────────────────────────────────────────────────────── */
.login-eyebrow{
  color:#9f1239 !important; background:#ffe4e6 !important;
  border:1px solid #fecdd3 !important;
}
.login-title{ color:#0f172a !important; }
.login-title span{ color: var(--mq-accent) !important; }
.login-sub{ color: var(--mq-muted) !important; }
.login-card{
  background:#ffffff !important;
  border:1px solid var(--mq-border-soft) !important;
  box-shadow:0 18px 45px rgba(15,23,42,.10) !important;
}
.card-stripe{ background:linear-gradient(90deg,#e11d48,#fb7185) !important; }
.field-box{
  background:#f8fafc !important;
  border:1px solid var(--mq-border) !important;
}
.field-box:focus-within{
  border-color: var(--mq-accent) !important;
  box-shadow:0 0 0 3px rgba(225,29,72,.14) !important;
  background:#ffffff !important;
}
.field-box input,
.field-box input:focus,
.field-box input:not([type="checkbox"]){
  border:0 !important; background:transparent !important;
  color:#0f172a !important; box-shadow:none !important;
  -webkit-text-fill-color:#0f172a;
}
.field-box > i, .toggle-pass{ color:#94a3b8 !important; }
.login-foot, .login-note, .page-footer{ color: var(--mq-muted-2) !important; }
.page-footer{ border-top:1px solid var(--mq-border-soft); }
.page-footer a, .voltar{ color: var(--mq-muted) !important; }
.page-footer a:hover{ color: var(--mq-accent) !important; }

/* ── CAMPOS: a armadilha clássica (texto branco no fundo branco) ─ */
input, select, textarea, button, optgroup{
  font-family:inherit;
  color:#0f172a !important;
  background-color:#ffffff;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select, textarea{
  background-color:#ffffff !important;
  border:1px solid var(--mq-border) !important;
  color:#0f172a !important;
  border-radius:10px;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--mq-accent) !important;
  box-shadow:0 0 0 3px rgba(225,29,72,.13) !important;
  color:#0f172a !important;
  background-color:#ffffff !important;
}
::placeholder{ color:#94a3b8 !important; opacity:1 !important; }
::-webkit-input-placeholder{ color:#94a3b8 !important; opacity:1 !important; }

/* options: no Chrome/Android precisam de fundo E cor explícitos */
select option, select optgroup, datalist option{
  background-color:#ffffff !important; color:#0f172a !important;
}
select option:checked{ background-color:#ffe4e6 !important; color:#9f1239 !important; }

/* autofill: o amarelo/azul do navegador com texto branco */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill{
  -webkit-text-fill-color:#0f172a !important;
  -webkit-box-shadow:0 0 0 1000px #f1f5f9 inset !important;
  box-shadow:0 0 0 1000px #f1f5f9 inset !important;
  caret-color:#0f172a;
  transition:background-color 9999s ease-out 0s;
}
input:disabled, select:disabled, textarea:disabled, button:disabled,
.fld input:disabled, .fld select:disabled{
  background-color:#eef2f7 !important;
  color:#64748b !important;
  -webkit-text-fill-color:#64748b;
  cursor:not-allowed; opacity:1;
}
label, .fld > span, .chk, legend{ color:#475569 !important; }
.fld > span{ color:#475569 !important; }
input[type="checkbox"], input[type="radio"]{ accent-color:#e11d48; }
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"]{ color-scheme:light; }
::-webkit-calendar-picker-indicator{ filter:none; cursor:pointer; opacity:.65; }

/* botões nativos sem classe */
input[type="submit"], input[type="button"], input[type="reset"], button:not([class]){
  background:linear-gradient(135deg,#e11d48,#fb7185) !important;
  color:#fff !important; border:0; border-radius:11px;
  padding:11px 16px; font-weight:700; cursor:pointer;
}

/* ── cabeçalho e menu da administração ───────────────────────── */
.adm-top{
  background:#ffffff !important;
  border-bottom:1px solid var(--mq-border-soft) !important;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
}
.adm-brand-t strong{ color:#0f172a !important; }
.adm-brand-t strong span{ color: var(--mq-accent) !important; }
.adm-brand-t small{ color: var(--mq-muted-2) !important; }
.adm-chip{
  background:#f1f5f9 !important; color:#334155 !important;
  border:1px solid var(--mq-border) !important;
}
.adm-out{ color:#475569 !important; background:#f1f5f9 !important; border:1px solid var(--mq-border) !important; }
.adm-out:hover{ color:#be123c !important; border-color:#fda4af !important; background:#fff1f2 !important; }
.adm-nav{
  background:#ffffff !important;
  border-bottom:1px solid var(--mq-border-soft) !important;
}
.adm-nav-i{ color:#475569 !important; }
.adm-nav-i i{ color:#64748b !important; }
.adm-nav-i:hover{ background:#f1f5f9 !important; color:#0f172a !important; }
.adm-nav-i.on{
  background:#ffe4e6 !important; color:#9f1239 !important;
  border-color:#fecdd3 !important;
}
.adm-nav-i.on i{ color:#e11d48 !important; }

/* ── conteúdo e cartões ──────────────────────────────────────── */
.adm-main, .page, .hub, .dash{ color: var(--mq-text); }
.pg-title{ color:#0f172a !important; }
.pg-sub{ color: var(--mq-muted) !important; }
.card, .dash-card, .login-card, .kpi, .atalho, .carga-opt, .cep-box, .exp-row, .orc-line, .hub-card{
  background:#ffffff !important;
  border:1px solid var(--mq-border-soft) !important;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
  color: var(--mq-text) !important;
}
.card-h{ border-bottom:1px solid var(--mq-border-soft) !important; }
.card-h h2{ color:#0f172a !important; }
.card-h h2 i{ color: var(--mq-accent) !important; }
.kpi small{ color: var(--mq-muted) !important; }
.kpi strong{ color:#0f172a !important; }
.kpi em{ color: var(--mq-muted-2) !important; }
.vazio{ color:#64748b !important; }
.mut{ color: var(--mq-muted) !important; }
.hint{
  background:#eff6ff !important; border:1px solid #bfdbfe !important;
  color:#1e3a8a !important;
}
.hint i{ color:#1d4ed8 !important; }

/* cartões do hub (dashboard.php tem <style> inline) */
.kpis .kpi, .hub .kpi{ background:#ffffff !important; }
.hub-hi h1{ color:#0f172a !important; }
.hub-hi h1 span{ color: var(--mq-accent) !important; }
.hub-sub{ color: var(--mq-muted) !important; }
.sec-t{ color:#64748b !important; }
.atalho{
  background:#ffffff !important;
  border:1px solid var(--mq-border-soft) !important;
}
.atalho:hover{
  background:#fff1f2 !important;
  border-color:#fda4af !important;
  transform:translateY(-2px);
}
.atalho-t strong{ color:#0f172a !important; }
.atalho-t small{ color: var(--mq-muted) !important; }
.atalho-go{ color: var(--mq-accent) !important; }
.atalho-i{
  background:linear-gradient(135deg,#e11d48,#fb7185) !important;
  color:#fff !important;
}
.hub-foot{ color:#64748b !important; border-top:1px solid var(--mq-border-soft) !important; }
.hub-foot a{ color: var(--mq-muted) !important; }
.hub-foot a:hover{ color: var(--mq-accent) !important; }
.badge-user{ background:#f1f5f9 !important; color:#334155 !important; border:1px solid var(--mq-border) !important; }
.btn-sair{ background:#fff1f2 !important; color:#9f1239 !important; border:1px solid #fecdd3 !important; }
.btn-sair:hover{ background:#ffe4e6 !important; color:#881337 !important; }
.dash-h{ color:#0f172a !important; }
.dash-p{ color: var(--mq-muted) !important; }
.dash-item small{ color: var(--mq-muted) !important; }
.dash-item strong{ color:#0f172a !important; }

/* ── TABELAS ─────────────────────────────────────────────────── */
.tbl{ color:#0f172a !important; }
.tbl th, table th{
  background:#f1f5f9 !important;
  color:#334155 !important;
  border-bottom:1px solid var(--mq-border) !important;
}
.tbl td, table td{
  background:transparent !important;
  color:#0f172a !important;
  border-bottom:1px solid var(--mq-border-soft) !important;
}
.tbl tbody tr:nth-child(even) td{ background:#f8fafc !important; }
.tbl tbody tr:hover td{ background:#fff1f2 !important; color:#0f172a !important; }
.tbl a, table a{ color:#be123c !important; font-weight:700; }
.tbl tr.off{ opacity:.55; }
.tbl caption{ color: var(--mq-muted); }

/* ── botões com classe ──────────────────────────────────────── */
.btn-primary{
  background:linear-gradient(135deg,#e11d48,#fb7185) !important;
  color:#fff !important; border:0 !important;
  box-shadow:0 8px 18px rgba(225,29,72,.22) !important;
}
.btn-primary:hover{ filter:brightness(.95); }
.btn-ghost{
  background:#ffffff !important; color:#334155 !important;
  border:1px solid var(--mq-border) !important;
}
.btn-ghost:hover{ background:#f1f5f9 !important; color:#0f172a !important; }
.btn-mini{
  background:#f1f5f9 !important; color:#be123c !important;
  border:1px solid var(--mq-border) !important;
}
.btn-mini:hover{ background:#ffe4e6 !important; border-color:#fda4af !important; }
.btn-ico{
  background:#ffffff !important; color:#475569 !important;
  border:1px solid var(--mq-border) !important;
}
.btn-ico:hover{ color:#0f172a !important; background:#f1f5f9 !important; }
.btn-ico.danger:hover{ color:#b91c1c !important; border-color:#fca5a5 !important; background:#fee2e2 !important; }
.btn-wa{ background:#16a34a !important; color:#fff !important; }
.big-btn{ border:1px solid var(--mq-border) !important; background:#ffffff !important; color:#0f172a !important; }
.big-btn i{ color: var(--mq-accent) !important; }
.big-btn.verde{ background:#dcfce7 !important; color:#166534 !important; border-color:#86efac !important; }
.big-btn.azul{ background:#dbeafe !important; color:#1e40af !important; border-color:#93c5fd !important; }
.big-btn.cinza{ background:#f1f5f9 !important; color:#334155 !important; }
.cep-btn{ background:#fff1f2 !important; color:#9f1239 !important; border:1px solid #fecdd3 !important; }
.cep-res{ background:#f8fafc !important; color:#0f172a !important; border:1px solid var(--mq-border-soft) !important; }
.cep-res.err{ background:#fee2e2 !important; color:#991b1b !important; border-color:#fca5a5 !important; }

/* ── alertas e badges: fundo claro + texto escuro colorido ───── */
.alert{ color:#0f172a !important; }
.alert-ok{ background:#dcfce7 !important; border:1px solid #86efac !important; color:#166534 !important; }
.alert-erro{ background:#fee2e2 !important; border:1px solid #fca5a5 !important; color:#991b1b !important; }
.alert.aviso, .alert-warn{ background:#fef3c7 !important; border:1px solid #fcd34d !important; color:#92400e !important; }
.alert i{ color:inherit !important; }

.st{ color:#0f172a; }
.st-verde{  color:#166534 !important; background:#dcfce7 !important; border:1px solid #86efac !important; }
.st-amarelo{color:#92400e !important; background:#fef3c7 !important; border:1px solid #fcd34d !important; }
.st-azul{   color:#075985 !important; background:#e0f2fe !important; border:1px solid #7dd3fc !important; }
.st-roxo{   color:#5b21b6 !important; background:#ede9fe !important; border:1px solid #c4b5fd !important; }
.st-vermelho{color:#991b1b !important; background:#fee2e2 !important; border:1px solid #fca5a5 !important; }
.st-cinza{  color:#334155 !important; background:#f1f5f9 !important; border:1px solid var(--mq-border) !important; }
.tagc{ background:#f1f5f9 !important; color:#334155 !important; border:1px solid var(--mq-border) !important; }
.chip-feriado{ background:#f1f5f9 !important; color:#334155 !important; border:1px solid var(--mq-border) !important; }
.chip-feriado .x{ color:#b91c1c !important; }

/* ── app do motorista ───────────────────────────────────────── */
.app-tabbar{
  background:#ffffff !important;
  border-top:1px solid var(--mq-border) !important;
  box-shadow:0 -6px 18px rgba(15,23,42,.08) !important;
}
.app-tab{ color:#64748b !important; }
.app-tab i{ color:inherit !important; }
.app-tab.on{ color:#e11d48 !important; }
.app-tab.on i{ color:#e11d48 !important; }
.carga-opt{ background:#ffffff !important; }
.carga-opt b{ color:#0f172a !important; }
.carga-opt small{ color: var(--mq-muted) !important; }
.carga-opt em{ color:#9f1239 !important; font-style:normal; font-weight:700; }
.carga-opt.on{
  border-color:#e11d48 !important;
  background:#fff1f2 !important;
  box-shadow:0 0 0 2px rgba(225,29,72,.15) !important;
}
.orc-line{ background:#ffffff !important; color:#0f172a !important; }
.orc-line span, .orc-line b{ color:#0f172a !important; }
.tot{ color:#0f172a !important; }
textarea.wa{ background:#f8fafc !important; color:#0f172a !important; border:1px solid var(--mq-border) !important; }
.step-badge{ background:#ffe4e6 !important; color:#9f1239 !important; border:1px solid #fecdd3 !important; }
.exp-row{ background:#f8fafc !important; }
.chk{ color:#334155 !important; }

/* ── página pública do cliente / mapa ───────────────────────── */
.leaflet-container{ background:#eef2f8 !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip{
  background:#ffffff !important; color:#0f172a !important;
  border:1px solid var(--mq-border) !important;
}
dialog, .modal, .modal-box, .modal-content{
  background:#ffffff !important; color:#0f172a !important;
  border:1px solid var(--mq-border) !important;
}
dialog::backdrop, .modal-backdrop{ background:rgba(15,23,42,.35) !important; }

/* ── correções estruturais mantidas ─────────────────────────── */
html, body{ max-width:100%; overflow-x:hidden; }
.adm-main, .page, .hub, .dash, .card, .kpi, .tbl-wrap, .form, .grid2, .row2, .row3{ max-width:100%; min-width:0; }
.adm-main{ padding-left:14px; padding-right:14px; }
.tbl-wrap{ overflow-x:auto; max-width:100%; }
.tbl{ min-width:520px; }
img, svg, canvas, iframe, table{ max-width:100%; }
body.modo-app{ padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
body.modo-app .adm-main, body.modo-app .page{ padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
.kpi strong, .tot, .valor, .tbl td.nowrap{ white-space:nowrap; }
@media (max-width:520px){
  .tbl{ font-size:.72rem; min-width:440px; }
  .tbl th, .tbl td{ padding:8px 6px; }
}

/* rolagem e seleção */
::selection{ background:#fecdd3; color:#881337; }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:#eef2f7; }
::-webkit-scrollbar-thumb{ background:#cbd5e1; border-radius:8px; }

/* ── impressão: papel branco, sem menus ─────────────────────── */
@media print{
  .bg-wrap, .adm-nav, .adm-top, .topbar, .app-tabbar, .hub-grid,
  .btn-primary, .btn-ghost, .btn-mini, .btn-ico, .atalho-go{ display:none !important; }
  html, body{ background:#fff !important; color:#111827 !important; }
  .card, .kpi, .dash-card, .hub, .tbl{ background:#fff !important; border:1px solid #d1d5db !important; box-shadow:none !important; }
  h1,h2,h3,h4,strong,b,td,th,p,span,small,div{ color:#111827 !important; }
  .tbl th{ background:#f3f4f6 !important; }
  .st, .st-verde, .st-amarelo, .st-azul, .st-roxo, .st-vermelho, .st-cinza{
    background:transparent !important; border:1px solid #9ca3af !important; color:#111827 !important;
  }
  a{ color:#111827 !important; text-decoration:underline; }
}

/* alto contraste do sistema operacional */
@media (prefers-contrast: more){
  :root{ --mq-text:#000000; --mq-muted:#1f2937; --mq-border:#94a3b8; }
  .tbl td, .tbl th, .pg-sub, .mut, .kpi em{ color:#000000 !important; }
}


/* ================= FORCE LIGHT (v1.4.0) =================
   Neutraliza qualquer estilo escuro remanescente (inline, cacheado ou de CSS antigo). */
html, body{
  background:#f4f6fb !important;
  color:#0f172a !important;
}
body.modo-app, body.modo-publico, body.modo-claro, body.modo-admin{ background:#f4f6fb !important; color:#0f172a !important; }
.bg-wrap, .bg-gradient, .bg-orb, .bg-orb-1, .bg-orb-2, .bg-grid{ display:none !important; }
.dash, .hub, .pf, .page, .adm-main, .conteudo, .wrap{ background:transparent !important; }
h1, h2, h3, h4, h5, strong, b, .hub-hi h1, .hub-hi h1 span, .dash-h, .pg-title{ color:#0f172a !important; }
.hub-hi h1 span, .brand-nome b, .pg-title span{ color:#e11d48 !important; }
p, small, .hub-sub, .hub-foot, .mut, .hint, .pg-sub, .dash-p, .dash-item small, .atalho-t small{
  color:#475569 !important;
}
.atalho, .card, .kpi, .dash-card, .dash-item, .login-card, .carga-opt, .cep-box, .orc-line, .exp-row, .tbl-wrap{
  background:#ffffff !important;
  border:1px solid #e2e8f0 !important;
  box-shadow:0 1px 2px rgba(15,23,42,.06) !important;
}
.atalho:hover{ background:#fff1f4 !important; border-color:#fda4af !important; }
.atalho-t strong, .kpi strong, .dash-item strong, .card-h, .card-h *, .tbl th, .tbl td{ color:#0f172a !important; }
.hub-foot{ border-top:1px solid #e2e8f0 !important; }
.hub-foot a{ color:#e11d48 !important; }
.topbar, .adm-top, .adm-nav, .app-tabbar{ background:#ffffff !important; border-color:#e2e8f0 !important; }
.topbar *, .adm-top *, .adm-nav *, .app-tab *{ color:#0f172a !important; }
.app-tab.on, .app-tab.on *{ color:#e11d48 !important; }
.brand-sub, .topbar-sub{ color:#64748b !important; }
input, select, textarea{ background:#ffffff !important; color:#0f172a !important; border-color:#cfd8e6 !important; }
option{ background:#ffffff !important; color:#0f172a !important; }
a{ color:#e11d48; }
table, thead, tbody, tr, td, th{ background-color:transparent; color:#0f172a !important; }
thead th{ background:#f1f5fb !important; color:#334155 !important; }
svg text{ fill:#0f172a !important; }
