* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #000000;
  font-family: 'Inter', Arial, sans-serif;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---------------- Header ---------------- */
.letterhead {
  text-align: center;
  margin-bottom: 8px;
}
.letterhead h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.letterhead p {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 2px 0 0;
}

.text-link {
  background: none;
  border: none;
  color: #333;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 10px;
  padding: 4px;
  font-family: inherit;
}

/* ---------------- Menu bar ---------------- */
.menu-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 2px solid #000;
  padding-bottom: 16px;
  margin: 20px 0 30px;
}
.menu-btn {
  border: 2px solid #000;
  background: #fff;
  color: #000;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.menu-btn:active { background: #eee; }
.menu-btn.active { background: #000; color: #fff; }
.menu-btn--logout { border-color: #B00020; color: #B00020; margin-left: auto; }

@media (max-width: 540px) {
  .menu-bar { justify-content: stretch; }
  .menu-btn { flex: 1 1 calc(50% - 5px); }
  .menu-btn--logout { margin-left: 0; }
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 14px;
}

.form-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 32px;
}

/* ---------------- Form ---------------- */
.booking-form { width: 100%; }

.form-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.form-row label {
  flex: 0 0 190px;
  font-size: 1rem;
  text-align: left;
}

.form-row input,
.form-row textarea {
  flex: 1;
  min-width: 0;
  border: 2px solid #000;
  border-radius: 0;
  padding: 9px 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #000;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid #444;
  outline-offset: 1px;
}
.form-row input:disabled {
  background: #f0f0f0;
  color: #666;
}

.form-row--textarea { align-items: flex-start; }
.form-row--textarea label { padding-top: 9px; }
.form-row--textarea textarea { resize: vertical; }

@media (max-width: 540px) {
  .form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .form-row label { flex: none; }
  .form-row input,
  .form-row textarea { width: 100%; }
}

/* ---------------- Buttons ---------------- */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn-outline {
  border: 2px solid #000;
  background: #fff;
  color: #000;
  padding: 13px 34px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-outline:active { background: #eee; }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Messages ---------------- */
.form-message {
  text-align: center;
  font-size: 0.9rem;
  margin: 4px 0 0;
}
.form-message.error { color: #B00020; }
.form-message.success { color: #0A7A3D; }

.hidden { display: none !important; }

/* ---------------- Confirmation ---------------- */
.confirmation-box {
  border: 2px solid #000;
  padding: 18px 22px;
  max-width: 480px;
  margin: 0 auto 24px;
}
.confirmation-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed #bbb;
  font-size: 0.95rem;
}
.confirmation-row:last-child { border-bottom: none; }
.confirmation-row span:first-child { color: #555; flex: 0 0 auto; }
.confirmation-row span:last-child { font-weight: 600; text-align: right; }

/* ---------------- Manage bookings ---------------- */
.list-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 14px;
  text-align: center;
}

.or-divider {
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  margin: 28px 0 20px;
}

.booking-card--selectable {
  cursor: pointer;
}
.booking-card--selectable:active { background: #f6f6f6; }
.booking-card__edit-hint {
  font-size: 0.78rem;
  color: #555;
  margin-top: 8px;
  text-decoration: underline;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}
.filter-row select {
  border: 2px solid #000;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.booking-card {
  border: 2px solid #000;
  padding: 14px 16px;
}
.booking-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.booking-card__ref {
  font-weight: 700;
  font-size: 0.95rem;
}
.booking-card__route { font-size: 0.95rem; margin: 4px 0; }
.booking-card__meta { font-size: 0.85rem; color: #444; margin: 2px 0; }
.booking-card__desc { font-size: 0.85rem; color: #444; margin-top: 6px; font-style: italic; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1.5px solid #000;
  white-space: nowrap;
}
.status-badge--pending { background: #fff; }
.status-badge--confirmed { background: #E8F0FE; }
.status-badge--completed { background: #E6F4EA; color: #0A7A3D; border-color: #0A7A3D; }
.status-badge--cancelled { background: #FBEAEA; color: #B00020; border-color: #B00020; }

.booking-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.btn-small {
  border: 2px solid #000;
  background: #fff;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-small:active { background: #eee; }
.btn-small--complete { border-color: #0A7A3D; color: #0A7A3D; }
.btn-small--cancel { border-color: #B00020; color: #B00020; }

/* ---------------- Dashboard ---------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}
@media (min-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
  border: 2px solid #000;
  padding: 14px 10px;
  text-align: center;
}
.stat-card__value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card__label {
  font-size: 0.75rem;
  color: #444;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-card--alert { border-color: #B00020; }
.stat-card--alert .stat-card__value { color: #B00020; }
