:root {
  --db: #ec0016;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #d1d5db;
  --bg: #f4f5f7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: #0b5cad; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 3px solid var(--db); padding: 10px 16px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar .who { color: var(--muted); font-size: 14px; }

.wrap { max-width: 960px; margin: 20px auto; padding: 0 16px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; margin-top: 24px; }
.muted { color: var(--muted); }
.err { color: var(--db); font-weight: 600; }
.ok { color: #067647; font-weight: 600; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 14px 0; }
.login { max-width: 380px; margin: 60px auto; }

label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
input, select, textarea { width: 100%; padding: 9px 10px; font-size: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
textarea { resize: vertical; }

button { cursor: pointer; font-size: 14px; }
button.primary, .primary.btn { background: var(--db); color: #fff; border: 0; padding: 10px 16px; border-radius: 8px; font-weight: 600; display: inline-block; }
button.btn, .btn { background: #fff; border: 1px solid var(--line); padding: 9px 14px; border-radius: 8px; color: var(--ink); }
button.link { background: none; border: 0; color: #0b5cad; padding: 0; }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.grid legend, fieldset legend { font-weight: 700; padding: 0 6px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { background: #f9fafb; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.actions a { margin-right: 8px; }

.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.badge.final { background: #d1fae5; color: #065f46; }
.badge.draft { background: #fef3c7; color: #92400e; }

/* trips */
.trip-head, .trip-row { display: grid; grid-template-columns: 90px 1fr 90px 90px 80px 34px; gap: 6px; align-items: center; }
.trip-head { font-size: 11px; color: var(--muted); text-transform: uppercase; margin: 6px 0; }
.trip-row { margin: 5px 0; }
.trip-row input { padding: 7px 8px; }
.trip-row .del { background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--db); }

.actions-bar { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; display: flex; gap: 10px; justify-content: flex-end; }

.autocomplete { border: 1px solid var(--line); border-radius: 7px; max-height: 220px; overflow: auto; margin-top: -4px; background: #fff; }
.autocomplete:empty { display: none; }
.ac-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #eee; }
.ac-item:hover { background: #f0f6ff; }

.inline-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.inline-form input { width: auto; flex: 1; }

@media (max-width: 620px) {
  .trip-head { display: none; }
  .trip-row { grid-template-columns: 1fr 1fr; }
  .trip-row input[name="von_nach"] { grid-column: 1 / -1; }
}
