:root {
  --bg: #f6f7f7; --fg: #15191c; --muted: #66707a; --card: #fff;
  --border: #e2e6e8; --accent: #0d9488; --accent-fg: #fff; --accent-soft: #ccfbf1;
  --error: #b42318; --red-soft: #fee4e2; --orange: #b54708; --orange-soft: #fef0c7;
  --chip: #eef1f3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416; --fg: #e8ecee; --muted: #93a0aa; --card: #1a1f22;
    --border: #2a3136; --accent: #2dd4bf; --accent-fg: #06201d; --accent-soft: #0f3b36;
    --error: #f97066; --red-soft: #4a1a17; --orange: #fdb022; --orange-soft: #3d2a08;
    --chip: #242b30;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 32px 0 10px; }
h3 { font-size: 1.1rem; margin: 0; }
code { font-size: .9em; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); margin-top: 0; }
.small { font-size: .85rem; }
.error { color: var(--error); }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.empty { text-align: center; padding: 40px 20px; }

/* header */
.bar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--fg); }
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.bar nav a { color: var(--muted); }
.bar nav a.active, .bar nav a:hover { color: var(--fg); text-decoration: none; }
.bar form { margin: 0; }
.count { background: var(--error); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 6px; }
.wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }

.notice, .alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice { background: var(--accent-soft); }
.alert { background: var(--red-soft); color: var(--fg); }
.alert-soft { background: var(--orange-soft); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* trips */
.trip { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.trip > summary { list-style: none; cursor: pointer; padding: 16px 20px; }
.trip > summary::-webkit-details-marker { display: none; }
.trip[open] > summary { border-bottom: 1px solid var(--border); }
.trip-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: flex-start; }
.trip-meta { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.trip.is-cancelled h3 { text-decoration: line-through; color: var(--muted); }

.bookings, .deadlines, .mails { list-style: none; margin: 0; padding: 0; }
.bookings > li, .deadlines > li, .mails > li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-top: 1px solid var(--border);
}
.bookings > li:first-child, .deadlines > li:first-child, .mails > li:first-child { border-top: 0; }
.card.bookings, .card.deadlines, .card.mails { padding: 0; }
.deadlines > li { align-items: center; }
.emoji { font-size: 1.4rem; line-height: 1.2; width: 1.8rem; text-align: center; flex: none; }
.booking-main, .mail-main { flex: 1; min-width: 0; }
.booking-name { font-weight: 600; color: var(--fg); }
.booking.is-cancelled .booking-name, .booking.is-cancelled .price { text-decoration: line-through; color: var(--muted); }
.price { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.details { margin: 8px 0 0; font-size: .9rem; color: var(--muted); white-space: pre-line; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badges:empty { display: none; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.badge-teal { background: var(--accent-soft); color: var(--fg); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--error); font-weight: 600; }
.badge-muted { background: var(--chip); color: var(--muted); }
.badge-mono { font-family: ui-monospace, Menlo, monospace; }

.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.mail-actions form { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.filters a { padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: .85rem; }
.filters a.active { background: var(--accent); color: var(--accent-fg); }

/* forms */
.form-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; margin-top: 16px; }
.grid-form .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg);
  padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .button {
  font: inherit; cursor: pointer; display: inline-block; padding: 9px 14px;
  border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-fg);
}
.button:hover { text-decoration: none; }
.login button { margin-top: 8px; }
button.secondary { background: var(--chip); color: var(--fg); }
button.small { padding: 5px 10px; font-size: .85rem; }
button.danger { background: var(--red-soft); color: var(--error); }
button.link { background: none; color: var(--muted); padding: 0; }
button.link:hover { color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions form { margin: 0; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 520px) {
  .bookings > li, .deadlines > li, .mails > li { flex-wrap: wrap; padding: 12px 16px; }
  .mails > li .mail-actions { justify-content: flex-start; width: 100%; }
  .trip > summary { padding: 14px 16px; }
}
