/* NeoCore Analytics — dunkles Premium-Theme, Montserrat (Basis aus Reports-Admin) */

:root {
  --bg: #060A14;
  --bg-elev: #0A1124;
  --bg-card: #141a2d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F4F8;
  --text-muted: #8A92A6;
  --accent: #58A6FF;
  --accent-dim: rgba(88, 166, 255, 0.15);
  --navy: #0E2146;
  --ok: #4ADE80;
  --warn: #FBBF24;
  --err: #F87171;
  --neutral: #94A3B8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.nav-brand { font-weight: 700; letter-spacing: -0.01em; font-size: 15px; color: var(--text); }
.nav-brand small { color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.nav-links { display: flex; gap: 24px; flex: 1; }
.nav-links a {
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 4px 0; text-decoration: none; border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.nav-logout { color: var(--text-muted); font-size: 12px; font-weight: 500; margin-left: 16px; }
.nav-logout:hover { color: var(--text); text-decoration: none; }

main { max-width: 1200px; margin: 0 auto; padding: 40px 32px 80px; }

h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 40px 0 16px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 32px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 8px; }
.card { background: var(--bg-card); border: 1px solid var(--border); padding: 20px; border-radius: 4px; }
.card.live { border-color: rgba(74, 222, 128, 0.35); }
.card-label { color: var(--text-muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin: 0 0 8px; }
.card-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; font-variant-numeric: tabular-nums; }
.card-sub { color: var(--text-muted); font-size: 12px; margin: 4px 0 0; }
.card-value.err { color: var(--err); }
.card-value.live { color: var(--ok); }

table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; font-size: 13px; }
thead { background: rgba(255, 255, 255, 0.02); }
th { text-align: left; padding: 12px 16px; color: var(--text-muted); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid; }
.badge-ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
.badge-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.badge-err { color: var(--err); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.badge-neutral { color: var(--neutral); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.badge-accent { color: var(--accent); border-color: rgba(88, 166, 255, 0.4); background: var(--accent-dim); }

.btn { display: inline-block; padding: 8px 16px; background: transparent; border: 1px solid var(--border-strong); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 4px; }
.btn:hover { background: rgba(255, 255, 255, 0.04); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--navy); }

.row-actions { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; gap: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--text-muted); font-family: inherit; font-size: 12px; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.seg button.active { background: var(--accent-dim); color: var(--accent); }

/* Live-Punkt (pulsierend) */
.livedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: pulse 1.8s infinite; }
.livedot.zero { background: var(--neutral); animation: none; box-shadow: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5);} 70% { box-shadow: 0 0 0 6px rgba(74,222,128,0);} 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0);} }

/* Balken (Quellen, Länder, Geräte …) */
.bars { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 16px 20px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: rgba(255,255,255,0.04); border-radius: 3px; height: 18px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 3px; min-width: 2px; }
.bar-val { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .split, .split-3 { grid-template-columns: 1fr; } }

/* Mini-Säulen-Chart (Zeitreihe) */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 16px; }
.chart-col { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.85; }
.chart-col:hover { opacity: 1; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item { display: grid; grid-template-columns: 90px 1fr 140px; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.timeline-item:last-child { border-bottom: none; }
.timeline-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline-detail { color: var(--text-muted); font-size: 12px; text-align: right; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: 4px; }
.error-banner { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.4); color: var(--err); padding: 12px 16px; border-radius: 4px; font-size: 13px; margin: 20px 0; }
.muted { color: var(--text-muted); }
.mono { font-family: 'SF Mono', Menlo, monospace; font-size: 12px; }
.note { color: var(--text-muted); font-size: 12px; margin-top: 8px; }
