/* =============================================================================
   BELMORE BOOKINGS — APP STYLES
   Modern SaaS-quality UI for the Belmore Ski Club member portal
   ============================================================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Montserrat:wght@600;700;800&display=swap');

/* ---- Design Tokens ---- */
:root {
  /* Colors */
  --primary:          #0F2744;
  --primary-hover:    #1A3A5E;
  --accent:           #2563EB;
  --accent-hover:     #1D4ED8;
  --accent-light:     #DBEAFE;
  --accent-pale:      #EFF6FF;

  --sidebar-bg:       #0B1C2C;
  --sidebar-border:   rgba(255,255,255,0.07);
  --sidebar-text:     rgba(255,255,255,0.65);
  --sidebar-hover:    rgba(255,255,255,0.07);
  --sidebar-active:   rgba(255,255,255,0.12);
  --sidebar-icon:     rgba(255,255,255,0.4);

  --bg:               #F1F5F9;
  --surface:          #FFFFFF;
  --surface-2:        #F8FAFC;
  --border:           #E2E8F0;
  --border-strong:    #CBD5E1;

  --text:             #0F172A;
  --text-secondary:   #475569;
  --text-muted:       #94A3B8;

  --success:          #16A34A;
  --success-bg:       #F0FDF4;
  --success-border:   #BBF7D0;
  --warning:          #D97706;
  --warning-bg:       #FFFBEB;
  --warning-border:   #FDE68A;
  --error:            #DC2626;
  --error-bg:         #FEF2F2;
  --error-border:     #FECACA;
  --info:             #0284C7;
  --info-bg:          #F0F9FF;
  --info-border:      #BAE6FD;

  /* Booking cell colors */
  --cell-available:   #F8FAFC;
  --cell-mine:        #DBEAFE;
  --cell-mine-text:   #1D4ED8;
  --cell-taken:       #FEF3C7;
  --cell-taken-text:  #92400E;
  --cell-full:        #FEE2E2;
  --cell-full-text:   #991B1B;
  --cell-waitlist:    #F3E8FF;
  --cell-waitlist-text:#6B21A8;
  --cell-disabled:    #F1F5F9;

  /* Typography */
  --font:             'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:     'Montserrat', 'Inter', sans-serif;

  /* Spacing */
  --sp1: 0.25rem;
  --sp2: 0.5rem;
  --sp3: 0.75rem;
  --sp4: 1rem;
  --sp5: 1.25rem;
  --sp6: 1.5rem;
  --sp8: 2rem;
  --sp10: 2.5rem;
  --sp12: 3rem;

  /* Layout */
  --sidebar-w:        256px;
  --topbar-h:         60px;
  --radius:           8px;
  --radius-lg:        12px;
  --radius-xl:        16px;
  --radius-full:      9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm:  0 1px 3px rgba(15,23,42,0.1), 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md:  0 4px 6px -1px rgba(15,23,42,0.1), 0 2px 4px -1px rgba(15,23,42,0.06);
  --shadow-lg:  0 10px 15px -3px rgba(15,23,42,0.1), 0 4px 6px -2px rgba(15,23,42,0.05);
  --shadow-xl:  0 20px 25px -5px rgba(15,23,42,0.1), 0 10px 10px -5px rgba(15,23,42,0.04);

  /* Transitions */
  --t: all 0.15s ease;
  --t-color: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Sidebar Header */
.sidebar-header {
  padding: var(--sp5) var(--sp4);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: var(--sp3);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  text-decoration: none;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1) opacity(0.85);
}

.sidebar-logo__text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo__name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
}

.sidebar-logo__sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: var(--sp4) var(--sp3);
  flex: 1;
}

.nav-section {
  margin-bottom: var(--sp6);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 var(--sp3);
  margin-bottom: var(--sp2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp2) var(--sp3);
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--t);
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-item svg, .nav-item .nav-icon { 
  width: 16px;
  height: 16px;
  color: var(--sidebar-icon);
  flex-shrink: 0;
  transition: color 0.15s;
}

