:root{
  --bg: #f5f3ee;
  --text: #1a1a1a;
  --teal: #1a6b5a;
  --border: #e0ddd5;
  --error: #dc2626;
  --muted: #6b675e;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header{
  background: #1a1a1a;
  color: #fff;
  padding: 14px 16px;
}

.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo{ margin: 0; font-size: 20px; }
.logo-sub{ color: var(--teal); }

nav a{
  color: #fff;
  text-decoration: none;
  margin-left: 14px;
  font-size: 14px;
}
nav a:hover{ text-decoration: underline; }

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
}

.section{ margin-top: 18px; }
h2{ margin: 0; font-size: 22px; }
h3{ font-size: 16px; margin: 0 0 10px; }
.muted{ color: var(--muted); font-weight: 400; }

.card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

/* Kopfzeile mit Filter */
.dash-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.filters{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.input{
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}
.select{ min-width: 160px; }

.btn{
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}
.btn.build{ background: var(--teal); color: #fff; }
.btn.build:hover{ background: #155345; }

/* Kennzahlen-Karten */
.stats{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.stat{ text-align: center; }
.stat-num{ font-size: 30px; font-weight: 750; color: var(--teal); line-height: 1.1; }
.stat-label{ font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Balkendiagramm */
.chart-card{ padding: 16px; }
.bars{ width: 100%; height: auto; display: block; }
.bars .bar{ fill: var(--teal); transition: fill .15s; }
.bars .bar:hover{ fill: #155345; }
.bars .axis{ stroke: var(--border); stroke-width: 1; }
.chart-legend{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* Zwei-Spalten-Layout */
.two-col{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Tabellen */
table.data{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td{
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th{ font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:last-child td{ border-bottom: none; }
table.data td.num, table.data th.num{ text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap{ white-space: nowrap; }
.ua{ color: var(--muted); font-size: 12px; word-break: break-all; }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  word-break: break-all;
}

/* Flash / Fehler */
.flash{
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.flash.error{ border-color: var(--error); color: var(--error); }

/* Login */
.login-section{ max-width: 380px; }
.login-card{ margin-top: 12px; }
.login-card label{ display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.login-card .input{ width: 100%; margin-bottom: 12px; }
.login-card .btn{ width: 100%; }

/* Footer */
.site-footer{
  max-width: 1100px;
  margin: 28px auto 18px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px){
  .stats{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col{ grid-template-columns: 1fr; }
}
