:root {
  --bg: #0a0b0e;
  --bg-2: #101217;
  --panel: #14171d;
  --panel-2: #1a1e26;
  --line: #262b35;
  --line-2: #323845;
  --text: #e9ecf2;
  --muted: #8a93a6;
  --dim: #5d6577;
  --accent: #e10600;
  --accent-2: #ff3b30;
  --amber: #ffb020;
  --green: #22c55e;
  --blue: #3b82f6;
  --c-practice: #3b82f6;
  --c-quali: #f5b301;
  --c-race: #e10600;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --font: 'Titillium Web', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(225, 6, 0, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(59, 130, 246, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(225, 6, 0, 0.45); }

/* ------------------------------------------------------------ Layout --- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; background: linear-gradient(180deg, #0d0f13, #0a0b0e); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8b0400); box-shadow: 0 6px 20px -6px rgba(225, 6, 0, 0.7);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-text b { display: block; font-size: 17px; letter-spacing: 0.04em; font-weight: 900; text-transform: uppercase; }
.brand-text span { font-size: 12px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.nav-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-weight: 600; transition: background 0.15s, color 0.15s; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(225, 6, 0, 0.18), rgba(225, 6, 0, 0.02)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--dim); display: grid; gap: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(10, 11, 14, 0.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: 0.01em; }
.topbar .spacer { flex: 1; }
.content { padding: 26px 28px 120px; max-width: 1480px; width: 100%; }
.menu-btn { display: none; }

/* --------------------------------------------------------- Komponenten --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2, .card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head > div:first-child { flex: 1; }
.card-head .sub { margin-bottom: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12.5px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform 0.06s, background 0.15s, border-color 0.15s, opacity 0.15s; text-decoration: none; font-size: 14px;
}
.btn:hover { background: #222733; border-color: #3d4453; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, #f0150f, #c40500); border-color: #ff3b30; color: #fff; box-shadow: 0 6px 18px -8px rgba(225, 6, 0, 0.9); }
.btn.primary:hover { background: linear-gradient(180deg, #ff2a24, #d10600); }
.btn.success { background: linear-gradient(180deg, #23b455, #16893f); border-color: #2fd46a; color: #fff; }
.btn.warn { background: rgba(255, 176, 32, 0.12); border-color: rgba(255, 176, 32, 0.45); color: #ffd27a; }
.btn.danger { background: rgba(225, 6, 0, 0.1); border-color: rgba(225, 6, 0, 0.45); color: #ff8a85; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line-2); background: var(--panel); }
.pill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill.on { color: #8df0b0; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); }
.pill.on .led { background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); animation: pulse 1.8s infinite; }
.pill.off { color: var(--muted); }
.pill.busy { color: #ffd27a; border-color: rgba(255, 176, 32, 0.4); background: rgba(255, 176, 32, 0.08); }
.pill.busy .led { background: var(--amber); animation: blink 0.8s infinite; }
.pill.err { color: #ff8a85; border-color: rgba(225, 6, 0, 0.45); background: rgba(225, 6, 0, 0.1); }
.pill.err .led { background: var(--accent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes blink { 50% { opacity: 0.3; } }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); text-transform: uppercase; }
.tag.p { color: #9cc3ff; border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.1); }
.tag.q { color: #ffd667; border-color: rgba(245, 179, 1, 0.4); background: rgba(245, 179, 1, 0.1); }
.tag.r { color: #ff8a85; border-color: rgba(225, 6, 0, 0.45); background: rgba(225, 6, 0, 0.1); }
.tag.dlc { color: #d7b8ff; border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.1); }
.cc { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 900; letter-spacing: 0.05em; background: #fff; color: #111; }

/* -------------------------------------------------------------- Felder --- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.field .help { font-size: 12.5px; color: var(--dim); }
.field .value-badge { margin-left: auto; font-family: var(--mono); color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #0e1015;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; min-width: 0;
}
.input:focus { border-color: rgba(225, 6, 0, 0.7); box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.18); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea.input { font-family: var(--mono); font-size: 13px; resize: vertical; min-height: 320px; line-height: 1.5; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--panel-2); color: var(--muted); font-size: 13px; cursor: default; }
.input-group button.addon { cursor: pointer; }
.input-group button.addon:hover { color: var(--text); }

.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #0e1015; cursor: pointer; user-select: none; }
.toggle:hover { border-color: var(--line-2); }
.toggle input { display: none; }
.toggle .sw { width: 38px; height: 22px; border-radius: 22px; background: #2a2f3a; position: relative; flex: none; transition: background 0.2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cfd5e0; transition: transform 0.2s; }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(16px); background: #fff; }
.toggle .t { display: grid; }
.toggle .t b { font-weight: 600; font-size: 14px; }
.toggle .t span { font-size: 12.5px; color: var(--dim); }

input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: #2a2f3a; outline: none; padding: 0; border: 0; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.range-wrap { padding: 10px 0 4px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #0e1015; border: 1px solid var(--line-2); gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13.5px; }
.seg button.on { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.p button.on { color: #9cc3ff; }
.seg.q button.on { color: #ffd667; }
.seg.r button.on { color: #ff8a85; }

/* ---------------------------------------------------------------- Hero --- */
.hero { position: relative; border-radius: 20px; overflow: hidden; min-height: 300px; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); isolation: isolate; background: #111; }
.hero-bg { position: absolute; inset: 0; z-index: -3; background-size: cover; background-position: center; transition: background 0.6s; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 22px); }
.hero-sky { position: absolute; inset: 0; z-index: -2; transition: background 0.6s; mix-blend-mode: soft-light; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5, 6, 8, 0.92) 0%, rgba(5, 6, 8, 0.6) 45%, rgba(5, 6, 8, 0.15) 100%), linear-gradient(0deg, rgba(5, 6, 8, 0.95) 0%, transparent 45%); }
.hero-word { position: absolute; right: -10px; bottom: 54px; z-index: -1; font-size: clamp(70px, 11vw, 170px); font-weight: 900; line-height: 0.85; text-transform: uppercase; letter-spacing: -0.02em; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.16); white-space: nowrap; pointer-events: none; font-style: italic; }
.hero-sun { position: absolute; z-index: -2; width: 180px; height: 180px; border-radius: 50%; filter: blur(30px); transition: all 0.6s; }
.hero-clouds { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; transition: opacity 0.6s; }
.hero-clouds i { position: absolute; border-radius: 50%; background: rgba(220, 228, 240, 0.55); filter: blur(28px); animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-30%); } to { transform: translateX(130%); } }
.hero-rain { position: absolute; inset: -40px; z-index: -1; pointer-events: none; background-image: repeating-linear-gradient(105deg, rgba(190, 210, 255, 0.0) 0 9px, rgba(190, 210, 255, 0.35) 9px 10px, rgba(190, 210, 255, 0) 10px 23px); background-size: 120px 120px; animation: rain 0.45s linear infinite; transition: opacity 0.6s; }
@keyframes rain { from { background-position: 0 0; } to { background-position: -30px 120px; } }
.hero-inner { position: relative; padding: 28px 30px 22px; display: flex; flex-direction: column; min-height: 300px; gap: 14px; }
.hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero h2 { margin: 6px 0 0; font-size: clamp(30px, 4vw, 50px); line-height: 1; font-weight: 900; letter-spacing: -0.01em; text-transform: uppercase; font-style: italic; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
.hero .server-name { color: #cfd5e0; font-size: 15px; margin-top: 2px; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; background: rgba(10, 11, 14, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px); font-weight: 600; font-size: 13.5px; }
.chip svg { width: 16px; height: 16px; opacity: 0.9; }
.chip b { font-family: var(--mono); font-weight: 600; }
.hero-cover-btn { position: absolute; top: 16px; right: 16px; z-index: 2; opacity: 0.0; transition: opacity 0.2s; }
.hero:hover .hero-cover-btn { opacity: 1; }

.timeline { display: flex; gap: 4px; height: 46px; margin-top: 6px; }
.timeline .seg-s { position: relative; border-radius: 8px; padding: 6px 10px; min-width: 64px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; background: rgba(10, 11, 14, 0.72); border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: blur(8px); }
.timeline .seg-s::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.timeline .seg-s::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--c), transparent 70%); opacity: 0.18; }
.timeline .seg-s b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.timeline .seg-s span { font-size: 11.5px; color: #b9c0cf; white-space: nowrap; font-family: var(--mono); position: relative; }
.timeline .seg-s.live { box-shadow: inset 0 0 0 1px var(--c), 0 0 18px -4px var(--c); }

/* ------------------------------------------------------------ Dashboard --- */
.stat { display: grid; gap: 2px; }
.stat .k { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.stat .v { font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -0.02em; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.meter { height: 6px; background: #20242d; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--amber) 70%, var(--accent)); background-size: 300% 100%; border-radius: 6px; transition: width 0.6s; }
.join-box { display: grid; gap: 10px; }
.copy-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #0e1015; border: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }
.copy-line .k { color: var(--dim); font-family: var(--font); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; width: 92px; flex: none; font-weight: 700; }
.copy-line .v { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drivers { display: grid; gap: 6px; }
.driver { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: #0e1015; border: 1px solid var(--line); }
.num-plate { height: 30px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-style: italic; font-size: 16px; background: #fff; color: #111; font-family: var(--font); }
.driver .n { font-weight: 700; }
.driver .c { font-size: 12.5px; color: var(--muted); }
.feed { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.feed-item { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.feed-item time { font-family: var(--mono); color: var(--dim); font-size: 12px; flex: none; }
.feed-item .ic { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); background: var(--dim); }
.feed-item.join .ic { background: var(--green); }
.feed-item.leave .ic { background: var(--amber); }
.feed-item.session .ic { background: var(--blue); }
.feed-item.error .ic { background: var(--accent); }
.empty { display: grid; place-items: center; gap: 8px; text-align: center; color: var(--dim); padding: 26px 10px; font-size: 14px; }
.empty svg { width: 34px; height: 34px; opacity: 0.5; }

/* ---------------------------------------------------------- Track-Grid --- */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.track-card { position: relative; border-radius: 12px; padding: 12px; min-height: 92px; cursor: pointer; overflow: hidden; border: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; transition: transform 0.12s, border-color 0.15s; isolation: isolate; text-align: left; }
.track-card::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--bg-img); background-size: cover; background-position: center; opacity: 0.85; }
.track-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 6, 8, 0.92), rgba(5, 6, 8, 0.25)); }
.track-card:hover { transform: translateY(-2px); border-color: #4a5263; }
.track-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.45), 0 10px 30px -12px rgba(225, 6, 0, 0.7); }
.track-card b { font-size: 15px; font-weight: 700; }
.track-card span { font-size: 12px; color: #b9c0cf; display: flex; gap: 6px; align-items: center; }
.track-card .tag { position: absolute; top: 8px; right: 8px; font-size: 10px; }
.track-card .check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: none; place-items: center; }
.track-card.on .check { display: grid; }
.track-card .check svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------ Sessions --- */
.sessions { display: grid; gap: 10px; }
.session-row { display: grid; grid-template-columns: 34px 190px repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 12px 14px 14px; border-radius: 12px; background: #0e1015; border: 1px solid var(--line); border-left: 4px solid var(--c); }
.session-row .idx { font-family: var(--mono); color: var(--dim); font-weight: 600; align-self: center; font-size: 18px; }
.session-row .acts { display: flex; gap: 4px; align-self: center; }
.presets-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-btn { display: grid; text-align: left; gap: 0; padding: 8px 12px; border-radius: 10px; background: #0e1015; border: 1px dashed var(--line-2); cursor: pointer; }
.preset-btn:hover { border-color: var(--accent); border-style: solid; }
.preset-btn b { font-size: 13.5px; }
.preset-btn span { font-size: 12px; color: var(--dim); font-family: var(--mono); }

/* ---------------------------------------------------------- Entrylist --- */
.entry { border-radius: 12px; background: #0e1015; border: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; }
.entry-head { display: grid; grid-template-columns: 74px 1fr 1fr 110px 110px 110px auto; gap: 12px; align-items: end; }
.entry .big-num { height: 42px; font-size: 22px; text-align: center; font-weight: 900; font-style: italic; background: #fff; color: #111; border-color: #fff; }
.driver-row { display: grid; grid-template-columns: 1fr 1fr 74px 1.4fr 130px auto; gap: 8px; align-items: end; }
.entry-flags { display: flex; gap: 8px; flex-wrap: wrap; }
.entry-flags .toggle { padding: 6px 10px; }

/* -------------------------------------------------------------- Tabellen --- */
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 10px 12px; background: #0e1015; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid #1c2029; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
tr.click { cursor: pointer; }
td.pos { font-weight: 900; font-style: italic; font-size: 16px; width: 44px; }
tr.p1 td.pos { color: #ffd667; }
tr.p2 td.pos { color: #d6dbe5; }
tr.p3 td.pos { color: #e3a46b; }
.purple { color: #c084fc; font-weight: 700; }
td .input { padding: 6px 8px; }

/* -------------------------------------------------------------- Konsole --- */
.console-wrap { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.terminal { background: #07080a; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0e1015; border-bottom: 1px solid var(--line); }
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights i { width: 11px; height: 11px; border-radius: 50%; background: #3a3f4b; }
.term-bar .lights i:nth-child(1) { background: #ff5f57; }
.term-bar .lights i:nth-child(2) { background: #febc2e; }
.term-bar .lights i:nth-child(3) { background: #28c840; }
.term-bar .input { padding: 6px 10px; max-width: 260px; font-size: 13px; }
.term-body { height: calc(100vh - 260px); min-height: 380px; overflow: auto; padding: 12px 0; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; }
.ln { display: flex; gap: 14px; padding: 0 16px; white-space: pre-wrap; word-break: break-word; }
.ln:hover { background: rgba(255, 255, 255, 0.03); }
.ln time { color: #475063; flex: none; user-select: none; }
.ln.err { color: #ff7b72; }
.ln.ok { color: #7ee2a8; }
.ln.warn { color: #ffcf70; }
.ln.info { color: #8cb8ff; }
.ln.sys { color: #6b7385; font-style: italic; }
.cmd-group { display: grid; gap: 4px; margin-bottom: 14px; }
.cmd-group h4 { margin: 0 0 4px; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.cmd { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: #0e1015; border: 1px solid var(--line); cursor: pointer; text-align: left; }
.cmd:hover { border-color: var(--accent); }
.cmd code { font-family: var(--mono); font-size: 12.5px; color: #ffb4b0; flex: none; }
.cmd span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- Savebar --- */
.savebar { position: fixed; left: calc(248px + 28px); right: 28px; bottom: 20px; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-radius: 14px; background: rgba(26, 30, 38, 0.92); backdrop-filter: blur(16px); border: 1px solid rgba(255, 176, 32, 0.35); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8); transform: translateY(140%); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.savebar.show { transform: none; }
.savebar .msg { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.savebar .msg .led { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* -------------------------------------------------------------- Toasts --- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; animation: tin 0.25s ease-out; border-left: 4px solid var(--green); }
.toast.err { border-left-color: var(--accent); }
.toast.warn { border-left-color: var(--amber); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* --------------------------------------------------------------- Login --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login::before { content: ''; position: absolute; inset: -20%; background: conic-gradient(from 200deg at 60% 40%, rgba(225, 6, 0, 0.35), transparent 30%, rgba(59, 130, 246, 0.2) 55%, transparent 75%, rgba(225, 6, 0, 0.25)); filter: blur(80px); animation: spin 30s linear infinite; }
.login::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 26px); }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); padding: 34px; border-radius: 20px; background: rgba(16, 18, 23, 0.82); backdrop-filter: blur(20px); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9); display: grid; gap: 18px; }
.login-card h1 { margin: 0; font-size: 30px; font-weight: 900; text-transform: uppercase; font-style: italic; letter-spacing: 0.01em; line-height: 1; }
.login-card h1 span { color: var(--accent); }
.checker { height: 10px; border-radius: 3px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 10px 10px; opacity: 0.85; }

/* --------------------------------------------------------------- Diverse --- */
.dropzone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 26px; text-align: center; display: grid; gap: 8px; place-items: center; color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(225, 6, 0, 0.05); }
.dropzone svg { width: 36px; height: 36px; opacity: 0.7; }
.progress { height: 8px; border-radius: 8px; background: #20242d; overflow: hidden; width: 100%; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(59, 130, 246, 0.07); border: 1px solid rgba(59, 130, 246, 0.25); font-size: 13.5px; color: #c4d6f5; }
.callout.warn { background: rgba(255, 176, 32, 0.07); border-color: rgba(255, 176, 32, 0.3); color: #f3dcae; }
.callout.err { background: rgba(225, 6, 0, 0.08); border-color: rgba(225, 6, 0, 0.35); color: #ffc2bf; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: #0e1015; border: 1px solid var(--line); }
.list-item + .list-item { margin-top: 8px; }
.list-item .grow { flex: 1; min-width: 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-2); }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-row { grid-template-columns: 34px 1fr 1fr 1fr; }
  .session-row .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .entry-head { grid-template-columns: 74px 1fr 1fr; }
  .driver-row { grid-template-columns: 1fr 1fr 74px; }
  .console-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: none; box-shadow: 0 0 80px rgba(0, 0, 0, 0.9); }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px 120px; }
  .topbar { padding: 12px 16px; }
  .topbar .hide-sm { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .savebar { left: 16px; right: 16px; flex-wrap: wrap; }
  .session-row { grid-template-columns: 1fr 1fr; }
  .session-row .idx { display: none; }
  .entry-head, .driver-row { grid-template-columns: 1fr 1fr; }
  .hero-inner { padding: 20px; }
}

/* ------------------------------------------------- Fahrzeuge & Modal --- */
.car-slot { display: inline-flex; flex: none; width: 74px; }
.car-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.driver { grid-template-columns: 52px 1fr auto; }
.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 7, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: tin 0.15s ease-out; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; flex: 1; font-family: var(--mono); font-size: 18px; color: #ffb4b0; }
.modal-head .btn { font-size: 22px; line-height: 1; width: 34px; height: 34px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pick-grid { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding-right: 4px; }
.pick { display: grid; grid-template-columns: 52px 78px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 10px; background: #0e1015; border: 1px solid var(--line); cursor: pointer; }
.pick:hover { border-color: var(--line-2); background: #12151b; }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.35); }
.pick .num-plate { height: 28px; font-size: 15px; }
.pick-text { display: grid; min-width: 0; }
.pick-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-text span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-preview { display: block; padding: 12px 14px; border-radius: 10px; background: #07080a; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 16px; color: #7ee2a8; }
.quick-track { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.quick-track .field { flex: 1; min-width: 200px; }
@media (max-width: 860px) { .pick { grid-template-columns: 48px 1fr auto; } .pick .car-slot { display: none; } }
.car-img { width: 100%; height: 34px; object-fit: contain; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.car-slot { width: 92px; }
.pick { grid-template-columns: 52px 96px 1fr auto; }
