:root {
  /* Farben und Schriften wie tellallyourfriends.de: dunkles Braunschwarz, Gold, Rost. Immer dunkel wie die Homepage. */
  color-scheme: dark;
  --bg: #14100c;
  --surface: #1e1813;
  --text: #d2ccba;
  --muted: #a59d8c;
  --line: #3a3128;
  --primary: #d3ae42;
  --on-primary: #14100c;
  --rust: #b8492b;
  --danger: #e07a5a;
  --ok: #8fb37f;
  --radius: 12px;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.4; }
h1, h2 { margin: 0 0 0.75rem; line-height: 1.1; font-family: "Barlow Condensed", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--primary); }
h2 { font-size: 1.4rem; text-shadow: 1px 1px 0 rgba(184, 73, 43, 0.55); }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 0.85rem; }
.ok { color: var(--ok); }
.neg { color: var(--danger); }
a { color: var(--primary); }

input, select, button, .button { font: inherit; color: inherit; }
input, select {
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
input[type="checkbox"] { width: 1.2rem; min-height: 1.2rem; accent-color: var(--primary); }
input:disabled { opacity: 0.5; }
input.short { width: 6rem; }
button, .button {
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button:disabled { opacity: 0.6; cursor: wait; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; }
.tabs button { border: none; background: none; white-space: nowrap; }
.tabs button.active { background: var(--primary); color: var(--on-primary); }

main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; align-items: end; }
.grid .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: 0.25rem; }
.tile strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }

table.list { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.list th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: normal; }
.list th, .list td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list tr.planned td { font-style: italic; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button, .trip-head button { min-height: 32px; padding: 0 0.5rem; border: none; background: none; color: var(--muted); }

.trip { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.trip-head { display: flex; gap: 0.5rem; align-items: center; }
.trip-head button { margin-left: auto; }
.car { padding: 1rem 0; border-bottom: 1px solid var(--line); }

.login { display: grid; place-items: center; min-height: 100vh; }
.login form { display: flex; flex-direction: column; gap: 0.5rem; width: min(360px, 90vw); }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }
.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 2;
  max-width: 90vw;
}

@media (max-width: 640px) {
  /* Laufender Stand passt auf dem Handy nicht mehr in die Zeile */
  #view-ledger .list th:nth-child(4), #view-ledger .list td:nth-child(4) { display: none; }
}

/* Inline-Bearbeitung in der Buchungsliste: sieht aus wie Text, wird beim Zeigen/Fokus zum Feld. */
input.inline { border-color: transparent; background: transparent; width: 100%; min-width: 8rem; padding-inline: 0.3rem; }
input.inline:hover { border-color: var(--line); }
input.inline:focus { border-color: var(--primary); background: var(--surface); }
.filters { margin-bottom: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Branding: Logo wie auf der Homepage, mit rostfarbenem Schein. */
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { height: 40px; width: auto; filter: drop-shadow(0 0 12px rgba(184, 73, 43, 0.35)); }
.login .brand-logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto 1rem; filter: drop-shadow(0 2px 24px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 40px rgba(184, 73, 43, 0.35)); }
.login h1 { text-align: center; font-size: 1.5rem; }
.tabs button { font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.05rem; }
.topbar { border-bottom: 2px solid var(--rust); }
.list tr.month th { background: var(--bg); color: var(--primary); font-family: "Barlow Condensed", sans-serif; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.03em; padding-top: 0.9rem; }
.list tr.month th .muted { font-family: "DM Sans", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
select.inline { border-color: transparent; background: transparent; min-width: 9rem; }
select.inline:hover, select.inline:focus { border-color: var(--line); background: var(--surface); }
.tag { display: inline-block; border: 1px solid var(--rust); color: var(--text); border-radius: 999px; padding: 0 0.5rem; font-size: 0.75rem; }
#view-ledger select.inline { width: 11rem; min-width: 0; }
#view-ledger td:nth-child(2) { width: 45%; }
