/* dark «glass» theme, the same look as the team's panel */
:root {
  --bg: #090f21; --surface: rgba(22, 34, 72, 0.58); --surface-2: rgba(255, 255, 255, 0.05); --solid: #111b3c;
  --text: #e8eeff; --muted: #8d9dc6; --border: rgba(125, 155, 255, 0.16); --field: rgba(6, 11, 28, 0.55);
  --accent: #4f8cff; --accent-2: #7b61ff; --accent-soft: rgba(79, 140, 255, 0.16);
  --green: #34d399; --green-soft: rgba(52, 211, 153, 0.14); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, 0.14);
  --red: #f87171; --red-soft: rgba(248, 113, 113, 0.14); --cyan: #22d3ee;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.35); --radius: 14px; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--text); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(46, 94, 220, 0.32), transparent 70%),
    radial-gradient(800px 480px at 100% 0%, rgba(123, 97, 255, 0.2), transparent 70%),
    var(--bg);
  background-attachment: fixed; min-height: 100vh;
}
a { color: #86b0ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }
.top { padding: 12px 16px; background: rgba(12, 20, 46, 0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top .inner { max-width: 1040px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; box-shadow: 0 4px 16px rgba(79, 140, 255, 0.45); }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); padding: 16px; margin-top: 16px; }
.card h2 { margin: 0; font-size: 17px; }
h1 { font-size: 24px; margin: 8px 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid .card { margin-top: 0; }
.btn { display: inline-block; font: inherit; text-align: center; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px 14px; cursor: pointer; color: var(--text); }
.btn:hover { background: var(--accent-soft); border-color: rgba(79, 140, 255, 0.4); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, #3b7bff, #5b5cf0); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(79, 140, 255, 0.35); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); color: var(--text); }
input:focus { outline: 2px solid rgba(79, 140, 255, 0.5); border-color: var(--accent); }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 13px; word-break: break-all; }
.alert { background: var(--amber-soft); color: var(--amber); border-radius: var(--radius); padding: 10px 14px; margin-top: 16px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .card { margin-top: 0; padding: 24px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--accent-soft); color: #9cc0ff; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #22346b; color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; box-shadow: var(--shadow); }
#toast.show { opacity: 1; }
#toast.error { background: var(--red); color: #1a0b0b; }
.narrow { max-width: 420px; }

/* numbers and charts */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 16px; }
.kpis .card { margin-top: 0; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.defs-only { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.spark { display: block; width: 100%; height: 40px; }
svg.spark .sp-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .sp-area { fill: url(#gradSpark); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; margin-top: 8px; }
svg.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg.chart .grid-line { stroke: var(--border); stroke-width: 1; }
svg.chart .bar-a { fill: url(#gradBar); }
svg.chart .bar-a:hover { opacity: .75; }
.stop-a { stop-color: #5b9bff; }
.stop-b { stop-color: #5b5cf0; }
.stop-c { stop-color: var(--accent); stop-opacity: .45; }
.stop-d { stop-color: var(--accent); stop-opacity: 0; }

/* the little map of an event instead of its coordinates */
.minimap { position: relative; display: block; width: 220px; height: 110px; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: #0e1832; }
.minimap:hover { border-color: rgba(79, 140, 255, 0.6); text-decoration: none; }
.minimap img { position: absolute; width: 256px; height: 256px; max-width: none; filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.7); user-select: none; }
.minimap .pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.5); }
.minimap .attr { position: absolute; right: 3px; bottom: 2px; font-size: 9px; line-height: 1.4; color: #c9d4f0; background: rgba(6, 11, 28, 0.6); padding: 0 5px; border-radius: 5px; }
td:has(> .minimap) { padding-top: 6px; padding-bottom: 6px; }
