:root {
  --bg: #0d1117; --panel: #161b22; --panel-2: #1c232c; --border: #2b333d; --border-soft: #21262d;
  --text: #e6edf3; --muted: #93a1b0; --dim: #6e7681; --accent: #2f81f7; --accent-2: #58a6ff;
  --good: #3fb950; --err: #f85149;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 34px 30px; width: 100%; max-width: 330px; text-align: center;
}
.login-card .brand { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.login-card .muted { margin: 0 0 20px; }
.login-card input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 14px; margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button {
  width: 100%; background: var(--accent); border: none; color: #fff; border-radius: 10px;
  padding: 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.login-card button:hover { background: var(--accent-2); }
.login-card button:disabled { opacity: .6; cursor: default; }
.accent { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); font-size: 13px; margin: 8px 0 0; }
.pad { padding: 24px; }

/* ---- Top bar ---- */
.bar {
  display: flex; align-items: center; gap: 14px; padding: 15px 22px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(13,17,23,.88);
  backdrop-filter: blur(8px); z-index: 5;
}
.bar .logo { font-size: 17px; font-weight: 600; }
.bar .sub { color: var(--muted); font-size: 13px; flex: 1; }
.bar .actions { display: flex; gap: 8px; }
.ghost {
  background: var(--border-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 12px; font: inherit; font-size: 15px; cursor: pointer; line-height: 1; transition: border-color .15s;
}
.ghost:hover { border-color: var(--accent); }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(63,185,80,.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,185,80,.5); } 70% { box-shadow: 0 0 0 7px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }

.chip {
  background: var(--border-soft); color: var(--muted); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 13px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }

main { max-width: 940px; margin: 0 auto; padding: 26px 22px 70px; }

/* ---- Letzte Configs (Aufklapp-Liste) ---- */
.rec-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 8px; margin-bottom: 30px; max-height: 420px; overflow-y: auto; }
.rec-item { padding: 12px 14px; border-radius: 10px; }
.rec-item + .rec-item { border-top: 1px solid var(--border-soft); }
.rec-l { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.rec-type { font-weight: 600; font-size: 13.5px; }
.rec-when { color: var(--dim); font-size: 11.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.rec-set { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.rec-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-tag { background: rgba(47,129,247,.12); color: var(--accent-2); border-radius: 6px; padding: 3px 8px; font-size: 11px; }
.rec-none { color: var(--dim); font-size: 11px; }

/* ---- Total ---- */
.total-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px; margin-bottom: 30px; display: flex; align-items: baseline; gap: 12px;
}
.total-card .n { font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.5px; }
.total-card .lbl { color: var(--muted); font-size: 14px; }

h2.sec { font-size: 13px; font-weight: 600; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.block { margin-bottom: 34px; }

/* ---- Prozent-Kreise ---- */
.circles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 22px 8px; }
.circ { text-align: center; }
.ring { width: 74px; height: 74px; display: block; margin: 0 auto 8px; }
.ring-bg { fill: none; stroke: var(--border-soft); stroke-width: 6.5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6.5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%; animation: draw .9s ease both; }
@keyframes draw { from { stroke-dashoffset: 163.4; } }
.ring-t { fill: var(--text); font-size: 15px; font-weight: 600; }
.circ-lbl { font-size: 12.5px; line-height: 1.25; }
.circ-cnt { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ---- Verteilungen (Balken + Donut) ---- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; }
.dist-card h4 { font-size: 12px; font-weight: 600; margin: 0 0 10px; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 84px; height: 84px; flex: none; }
.donut circle { transition: stroke-dasharray .5s ease; }
.legend { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.leg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.leg-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-v { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg-v .cnt { color: var(--dim); }
.row { margin: 9px 0; }
.row .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 10px; }
.row .top .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .pct { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .cnt { color: var(--dim); }
.track { background: var(--border-soft); border-radius: 6px; height: 7px; overflow: hidden; }
.fill { background: var(--accent); height: 100%; border-radius: 6px; transition: width .5s ease; }

/* ---- Pro Display-Typ ---- */
.pd { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.pd-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.pd-name { font-weight: 600; font-size: 15px; }
.pd-type { color: var(--dim); font-size: 12px; }
.pd-total { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pd-dists { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 24px; margin-bottom: 16px; }
.pd-fh { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.pd-flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; }
.pd .row { margin: 7px 0; }
.pd-empty { color: var(--dim); font-size: 12px; }

/* ---- Nachtmodus-Zeitfenster ---- */
.night-card { display: flex; flex-direction: column; justify-content: center; }
.night-big { font-size: 30px; font-weight: 600; letter-spacing: .5px; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.night-big .dash { color: var(--dim); margin: 0 4px; }
.night-sub { color: var(--muted); font-size: 12px; }

.meta { color: var(--dim); font-size: 12px; text-align: center; padding: 0 20px 34px; }
