/* ==========================================================================
   Temas visuais do CRM FLASH (em teste). Aplicados por <html data-tema="...">:
     (vazio)          -> Original (como está hoje)
     moderno          -> Moderno, cabeçalho escuro
     moderno-claro    -> Moderno, cabeçalho branco
   Cor de destaque: vermelho Flash Educa.
   ========================================================================== */
html[data-tema^="moderno"] {
    --marca: #e11d2a;
    --marca-suave: rgba(225, 29, 42, .12);
    --foco: #16a34a;
    --foco-suave: rgba(22, 163, 74, .16);
    --fundo: #f5f6fa;
    --texto: #0f172a;
    --texto-2: #475569;
    --borda: #e8ebf1;
    --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
    --sombra-alta: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .10);
}

/* As folhas do Orçamento (#orc-doc) e da Adesão (#adz-doc) ficam SEMPRE como no original */
/* ---- base ---- */
html[data-tema^="moderno"] body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--fundo) !important;
    color: var(--texto);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv11', 'ss01';
}
html[data-tema^="moderno"] main { padding-top: 1.75rem; }

/* ---- títulos ---- */
html[data-tema^="moderno"] main h1:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { font-size: 1.6rem !important; font-weight: 700 !important; letter-spacing: -.025em; color: var(--texto) !important; }
html[data-tema^="moderno"] main h2:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { font-weight: 650 !important; letter-spacing: -.015em; color: var(--texto); }
html[data-tema^="moderno"] main h3:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { font-weight: 600; letter-spacing: -.01em; }
html[data-tema^="moderno"] main h1 + p:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main h2 + p:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { color: #64748b !important; }

/* números grandes (cartões do painel) alinhados e mais firmes */
html[data-tema^="moderno"] main .text-2xl:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .text-3xl:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .text-4xl:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }

/* ---- cartões / caixas ---- */
html[data-tema^="moderno"] main .bg-white.shadow:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .bg-white.shadow-sm:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .bg-white.shadow-md:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .bg-white.shadow-lg:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .card:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    border-radius: 16px !important;
    box-shadow: var(--sombra) !important;
    border: 1px solid var(--borda);
}
html[data-tema^="moderno"] main .ring-1:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { --tw-ring-color: var(--borda) !important; }
html[data-tema^="moderno"] main .rounded:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .rounded-md:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .rounded-lg:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { border-radius: 12px !important; }
html[data-tema^="moderno"] main .rounded-xl:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .rounded-2xl:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { border-radius: 16px !important; }
html[data-tema^="moderno"] main a.bg-white:hover:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main .card:hover:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { box-shadow: var(--sombra-alta) !important; }

/* ---- botões ---- */
html[data-tema^="moderno"] main button:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main a[class*="px-"][class*="py-"][class*="bg-"]:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main input[type="submit"]:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    border-radius: 10px !important;
    font-weight: 600;
    letter-spacing: .005em;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, filter .15s ease;
}
html[data-tema^="moderno"] main button[class*="bg-"]:not([class*="bg-white"]):not([class*="bg-transparent"]):not([class*="bg-slate-50"]):not([class*="bg-slate-100"]):hover:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main a[class*="px-"][class*="py-"][class*="bg-"]:not([class*="bg-white"]):not([class*="bg-slate-50"]):not([class*="bg-slate-100"]):hover:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
    filter: brightness(1.04);
}
html[data-tema^="moderno"] main button:active:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { transform: translateY(0) !important; }

/* ---- campos ---- */
html[data-tema^="moderno"] main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main select:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main textarea:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    border-radius: 10px !important;
    border-color: #dde2ea !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
html[data-tema^="moderno"] main input:not([type="checkbox"]):not([type="radio"]):focus:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main select:focus:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main textarea:focus:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    outline: none !important;
    border-color: var(--foco) !important;
    box-shadow: 0 0 0 4px var(--foco-suave) !important;
}
html[data-tema^="moderno"] main input[type="checkbox"]:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main input[type="radio"]:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { accent-color: var(--foco); }

