/* Camada semântica: as superfícies novas devem consumir estes tokens, não tons avulsos. */
:root{--page-bg:#f5f7fa;--surface:#fff;--surface-subtle:#f8fafc;--surface-hover:#f1f6f9;--border:#e0e7ee;--border-strong:#c9d6e2;--text-primary:#14263a;--text-secondary:#607487;--accent:#147ea8;--accent-subtle:#e8f5fa;--success:#19875e;--success-subtle:#e9f7ef;--danger:#c64b57;--danger-subtle:#fff0f1;--warning:#a66b12;--warning-subtle:#fff6df;--info:#247ca2;--table-header:#f4f7f9;--sidebar-active:#e8f5fa;--sidebar-hover:#f1f6f9;--card-shadow:0 10px 26px rgba(31,52,73,.07)}
html[data-resolved-theme="dark"]{--page-bg:#080b10;--surface:#10151d;--surface-subtle:#151c26;--surface-hover:#1b2430;--border:#293542;--border-strong:#344355;--text-primary:#f2f5f8;--text-secondary:#8795a6;--accent:#39c7cf;--accent-subtle:#15363c;--success:#52d0a4;--success-subtle:#13352c;--danger:#ee737b;--danger-subtle:#3a2026;--warning:#e3b45f;--warning-subtle:#382f1f;--info:#84e4e7;--table-header:#151c26;--sidebar-active:#17212c;--sidebar-hover:#111821;--card-shadow:0 22px 50px rgba(0,0,0,.24)}

/* Marca e navegação: o arquivo de marca é preservado como selo compacto para não carregar um bloco escuro grande no tema claro. */
.brand{align-items:center;padding:4px 9px 25px}.brand-lockup{width:46px;max-width:none;height:46px;max-height:none;object-fit:cover;object-position:center;border:1px solid var(--border-strong);border-radius:12px;box-shadow:0 5px 14px rgba(14,33,49,.14)}.brand:after{content:"ATLAS\A Financeiro e Operacional";white-space:pre-line;color:var(--text-primary);font-size:16px;font-weight:800;line-height:1.1;letter-spacing:.08em;font-variant-caps:all-small-caps}.brand{color:var(--text-primary)}
html[data-resolved-theme="light"] nav button{min-height:39px;border:0;border-left:3px solid transparent;border-radius:8px;color:#607487}html[data-resolved-theme="light"] nav button:hover{border-left-color:#b9deec;background:var(--sidebar-hover);color:#1e5e80}html[data-resolved-theme="light"] nav button.active{border-color:transparent;border-left-color:var(--accent);background:var(--sidebar-active);color:#126d98;box-shadow:none}html[data-resolved-theme="light"] nav button.active .nav-icon{stroke-width:2}html[data-resolved-theme="light"] .nav-group{gap:4px;margin-bottom:20px}

/* Cabeçalho e controles compartilham a mesma escala e hierarquia. */
.top-frame header{min-height:106px;padding:8px 0}.header-controls{gap:8px}.theme-control{padding:4px 0}.theme-control select{background:var(--surface);border-color:var(--border);color:var(--text-primary)}.header-action{border-radius:8px}.online-session{border-radius:9px}.online-session button{min-height:34px}.top-frame header>.online-session{border-color:var(--border);background:var(--surface-subtle)}
html[data-resolved-theme="light"] .top-frame header{gap:18px}html[data-resolved-theme="light"] .header-action{min-height:40px}html[data-resolved-theme="light"] .header-action span{border-color:rgba(20,126,168,.38)}

/* Dashboard operacional: cartões claros, espaçados e escaneáveis. */
.operational-cards article{position:relative;overflow:hidden}.operational-cards .metric-icon{display:grid;place-items:center;width:34px;height:34px;margin-bottom:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--accent)}.operational-cards .metric-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.operational-cards article:nth-child(2) .metric-icon{color:var(--info)}.operational-cards article:nth-child(3) .metric-icon{color:var(--success)}.operational-cards article:nth-child(4) .metric-icon{color:var(--danger)}
html[data-resolved-theme="light"] .operational-cards article,html[data-resolved-theme="light"] .control-grid article{background:var(--surface);border-color:var(--border);box-shadow:0 5px 14px rgba(31,52,73,.045)}html[data-resolved-theme="light"] .operational-cards article:after{content:"";position:absolute;right:0;bottom:0;width:34%;height:2px;background:#d7edf5}html[data-resolved-theme="light"] .operational-cards article:nth-child(3):after{background:#ccebd9}html[data-resolved-theme="light"] .operational-cards article:nth-child(4):after{background:#f2cdd1}html[data-resolved-theme="light"] .operational-cards .metric-icon{background:var(--surface-subtle)}

/* Agenda financeira, tabelas e ações de linha. */
.filter-panel .panel-heading.compact{gap:16px}.filter-panel .row-actions{display:flex;flex-wrap:wrap;gap:8px}.filter-panel .row-actions button{min-height:38px;border-radius:8px;font-weight:650}.filter-grid .clear-filters{align-self:end;min-height:38px;border-radius:8px}.table-wrap table{border-collapse:separate;border-spacing:0}.table-wrap thead th{height:42px}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px}.table-wrap .row-actions button{min-height:32px;padding:6px 9px;border-radius:7px;font-size:12px;white-space:nowrap}.table-wrap .row-actions button[data-settle]{border-color:#bde4cf;background:var(--success-subtle);color:var(--success)}.table-wrap .row-actions button[data-edit]{border-color:#c5e1ea;background:#eff9fb;color:#176f99}.table-wrap .row-actions button[data-del],.table-wrap .row-actions button[data-cancel]{border-color:#f1c8cd;background:#fff5f6;color:#b73f4d}
html[data-resolved-theme="light"] .filter-panel,html[data-resolved-theme="light"] .filter-panel .panel-heading{background:var(--surface)}html[data-resolved-theme="light"] .filter-grid{background:var(--surface-subtle)}html[data-resolved-theme="light"] .table-wrap thead th{background:var(--table-header);color:var(--text-secondary)}html[data-resolved-theme="light"] .table-wrap td{color:var(--text-primary)}html[data-resolved-theme="light"] .table-wrap tbody tr:nth-child(even){background:#fcfdfe}

/* Tema claro da Saúde Financeira / DRE: mantém o componente legível sem alterar seus cálculos. */
html[data-resolved-theme="light"] .financial-health-section,html[data-resolved-theme="light"] .managerial-financial-section{color:var(--text-primary)}
html[data-resolved-theme="light"] .health-grid article,html[data-resolved-theme="light"] .managerial-primary-grid article{background:var(--surface);border-color:var(--border);box-shadow:var(--card-shadow)}
html[data-resolved-theme="light"] .health-grid small,html[data-resolved-theme="light"] .health-grid span,html[data-resolved-theme="light"] .health-note,html[data-resolved-theme="light"] .managerial-primary-grid small,html[data-resolved-theme="light"] .managerial-primary-grid span{color:var(--text-secondary)}
html[data-resolved-theme="light"] .coverage-block{border-color:#f0d79f;background:linear-gradient(120deg,#fff9ea,#ffffff 62%)}
html[data-resolved-theme="light"] .executive-report-launcher,html[data-resolved-theme="light"] .managerial-analysis-grid>section{background:var(--surface);border-color:var(--border);box-shadow:var(--card-shadow)}
html[data-resolved-theme="light"] .report-summary article,html[data-resolved-theme="light"] .report-columns>div,html[data-resolved-theme="light"] .report-rankings>div,html[data-resolved-theme="light"] .report-evolution,html[data-resolved-theme="light"] .report-attention,html[data-resolved-theme="light"] .managerial-category-detail{background:var(--surface-subtle);border-color:var(--border)}
html[data-resolved-theme="light"] .managerial-category-detail div{border-top-color:var(--border)}
html[data-resolved-theme="light"] .report-bar b{background:var(--accent)}html[data-resolved-theme="light"] .report-bar em{background:var(--danger)}
html[data-resolved-theme="light"] .managerial-alerts p{border-color:#f0d79f;background:var(--warning-subtle);color:#80601e}
html[data-resolved-theme="light"] .dre-card{background:var(--surface);border-color:var(--border);box-shadow:0 5px 14px rgba(31,52,73,.04)}
html[data-resolved-theme="light"] .dre-card.result{border-color:#b9deec;background:#eff9fb}
html[data-resolved-theme="light"] .dre-flow{background:var(--surface);border-color:var(--border)}
html[data-resolved-theme="light"] .dre-flow div{border-bottom-color:var(--border)}
html[data-resolved-theme="light"] .dre-flow .subtotal{background:var(--surface-subtle)}
html[data-resolved-theme="light"] .dre-flow .total{background:#e8f5fa;color:#124968}
html[data-resolved-theme="light"] .dre-outside{border-color:#f0d79f;background:#fff9ed}
html[data-resolved-theme="light"] .dre-outside div{border-top-color:#f3e1b7}
html[data-resolved-theme="light"] .dre-unclassified{color:var(--warning)}

@media(max-width:980px){.top-frame header{min-height:0}.brand:after{font-size:15px}.operational-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-panel .panel-heading.compact{align-items:flex-start;flex-direction:column}.filter-panel .row-actions{width:100%}.filter-panel .row-actions button{flex:1}}
@media(max-width:640px){.brand{padding-bottom:20px}.brand-lockup{width:42px;height:42px}.brand:after{font-size:14px}.operational-cards,.control-grid{grid-template-columns:1fr}.filter-panel .row-actions{display:grid;grid-template-columns:1fr}.filter-panel .row-actions button{width:100%}.table-wrap .row-actions{justify-content:flex-start;flex-wrap:wrap}.top-frame header{padding:4px 0}}

/* Cadastro comercial: mantém formulários extensos legíveis e separados por contexto. */
.form-section{grid-column:1/-1;margin:4px 0 -2px;padding:12px 0 7px;border-bottom:1px solid var(--border);color:var(--accent);font-size:11px;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.fields select[multiple]{min-height:104px}.contract-notice{margin:14px 18px 0;padding:10px 12px;border-left:3px solid var(--info);background:var(--surface-subtle);color:var(--text-secondary);font-size:12px}.contract-detail{display:grid;gap:16px}.contract-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.contract-summary article,.contract-detail-grid>section{padding:16px;border:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:var(--card-shadow)}.contract-summary small{display:block;margin-bottom:7px;color:var(--text-secondary);font-size:10px;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.contract-summary strong{font-size:14px;line-height:1.35}.contract-detail-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);gap:16px}.contract-detail-grid h3{margin:3px 0 14px;color:var(--text-primary)}.contract-detail-grid p{color:var(--text-secondary)}.contract-detail dl{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px 14px;margin:0}.contract-detail dt{color:var(--text-secondary);font-size:11px;font-weight:700;text-transform:uppercase}.contract-detail dd{margin:0;white-space:pre-wrap;color:var(--text-primary)}.contract-installments{margin-top:0}
@media(max-width:900px){.contract-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.contract-detail-grid{grid-template-columns:1fr}}
@media(max-width:560px){.contract-summary{grid-template-columns:1fr}.contract-detail dl{grid-template-columns:1fr;gap:3px}.contract-detail dd{margin-bottom:11px}}
