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

:root {
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --text: #111827;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --border: #e5e7eb;
  --radius: 6px;
  --font: system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --transition: 150ms ease;
  --warn-bg: #fef9c3; --warn-text: #854d0e; --warn-border: #fde68a;
  --warning-text: #b45309;
}

body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border); min-height: 60px;
}
.site-header .logo { font-weight: 700; font-size: 1.25rem; color: var(--text); transition: color var(--transition); }
.site-header .logo:hover { color: var(--accent); text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .625rem 1rem; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); cursor: pointer;
  font-size: .875rem; font-family: inherit; line-height: 1.25;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { background: var(--bg-subtle); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: inherit; font-family: inherit; padding: 0; min-height: unset; transition: color var(--transition); }
.btn-link:hover { text-decoration: underline; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-sm { min-height: 32px; padding: .25rem .625rem; font-size: .8rem; }

/* Main layout */
main { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Hero */
.hero { max-width: 600px; padding: 4rem 0; }
.hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero p { color: var(--text-muted); font-size: 1.125rem; margin-bottom: 1.5rem; }
.feature-list { list-style: none; margin-bottom: 2rem; }
.feature-list li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.feature-list li { padding: .25rem 0; color: var(--text-muted); }

/* Dashboard nav */
.dash-nav { display: flex; gap: .5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; flex-wrap: wrap; }
.dash-nav a { padding: .375rem .75rem; border-radius: var(--radius); font-size: .875rem; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.dash-nav a:hover, .dash-nav a.active { background: var(--bg-subtle); color: var(--text); text-decoration: none; }

/* Page heading */
.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* Cards */
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .75rem; display: flex; align-items: center; justify-content: space-between; transition: border-color var(--transition), box-shadow var(--transition); }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.card-title { font-weight: 600; }
.card-meta { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-arrow { color: var(--text-muted); transition: transform var(--transition); }
.card-link:hover .card-arrow { transform: translateX(3px); }
.card-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.card-list { margin-bottom: 2rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; padding: .5rem .75rem; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-muted); }
td { padding: .625rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="number"], input[type="time"], input[type="color"], select, textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .875rem; font-family: inherit;
  background: var(--bg); transition: border-color var(--transition);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); border-color: var(--accent); }
input:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .8rem; color: #ef4444; margin-top: .25rem; }
.form-actions { margin-top: 1.5rem; }
.form-inline { display: inline; }

/* Alert */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }

/* Status badges */
.badge { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-pending   { background: var(--warn-bg); color: var(--warn-text); }
.badge-confirmed { background: #dcfce7; color: #166534; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* Slot grid */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; }
.slot-grid-wrap { margin-bottom: 1.5rem; }
.slot-btn {
  padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); cursor: pointer; font-size: .875rem; text-align: center;
  min-height: 44px; transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.slot-btn:hover { border-color: var(--accent); color: var(--accent); }
.slot-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot-empty { padding: 1rem 0; }

/* Date nav */
.date-nav { display: flex; gap: .375rem; margin-bottom: 1rem; flex-wrap: wrap; }
.date-btn {
  padding: .375rem .625rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .8rem; cursor: pointer; background: var(--bg);
  min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.date-btn:hover, .date-btn.active { border-color: var(--accent); color: var(--accent); }
.date-btn-day  { font-weight: 600; font-size: .875rem; }
.date-btn-date { font-size: .75rem; color: var(--text-muted); }

/* Booking picker */
.back-link { color: var(--text-muted); font-size: .875rem; }
.back-link:hover { color: var(--text); text-decoration: none; }
.picker-header { margin-bottom: 1.5rem; }
.picker-header h1 { margin-top: .5rem; }
.booking-form-section { max-width: 400px; }

/* Confirm / splash */
.confirm-page  { max-width: 500px; margin: 4rem auto; text-align: center; }
.confirm-icon  { font-size: 3rem; margin-bottom: 1rem; }
.confirm-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }

/* Layout utilities */
.content-narrow { max-width: 600px; }
.content-form   { max-width: 500px; }
.action-row  { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filter-row  { margin-bottom: 1.5rem; }
.section-intro   { margin-bottom: 2rem; }
.section-heading { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.hidden { display: none; }

/* Text utilities */
.text-muted   { color: var(--text-muted); }
.text-warning { color: var(--warning-text); }

/* Color dot */
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }

/* Availability table */
.avail-table { width: 100%; border-collapse: collapse; }
.avail-table td { padding: .5rem .75rem; vertical-align: middle; }
.avail-table input[type="time"] { width: auto; }

/* Details / summary */
details summary { cursor: pointer; font-weight: 600; margin-bottom: 1rem; padding: .5rem 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details .detail-body { margin-top: 1rem; }

/* Mobile */
@media (max-width: 640px) {
  main { padding: 1.5rem 1rem; }
  .avail-table, table { display: block; overflow-x: auto; }
  .site-header { padding: 1rem; }
}