/* ---- tabelas ---- */
html[data-tema^="moderno"] main table:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { border-collapse: separate; border-spacing: 0; }
html[data-tema^="moderno"] main thead th:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) {
    font-size: 11px !important;
    letter-spacing: .06em;
    color: #64748b !important;
    font-weight: 600 !important;
}
html[data-tema^="moderno"] main thead.bg-slate-900 th:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main thead.bg-slate-800 th:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *),
html[data-tema^="moderno"] main thead tr.bg-slate-900 th:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { color: #e2e8f0 !important; }
html[data-tema^="moderno"] main tbody td:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { border-color: #eef1f5 !important; }
html[data-tema^="moderno"] main tbody tr:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { transition: background-color .12s ease; }
html[data-tema^="moderno"] main tbody tr:hover:not(.orc-doc):not(.adz-doc):not(:is(.orc-doc, .adz-doc) *) { background-color: #f8fafc; }

/* ---- cabeçalho escuro (Moderno) ---- */
html[data-tema^="moderno"] header {
    background: linear-gradient(180deg, #0b1222 0%, #111b31 100%) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 6px 20px rgba(2, 6, 23, .25) !important;
}
html[data-tema^="moderno"] header nav { gap: .25rem !important; }
html[data-tema^="moderno"] header .nav-link {
    padding: 6px 10px;
    border-radius: 9px;
    color: #cbd5e1;
    transition: background-color .15s ease, color .15s ease;
}
html[data-tema^="moderno"] header .nav-link:hover { color: #fbbf24 !important; }
html[data-tema^="moderno"] header .nav-link.ativo { color: #fbbf24; }
html[data-tema^="moderno"] header .nav-link.ico-menu { padding: 0 6px; }

/* ---- cabeçalho branco (Moderno claro) ---- */
html[data-tema="moderno-claro"] header {
    background: rgba(255, 255, 255, .92) !important;
    backdrop-filter: saturate(1.4) blur(8px);
    color: var(--texto) !important;
    border-bottom: 1px solid var(--borda);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important;
    position: sticky; top: 0; z-index: 50;
}
html[data-tema="moderno-claro"] header .nav-link { color: var(--texto-2); }
html[data-tema="moderno-claro"] header .nav-link:hover { background: #f1f5f9; color: var(--texto) !important; }
html[data-tema="moderno-claro"] header .nav-link.ativo { background: #fff1f2; color: var(--marca); }
html[data-tema="moderno-claro"] header .text-slate-600 { color: #cbd5e1 !important; }
html[data-tema="moderno-claro"] header img { filter: none !important; }
html[data-tema="moderno-claro"] .ico-rotulo { color: var(--marca) !important; }

/* ---- seletor de tema (só no teste) ---- */
.tema-seletor { display: inline-flex; gap: 2px; margin-left: 12px; padding: 2px; border-radius: 8px; background: rgba(17, 24, 39, .12); vertical-align: middle; }
.tema-seletor button { border: 0; background: transparent; padding: 1px 9px; border-radius: 6px; font: 700 11px/20px system-ui, sans-serif; color: #111827; cursor: pointer; }
.tema-seletor button.on { background: #111827; color: #fbbf24; }

/* ---- nome do sistema ao lado do logo ("CRM / FLASH EDUCA") ---- */
html[data-tema^="moderno"] header a > span.tracking-wide {
    font-size: 0 !important;
    display: none;
    padding-left: 14px;
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, .16);
    line-height: 1;
}
@media (min-width: 640px) { html[data-tema^="moderno"] header a > span.tracking-wide { display: inline-flex; flex-direction: column; justify-content: center; } }
html[data-tema^="moderno"] header a > span.tracking-wide::before {
    content: 'CRM';
    font: 800 20px/1 'Inter', system-ui, sans-serif;
    letter-spacing: .14em;
    color: #fff;
}
html[data-tema^="moderno"] header a > span.tracking-wide::after { content: none; }
html[data-tema="moderno-claro"] header a > span.tracking-wide { border-left-color: #e2e8f0; }
html[data-tema="moderno-claro"] header a > span.tracking-wide::before { color: #0f172a; }

/* CRM à esquerda, logo à direita */
html[data-tema^="moderno"] header a:has(> span.tracking-wide) > img { order: 2; }
html[data-tema^="moderno"] header a > span.tracking-wide { order: 1; border-left: 0 !important; padding-left: 0 !important; margin-left: 0 !important;
    padding-right: 14px; margin-right: 2px; border-right: 1px solid rgba(255, 255, 255, .16); }
html[data-tema="moderno-claro"] header a > span.tracking-wide { border-right-color: #e2e8f0; }

/* ---- "selecionado" em AZUL (fundo azul-claro + letra azul) nas escolhas fora do menu ---- */
html[data-tema^="moderno"] .dn-pill a.on,
html[data-tema^="moderno"] #pills .pill[aria-pressed="true"] {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
    font-weight: 600;
}
html[data-tema^="moderno"] #pills .pill[aria-pressed="true"] .cnt { background: #dbeafe !important; color: #1e40af !important; }
html[data-tema^="moderno"] .dn-abas button.on { color: #1d4ed8 !important; }
html[data-tema^="moderno"] .dn-pill a:hover:not(.on) { color: #1d4ed8; }
