/* Gemeinsame Basis aller Dashboard-Varianten */
:root {
  --bg: #0A1622; --bg-deep: #060E17;
  --surface: #10202F; --surface-2: #142A3D;
  --line: rgba(160,196,224,0.10); --line-strong: rgba(160,196,224,0.22);
  --ink: #E8F0F7; --ink-2: #93A9BD; --ink-3: #5C7288;
  --ok: #35D0A8; --warn: #F5B84A; --crit: #F0655A; --blue: #5CA8FF;
  --glow-ok: rgba(53,208,168,0.35); --glow-blue: rgba(92,168,255,0.35);
  --ms-red: #F25022; --ms-green: #7FBA00; --ms-blue: #00A4EF; --ms-yellow: #FFB900;
  --cx-blue: #2F80ED;
  --radius: 14px; --gap: clamp(10px, 1.1vw, 18px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 800px at 70% -10%, #16304A 0%, var(--bg) 55%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums; overflow: hidden; cursor: default;
}
body.idle { cursor: none; }
body::before {
  content: ""; position: fixed; inset: 0;
  background-image: linear-gradient(rgba(160,196,224,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(160,196,224,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  pointer-events: none;
}
.app { position: relative; height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: var(--gap); gap: var(--gap); }

/* Kopf */
header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--ok)); display: grid; place-items: center; box-shadow: 0 0 24px var(--glow-blue); }
.brand .mark svg { width: 22px; height: 22px; }
.brand h1 { font-size: clamp(16px, 1.35vw, 22px); font-weight: 600; letter-spacing: -0.01em; }
.brand h1 span { color: var(--ink-2); font-weight: 400; }
.headright { display: flex; align-items: center; gap: 28px; }
.live { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: clamp(12px, 0.95vw, 15px); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--glow-ok); } 70% { box-shadow: 0 0 0 10px rgba(53,208,168,0); } 100% { box-shadow: 0 0 0 0 rgba(53,208,168,0); } }
.clock { text-align: right; line-height: 1.1; }
.clock .time { font-size: clamp(22px, 2.1vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.clock .date { font-size: clamp(11px, 0.9vw, 14px); color: var(--ink-2); }

/* Raster + Karten */
main { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(6, 1fr); gap: var(--gap); min-height: 0; }
.card { background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(12px, 1.2vw, 20px); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
.card h2 { font-size: clamp(12px, 0.95vw, 15px); font-weight: 500; color: var(--ink-2); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card h2 small { color: var(--ink-3); font-weight: 400; }
canvas.fill { flex: 1; width: 100%; height: 100%; min-height: 0; }

/* Bausteine */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(10px, 1vw, 16px) clamp(12px, 1.2vw, 18px); display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.kpi .v { font-size: clamp(22px, 2vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.kpi .v small { font-size: 0.5em; color: var(--ink-2); font-weight: 500; margin-left: 3px; }
.kpi .k { font-size: clamp(11px, 0.85vw, 13px); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: clamp(10px, 0.8vw, 12px); color: var(--ok); }
.kpi .d.neg { color: var(--warn); }
.bar { height: 6px; border-radius: 4px; background: rgba(160,196,224,0.12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); transition: width 1.5s ease; }
.bar i.ok { background: var(--ok); } .bar i.warn { background: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); } .dot.blue { background: var(--blue); } .dot.off { background: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: clamp(11px, 0.9vw, 14px); white-space: nowrap; background: rgba(53,208,168,0.10); border: 1px solid rgba(53,208,168,0.35); color: var(--ok); }
.pill.warn { background: rgba(245,184,74,0.10); border-color: rgba(245,184,74,0.4); color: var(--warn); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Ereignis-Feed */
.feed ul { list-style: none; flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.feed li { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: start; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,0.025); border: 1px solid transparent; font-size: clamp(11px, 0.88vw, 14px); animation: enter .6s cubic-bezier(.2,.8,.2,1); }
.feed li:first-child { border-color: var(--line-strong); background: rgba(92,168,255,0.06); }
@keyframes enter { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.feed .t { color: var(--ink-3); font-size: 0.9em; padding-top: 2px; }
.feed .dot { margin-top: 6px; }
.feed .msg { line-height: 1.35; }
.feed .msg b { font-weight: 600; }
.feed .msg span { color: var(--ink-2); }

/* Anbieter-Logos (Bilddateien in logos/) */
.logoimg { display: inline-block; width: auto; max-width: 200px; object-fit: contain; vertical-align: middle; flex: none; }
.svc { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: clamp(11px, 0.9vw, 14px); }
.svc:first-of-type { border-top: 0; }
.svc .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.svc .nm { display: flex; flex-direction: column; min-width: 0; }
.svc .nm span { color: var(--ink-3); font-size: 0.85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc .lat { color: var(--ink-2); font-size: 0.9em; white-space: nowrap; }
.svc .st { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 500; white-space: nowrap; }
.svc .st.warn { color: var(--warn); }

/* Laufband */
footer { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 0 8px 14px; overflow: hidden; font-size: clamp(11px, 0.88vw, 14px); color: var(--ink-2); }
footer .tag { color: var(--ink); font-weight: 500; white-space: nowrap; padding-right: 14px; border-right: 1px solid var(--line-strong); }
.ticker { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent); }
.ticker div { display: inline-block; padding-left: 100%; animation: ticker 70s linear infinite; animation-delay: -22s; }
.ticker span { margin-right: 56px; }
.ticker b { color: var(--ok); font-weight: 500; }
.ticker em { color: var(--warn); font-style: normal; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* Navigations-Hinweis (blendet sich aus) */
.navhint { position: fixed; right: 18px; bottom: 60px; font-size: 12px; color: var(--ink-3); background: rgba(6,14,23,0.85); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; opacity: 0; transition: opacity .4s; pointer-events: none; }
body:not(.idle) .navhint { opacity: 1; }
.navhint b { color: var(--ink-2); font-weight: 500; }

@media (prefers-reduced-motion: reduce) { .ticker div, .live i { animation: none; } }
