/* Liquid-Glass-Design: translucent Cards, weiche Verläufe, SF-Typografie */
:root {
  --accent: #0071e3;
  --accent-dark: #0060c0;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --red: #d63a2f;
  --red-bg: rgba(214, 58, 47, .1);
  --amber: #b25e02;
  --amber-bg: rgba(255, 159, 10, .14);
  --green: #1d7a3d;
  --green-bg: rgba(48, 209, 88, .14);
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-border: rgba(255, 255, 255, .75);
  --hairline: rgba(60, 60, 67, .12);
  --shadow: 0 10px 34px rgba(24, 39, 75, .09), 0 2px 8px rgba(24, 39, 75, .05);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px; line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(0, 113, 227, .16), transparent 60%),
    radial-gradient(900px 600px at 105% 8%, rgba(175, 82, 222, .13), transparent 55%),
    radial-gradient(900px 700px at 55% 115%, rgba(48, 209, 88, .10), transparent 55%),
    #f4f5f7;
  background-attachment: fixed;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 252, .72);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--hairline);
}
.nav { display: flex; align-items: center; justify-content: space-between;
       gap: 12px; flex-wrap: wrap; padding: 12px 20px; }
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
nav { display: flex; gap: 4px; align-items: center; background: rgba(120,120,128,.1);
      border-radius: 999px; padding: 4px; }
nav a { color: var(--text); text-decoration: none; font-size: .92rem;
        padding: 7px 16px; border-radius: 999px; transition: background .18s, color .18s; }
nav a:hover { background: rgba(120,120,128,.14); }
nav a.active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 600; }
.logout-form { margin: 0; }
.logout-form button { background: none; border: 0; color: var(--muted);
  font-size: .9rem; cursor: pointer; padding: 7px 10px; border-radius: 999px; }
.logout-form button:hover { background: rgba(120,120,128,.12); color: var(--text); }

main { padding: 34px 20px 72px; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; margin: 0 0 20px; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.02em; margin: 30px 0 14px; }
.lead { color: var(--muted); margin: -10px 0 22px; max-width: 62ch; }

/* ---------- Cards & Stats ---------- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px; margin-bottom: 22px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
         gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  border: 1px solid var(--glass-border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px;
  transition: transform .18s ease;
}
.stat:hover { transform: translateY(-2px); }
.stat .num { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; }
.stat .label { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.stat.accent .num { color: var(--accent); }
.stat.red .num { color: var(--red); }

/* ---------- Tabellen ---------- */
.page-spacer { height: 80px; }
.site-footer { text-align: center; color: var(--muted); font-size: .82rem;
  padding: 26px 0 10px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.legal-text h2 { margin-top: 18px; }
.legal-text ul { padding-left: 20px; }
.all-trains { margin-top: 18px; }
.all-trains > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center;
  gap: 8px; font-weight: 600; font-size: .95rem; color: var(--accent, #0071e3);
  padding: 10px 16px; border-radius: 999px; background: rgba(120,120,128,.1);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.all-trains > summary::-webkit-details-marker { display: none; }
.all-trains > summary::before {
  content: "▸"; display: inline-block; transition: transform .18s ease;
}
.all-trains[open] > summary::before { transform: rotate(90deg); }
.all-trains > summary:hover { background: rgba(120,120,128,.18); }

.table-scroll { overflow-x: auto; border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 16px; text-align: left; }
th { font-weight: 600; font-size: .8rem; text-transform: uppercase;
     letter-spacing: .04em; color: var(--muted);
     border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { border-bottom: 1px solid rgba(60, 60, 67, .07); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(0, 113, 227, .05); }
tr.relevant td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px;
         font-size: .78rem; font-weight: 600; letter-spacing: .01em; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-grey { background: rgba(120,120,128,.12); color: var(--muted); }

/* ---------- Formulare ---------- */
form label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], select {
  width: 100%; max-width: 440px; padding: 11px 14px;
  border: 1px solid rgba(60, 60, 67, .18); border-radius: 12px;
  font-size: .97rem; font-family: inherit; color: var(--text);
  background: rgba(255, 255, 255, .82);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236e6e73' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .18); }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }

button, .btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 22px; font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(0, 113, 227, .25);
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:active, .btn:active { transform: scale(.97); }
button.secondary { background: rgba(120,120,128,.14); color: var(--text); box-shadow: none; }
button.secondary:hover { background: rgba(120,120,128,.22); }
button.danger { background: var(--red-bg); color: var(--red); box-shadow: none; }
button.danger:hover { background: rgba(214, 58, 47, .18); }
.btn.small, button.small { padding: 7px 14px; font-size: .85rem; }

.flash { padding: 13px 18px; border-radius: 14px; margin-bottom: 16px;
  border: 1px solid transparent; font-size: .93rem;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.flash-success { background: var(--green-bg); color: var(--green);
  border-color: rgba(48, 209, 88, .25); }
.flash-error { background: var(--red-bg); color: var(--red);
  border-color: rgba(214, 58, 47, .22); }
.flash a { color: inherit; font-weight: 600; }
.muted { color: var(--muted); }
.inline-form { display: inline; }

.filter-bar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  margin-bottom: 20px; }
.filter-bar label { margin: 0 0 6px; }
.filter-bar input { max-width: 180px; }

/* ---------- Autocomplete ---------- */
.autocomplete { position: relative; max-width: 440px; }
.autocomplete ul { position: absolute; z-index: 30; left: 0; right: 0; margin: 6px 0 0;
  padding: 6px; list-style: none;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--glass-border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(24, 39, 75, .18);
  max-height: 250px; overflow-y: auto; }
.autocomplete li { padding: 9px 12px; cursor: pointer; border-radius: 9px;
  font-size: .95rem; }
.autocomplete li:hover, .autocomplete li.sel { background: rgba(0, 113, 227, .1); }
.autocomplete li.info { color: var(--muted); cursor: default; font-size: .87rem; }
.autocomplete li.info:hover { background: none; }

.check-row { display: flex; gap: 10px; flex-wrap: wrap; }
.check-row label { display: flex; align-items: center; gap: 7px; font-weight: 500;
  margin: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(120,120,128,.09); border: 1px solid transparent;
  transition: background .15s, border-color .15s; font-size: .9rem; }
.check-row label:has(input:checked) { background: rgba(0, 113, 227, .1);
  border-color: rgba(0, 113, 227, .35); color: var(--accent-dark); }
.check-row input { accent-color: var(--accent); }
.time-row { display: flex; gap: 10px; max-width: 440px; align-items: center; }
.time-row select { max-width: 200px; }

/* ---------- Login ---------- */
.login-shell { min-height: calc(100vh - 60px); display: flex;
  align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; text-align: center; padding: 40px 34px; }
.login-card .train { font-size: 2.6rem; }
.login-card h1 { font-size: 1.45rem; margin: 10px 0 4px; }
.login-card p { color: var(--muted); margin: 0 0 20px; font-size: .93rem; }
.login-card input { max-width: 100%; text-align: center; }
.login-card button { width: 100%; margin-top: 16px; }

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 18px; }
  nav a { padding: 6px 11px; font-size: .86rem; }
}
