:root { --red: #e30613; --bg: #f6f6f6; --fg: #1d1d1d; --muted: #666; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--fg); }
.topbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--red); color: #fff; }
.topbar a { color: #fff; }
.brand { font-weight: 700; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
nav .who { opacity: .9; }
nav form { margin: 0; }
nav button { background: transparent; color: #fff; border: 1px solid #fff; border-radius: 4px; padding: .25rem .6rem; cursor: pointer; }
main { max-width: 56rem; margin: 1.5rem auto; padding: 0 1rem; }
.card, form { max-width: 28rem; }
input, select, textarea { width: 100%; padding: .5rem; font: inherit; border: 1px solid #bbb; border-radius: 4px; }
button[type=submit], .btn { background: var(--red); color: #fff; border: 0; border-radius: 4px; padding: .5rem 1rem; font: inherit; cursor: pointer; }
.messages { list-style: none; padding: .5rem 1rem; background: #fff3cd; border-radius: 4px; }
.errorlist { color: #b00020; padding-left: 1rem; }
.btn-group, .alert { margin: .5rem 0; }
.head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.head h1 { margin: .5rem 0; }
.actions { display: flex; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.btn { text-decoration: none; display: inline-block; }
button.danger, button[type=submit].danger { background: #fff; color: #b00020; border: 1px solid #b00020; border-radius: 4px; padding: .5rem 1rem; font: inherit; cursor: pointer; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1rem 0; }
.tabs a { padding: .4rem .8rem; border-radius: 4px; background: #e6e6e6; color: var(--fg); text-decoration: none; }
.tabs a.active { background: var(--fg); color: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
th { font-size: .85rem; color: var(--muted); }
.empty { color: var(--muted); }
.status { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .85rem; background: #e6e6e6; white-space: nowrap; }
.status-requested { background: #fff3cd; }
.status-accepted, .status-completed { background: #d1e7dd; }
.status-change_requested { background: #ffe5b4; }
.status-en_route, .status-patient_on_board { background: #cfe2ff; }
.status-rejected, .status-cancelled { background: #f8d7da; }
.notice { background: #fff; border-left: 4px solid var(--red); padding: .6rem 1rem; }
.ride-form { max-width: 36rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field small { display: block; color: var(--muted); }
.field input[type=checkbox] { width: auto; }
.has-error input, .has-error select { border-color: #b00020; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; background: #fff; padding: 1rem; }
dt { color: var(--muted); }
dd { margin: 0; }
@media (max-width: 40rem) { dl { grid-template-columns: 1fr; } table { font-size: .9rem; } }
.badge { display: inline-block; vertical-align: middle; font-size: .85rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--red); color: #fff; }
.badge.flash { animation: flash 1s ease-in-out 3; }
@keyframes flash { 50% { background: #ffb400; color: #000; } }
tr.open td { background: #fffbea; }
.warn { color: #b00020; }
.filterbar { display: flex; flex-wrap: wrap; gap: 1rem; max-width: none; margin-bottom: 1rem; }
.filterbar label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.filterbar select { width: auto; min-width: 12rem; }
.panel { background: #fff; border-left: 4px solid var(--fg); padding: .5rem 1rem 1rem; margin: 1rem 0; }
.panel h2 { margin: .5rem 0; font-size: 1.1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; max-width: none; margin-bottom: .75rem; }
.inline-form label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.inline-form input { width: auto; min-width: 12rem; }
