body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #f8f9fb;
    color: #222;
}

h1 {
    font-size: 1.6rem;
    margin: 0 0 1rem 0;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.wrap { padding: 1rem; }

.controls {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
    margin-bottom: 1rem; background: #fff; padding: .5rem;
    border-radius: 8px; border: 1px solid #ddd;
}
.controls label { display: flex; align-items: center; gap: .25rem; }
.controls select, .controls input[type="date"], .controls button {
    padding: .25rem .5rem; font-size: .9rem;
}

.kpis {
    display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: .5rem; margin-bottom: 1rem;
}
.card {
    background: #fff; padding: .75rem; border-radius: 8px; border: 1px solid #ddd; text-align: center;
}
.card div { font-size: .85rem; color: #555; }
.card strong { font-size: 1.2rem; }

.tabs { display: flex; gap: .5rem; margin-bottom: .5rem; }
.tabs button {
    padding: .4rem .8rem; background: #fff; border: 1px solid #ddd; border-radius: 6px; cursor: pointer;
}
.tabs button.active { background: #eef6ff; border-color: #b3d4ff; }

.chart-container {
    background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: .5rem .75rem; margin-bottom: .75rem;
}

.table-wrapper {
    overflow-x: auto; background: #fff; border-radius: 8px; border: 1px solid #ddd;
}

table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: .5rem; border-bottom: 1px solid #eee; text-align: left; }
th { background: #f1f1f1; }
tr:nth-child(even) { background: #fafafa; }

.muted { color: #666; font-size: .85rem; }
.error { color: #c00; font-size: .85rem; margin-top: .5rem; }

/* Login overlay */
.login { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card {
    background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
    width: 100%; max-width: 320px; text-align: center;
}

.toast {
    position: fixed; bottom: 1rem; right: 1rem; background: #333; color: #fff;
    padding: .75rem 1rem; border-radius: 6px; opacity: .95; font-size: .9rem;
}

/* Responsive */
@media (max-width: 1024px) { .kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); } }
@media (max-width: 680px)  { .kpis { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
