:root {
  --background: #f4f5f1;
  --surface: #ffffff;
  --text: #252a26;
  --muted: #68716b;
  --border: #d8ddd8;
  --accent: #326047;
  --accent-light: #edf4ef;
  --error: #a33c32;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
a { color: inherit; }
button, input { font: inherit; }
.page-shell { width: min(900px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 24px; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-box, .form-panel { width: 100%; max-width: 440px; padding: 30px; background: var(--surface); border: 1px solid var(--border); }
h1 { margin: 0 0 24px; font-size: 27px; line-height: 1.2; font-weight: 650; }
.login-box h1 { margin-bottom: 24px; }
.stack-form { display: grid; gap: 10px; }
.stack-form label, .form-field label, .form-field legend { font-size: 14px; font-weight: 600; }
.field-input { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--text); background: white; border: 1px solid var(--border); border-radius: 4px; }
.field-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.button { min-height: 42px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.button-primary { color: white; background: var(--accent); }
.button-primary:hover { background: #284d39; }
.button-secondary { color: var(--text); background: white; border-color: var(--border); }
.button-secondary:hover { background: var(--background); }
.button-danger { min-height: 34px; padding: 5px 9px; color: var(--error); background: white; border-color: var(--border); font-size: 13px; }
.button-danger:hover { background: #fbefed; border-color: var(--error); }
.button-wide { width: 100%; margin-top: 6px; }
.form-error { margin: 0; color: var(--error); font-size: 13px; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); }
.brand-block { padding: 8px 0; }
.wordmark { font-weight: 650; text-decoration: none; }
.route-summary { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.content-main { padding: 42px 0; }
.content-main h1 { margin-bottom: 20px; }
.table-section { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
th { background: #f8f9f7; font-size: 13px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.row-action { width: 1%; white-space: nowrap; }
.row-action form { margin: 0; }
.empty-state { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; }
.form-main { display: flex; justify-content: center; padding: 48px 0; }
.form-panel h1 { margin-bottom: 22px; }
.ride-form { gap: 18px; }
.form-field { display: grid; gap: 7px; }
.direction-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.direction-field legend { margin-bottom: 7px; }
.direction-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.direction-option { cursor: pointer; }
.direction-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.direction-choice { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 4px; }
.direction-option input:checked + .direction-choice { color: var(--accent); background: var(--accent-light); border-color: var(--accent); }
.direction-option input:focus-visible + .direction-choice { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-check { margin-left: auto; visibility: hidden; }
.direction-option input:checked + .direction-choice .choice-check { visibility: visible; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.notice { margin: 0 0 16px; padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.notice-success { color: var(--accent); background: var(--accent-light); }

@media (max-width: 560px) {
  .page-shell { padding: 0 16px; }
  .topbar { align-items: flex-start; padding: 14px 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .button { min-height: 40px; padding: 7px 10px; font-size: 13px; }
  .content-main { padding: 30px 0; }
  .login-box, .form-panel { padding: 22px; }
  .form-main { padding: 30px 0; }
  th, td { padding: 11px 12px; }
}