/* ============================================================
   ASTRA PADEL CLUB — NEW DESIGN
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --color-bg: #FAF7F4;
  --color-surface: #FFFFFF;
  --color-primary: #C75B2A;
  --color-primary-dark: #A84B22;
  --color-primary-light: #F5E6DD;
  --color-accent: #2B7A5E;
  --color-accent-light: #D9EBE2;
  --color-text: #2D2A26;
  --color-text-secondary: #6B6560;
  --color-text-muted: #9A938D;
  --color-border: #E8E2DC;
  --color-border-light: #F0EBE6;
  --color-slot-free: #FAFAFA;
  --color-slot-free-border: #E8E2DC;
  --color-slot-busy-bg: #F0EBE6;
  --color-slot-busy-text: #9A938D;
  --color-selected-bg: #D9EBE2;
  --color-selected-border: #2B7A5E;
  --color-danger: #DC4B4B;
  --color-success: #2B9A5E;

  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --slot-h: 44px;
  --slot-head-h: 44px;
  --cell-gap: 6px;
  --time-col: 100px;
  --sidebar-w: 340px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
::selection { background: var(--color-primary-light); color: var(--color-text); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--color-primary) !important; box-shadow: 0 0 0 3px rgba(199,91,42,.15); }

/* ---------- APP SHELL ---------- */
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 120px;
}

/* ---------- HEADER ---------- */
.app-header { text-align: center; margin-bottom: 20px; }
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.logo-img { height: 280px; width: auto; object-fit: contain; }
.header-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--color-text); }
.header-subtitle { font-size: 14px; color: var(--color-text-secondary); }

/* ---------- STEPPER ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
}
.stepper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.stepper-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: all .2s;
}
.stepper-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color .2s;
}
.stepper-item.active .stepper-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.stepper-item.active .stepper-label { color: var(--color-text); }
.stepper-item.done .stepper-num {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.stepper-item.done .stepper-label { color: var(--color-text-secondary); }
.stepper-line {
  flex: 0 0 40px;
  height: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

/* ---------- DATE TOOLBAR ---------- */
.date-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 90;
}
.date-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: background .15s;
}
.date-arrow:hover { background: var(--color-bg); }
.date-chips-scroll {
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-chips-scroll::-webkit-scrollbar { display: none; }
.date-chips {
  display: flex;
  gap: 6px;
  white-space: nowrap;
  padding: 2px 0;
  width: 100%;
}
.chip {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all .15s;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.chip:hover { background: var(--color-bg); border-color: var(--color-primary); }
.chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.calendar-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all .15s;
}
.calendar-btn:hover { background: var(--color-bg); border-color: var(--color-primary); }

/* Calendar popover */
.cal-popover {
  position: absolute;
  right: 12px;
  top: calc(100% + 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px;
  z-index: 100;
  width: 280px;
}
.cal-popover-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-secondary);
}
.cal-nav-btn:hover { background: var(--color-bg); }
.cal-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.cal-title { font-size: 14px; font-weight: 700; text-transform: capitalize; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.cal-weekdays span { font-size: 11px; color: var(--color-text-muted); text-align: center; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-grid button {
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  transition: all .12s;
}
.cal-grid button:hover:not(:disabled) { background: var(--color-bg); border-color: var(--color-primary); }
.cal-grid button.chip-active {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
}
.cal-grid button:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- MAIN CONTENT LAYOUT ---------- */
.main-content {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 24px;
  align-items: start;
}

/* ---------- COURT MAP ---------- */
.court-map-section {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.court-map-img {
  width: 100%;
  height: auto;
  display: block;
}
.court-map-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- LEGEND ---------- */
.court-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-dot-classic { background: #6B6560; }
.legend-dot-premium { background: var(--color-primary); }

/* ---------- FILTERS ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }
.filter-pills { display: flex; gap: 4px; }
.filter-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all .15s;
}
.filter-pill:hover { border-color: var(--color-primary); }
.filter-pill.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}
.filter-select-wrap { position: relative; }
.filter-select {
  padding: 6px 32px 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B6560' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.price-note {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* ---------- SCHEDULE TABLE ---------- */
.schedule-section {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: clip;
}
.loading-bar { height: 2px; background: var(--color-border-light); overflow: hidden; opacity: 0; transition: opacity .15s; }
.loading-bar.visible { opacity: 1; }
.loading-bar-fill { height: 100%; width: 0; background: var(--color-primary); transition: width .3s; }
.table-viewport { overflow: visible; }
.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-bg);
}
.table-wrap { min-width: 100%; }

/* Table cells */
.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--cell-gap);
}
.schedule-table th,
.schedule-table td { vertical-align: middle; text-align: center; }

