/* ============================================================
   FairPlay Padel — dashboard theme
   "Clean light / Stripe" : white surfaces, soft shadows,
   refined type, indigo accent. Designed to feel premium.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:          #f5f7fb;
  --bg-grad-a:   #fbfcfe;
  --bg-grad-b:   #eef1f8;
  --panel:       #ffffff;
  --panel-2:     #f7f8fb;   /* subtle inset / table head */
  --border:      #e7e9f0;
  --border-2:    #dfe2ec;

  /* Text */
  --text:        #16192c;
  --text-soft:   #3c4257;
  --muted:       #6b7280;
  --faint:       #98a1b3;

  /* Brand / accent (indigo "blurple") */
  --accent:        #635bff;
  --accent-hover:  #4f47e6;
  --accent-soft:   #ecebff;
  --accent-ink:    #4338ca;

  /* Status */
  --ok:        #0e9f6e;
  --ok-soft:   #e3f6ee;
  --warn:      #b45309;
  --warn-soft: #fdf0d5;
  --danger:      #df1b41;
  --danger-soft: #fde7eb;

  /* Padel-ball touch */
  --ball: #c6f135;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(20, 24, 48, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 24, 48, 0.06), 0 1px 3px rgba(20, 24, 48, 0.05);
  --shadow-md: 0 2px 4px rgba(20, 24, 48, 0.04), 0 6px 16px rgba(20, 24, 48, 0.08);
  --shadow-lg: 0 10px 30px rgba(20, 24, 48, 0.10), 0 4px 8px rgba(20, 24, 48, 0.05);
  --ring:      0 0 0 3px rgba(99, 91, 255, 0.22);

  /* Geometry */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(99,91,255,0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(14,159,110,0.05), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { letter-spacing: -0.02em; }

::selection { background: rgba(99,91,255,0.18); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  height: 64px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.topbar .brand a:hover { color: var(--text); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 16px;
  background: linear-gradient(135deg, #2e7d4f, #1f6b3f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), var(--shadow-xs);
}
.brand-sub { color: var(--faint); font-weight: 500; }

.topbar nav { display: flex; align-items: center; gap: 12px; }
.topbar .user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}
.topbar .user::before {
  content: attr(data-initial);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 32px 28px 64px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
/* Heading block: title + subtitle stacked and left-aligned.
   (Do NOT make this a row — that was the old alignment bug.) */
.page-heading { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; }
.page-header .sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.section-title { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-soft); }

/* ---------- Flash messages ---------- */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.flash::before { font-size: 16px; }
.flash.ok    { border-color: #bdebd6; background: var(--ok-soft);     color: #0a7a55; }
.flash.ok::before    { content: "✓"; }
.flash.error { border-color: #f6c4cf; background: var(--danger-soft); color: #b3173a; }
.flash.error::before { content: "!"; font-weight: 800; }

.empty {
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-md);
  padding: 32px;
  text-align: center;
}

/* ---------- Dashboard stats ---------- */
.stats { margin-bottom: 28px; }

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-size: 12px;
}

.refresh-control { display: flex; align-items: center; gap: 10px; }
.refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.refresh-status strong { color: var(--text-soft); font-weight: 700; }
.refresh-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(14,159,110,0.45);
  animation: pulse-ok 2.4s infinite;
}
@keyframes pulse-ok {
  0% { box-shadow: 0 0 0 0 rgba(14,159,110,0.4); }
  70% { box-shadow: 0 0 0 7px rgba(14,159,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,159,110,0); }
}
.refresh-updated { display: none; color: var(--ok); font-weight: 600; }
.refresh-status.is-updated .refresh-label { display: none; }
.refresh-status.is-updated .refresh-updated { display: inline; }
.refresh-icon { display: inline-block; font-size: 14px; line-height: 1; }
.refresh-icon.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.next-up {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background:
    linear-gradient(135deg, rgba(99,91,255,0.10), rgba(99,91,255,0.02) 60%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px 18px 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.next-up::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), #8a84ff);
}
.next-up-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.next-up-label .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(99,91,255,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(99,91,255,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(99,91,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,91,255,0); }
}
.next-up-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.next-up-main strong { font-size: 17px; font-weight: 700; color: var(--text); }
.next-up-when { color: var(--muted); font-size: 14px; }
.countdown {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--r-md);
  padding: 10px 16px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(99,91,255,0.32);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover {
  border-color: #c9caff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 18px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(99,91,255,0.10);
}
.stat-value { font-size: 27px; font-weight: 700; color: var(--text); line-height: 1.1; letter-spacing: -0.02em; }
.stat-value .unit { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
/* Text-valued cards (e.g. a date) read better a touch smaller so they stay on one line */
.stat-card.compact .stat-value { font-size: 18px; line-height: 1.25; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }

.stats-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.stats-caption strong { color: var(--text); }

/* ---------- Bookings table ---------- */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;          /* scroll instead of crushing columns */
}
table.bookings {
  width: 100%;
  border-collapse: collapse;
}
table.bookings th, table.bookings td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;       /* keep each cell on one line; table scrolls if it must */
}
.col-actions { text-align: right; }
table.bookings th {
  background: var(--panel-2);
  color: var(--faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.bookings tbody tr { transition: background .12s ease; }
table.bookings tbody tr:hover { background: #fafbff; }
table.bookings tr:last-child td { border-bottom: none; }
table.bookings tr.disabled td:not(.actions) { opacity: 0.5; }
table.bookings .name-cell { font-weight: 600; color: var(--text); }
table.bookings .actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
form.inline { display: inline; margin: 0; }

code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color: var(--text-soft);
}

.target-day { font-weight: 600; color: var(--text-soft); }

/* ---------- Account balance ---------- */
.bal-line { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.bal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bal::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.bal.ok   { background: var(--ok-soft);     color: #0a7a55; border-color: #bdebd6; }
.bal.ok::before   { background: var(--ok); }
.bal.warn { background: var(--warn-soft);   color: #92400e; border-color: #fcd9a8; }
.bal.warn::before { background: var(--warn); }
.bal.low  { background: var(--danger-soft); color: #b3173a; border-color: #f6c4cf; }
.bal.low::before  { background: var(--danger); }
.bal-when { color: var(--faint); font-size: 11px; white-space: nowrap; }

.bal-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(180,83,9,0.07), var(--panel) 60%);
  border: 1px solid #fcd9a8;
  border-left: 4px solid var(--warn);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: fade-up .45s var(--ease-out) backwards;
}
.bal-alert-icon { font-size: 17px; line-height: 1; }
.bal-alert-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }
.bal-alert-text strong { color: var(--text); }
.bal-alert .btn { margin-left: auto; white-space: nowrap; }

/* ---------- Friendly info note (reassurance for non-technical users) ---------- */
.info-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--accent-soft);
  border: 1px solid #d9d6ff;
  border-radius: var(--r-md);
  padding: 13px 16px;
  margin-bottom: 16px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}
.info-note-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}
.info-note strong { color: var(--text); }

