:root {
    --ml-azul: #33A9DC;
    --ml-azul2: #1f86b3;
    --ml-vermelho: #E8352E;
    --ml-amarelo: #FFD400;
    --ml-escuro: #1c2733;
}

body {
    background-color: #f4f6f9;
    color: #212529;
}

/* Barra superior: degrade cinza clean, mais claro do lado da logo */
.ml-navbar {
    background: linear-gradient(90deg, #fbfdff 0%, #eef3f7 60%, #e6edf3 100%);
    border-bottom: 2px solid var(--ml-azul);
    box-shadow: 0 2px 10px rgba(28, 39, 51, .05);
    padding-top: .35rem;
    padding-bottom: .35rem;
}
.ml-navbar .navbar-brand span { color: var(--ml-escuro); letter-spacing: .3px; }
.ml-navbar .nav-link { color: var(--ml-escuro); font-weight: 600; padding-left: .8rem; padding-right: .8rem; border-radius: .4rem; }
.ml-navbar .nav-link:hover { color: var(--ml-azul2); background: rgba(51, 169, 220, .1); }
.ml-navbar .nav-link.active { color: #fff; background: var(--ml-azul2); }
.ml-badge-base { font-size: .8rem; padding: .45rem .7rem; }
.ml-menu-cadastros { max-height: 78vh; overflow-y: auto; }
.ml-menu-cadastros .dropdown-header { text-transform: uppercase; font-size: .7rem; letter-spacing: .6px; color: var(--ml-azul2); }

/* Faixa de alerta quando a Base de Teste esta ativa */
.ml-faixa-teste {
    background-color: var(--ml-amarelo);
    color: #5c4700;
    border-bottom: 1px solid #e6c200;
}
body.base-teste { box-shadow: inset 0 0 0 3px rgba(255, 212, 0, .5); }

/* Layout compacto */
.ml-main .h3, .ml-main h1.h3 { font-size: 1.4rem; }
.ml-main .card-body { padding: 1rem 1.1rem; }
.ml-card-icone { font-size: 1.7rem; width: 2.3rem; text-align: center; }
.card { border-radius: .6rem; }

.navbar .dropdown-item.active,
.navbar .dropdown-item:active { background-color: var(--ml-azul); }

/* Graficos com altura controlada (encaixe perfeito, sem estourar) */
.ml-chart { position: relative; width: 100%; height: 220px; }
.ml-chart-sm { position: relative; width: 100%; height: 168px; }
.ml-chart-lg { position: relative; width: 100%; height: 300px; }
.card-header.bg-white { padding: .55rem .9rem; font-size: .92rem; }
.ml-dash .card-body { padding: .8rem .9rem; }

/* KPIs compactos do dashboard */
.ml-kpi { border: 1px solid #e7edf3; border-radius: .6rem; background: #fff; }
.ml-kpi .rotulo { color: #6c7a89; font-size: .8rem; }
.ml-kpi .valor { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.ml-kpi .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; }

footer { border-top: 1px solid #e3e7ec; margin-top: 1.5rem; }

/* Select2 combinando com Bootstrap 5 */
.select2-container .select2-selection--single { height: calc(2.5rem + 2px); display: flex; align-items: center; border-color: #ced4da; border-radius: .375rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; }
.select2-dropdown { border-color: #ced4da; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--ml-azul); }

/* Impressao PDF */
@media print {
    .ml-navbar, .ml-faixa-teste, footer, .ml-no-print, .dataTables_filter,
    .dataTables_length, .dataTables_paginate, .dataTables_info { display: none !important; }
    body { background: #fff !important; box-shadow: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
    .ml-main { padding: 0 !important; }
    a[href]:after { content: ""; }
    .ml-print-cabecalho { display: flex !important; }
}
.ml-print-cabecalho { display: none; align-items: center; gap: 12px; margin-bottom: 12px; }
.ml-print-cabecalho img { height: 42px; }
