/* 1. VARIÁVEIS E RESET */
:root {
    --sq-bg: #f8fafc;
    --sq-white: #ffffff;
    --sq-text-dark: #0f172a;
    --sq-text-muted: #64748b;
    --sq-border: #e2e8f0;
    --sq-primary: #f97316;
    --sq-success: #10b981;
    --sq-danger: #ef4444;
    --sq-warning: #f59e0b;
}

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

body { 
    background-color: var(--sq-bg); 
    color: var(--sq-text-dark); 
    font-family: 'Inter', sans-serif; /* Sugestão de fonte clean */
    line-height: 1.5;
}

/* 2. CONTAINERS E LAYOUT */
.dash-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 1.5rem; 
    font-size: 0.85rem;
}

/* Header Responsivo */
.dash-header { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center; 
    gap: 1.5rem;
    margin-bottom: 2.5rem; 
}

.dash-header h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.dash-header p { color: var(--sq-text-muted); }

/* Breadcrumb */
.breadcrumb-box { 
    font-size: 0.75rem; 
    color: var(--sq-text-muted); 
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.breadcrumb-box a { color: var(--sq-text-muted); text-decoration: none; }

/* Grid de Estatísticas (Topo) */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 1rem; 
    margin-bottom: 2rem; 
}

/* Layout Principal (Corpo) */
.main-layout { 
    display: grid; 
    grid-template-columns: 1fr 320px; 
    gap: 1.5rem; 
}

/* 3. COMPONENTES (CARDS, BOTÕES, BARS) */
.stat-card {
    background: var(--sq-white); 
    padding: 1.5rem; 
    border-radius: 12px;
    border: 1px solid var(--sq-border); 
    position: relative;
}

.stat-label { font-size: 0.7rem; font-weight: 700; color: var(--sq-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin-top: 8px; display: block; }
.stat-icon { position: absolute; top: 1.5rem; right: 1.5rem; color: var(--sq-border); font-size: 1.2rem; }

.badge-status {
    background: var(--sq-white); border: 1px solid var(--sq-border);
    padding: 0.75rem 1.25rem; border-radius: 12px; display: flex; align-items: center; gap: 12px;
}

.card-white { 
    background: var(--sq-white); border-radius: 16px; border: 1px solid var(--sq-border);
    padding: 1.5rem; margin-bottom: 1.5rem;
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.card-title { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }

/* Abas/Filtros de Período */
.btn-group { background: var(--sq-bg); padding: 4px; border-radius: 8px; display: flex; gap: 4px; }
.btn-tab { 
    padding: 6px 16px; border-radius: 6px; text-decoration: none; 
    font-size: 0.75rem; font-weight: 600; color: var(--sq-text-muted); transition: 0.2s;
}
.btn-tab.active { background: var(--sq-white); color: var(--sq-primary); border: 1px solid var(--sq-border); }

/* Barras de Progresso */
.progress-container { margin-bottom: 1.25rem; }
.progress-labels { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 600; font-size: 0.75rem; }
.progress-bar-bg { height: 8px; background: var(--sq-bg); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; }

/* Widgets */
.goal-box { background: var(--sq-text-dark); color: white; border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; }
.btn-primary-clean {
    background: var(--sq-primary); color: white; width: 100%; padding: 0.8rem;
    border-radius: 10px; text-decoration: none; font-weight: 700; text-align: center;
    display: block; transition: 0.2s; border: none; cursor: pointer;
}

/* 4. GRÁFICOS */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px; /* Mantém proporção em diferentes telas */
}

/* 5. MEDIA QUERIES (RESPONSIVIDADE) */

/* Tablets e Monitores Pequenos */
@media (max-width: 992px) {
    .main-layout { grid-template-columns: 1fr; }
    
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge-status { width: 100%; justify-content: center; }
}

/* Telemóveis Portáteis */
@media (max-width: 600px) {
    .dash-container { padding: 1rem; }
    
    .stats-grid { grid-template-columns: 1fr; }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-group { width: 100%; }
    .btn-tab { flex: 1; text-align: center; padding: 8px 4px; }
    
    .dash-header h1 { font-size: 1.3rem; }
    
    .chart-container { height: 250px; } /* Reduz um pouco a altura em telas muito pequenas */
}