.table-head-cell {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-radius: var(--radius-md);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  height: var(--slot-head-h);
  min-height: var(--slot-head-h);
  white-space: nowrap;
  border: none;
}
.table-time-cell {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-radius: var(--radius-md);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  height: var(--slot-h);
  min-height: var(--slot-h);
  width: var(--time-col);
  min-width: var(--time-col);
  max-width: var(--time-col);
  white-space: nowrap;
  border: none;
}

.slot {
  border-radius: var(--radius-md);
  height: var(--slot-h);
  min-height: var(--slot-h);
  max-height: var(--slot-h);
  position: relative;
  padding: 0 !important;
  overflow: hidden;
}
.slot-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Slot states */
.slot[data-status="free"] {
  background: var(--color-slot-free);
  border: 1px solid var(--color-slot-free-border);
  cursor: pointer;
  transition: all .12s;
}
.slot[data-status="free"]:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.slot[data-status="free"] .font-semibold { color: var(--color-text); font-size: 11px; }

.slot[data-status="busy"] {
  background: var(--color-slot-busy-bg);
  border: 1px solid var(--color-border-light);
}
.slot[data-status="busy"],
.slot[data-status="busy"] * { color: var(--color-slot-busy-text) !important; }
.slot[data-status="busy"] .font-semibold { font-size: 11px; }

.slot[data-status="selected"],
.slot-selected {
  background: var(--color-selected-bg) !important;
  border-color: var(--color-selected-border) !important;
}
.slot[data-status="selected"] .font-semibold,
.slot-selected .font-semibold { color: var(--color-accent) !important; }

.slot-empty {
  background: var(--color-bg) !important;
  border: 1px solid var(--color-border-light) !important;
}

.slot[data-status="loading"] {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
}

/* Table overlay / loader */
.table-overlay {
  position: absolute;
  inset: 0;
  background: rgba(250,247,244,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.table-overlay.hidden { display: none; }
.loader-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; }
.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-phrase { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); text-align: center; }

.hint-msg {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #FFF3E6;
  border: 1px solid #F0D8B8;
  font-size: 12px;
  color: #8B5E3C;
}
.hint-msg.hidden { display: none; }

/* Split layout for mobile tables */
.schedule-split {
  display: grid;
  grid-template-columns: var(--time-col) minmax(0,1fr);
  grid-template-rows: var(--slot-head-h) minmax(0,1fr);
  gap: 0;
  width: 100%;
  background: var(--color-surface);
}
.schedule-corner { grid-column:1; grid-row:1; overflow:hidden; background:var(--color-surface); }
.schedule-header { grid-column:2; grid-row:1; overflow:hidden; background:var(--color-surface); }
.schedule-time { grid-column:1; grid-row:2; overflow:hidden; background:var(--color-surface); }
.schedule-body { grid-column:2; grid-row:2; overflow:hidden; background:var(--color-surface); }
.schedule-corner-table, .schedule-head-table, .schedule-time-table, .schedule-body-table { border-collapse: separate; }
.schedule-corner-table { border-spacing: 0; }
.schedule-head-table { border-spacing: var(--cell-gap) 0; }
.schedule-time-table { border-spacing: 0 var(--cell-gap); }
.schedule-body-table { border-spacing: var(--cell-gap); }
.schedule-corner-table, .schedule-time-table { width: var(--time-col); min-width: var(--time-col); max-width: var(--time-col); }
.schedule-head-table, .schedule-body-table { width: max-content; }
.schedule-header-track { overflow: hidden; }
.schedule-time-track { overflow: hidden; }
.schedule-body-track {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  position: sticky;
  top: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  min-height: 200px;
}
.sidebar-empty { text-align: center; }
.sidebar-empty-icon { margin-bottom: 16px; }
.sidebar-empty-img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; opacity: .5; }
.sidebar-empty-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.sidebar-empty-text { font-size: 13px; color: var(--color-text-muted); margin-bottom: 16px; line-height: 1.4; }
.sidebar-steps { list-style: none; text-align: left; margin-bottom: 20px; }
.sidebar-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.sidebar-court-img-wrap { border-radius: var(--radius-md); overflow: hidden; }
.sidebar-court-img-wrap img { width: 100%; height: auto; }
.sidebar-details { margin-bottom: 16px; }
.sidebar-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
}
.sidebar-detail-row:last-child { border-bottom: none; }
.sidebar-detail-row .material-symbols-outlined { font-size: 16px; color: var(--color-text-muted); }
.sidebar-detail-value { margin-left: auto; font-weight: 600; color: var(--color-text); }
.sidebar-detail-price { color: var(--color-primary); font-weight: 800; font-size: 18px; }

