:root {
  --db-red: #ec0016;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --bg: #f5f4f2;
  --line: #ddd8d2;
  --muted: #6b6b6b;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand-mark {
  background: var(--db-red);
  color: white;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 13px;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.step { display: none; }
.step.active { display: block; }

h1 { font-size: 19px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 0 0 16px;
}
legend { font-weight: 600; font-size: 13px; color: var(--muted); padding: 0 6px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
input, select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--db-red); outline-offset: 1px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.time-pair { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.time-pair input { width: 100%; margin-top: 0; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
}
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }
.inline-text { width: auto; flex: 1; margin: 0 0 0 auto; padding: 4px 8px; font-size: 13px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 16px;
  cursor: pointer;
  margin-bottom: 16px;
  text-align: center;
  color: var(--muted);
}
.dropzone:hover { border-color: var(--db-red); }
.dropzone img { max-width: 100%; max-height: 300px; border-radius: 4px; }

.primary-btn {
  background: var(--db-red);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn:disabled { background: #e0a4ab; cursor: not-allowed; }
.primary-btn:hover:not(:disabled) { background: #c40013; }

.ghost-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}
.ghost-btn:hover { border-color: var(--db-red); color: var(--db-red); }

.actions { display: flex; justify-content: space-between; margin-top: 20px; }
.status { font-size: 13px; margin-top: 12px; color: var(--muted); min-height: 18px; }
.status.error { color: var(--db-red); }
.status.ok { color: #1a7a3c; }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 10;
}
.modal-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.nav-actions { display: flex; gap: 8px; }

.summary-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 480px) { .summary-box { grid-template-columns: 1fr 1fr; } }
.summary-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.summary-item .value { font-size: 20px; font-weight: 700; }
.summary-item .label { font-size: 11px; color: var(--muted); }

.list-actions { display: flex; gap: 20px; margin-bottom: 10px; }

.verspaetung-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.verspaetung-row.eingereicht { opacity: 0.5; }
.verspaetung-row .vr-main { flex: 1; }
.verspaetung-row .vr-min { font-weight: 700; }
.verspaetung-row .vr-del { color: var(--db-red); background: none; border: none; cursor: pointer; font-size: 16px; }

hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card { max-width: 380px; width: 100%; }
.auth-card .brand { justify-content: center; margin-bottom: 18px; font-size: 17px; }
.auth-tabs { display: flex; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.auth-tab {
  flex: 1; padding: 9px; border: none; background: var(--paper); color: var(--muted);
  font-size: 13px; cursor: pointer;
}
.auth-tab.active { background: var(--db-red); color: white; }
.auth-card .primary-btn { width: 100%; margin-top: 6px; }

.whoami { font-size: 12px; color: var(--muted); margin-right: 4px; }

.jahres-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.jahres-box .jahres-bar {
  height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px;
}
.jahres-box .jahres-bar-fill { height: 100%; background: var(--db-red); }

.confirm-box {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.confirm-box p { margin: 0 0 8px; font-size: 13px; }
.confirm-box .primary-btn, .confirm-box .ghost-btn { margin-right: 8px; }

.vr-screenshot-link { color: var(--db-red); text-decoration: none; font-size: 12px; margin-left: 6px; }
.vr-screenshot-link:hover { text-decoration: underline; }
