:root {
  --green-dark:  #1e4620;
  --green-mid:   #2e6b31;
  --green-light: #4a9b4f;
  --cream:       #f5f2eb;
  --white:       #ffffff;
  --border:      #d4cfc4;
  --text:        #1a1a1a;
  --text-muted:  #6b6660;
  --red:         #c0392b;
  --badge-pending-bg:   #fff8e1;
  --badge-pending-text: #7a5c00;
  --badge-booked-bg:    #e8f5e9;
  --badge-booked-text:  #1b5e20;
  --badge-failed-bg:    #fce4e4;
  --badge-failed-text:  #7f0000;
  --badge-cancelled-bg: #f0f0f0;
  --badge-cancelled-text: #555;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--green-dark);
  color: var(--white);
  padding: 0 1.25rem;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .01em;
}
nav { display: flex; align-items: center; gap: 1rem; }
.user-name { font-size: .875rem; opacity: .8; }
.nav-link { color: rgba(255,255,255,.75); font-size: .875rem; text-decoration: none; }
.nav-link:hover { color: var(--white); }

/* ── Main ── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ── Flash ── */
.flash {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-header h2 { font-size: 1.25rem; font-weight: 600; }
.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 2rem 0 .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .8rem;
}

/* ── Booking cards ── */
.card-list { display: flex; flex-direction: column; gap: .75rem; }

.booking-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.booking-card.booked  { border-left: 4px solid var(--green-light); }
.booking-card.failed  { border-left: 4px solid var(--red); opacity: .8; }
.booking-card.cancelled { opacity: .6; }

.booking-main { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; }
.booking-date { font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; }
.booking-time { color: var(--text-muted); font-size: .9rem; }
.booking-players { font-size: .85rem; color: var(--text-muted); }

.booking-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.booking-by   { font-size: .8rem; color: var(--text-muted); }
.booking-notes { font-size: .8rem; color: var(--text-muted); max-width: 220px; }

/* ── Status badges ── */
.status-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: .2em .6em;
  border-radius: 99px;
  white-space: nowrap;
}
.status-badge.pending   { background: var(--badge-pending-bg);   color: var(--badge-pending-text); }
.status-badge.booked    { background: var(--badge-booked-bg);    color: var(--badge-booked-text); }
.status-badge.failed    { background: var(--badge-failed-bg);    color: var(--badge-failed-text); }
.status-badge.cancelled { background: var(--badge-cancelled-bg); color: var(--badge-cancelled-text); }

/* ── Empty state ── */
.empty-state { color: var(--text-muted); font-size: .95rem; padding: .5rem 0; }
.empty-state a { color: var(--green-mid); }

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: filter .15s;
}
.btn-primary:hover, .btn-secondary:hover { filter: brightness(.93); }

.btn-primary {
  background: var(--green-mid);
  color: var(--white);
  padding: .5rem 1.1rem;
}
.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .5rem 1.1rem;
}
.btn-ghost-sm {
  background: none;
  color: var(--text-muted);
  font-size: .8rem;
  padding: .25rem .5rem;
  border: 1px solid var(--border);
}
.btn-ghost-sm:hover { background: var(--cream); }
.btn-full { width: 100%; }

/* ── Form card ── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 480px;
}

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.field input[type="date"],
.field select {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  background: var(--white);
  color: var(--text);
  appearance: auto;
}
.field input:focus,
.field select:focus { outline: 2px solid var(--green-mid); outline-offset: 1px; border-color: transparent; }

.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; margin-bottom: 0; }

.field-hint, .range-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .4rem;
}
.range-hint { margin-top: .75rem; margin-bottom: 1.25rem; }

.checkbox-field { margin-bottom: 1.5rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  cursor: pointer;
}
.checkbox-label input { width: 1rem; height: 1rem; accent-color: var(--green-mid); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .5rem;
}

/* ── Auth page ── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.25rem; }
.auth-card label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.auth-card input[type="email"] {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  margin-bottom: 1rem;
}
.auth-card input:focus { outline: 2px solid var(--green-mid); outline-offset: 1px; border-color: transparent; }