.nav-item:hover svg, .nav-item.active svg { color: rgba(255,255,255,0.8); }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

/* Sidebar User */
.sidebar-user {
  padding: var(--sp4);
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: var(--sp3);
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  flex-grow: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

.user-logout {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: var(--t);
  background: none;
  border: none;
  text-decoration: none;
}

.user-logout:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp8);
  gap: var(--sp4);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp3);
}

/* Main Content */
.main-content {
  padding: var(--sp8);
  flex: 1;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp4);
  margin-bottom: var(--sp8);
  flex-wrap: wrap;
}

.page-header--center {
  align-items: center;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp1);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--t);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}
.btn-danger:hover {
  background: #FEE2E2;
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.btn-success:hover {
  background: #DCFCE7;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-xl { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: var(--sp5) var(--sp6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp4);
  flex-wrap: wrap;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { padding: var(--sp6); }

.card-body--flush { padding: 0; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp5);
  margin-bottom: var(--sp8);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp5) var(--sp6);
  box-shadow: var(--shadow-xs);
  transition: var(--shadow-md);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp2);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: var(--sp2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change--up { color: var(--success); }
.stat-change--down { color: var(--error); }
.stat-change--neutral { color: var(--text-muted); }

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: var(--sp4);
}

.stat-icon--blue  { background: var(--accent-pale); }
.stat-icon--green { background: var(--success-bg); }
.stat-icon--amber { background: var(--warning-bg); }
.stat-icon--red   { background: var(--error-bg); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--sp5);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp2);
  letter-spacing: 0.02em;
}

.form-label--required::after {
  content: ' *';
  color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--t);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.form-input:disabled,
.form-select:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp1);
}

.form-error {
  font-size: 11px;
  color: var(--error);
  margin-top: var(--sp1);
}

/* Input group (icon + input) */
.input-group {
  position: relative;
}

.input-group-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-group .form-input { padding-left: 34px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: var(--surface-2); }

