/* ARQUIVO: assets/css/style.css
   Design system do Portal Capital Projetos — v2
   Paleta de marca + tokens compartilhados por login, sidebar, cards, tabelas e gráficos. */

:root {
    /* Identidade Capital Pro */
    --cor-primaria: #0a2342;       /* Azul Marinho Profundo */
    --cor-primaria-clara: #15335c;
    --cor-secundaria: #15803d;     /* Verde institucional (texto/ícones sobre branco) */
    --cor-secundaria-forte: #198754;
    --cor-fundo: #f3f4f6;          /* Cinza gelo */
    --cor-texto: #1f2937;
    --cor-texto-muted: #6b7280;
    --cor-borda: #e5e7eb;

    /* Paleta categórica (séries de gráfico — ordem fixa, não ciclar) */
    --serie-1: #2a78d6; /* azul */
    --serie-2: #eb6834; /* laranja */
    --serie-3: #1baf7a; /* verde-água */
    --serie-4: #eda100; /* amarelo */
    --serie-5: #e87ba4; /* magenta */
    --serie-6: #008300; /* verde */
    --serie-7: #6250d6; /* violeta */
    --serie-8: #e34948; /* vermelho */

    /* Status (fixos, nunca reaproveitados como série) */
    --status-bom: #0ca30c;
    --status-atencao: #fab219;
    --status-grave: #ec835a;
    --status-critico: #d03b3b;

    --radius: 14px;
    --radius-sm: 10px;
    --sombra-card: 0 1px 2px rgba(10,35,66,0.04), 0 8px 24px rgba(10,35,66,0.06);
    --sombra-card-hover: 0 4px 10px rgba(10,35,66,0.08), 0 12px 28px rgba(10,35,66,0.10);
}

body {
    background-color: var(--cor-fundo);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--cor-texto);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.bg-login {
    background:
        radial-gradient(circle at 15% 15%, rgba(21,128,61,0.25), transparent 45%),
        linear-gradient(135deg, var(--cor-primaria) 0%, #020b18 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    padding: 36px 32px 28px;
    border: none;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.login-logo img { max-height: 54px; width: auto; object-fit: contain; }

.login-card h4 {
    font-weight: 700;
    color: var(--cor-primaria);
    font-size: 1.15rem;
}
.login-card .subtitulo {
    color: var(--cor-texto-muted);
    font-size: 0.85rem;
    margin-bottom: 22px;
}

.login-card .form-control {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    border: 1px solid var(--cor-borda);
    background: #f9fafb;
}
.login-card .form-control:focus {
    border-color: var(--cor-secundaria-forte);
    box-shadow: 0 0 0 3px rgba(21,128,61,0.12);
    background: #fff;
}

.btn-login {
    background: var(--cor-primaria);
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.2s, transform 0.15s;
}
.btn-login:hover { background: var(--cor-primaria-clara); transform: translateY(-1px); color: #fff; }

/* ============================================================
   MENU LATERAL (SIDEBAR)
   ============================================================ */
#sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 260px; padding: 20px 15px;
    background: linear-gradient(180deg, var(--cor-primaria) 0%, #061427 100%);
    color: #e2e8f0; overflow-y: auto; z-index: 1000;
    box-shadow: 4px 0 16px rgba(0,0,0,0.12);
}

.sidebar-logo {
    display: flex; align-items: center; justify-content: center;
    padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px; background-color: #fff; border-radius: var(--radius-sm); padding: 12px;
}
.sidebar-logo img { max-height: 48px; width: auto; object-fit: contain; }

#sidebar .nav-link {
    color: #94a3b8; margin-bottom: 4px; border-radius: 8px; padding: 11px 14px;
    font-weight: 500; font-size: 0.92rem; transition: all 0.18s ease; display: flex; align-items: center;
}
#sidebar .nav-link i { margin-right: 12px; width: 18px; text-align: center; font-size: 1.05rem; }
#sidebar .nav-link:hover { color: #fff; background-color: rgba(255,255,255,0.06); transform: translateX(3px); }
#sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, var(--cor-secundaria-forte) 0%, #22a06b 100%);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(21,128,61,0.35);
}

.sidebar-header {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: #64748b; margin-top: 18px; margin-bottom: 8px; padding-left: 14px; font-weight: 700;
}

.user-panel { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-avatar {
    width: 38px; height: 38px; background: var(--cor-secundaria-forte); color: #fff; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1rem;
}

.main-content { margin-left: 260px; padding: 28px 30px; min-height: 100vh; }

@media (max-width: 768px) {
    #sidebar { position: relative; width: 100%; height: auto; }
    .main-content { margin-left: 0; padding: 16px; }
    .sidebar-logo { justify-content: center; }
}

/* ============================================================
   CABEÇALHO DE PÁGINA
   ============================================================ */
.page-title {
    font-weight: 700;
    color: var(--cor-primaria);
}
.page-subtitle { color: var(--cor-texto-muted); font-size: 0.92rem; }

/* ============================================================
   CARDS, KPIs E TENDÊNCIAS
   ============================================================ */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--sombra-card);
    transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { box-shadow: var(--sombra-card-hover); }
.card-header {
    border-bottom: 1px solid var(--cor-borda);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.kpi-card { position: relative; overflow: hidden; padding: 4px 2px; }
.kpi-card .kpi-icone {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 10px;
}
.kpi-card .kpi-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
}
.kpi-card .kpi-valor { font-weight: 700; font-size: 1.65rem; line-height: 1.2; }
.kpi-card .kpi-tendencia {
    font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px; margin-top: 6px;
}
.kpi-tendencia.up   { color: var(--status-bom); background: rgba(12,163,12,0.1); }
.kpi-tendencia.down { color: var(--status-critico); background: rgba(208,59,59,0.1); }
.kpi-tendencia.flat { color: var(--cor-texto-muted); background: rgba(107,114,128,0.1); }

.kpi-bg-dark  { background: linear-gradient(135deg, var(--cor-primaria) 0%, #0f3460 100%); color: #fff; }
.kpi-bg-verde { background: linear-gradient(135deg, var(--cor-secundaria-forte) 0%, #22a06b 100%); color: #fff; }

/* ============================================================
   RANKINGS (top clientes, por gerente, etc.)
   ============================================================ */
.ranking-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 2px; border-bottom: 1px solid var(--cor-borda);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-posicao {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--cor-fundo); color: var(--cor-texto-muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; margin-right: 10px; flex-shrink: 0;
}
.ranking-posicao.top1 { background: #fef3c7; color: #92400e; }
.ranking-posicao.top2 { background: #e5e7eb; color: #374151; }
.ranking-posicao.top3 { background: #fde2d1; color: #9a3412; }

/* ============================================================
   TABELAS
   ============================================================ */
.table thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--cor-borda);
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table td { vertical-align: middle; font-size: 0.9rem; }
.table-hover tbody tr:hover { background-color: rgba(21,128,61,0.035); }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 767.98px) {
    .main-content { padding: 16px; }
    .h3 { font-size: 1.4rem; }
    .small { font-size: 0.75rem; }
    .kpi-card .kpi-valor { font-size: 1.35rem; }
}
