/* ================= CSS VARIABLES & DESIGN SYSTEM ================= */
:root {
    --primary-navy: #1E3A8A;
    --accent-gold: #2563EB; /* Replaced Gold with Clean Blue */
    --bg-content: #F8F9FA;
    --bg-surface: #FFFFFF;
    
    --text-main: #333333;
    --text-muted: #6b7280;
    --text-light: #f3f4f6;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 30px rgba(30, 58, 138, 0.08);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    --sidebar-width: 250px;
    --topbar-height: 70px;
}

/* ================= RESET & BASE ================= */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}
body { background-color: var(--bg-content); color: var(--text-main); font-size: 14px; line-height: 1.5; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* ================= TOPBAR (HEADER FIXO) ================= */
.topbar {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--topbar-height);
    background-color: var(--bg-surface); z-index: 1000; display: flex;
    justify-content: space-between; align-items: center; padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 20px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--primary-navy); }
.ds-brand { display: flex; align-items: center; gap: 10px; }
.brand-text { font-size: 0.9rem; letter-spacing: 0.5px; color: var(--primary-navy); }
.quick-nav { display: flex; gap: 20px; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.quick-nav a:hover { color: var(--accent-gold); }
.user-profile { display: flex; align-items: center; gap: 10px; border-left: 1px solid #eaeaea; padding-left: 20px; }
.user-greeting { font-size: 0.85rem; }
.avatar { width: 35px; height: 35px; border-radius: 50%; background-color: var(--primary-navy); color: #fff; display: flex; justify-content: center; align-items: center; }

/* ================= DASHBOARD LAYOUT ================= */
.dashboard-wrapper { display: flex; margin-top: var(--topbar-height); min-height: calc(100vh - var(--topbar-height)); }

/* ================= SIDEBAR (MENU LATERAL FIXO) ================= */
.sidebar {
    position: fixed; top: var(--topbar-height); left: 0;
    width: var(--sidebar-width); height: calc(100vh - var(--topbar-height));
    background-color: var(--primary-navy); color: var(--text-light);
    display: flex; flex-direction: column; justify-content: space-between; transition: var(--transition); z-index: 900;
}
.sidebar-menu { padding: 30px 0; display: flex; flex-direction: column; gap: 5px; }
.menu-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 30px;
    font-size: 0.9rem; font-weight: 500; transition: var(--transition); opacity: 0.8;
}
.menu-item i { width: 18px; height: 18px; }
.menu-item:hover { opacity: 1; background-color: rgba(255,255,255,0.1); border-radius: 4px; }
.menu-item.active { background-color: #ffffff; color: var(--primary-navy); opacity: 1; font-weight: 600; border-radius: 4px; }
.sidebar-footer { padding: 30px; font-size: 0.75rem; opacity: 0.5; border-top: 1px solid rgba(255,255,255,0.1); }

/* ================= MAIN CONTENT (ÁREA CENTRAL) ================= */
.main-content {
    margin-left: var(--sidebar-width); padding: 40px; width: calc(100% - var(--sidebar-width));
}
.content-header { margin-bottom: 30px; }
.content-header h1 { font-size: 1.6rem; color: var(--primary-navy); margin-bottom: 5px; }
.content-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ================= GRID DE CARDS ================= */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px;
}
.widget-card {
    background-color: var(--bg-surface); padding: 25px; border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft); transition: var(--transition); border: 1px solid transparent;
    display: flex; flex-direction: column;
}
.widget-card:hover { box-shadow: var(--shadow-hover); border-color: rgba(30, 58, 138, 0.05); transform: translateY(-3px); }
.widget-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.widget-title h3 { font-size: 1.05rem; color: var(--primary-navy); font-weight: 600; }
.icon-action { color: var(--text-muted); width: 20px; cursor: pointer; transition: color 0.2s; }
.icon-action:hover { color: var(--accent-gold); }

/* Containers de Gráfico */
.chart-container { position: relative; width: 100%; height: 250px; display: flex; justify-content: center; align-items: center; }

/* ================= COMPONENTES DOS CARDS ================= */
/* Tabela Limpa (Próximos Prazos) */
.table-container { overflow-x: auto; flex-grow: 1; }
.clean-table { width: 100%; border-collapse: collapse; text-align: left; }
.clean-table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; font-weight: 600; }
.clean-table td { padding: 15px 0; border-bottom: 1px solid #f9fafb; font-size: 0.85rem; vertical-align: top; }
.text-danger { color: #dc2626; font-weight: 600; }

/* KPIs Financeiros */
.kpi-wrapper { justify-content: flex-start; }
.kpi-grid { display: flex; flex-direction: column; gap: 20px; margin-top: 10px; }
.kpi-block { display: flex; flex-direction: column; gap: 5px; padding-bottom: 20px; }
.border-bottom { border-bottom: 1px solid #f0f0f0; }
.kpi-label { font-size: 0.8rem; text-transform: uppercase; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--primary-navy); }
.gold-text { color: var(--primary-navy); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .card-half-width { grid-column: span 1; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
    .menu-toggle { display: block; }
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .quick-nav { display: none; }
    .brand-text { display: none; }
}
