:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

header.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.topbar h1 { font-size: 18px; margin: 0; }

nav.tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid var(--border);
}

nav.tabs a {
  text-decoration: none;
  color: var(--muted);
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

nav.tabs a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

main {
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.caption {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .kpis, .kpis.kpis-4 { grid-template-columns: repeat(2, 1fr); }
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.kpi-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}

table.dash {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

table.dash th, table.dash td {
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

table.dash th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

table.dash tr:last-child td { border-bottom: none; }

table.dash td.num { font-variant-numeric: tabular-nums; }

table.dash td.colored { font-weight: 600; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.chart-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

select, button, input[type="password"] {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
}

button {
  cursor: pointer;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

button.secondary {
  background: white;
  color: var(--text);
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.login-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  width: 320px;
}

.login-card h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error {
  color: #dc2626;
  font-size: 13px;
}

.right-actions { display: flex; gap: 8px; align-items: center; }
.right-actions a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.right-actions a:hover { color: var(--text); }