/* ---------- Booking cards (readable layout) ---------- */
.booking-list { display: flex; flex-direction: column; gap: 14px; }

.bk-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.bk-card:hover { box-shadow: var(--shadow-md); }
.bk-card.paused { background: #fcfcfd; }
.bk-card.paused .bk-body, .bk-card.paused .bk-title h3 { opacity: .58; }

.bk-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.bk-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.bk-title-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px; font-size: 17px;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(99,91,255,.10);
}
.bk-title h3 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bk-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 16px 24px;
  padding: 20px;
}
.bk-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bk-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-weight: 700;
}
.bk-value {
  font-size: 15px; color: var(--text); font-weight: 600; line-height: 1.4;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bk-note { font-size: 12px; color: var(--muted); font-weight: 400; }

.bk-check {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-2); background: var(--panel);
  color: var(--accent-ink); font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; cursor: pointer; font-family: inherit;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.bk-check:hover:not(:disabled) { background: var(--accent-soft); border-color: #c9caff; }
.bk-check:disabled { opacity: .45; cursor: not-allowed; }
.bk-check-status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.bk-check-status.running { color: var(--accent-ink); }
.bk-check-status.done { color: #0a7a55; }
.bk-check-status.err { color: var(--danger); }
.bk-check-status .spin { display: inline-block; animation: spin .8s linear infinite; }

.bk-foot {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

/* On / off switch (clear for non-technical users) */
.bk-switch {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px; cursor: pointer; font: inherit;
}
.bk-switch:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 999px; }
.bk-switch-track {
  position: relative; flex: none; width: 44px; height: 25px;
  border-radius: 999px; background: var(--border-2); transition: background .2s ease;
}
.bk-switch-knob {
  position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: left .2s ease;
}
.bk-switch.on .bk-switch-track { background: var(--ok); }
.bk-switch.on .bk-switch-knob { left: 22px; }
.bk-switch-text { font-size: 13.5px; font-weight: 700; }
.bk-switch.on .bk-switch-text { color: #0a7a55; }
.bk-switch.off .bk-switch-text { color: var(--muted); }

.booking-list .bk-card { animation: fade-up .5s var(--ease-out) backwards; }
.booking-list .bk-card:nth-child(1) { animation-delay: .04s; }
.booking-list .bk-card:nth-child(2) { animation-delay: .10s; }
.booking-list .bk-card:nth-child(3) { animation-delay: .16s; }
.booking-list .bk-card:nth-child(4) { animation-delay: .22s; }
.booking-list .bk-card:nth-child(n+5) { animation-delay: .26s; }

@media (max-width: 560px) {
  .bk-head { flex-wrap: wrap; }
  .bk-foot { flex-wrap: wrap; }
  .bk-foot .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--panel);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { background: #fafbff; border-color: #cfd3e0; color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 2px rgba(20,24,48,0.10), 0 6px 16px rgba(99,91,255,0.30);
}
.btn.primary:hover { color: #fff; filter: brightness(1.04); box-shadow: 0 2px 4px rgba(20,24,48,0.10), 0 10px 22px rgba(99,91,255,0.36); }

.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-soft); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--border); color: var(--text); }

.btn.danger { background: var(--panel); color: var(--danger); border-color: #f1c6ce; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e7a9b4; color: #b3173a; }

.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 7px; }

/* ---------- Status badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s ease, box-shadow .15s ease;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.badge:hover { filter: brightness(0.98); }
.badge:focus-visible { outline: none; box-shadow: var(--ring); }
.badge.on  { background: var(--ok-soft); color: #0a7a55; border-color: #bdebd6; }
.badge.on::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(14,159,110,0.18); }
.badge.off { background: var(--panel-2); color: var(--muted); border-color: var(--border-2); }
.badge.off::before { background: var(--faint); }

/* ---------- Login ---------- */
.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 24px 0; }
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.login-card .login-logo {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border-radius: 14px;
  font-size: 26px;
  background: linear-gradient(135deg, #2e7d4f, #1f6b3f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), var(--shadow-md);
}
.login-card h1 { margin: 0 0 4px; text-align: center; font-size: 22px; }
.login-card .login-sub { margin: 0 0 24px; text-align: center; color: var(--muted); font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.login-card input {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.login-card .btn.primary { margin-top: 4px; padding: 11px; font-size: 15px; }

/* ---------- Booking form ---------- */
.booking-form { display: flex; flex-direction: column; gap: 4px; }
.booking-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin: 0 0 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.booking-form legend {
  padding: 4px 12px;
  margin-left: -4px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.booking-form > .row:first-child { margin-bottom: 18px; align-items: flex-end; }
.booking-form .row { display: flex; gap: 18px; flex-wrap: wrap; }
.booking-form .row > label { flex: 1 1 220px; }
.booking-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.booking-form label.checkbox {
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
  padding: 10px 0;
}
.booking-form input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.booking-form input, .booking-form select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.booking-form input:focus, .booking-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.booking-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.booking-form .hint { color: var(--muted); font-size: 13px; font-weight: 400; margin: 6px 0 14px; line-height: 1.55; }
.booking-form .hint strong { color: var(--text-soft); }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- Log viewer ---------- */
.log-window {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #1e2540;
}
.log-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #161c33;
  border-bottom: 1px solid #232b49;
}
.log-bar .dots { display: flex; gap: 7px; }
.log-bar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.log-bar .dots i:nth-child(1) { background: #ff5f57; }
.log-bar .dots i:nth-child(2) { background: #febc2e; }
.log-bar .dots i:nth-child(3) { background: #28c840; }
.log-bar .log-title {
  margin-left: 8px;
  color: #9aa4c4;
  font-size: 12.5px;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
pre.log {
  margin: 0;
  background: #0b1020;
  color: #cdd6f4;
  padding: 18px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar { padding: 0 18px; }
  .brand-sub { display: none; }
  .container { padding: 24px 16px 48px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .countdown { margin-left: 0; width: 100%; text-align: center; }
  .table-wrap { overflow-x: auto; }
  table.bookings { min-width: 720px; }
}

/* ============================================================
   Animations — subtle, staggered entrances + micro-motion.
   fill-mode "backwards" applies the start state during the
   delay but releases after, so :hover transforms keep working.
   All of this is disabled under prefers-reduced-motion (below).
   ============================================================ */
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

:root { --ease-out: cubic-bezier(.22, 1, .36, 1); }

.page-header   { animation: fade-up .5s  var(--ease-out) backwards; }
.next-up       { animation: fade-up .55s var(--ease-out) backwards; }
.flash         { animation: flash-in .4s ease backwards; }
.empty         { animation: fade-up .5s  var(--ease-out) backwards; }

.stat-cards .stat-card { animation: fade-up .55s var(--ease-out) backwards; }
.stat-cards .stat-card:nth-child(1) { animation-delay: .04s; }
.stat-cards .stat-card:nth-child(2) { animation-delay: .09s; }
.stat-cards .stat-card:nth-child(3) { animation-delay: .14s; }
.stat-cards .stat-card:nth-child(4) { animation-delay: .19s; }
.stat-cards .stat-card:nth-child(5) { animation-delay: .24s; }
.stat-cards .stat-card:nth-child(6) { animation-delay: .29s; }
.stats-caption { animation: fade-up .5s var(--ease-out) .32s backwards; }

.table-wrap { animation: fade-up .55s var(--ease-out) .12s backwards; }
table.bookings tbody tr { animation: fade-in .5s ease backwards; }
table.bookings tbody tr:nth-child(1) { animation-delay: .18s; }
table.bookings tbody tr:nth-child(2) { animation-delay: .24s; }
table.bookings tbody tr:nth-child(3) { animation-delay: .30s; }
table.bookings tbody tr:nth-child(4) { animation-delay: .36s; }
table.bookings tbody tr:nth-child(5) { animation-delay: .42s; }
table.bookings tbody tr:nth-child(n+6) { animation-delay: .48s; }

.login-card { animation: fade-up .6s var(--ease-out) backwards; }

.booking-form > .row:first-child { animation: fade-up .5s var(--ease-out) backwards; }
.booking-form fieldset { animation: fade-up .5s var(--ease-out) backwards; }
.booking-form fieldset:nth-of-type(1) { animation-delay: .06s; }
.booking-form fieldset:nth-of-type(2) { animation-delay: .12s; }
.booking-form fieldset:nth-of-type(3) { animation-delay: .18s; }
.booking-form fieldset:nth-of-type(4) { animation-delay: .24s; }
.form-actions { animation: fade-up .5s var(--ease-out) .28s backwards; }

.log-window { animation: fade-up .5s var(--ease-out) backwards; }

/* Buttons get a touch more life on press */
.btn:active { transform: translateY(1px) scale(.985); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
