/* SM-Prüfung — Design-Tokens und Grundbausteine aus senvis-hub (Petrol #0d7377) */
:root {
  --primary: #0d7377; --primary-hover: #0a5c60; --primary-light: #e6f2f2;
  --bg: #f2f5f7; --surface: #ffffff; --surface-2: #f8fafb;
  --text: #1a2332; --text-muted: #58697a; --text-subtle: #96aab8;
  --border: #dde4ea;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --green: #10b981; --green-light: #d1fae5; --red: #ef4444; --red-light: #fee2e2;
  --topbar-h: 52px; --container: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Roboto Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #18b0b6; --primary-hover: #0d7377; --primary-light: #0b2e30;
    --bg: #0e1822; --surface: #162030; --surface-2: #1b2840;
    --text: #dde8f0; --text-muted: #7d92a8; --text-subtle: #4e6070; --border: #243040;
    --green-light: #0c2e1e; --red-light: #2e0d0d;
  }
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
[x-cloak] { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); font-size: 0.875rem; }
.error { color: var(--red); font-size: 0.875rem; margin-top: 0.5rem; }
.center { text-align: center; padding: 1rem 0; }

/* Topbar */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-xs); display: flex; align-items: center;
  padding: 0 1rem; gap: 0.75rem; z-index: 100; }
.topbar__logo { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.topbar__spacer { flex: 1; }
.topbar__user { font-size: 0.8125rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45vw; }
.topbar__logout { font-size: 0.8125rem; color: var(--text-muted); padding: 0.25rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 480px) { .topbar__user { display: none; } }

/* Layout */
.main { max-width: var(--container); margin: 0 auto; padding: calc(var(--topbar-h) + 1rem) 1rem 4rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem; }
.section { margin-bottom: 1rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.section__head h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }

/* Formulare und Buttons */
.form-select { width: 100%; padding: 0.6rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: var(--font); font-size: 0.9rem; }
.form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,115,119,0.13); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.6rem 1.125rem;
  border: 1.5px solid transparent; border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; line-height: 1; white-space: nowrap; transition: background 0.14s, opacity 0.14s; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:not(:disabled):hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:not(:disabled):hover { background: var(--bg); color: var(--text); }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn--big { padding: 1rem 1.5rem; font-size: 1.1rem; width: 100%; }
.btn-row { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.controls { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
@media (min-width: 640px) {
  .btn--big { width: auto; min-width: 16rem; }
  .controls { flex-direction: row; align-items: center; }
}

/* Stationen */
.stations { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.station { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0.75rem; background: var(--surface-2); }
.station--online { border-color: var(--green); }
.station--offline { border-color: var(--red); }
.station__slot { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-subtle); margin-bottom: 0.25rem; }
.station__name { font-weight: 600; margin-bottom: 0.25rem; }
.station__pad { font-size: 0.875rem; margin: 0.5rem 0; }
.badge { display: inline-flex; align-items: center; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.6875rem;
  font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.badge--ok { background: var(--green-light); color: var(--green); }
.badge--off { background: var(--red-light); color: var(--red); }

/* Pads */
.pads { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pad { border: 2px solid var(--border); border-radius: var(--radius); padding: 0.875rem; background: var(--surface-2); transition: background 0.3s, border-color 0.3s; }
.pad--waiting { background: var(--red-light); border-color: var(--red); }
.pad--failed { border-color: var(--red); }
.pad--ok { background: var(--green-light); border-color: var(--green); }
.pad__name { font-weight: 700; font-size: 1.05rem; }
.pad__timers { display: flex; gap: 1rem; margin: 0.6rem 0 0.3rem; }
.timer { display: flex; flex-direction: column; }
.timer__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.timer__value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pad__state { font-size: 0.8rem; }

/* Abschluss */
.finish { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.decision { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.decision__options { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.9rem; }
.decision__options label { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.decision__options input { width: 1.1rem; height: 1.1rem; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.5rem 2rem; width: 100%; max-width: 400px; }
.login-logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.04em; margin-bottom: 0.25rem; }
.login-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 2rem; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 0.625rem; width: 100%; padding: 0.75rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500; }
.google-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.message-box { padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--red-light); color: var(--red); font-size: 0.875rem; border: 1px solid var(--red); margin-bottom: 1.25rem; }
