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

body {
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-box {
    background: #1e293b;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
}

.login-box input:focus {
    outline: none;
    border-color: #3b82f6;
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #2563eb;
}

.error {
    color: #ef4444;
    text-align: center;
    margin-top: 16px;
}

/* Dashboard */
.dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #334155;
}

header h1 {
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#last-update {
    color: #64748b;
    font-size: 0.875rem;
}

.btn-logout {
    padding: 8px 16px;
    background: #334155;
    color: #e2e8f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background: #475569;
}

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

.kpi-card {
    background: #1e293b;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.kpi-card.alert {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.kpi-card.alert .kpi-value {
    color: #fca5a5;
}

.kpi-label {
    color: #94a3b8;
    margin-top: 8px;
    font-size: 0.875rem;
}

/* Sections */
.section {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.section h2 {
    font-size: 1.125rem;
    margin-bottom: 20px;
    color: #f1f5f9;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

th {
    background: #0f172a;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    font-size: 0.875rem;
}

tr:hover {
    background: #334155;
}

/* Chart */
.chart-container {
    height: 300px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header {
        flex-direction: column;
        gap: 16px;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
}
