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

:root {
    --primary: #1F4E78;
    --success: #92D050;
    --warning: #FFD966;
    --danger: #FF0000;
    --light: #F5F5F5;
    --dark: #333333;
    --border: #E0E0E0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary);
}

.header h1 {
    color: var(--primary);
    font-size: 32px;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 8px;
}

.header .last-update {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.btn-refresh {
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-refresh:hover {
    background: #7FC23D;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-refresh.rotating {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* KPIs Grid */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-icon {
    font-size: 32px;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
}

.kpi-value {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: bold;
}

.kpi-change {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-container h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.chart {
    min-height: 300px;
}

/* Insights Section */
.insights-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.insights-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.insight-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e7ff 100%);
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--primary);
}

.insight-label {
    color: var(--primary);
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
}

.insight-text {
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
}

/* Projects Section */
.projects-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.projects-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--primary);
    color: white;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: var(--light);
}

tbody tr td:last-child {
    font-weight: bold;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.status-bom {
    background: var(--success);
    color: white;
}

.status-ok {
    background: var(--warning);
    color: #333;
}

.status-baixa {
    background: #FFA500;
    color: white;
}

.status-prejuizo {
    background: var(--danger);
    color: white;
}

/* Footer */
.footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .kpis-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}