/* ---------- BUTTONS ---------- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  transition: background .15s;
  cursor: pointer;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled, .btn-disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled:hover, .btn-disabled:hover { background: var(--color-primary); }
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  transition: background .15s;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--color-bg); }
.btn-wide { width: 100%; }

/* ---------- FLOATING BAR (mobile) ---------- */
.floating-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 80;
}
.floating-bar.hidden { display: none; }
.floating-bar-info { display: flex; align-items: center; gap: 6px; flex: 1; }
.fb-label { font-size: 12px; font-weight: 700; color: var(--color-text-secondary); }
.fb-pill {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text);
}
.fb-price { background: var(--color-primary-light); border-color: #E8CDB8; color: var(--color-primary-dark); }
.floating-bar .btn-primary { width: auto; padding: 10px 18px; font-size: 13px; flex-shrink: 0; }

/* ---------- BOTTOM SHEET ---------- */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
}
.bottom-sheet-backdrop.hidden { display: none; }
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 201;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(0);
  transition: transform .25s ease;
}
.bottom-sheet.hidden { display: none; }
.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  margin: 0 auto 16px;
}

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 220;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }
.modal-panel {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
}
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background .12s;
}
.modal-close-btn:hover { background: var(--color-bg); }
.modal-body { }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.modal-court-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.modal-court-preview img { width: 100%; height: auto; }
.modal-slot-details { margin-bottom: 12px; }
.modal-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.modal-detail-row .material-symbols-outlined { font-size: 18px; color: var(--color-text-muted); }
.modal-detail-value { margin-left: auto; font-weight: 600; color: var(--color-text); }
.modal-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--color-border-light);
}
.modal-total-label { font-size: 14px; font-weight: 600; color: var(--color-text-secondary); }
.modal-total-price { font-size: 22px; font-weight: 800; color: var(--color-primary); }
.modal-info-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #F0F7FF;
  border: 1px solid #D6E8F8;
  font-size: 12px;
  color: #4A6FA5;
  margin-bottom: 20px;
}
/* ---- Modal booking preview (new design) ---- */
.modal-preview-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}
.modal-court-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #2a2a2a;
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(160deg,#3a2a22 0%,#1a1a1a 100%);
}
.modal-court-card-lines {
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 4px;
}
.modal-court-card-lines::before {
  content:'';
  position:absolute;
  left:50%; top:0; bottom:0;
  width:2px;
  background:rgba(255,255,255,.15);
  transform:translateX(-50%);
}
.modal-court-card-name {
  position: relative;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  z-index: 1;
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.modal-court-card-star {
  position: relative;
  font-size: 20px;
  z-index: 1;
  margin-bottom: 8px;
  color: #fff;
}
.modal-court-card-badge {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.12);
  padding: 3px 8px;
  border-radius: 20px;
}
.modal-booking-rows { display: flex; flex-direction: column; gap: 0; }
.modal-booking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 13px;
}
.modal-booking-row:last-child { border-bottom: none; }
.modal-booking-row-icon {
  color: var(--color-text-muted);
  font-size: 16px;
  flex-shrink: 0;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-booking-row-label { color: var(--color-text-secondary); flex: 1; }
.modal-booking-row-value { font-weight: 600; color: var(--color-text); text-align: right; }
.modal-booking-row-value.price-value { color: var(--color-primary); font-size: 15px; font-weight: 800; }

.modal-form-fields { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); margin-top: 8px; }
.required { color: var(--color-danger); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-textarea { min-height: 72px; resize: vertical; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 2px; }
.form-error.hidden { display: none; }
.form-error-block { padding: 8px 12px; background: #FEF0F0; border: 1px solid #F8D0D0; border-radius: var(--radius-sm); font-size: 12px; color: var(--color-danger); margin-bottom: 12px; }
.form-error-block.hidden { display: none; }
.comment-toggle {
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  margin-top: 8px;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 12px;
  cursor: pointer;
}
.consent-checkbox {
  margin-top: 2px;
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.consent-link { color: var(--color-primary); text-decoration: underline; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.modal-loader {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  z-index: 10;
}
.modal-loader.hidden { display: none; }

/* Sidebar dynamic content */
.sb-court-card {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 16/7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.sb-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 13px;
}
.sb-detail-row:last-child { border-bottom: none; }
.sb-detail-icon { color: var(--color-text-muted); flex-shrink: 0; display: flex; }
.sb-detail-label { color: var(--color-text-secondary); flex: 1; }
.sb-detail-value { font-weight: 600; color: var(--color-text); text-align: right; }
.sb-detail-value.sb-price-value { color: var(--color-primary); font-size: 15px; font-weight: 800; }
.sb-court-detail-block { margin-bottom: 4px; }
.sb-court-separator { height: 1px; background: var(--color-border-light); margin: 16px 0; }

/* Legacy sidebar rows (kept for compat) */
.sb-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--color-text-secondary);
  margin-bottom: 12px; font-weight: 600;
}
.sb-court-block {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sb-court-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.sb-court-time {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.sb-court-price { font-size: 13px; font-weight: 700; color: var(--color-primary); }
.sb-total {
  font-size: 14px; color: var(--color-text-secondary);
  padding-top: 10px; border-top: 1px solid var(--color-border-light);
  margin-top: 4px;
}
.sb-total strong { color: var(--color-text); font-size: 16px; }

/* Table empty state */
.table-empty { padding: 32px; text-align: center; color: var(--color-text-muted); font-size: 13px; }

/* Result */
.result-icon { text-align: center; margin-bottom: 12px; }
.result-details { font-size: 14px; line-height: 1.5; }
.result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--color-text-secondary); font-weight: 500; }

/* ---------- BOTTOM SHEET FORM ---------- */
.bs-form-title {
  font-size: 18px; font-weight: 800;
  margin-bottom: 16px; text-align: center;
}
.bs-summary {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.bs-summary-date {
  font-size: 13px; color: var(--color-text-secondary);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.bs-summary-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; margin-bottom: 4px;
}
.bs-summary-time {
  margin-left: auto; color: var(--color-text-secondary);
  font-size: 12px;
}
.bs-summary-total {
  font-size: 15px; font-weight: 800;
  color: var(--color-primary);
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
}
.bs-form-fields { display: flex; flex-direction: column; gap: 4px; }

/* ---------- DEBUG ---------- */
.debug-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; margin-top: 12px; }
.debug-panel.hidden { display: none; }
.debug-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.debug-actions { display: flex; gap: 6px; }
.debug-btn { padding: 4px 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 11px; background: var(--color-surface); }
.debug-log { font-size: 11px; line-height: 1.4; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; color: var(--color-text-secondary); }

/* ============================================================
   SCHEDULE TABLE — clean light design
   ============================================================ */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-table th,
.schedule-table td { padding: 0; }

/* Column header */
.sched-th {
  background: var(--color-bg);
  padding: 0 8px;
  height: var(--slot-head-h);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  vertical-align: middle;
}
.sched-time-th {
  text-align: left;
  padding-left: 16px;
  min-width: 120px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
}
.sched-th-name { font-size: 12px; font-weight: 700; color: var(--color-text); }
.sched-th-premium { color: var(--color-primary); }

/* Time cell */
.sched-time-td {
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border-light);
  min-width: 120px;
  background: var(--color-bg);
  white-space: nowrap;
  height: var(--slot-h);
}
.sched-time-from { font-size: 13px; font-weight: 600; color: var(--color-text); }
.sched-time-to   { font-size: 11px; color: var(--color-text-muted); }

/* Slot cell */
.sched-slot {
  height: var(--slot-h);
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
  border-left: 1px solid var(--color-border-light);
  cursor: default;
  transition: background .12s;
}
.sched-slot[data-status="free"] { cursor: pointer; background: #fff; }
.sched-slot[data-status="free"]:hover { background: var(--color-primary-light); }
.sched-slot[data-status="busy"]     { background: var(--color-slot-busy-bg); cursor: default; }
.sched-slot[data-status="selected"] { background: var(--color-primary); cursor: pointer; }

.sched-slot-txt {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  padding: 0 6px;
}
.sched-slot-busy    { color: var(--color-text-muted); font-weight: 500; }
.sched-slot-premium { color: var(--color-primary); }
.sched-slot-sel     { color: #fff; }

/* Row hover */
.schedule-table tbody tr:hover .sched-time-td { color: var(--color-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / below desktop sidebar */
@media (max-width: 1023px) {
  .main-content { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .floating-bar { display: flex; }
  .app-shell { padding: 12px 16px 100px; }
  .header-title { font-size: 22px; }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --slot-h: 44px;
    --slot-head-h: 44px;
    --time-col: 72px;
    --cell-gap: 4px;
  }
  .app-shell { padding: 8px 10px 100px; }
  .header-title { font-size: 18px; }
  .header-subtitle { font-size: 12px; }
  .stepper { gap: 0; }
  .stepper-label { display: none; }
  .stepper-line { flex: 0 0 24px; }
  .logo-img { height: 120px; }
  .date-toolbar { padding: 6px 8px; gap: 4px; }
  .cal-label { display: none; }
  .court-map-section {
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 0;
  }
  .court-legend { font-size: 11px; gap: 12px; flex-wrap: wrap; justify-content: center; }
  .filters-bar { gap: 8px; }
  .filter-label { display: none; }
  .filter-pill { padding: 5px 8px; font-size: 11px; }
  .filter-select { font-size: 11px; padding: 5px 28px 5px 8px; }
  .floating-bar { left: 8px; right: 8px; }
  /* chips: on mobile don't stretch, scroll naturally */
  .date-chips { width: auto; }
  .chip { flex: 0 0 auto; min-width: 0; font-size: 11px; padding: 5px 10px; white-space: nowrap; }
  /* schedule table header same height as slots */
  .sched-th { height: var(--slot-head-h); padding: 0 4px; font-size: 10px; }
  .sched-time-th { padding: 0 8px; font-size: 9px; }
  .sched-time-td { padding: 0 8px; min-width: 72px; }
  .sched-time-from { font-size: 11px; }
  .sched-time-to { font-size: 9px; }
  .sched-slot { height: var(--slot-h); }
  .sched-slot-txt { font-size: 11px; }

  /* Split table mobile behavior */
  .schedule-split {
    grid-template-columns: calc(var(--time-col) + 2 * var(--cell-gap)) minmax(0,1fr);
    grid-template-rows: calc(var(--slot-head-h) + 2 * var(--cell-gap)) minmax(0,1fr);
  }
  .schedule-corner {
    position: sticky;
    top: 0; left: 0;
    z-index: 30;
    background: var(--color-surface);
    padding: var(--cell-gap);
  }
  .schedule-header-track { position: sticky; top: 0; z-index: 20; background: var(--color-surface); }
  .schedule-header { padding: var(--cell-gap) 0; }
  .schedule-time-track { position: sticky; left: 0; z-index: 21; background: var(--color-surface); }
  .schedule-time { padding: 0 var(--cell-gap); }
  .schedule-head-table { margin-left: calc(-1 * var(--cell-gap)); }
  .schedule-time-table { margin-top: calc(-1 * var(--cell-gap)); }
  .schedule-body-table { margin-left: calc(-1 * var(--cell-gap)); margin-top: calc(-1 * var(--cell-gap)); }
  .schedule-body-track { overflow: auto; max-height: 50dvh; }

  .modal-panel { padding: 20px; max-width: 100%; border-radius: var(--radius-lg); }
  .modal-backdrop { padding: 8px; align-items: flex-end; }
}

/* Desktop wide */
@media (min-width: 1024px) {
  .floating-bar { display: none !important; }
  .floating-bar.hidden { display: none !important; }
}

/* Ensure sidebar shows on desktop */
@media (min-width: 1024px) {
  .sidebar { display: block; }
}