.table td .cell-primary {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.table td .cell-secondary {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--confirmed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge--pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge--cancelled {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.badge--neutral {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   ALERTS / NOTICES
   ============================================================ */
.alert {
  padding: var(--sp4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--sp3);
  font-size: 13px;
  margin-bottom: var(--sp5);
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-text { color: inherit; opacity: 0.85; }

.alert--success { background: var(--success-bg); border-color: var(--success-border); color: #14532D; }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: #78350F; }
.alert--error   { background: var(--error-bg);   border-color: var(--error-border);   color: #7F1D1D; }
.alert--info    { background: var(--info-bg);    border-color: var(--info-border);    color: #0C4A6E; }

/* ============================================================
   BOOKING GRID (CALENDAR TABLE)
   ============================================================ */
.booking-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp4);
  margin-bottom: var(--sp6);
  flex-wrap: wrap;
}

.booking-controls-left {
  display: flex;  
  align-items: center;
  gap: var(--sp4);
  flex-wrap: wrap;
}

.booking-controls-right {
  display: flex;
  align-items: center;
  gap: var(--sp3);
}

.date-nav {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp1);
}

.date-nav__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--t);
}

.date-nav__btn:hover { background: var(--surface-2); color: var(--text); }

.date-nav__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  text-align: center;
}

/* Legend */
.booking-legend {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  font-weight: 500;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid;
  flex-shrink: 0;
}

.legend-available { background: var(--cell-available); border-color: var(--border); }
.legend-mine      { background: var(--cell-mine);      border-color: #93C5FD; }
.legend-taken     { background: var(--cell-taken);     border-color: #FDE68A; }
.legend-full      { background: var(--cell-full);      border-color: #FCA5A5; }
.legend-waitlist  { background: var(--cell-waitlist);  border-color: #D8B4FE; }
.legend-disabled  { background: var(--cell-disabled);  border-color: var(--border); }

/* Grid table */
.booking-grid-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.booking-grid {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 12px;
}

.booking-grid th {
  padding: 8px 6px;
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

.booking-grid th.col-label {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  padding-left: 16px;
  min-width: 100px;
  max-width: 120px;
  border-right: 2px solid var(--border);
}

.booking-grid td.row-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  padding: 6px 16px 6px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  min-width: 100px;
}

.booking-grid th.col-date { font-size: 11px; min-width: 52px; }
.booking-grid th.col-weekend { background: #F0F9FF; }

.booking-cell {
  padding: 0;
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  cursor: default;
  height: 44px;
  min-width: 52px;
}

.booking-cell--available {
  background: var(--cell-available);
  cursor: pointer;
}

.booking-cell--available:hover {
  background: var(--accent-pale) !important;
  border-color: var(--accent) !important;
  z-index: 1;
}

.booking-cell--mine {
  background: var(--cell-mine);
  cursor: pointer;
}

.booking-cell--taken  { background: var(--cell-taken);    cursor: not-allowed; }
.booking-cell--full   { background: var(--cell-full);     cursor: not-allowed; }
.booking-cell--waitlist { background: var(--cell-waitlist); }
.booking-cell--disabled { background: var(--cell-disabled); }
.booking-cell--weekend { opacity: 0.95; }

.cell-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px;
}

.cell-code { font-size: 9px; color: var(--cell-mine-text); }

/* Selected cell */
.booking-cell--selected {
  background: #BFDBFE !important;
  border: 2px solid var(--accent) !important;
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Row header sections */
.row-section-header th,
.row-section-header td {
  background: var(--primary) !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: var(--sp6);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  padding: var(--sp5) var(--sp6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp4);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--t);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }

.modal-body { padding: var(--sp6); }
.modal-footer {
  padding: var(--sp4) var(--sp6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp3);
  justify-content: flex-end;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--sp12) var(--sp8);
  color: var(--text-secondary);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--sp4);
  display: block;
}

.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp2);
}

.empty-state__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--sp6);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--sp6);
}

.tab {
  padding: var(--sp3) var(--sp5);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--t-color);
  white-space: nowrap;
  text-decoration: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp2);
  color: var(--text-secondary);
  border-radius: var(--radius);
}

.sidebar-toggle:hover { background: var(--surface-2); }

/* ============================================================
   PROGRESS / LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-toggle { display: flex; }

  .main-area {
    margin-left: 0;
  }

  .main-content { padding: var(--sp4) var(--sp3); }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .page-actions { flex-wrap: wrap; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .booking-controls { flex-direction: column; align-items: flex-start; }

  .topbar { padding: 0 var(--sp4); }

  /* Modal full-width on mobile */
  .modal { max-width: calc(100vw - 24px) !important; margin: 0 auto; }
  .modal-body[style*="grid-template-columns:1fr 1fr"],
  .modal-body[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Booking grid: use smooth horizontal scroll */
  .booking-grid-container {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    cursor: grab;
    position: relative;
  }

  .booking-grid-container::after {
    content: '← Swipe to scroll →';
    display: block;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
  }

  .booking-grid th.col-date { min-width: 40px; font-size: 9px; }
  .booking-cell { min-width: 40px; height: 36px; }
  .booking-grid td.row-label { min-width: 70px; font-size: 10px; padding: 4px 8px; }
  .booking-grid th.col-label { min-width: 70px; font-size: 9px; padding: 6px 8px; }
  .cell-content { font-size: 8px; }

  /* DataTable mobile */
  .table-wrapper { -webkit-overflow-scrolling: touch; }
  .table td, .table th { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }

  .page-title { font-size: 18px; }
  .card-body { padding: var(--sp4); }

  /* Booking grid: reduce further on very small screens */
  .booking-cell { min-width: 34px; height: 32px; }
  .booking-grid th.col-date { min-width: 34px; font-size: 8px; }
}
