/* ══════════════════════════════════════════════
   PONTEIO — CSS CONSOLIDADO
   Baseado no CSS dos módulos gestao_metas.py,
   gestao_mix.py, gestao_tkm.py e app.py
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #F0F2F6;
    color: #0D2B6E;
    min-height: 100vh;
}

/* ── PÁGINA DE LOGIN ── */
body.login-page {
    background-color: #07193A;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Círculos decorativos */
.login-circle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.lc1 { width: 420px; height: 420px; background: rgba(13,43,110,0.55);  top: -80px;  left: -100px; }
.lc2 { width: 300px; height: 300px; background: rgba(232,55,74,0.18);  top: 10%;    right: -60px; }
.lc3 { width: 200px; height: 200px; background: rgba(13,43,110,0.4);   bottom: 5%;  left: 5%;    }
.lc4 { width: 140px; height: 140px; background: rgba(232,55,74,0.10);  bottom: 15%; right: 18%;  }

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 48px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.login-brand {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo {
    height: 90px;
    object-fit: contain;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.login-brand-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 2px;
    line-height: 1;
}
.login-brand-name span { color: #FFFFFF; }
.login-brand-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 6px;
    font-family: 'Segoe UI', sans-serif;
}

/* Boas-vindas */
.login-welcome {
    text-align: center;
    margin-bottom: 6px;
    width: 100%;
}
.login-welcome-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.1;
}
.login-welcome-sub {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 1px;
    margin-top: 4px;
}
.login-welcome-hint {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-top: 10px;
    font-family: 'Segoe UI', sans-serif;
}

/* Card do formulário */
.login-card {
    background: #FFFFFF;
    border: 1.5px solid #D0D8EC;
    border-radius: 14px;
    padding: 44px 44px 36px;
    box-shadow: 0 4px 32px rgba(13,43,110,0.13);
    margin-top: 28px;
    width: 100%;
    max-width: 420px;
}

.login-field { display: flex; flex-direction: column; }

.login-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0D2B6E;
    display: block;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #D0D8EC;
    border-radius: 10px;
    background: #FFFFFF;
    color: #0D2B6E;
    font-size: 15px;
    font-family: 'Segoe UI', sans-serif;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
    border-color: #0D2B6E;
    box-shadow: 0 0 0 3px rgba(232,55,74,0.25);
}
.login-input::placeholder { color: #B0BAD0; }

.login-btn {
    width: 100%;
    margin-top: 8px;
    padding: 14px 0;
    background: #E8374A;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s;
}
.login-btn:hover { background: #C4202F; }

.login-error {
    background: rgba(232,55,74,0.15);
    border: 1px solid rgba(232,55,74,0.4);
    border-radius: 8px;
    padding: 10px 14px;
    color: #CC1A2A;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
}

/* ── DASHBOARD ── */
body:not(.login-page) {
    padding: 0;
    background: #F0F2F6;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: #0D2B6E;
    border-radius: 10px;
    margin: 18px 24px 18px;
    box-shadow: 0 2px 12px rgba(13,43,110,0.18);
}
.dash-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dash-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}
.dash-header-text { display: flex; flex-direction: column; }
.dash-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    margin: 0;
}
.dash-title span { color: #FFFFFF; }
.dash-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin-top: 3px;
}
.dash-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.dash-saudacao {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}
.dash-saudacao strong { color: #FFD166; font-weight: 800; }

.dash-btn-sair {
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background .2s;
    cursor: pointer;
}
.dash-btn-sair:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── ABAS ── */
.tab-bar {
    display: flex;
    gap: 0;
    background: #FFFFFF;
    border: 1.5px solid #D0D8EC;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    margin: 0 24px;
    padding: 0 16px;
    box-shadow: 0 1px 4px rgba(13,43,110,0.06);
}
.tab-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8896B8;
    padding: 14px 32px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    margin: 0 4px;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: #0D2B6E;
    background: #F5F7FC;
    border-radius: 8px 8px 0 0;
}
.tab-btn.active {
    color: #0D2B6E;
    border-bottom: 3px solid #E8374A;
    background: #F0F2F6;
}

.tab-panel {
    display: none;
    background: #F0F2F6;
    border: 1.5px solid #D0D8EC;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin: 0 24px;
    padding: 24px;
}
.tab-panel.active { display: block; }

/* ── FILTER BAR ── */
.filter-bar {
    background: #FFFFFF;
    border: 1.5px solid #D0D8EC;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(13,43,110,0.07);
}
.filter-bar-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #0D2B6E;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}
.filter-field { display: flex; flex-direction: column; min-width: 130px; }

.filter-select {
    background: #F5F7FC;
    border: 1.5px solid #D0D8EC;
    border-radius: 6px;
    color: #0D2B6E;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
}
.filter-select:focus { border-color: #0D2B6E; }

.filter-input-num {
    background: #F5F7FC;
    border: 1.5px solid #D0D8EC;
    border-radius: 6px;
    color: #0D2B6E;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    width: 140px;
    transition: border-color .2s;
}
.filter-input-num:focus { border-color: #0D2B6E; }

.filter-btn {
    background: #0D2B6E;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 9px 20px;
    cursor: pointer;
    height: 38px;
    align-self: flex-end;
    transition: background .2s;
}
.filter-btn:hover { background: #1A3F96; }

/* ── SECTION TITLE ── */
.section-title {
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #0D2B6E;
    border-left: 3px solid #0D2B6E;
    padding-left: 10px;
    margin: 20px 0 12px 0;
}

/* ── KPI CARDS ── */
.kpis-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.kpi-card {
    background: #FFFFFF;
    border: 1.5px solid #D0D8EC;
    border-radius: 8px;
    padding: 14px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(13,43,110,0.07);
    min-width: 140px;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.kpi-card.azul::before    { background: #0D2B6E; }
.kpi-card.vermelho::before { background: #CC1A2A; }
.kpi-card.verde::before    { background: #0A7A45; }

.kpi-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #000000;
}
.kpi-value {
    font-family: 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: #0D2B6E;
}
.kpi-value.pos { color: #0A7A45; }
.kpi-value.neg { color: #CC1A2A; }

/* ── INFO BLOCO ── */
.info-bloco {
    background: #EEF1F7;
    border: 1.5px solid #D0D8EC;
    border-radius: 8px;
    padding: 12px 18px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #2A3A5C;
    line-height: 1.8;
    margin-top: 8px;
}

/* ── TABELAS ── */
.table-area {
    overflow-x: auto;
}
.table-area table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
}
.table-area thead tr { background: #0D2B6E; }
.table-area tbody tr:hover { background: #EBF0FA !important; }
.table-area tbody tr:hover td { color: #0D2B6E !important; }

/* ── LOADING ── */
.loading-msg {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #0D2B6E;
    background: #FFFFFF;
    border: 1.5px solid #D0D8EC;
    border-radius: 8px;
    margin-top: 12px;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #D0D8EC;
    border-top-color: #0D2B6E;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ERRO ── */
.erro-msg {
    background: #FDECEA;
    border: 1.5px solid #F5B8BC;
    border-radius: 8px;
    padding: 14px 18px;
    color: #CC1A2A;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    margin-top: 12px;
}

/* ── CONTEÚDO ── */
.content-area { margin-bottom: 4px; }

/* ── RODAPÉ ── */
.rodape {
    text-align: center;
    font-size: 11px;
    color: #B0BAD0;
    padding: 18px 24px;
    margin-top: 12px;
}

hr { border-color: #D0D8EC; }
