:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --text: #1f2a36;
  --muted: #607384;
  --primary: #005a9c;
  --primary-strong: #003d69;
  --ok: #1f7a4f;
  --error: #b8312f;
  --border: #d7e0ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(160deg, #f2f5f9 0%, #eef8f6 100%);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
}

.login-shell {
  max-width: 540px;
}

.login-panel {
  margin-top: 8vh;
}

h1, h2, h3 {
  margin-top: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input, select, button {
  font: inherit;
}

input, select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.62rem 0.9rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  align-self: end;
}

button:hover {
  background: var(--primary-strong);
}

.logout-btn {
  background: #516173;
}

.logout-btn:hover {
  background: #3f4d5c;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}

.filter-row label {
  display: grid;
  gap: 0.35rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}

.kpi span {
  color: var(--muted);
  font-size: 0.9rem;
  display: block;
}

.kpi strong {
  font-size: 1.05rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

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

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

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.95rem;
}

th {
  background: #f8fbff;
}

.alert {
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.7rem;
}

.alert.success {
  background: #e8f7ef;
  color: var(--ok);
  border: 1px solid #bce7cf;
}

.alert.error {
  background: #fdeceb;
  color: var(--error);
  border: 1px solid #f4c2c1;
}
