/* ============================================================
   SIAFI — sigepe_theme.css
   Localização: assets/css/sigepe_theme.css
   ============================================================ */

:root {
    --sigepe-blue-dark:  #071d41;
    --sigepe-blue-light: #005c99;
    --sigepe-orange:     #e3701c;
    --bg-body:           #f0f2f5;
    --text-primary:      #333;
    --text-secondary:    #666;
    --header-h:          60px;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
    background-color: var(--bg-body);
    font-family: 'Rawline', 'Segoe UI', Arial, sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* ── Header ───────────────────────────────────────────────── */
.header-sigepe {
    background-color: var(--sigepe-blue-light);
    color: white;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.sigepe-menu-btn {
    background-color: var(--sigepe-orange);
    height: 100%;
    width: 60px;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.sigepe-menu-btn:hover { background-color: #c45e14; }

.sigepe-logo {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: .5px;
    flex-grow: 1;
    padding-left: 15px;
    border-left: 1px solid rgba(255,255,255,.1);
    height: 100%;
    display: flex;
    align-items: center;
}

.sigepe-user-area {
    display: flex;
    align-items: center;
    padding-right: 20px;
    gap: 15px;
}

.user-avatar {
    width: 35px; height: 35px;
    background: #81c784;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.siafi-sidebar {
    position: fixed;
    top: 0; left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--sigepe-blue-dark);
    color: #fff;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: left .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}
.siafi-sidebar.open { left: 0; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
}
.sidebar-overlay.show { display: block; }

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,.06);
    flex-shrink: 0;
}
.s-avatar {
    width: 38px; height: 38px;
    background: var(--sigepe-orange);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
    flex-shrink: 0;
}
.s-nome  { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.s-cargo { font-size: .72rem; opacity: .7; margin-top: 2px; }

.sidebar-nav {
    flex: 1;
    padding: 8px 0 16px;
    overflow-y: auto;
}

.s-section {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.4);
    padding: 14px 16px 4px;
    font-weight: 600;
}

.s-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    font-size: .85rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.s-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.s-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-left-color: var(--sigepe-orange);
    font-weight: 600;
}
.s-link i { font-size: 1rem; flex-shrink: 0; }

.s-badge {
    margin-left: auto;
    background: rgba(255,255,255,.15);
    border-radius: 4px;
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    letter-spacing: .5px;
    flex-shrink: 0;
}

.sidebar-foot {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}
.btn-sair {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .82rem;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.btn-sair:hover { background: rgba(255,0,0,.15); color: #ff8a80; }

/* ── Main content ─────────────────────────────────────────── */
/*
   REGRA DO SISTEMA:
   sidebar.php injeta: body { padding-top: 60px }
   Isso empurra TODO o body 60px para baixo do header fixo.
   
   Páginas COM sidebar  → .page-wrap / .main-content só precisam de padding lateral
   Páginas SEM sidebar  → .page-wrap / .main-content precisam de margin-top:60px

   O bloco abaixo serve como FALLBACK para páginas que por algum motivo
   não tenham nenhuma definição de padding/margin no wrapper.
   As páginas individuais sobrescrevem conforme necessário.
*/
.main-content {
    padding: 20px 20px 32px;
    min-height: calc(100vh - var(--header-h));
    box-sizing: border-box;
}

/* ── Cards de serviços (dashboard) ───────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}
.card-servico {
    background: white;
    border-radius: 4px;
    border-top: 4px solid var(--sigepe-blue-light);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    transition: transform .2s;
    overflow: hidden;
}
.card-servico:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,.15); }
.card-servico-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: var(--sigepe-blue-light);
    display: flex; align-items: center; gap: 10px;
}
.card-servico-body { padding: 15px; }

/* ── Contracheque widget ──────────────────────────────────── */
.contracheque-widget { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.cc-row { display: flex; justify-content: space-between; padding: 10px 15px; border-bottom: 1px solid #f0f0f0; font-size: .9rem; }
.cc-row:last-child { border-bottom: none; }
.cc-positive { color: #2e7d32; font-weight: bold; }
.cc-negative { color: #c62828; font-weight: bold; }
.cc-footer { background: #f9f9f9; padding: 15px; display: flex; justify-content: space-between; text-align: center; border-top: 1px solid #ddd; }
.cc-val-box h6 { font-size: .7rem; color: #777; margin: 0; text-transform: uppercase; }
.cc-val-box div { font-weight: bold; font-size: 1rem; }

/* ── Utilitários ──────────────────────────────────────────── */
.badge-perfil-admin     { background: #7c3aed; color: #fff; }
.badge-perfil-financeiro{ background: #0369a1; color: #fff; }
.badge-perfil-operador  { background: #0f766e; color: #fff; }
.badge-perfil-auditor   { background: #b45309; color: #fff; }
.badge-perfil-readonly  { background: #6b7280; color: #fff; }