/* ============================================================
   BookMe — Main Stylesheet (Mobile-First)
   Primary: #6C63FF | BG: #FFFFFF | Dark: #2D2D3A
   ============================================================ */

/* ── 1. Variables ─────────────────────────────────────────── */
:root {
  --primary:        #6C63FF;
  --primary-dark:   #5A52E0;
  --primary-light:  #EAE9FF;
  --secondary:      #43A89A;
  --accent:         #FF6584;
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --dark:           #2D2D3A;
  --dark-2:         #404055;
  --gray:           #6B7280;
  --gray-light:     #9CA3AF;
  --border:         #E5E7EB;
  --light:          #F8F9FA;
  --white:          #FFFFFF;
  --sidebar-w:      260px;
  --header-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      20px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 24px rgba(0,0,0,.12);
  --transition:     .2s ease;
}

/* ── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

/* ── 3. Typography ────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--gray); }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-med  { font-weight: 500; }

/* ── 4. Layout helpers ────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── 5. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-primary   { background: var(--primary);   color: #fff; }
.btn-primary:hover:not(:disabled)   { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #358e82; }
.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-success   { background: var(--success);   color: #fff; }
.btn-outline   { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-ghost     { background: transparent; color: var(--gray); border-color: var(--border); }
.btn-ghost:hover:not(:disabled)   { background: var(--light); }
.btn-sm        { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg        { padding: .9rem 1.75rem; font-size: 1rem; }
.btn-block     { width: 100%; }
.btn-icon      { padding: .5rem; }

/* ── 6. Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--dark-2);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-control::placeholder { color: var(--gray-light); }
.form-control.is-invalid { border-color: var(--danger); }
.form-hint { font-size: .78rem; color: var(--gray); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.5rem; }

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

.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"]  { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); cursor: pointer; }

/* ── 7. Cards ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body  { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--light); }

/* Stat cards */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.purple { background: var(--primary-light); }
.stat-icon.teal   { background: #d1f5f0; }
.stat-icon.pink   { background: #ffe0e7; }
.stat-icon.amber  { background: #fef3c7; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--dark); }
.stat-label { font-size: .8rem; color: var(--gray); margin-top: .25rem; }

/* ── 8. Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table th {
  background: var(--light);
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--light); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── 9. Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-purple  { background: var(--primary-light); color: var(--primary-dark); }
.badge-green   { background: #d1fae5; color: #065f46; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-amber   { background: #fef3c7; color: #92400e; }
.badge-gray    { background: var(--light); color: var(--gray); }

/* ── 10. Alerts ───────────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c4c0ff; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── 11. Toast notifications ──────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
}
.toast {
  background: var(--white);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: .9rem 1.1rem;
  font-size: .875rem;
  max-width: 320px;
  pointer-events: auto;
  animation: slideInRight .3s ease, fadeOut .4s ease 2.6s forwards;
}
.toast.success { border-color: var(--success); }
.toast.danger  { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ── 12. Modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body    { padding: 1.5rem; }
.modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }
.modal-close   { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray); line-height: 1; padding: .25rem; border-radius: var(--radius-sm); transition: background var(--transition); }
.modal-close:hover { background: var(--light); }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── 13. Admin / Client layout ────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.sidebar-logo-text { font-weight: 700; font-size: 1.125rem; color: #fff; }
.sidebar-logo-sub  { font-size: .7rem; color: rgba(255,255,255,.5); display: block; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav-section { padding: .5rem 1.25rem .25rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); font-weight: 600; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  margin: .1rem .75rem;
  border-radius: var(--radius-sm);
}
.sidebar-nav a:hover  { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-nav a .nav-icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 1rem; }
.sidebar-nav a .nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user { display: flex; align-items: center; gap: .75rem; }
.sidebar-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .72rem; color: rgba(255,255,255,.5); }

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

/* Top bar */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.topbar-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--dark); padding: .35rem; }
.topbar-title { font-weight: 700; font-size: 1.1rem; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }

/* Page content */
.page-content { padding: 1.5rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }

/* Data grid (cards for tables) */
.data-grid { display: grid; gap: 1rem; }

/* ── 14. Login Page ───────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 60%);
  padding: 1.5rem;
}
.login-card { width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon { width: 64px; height: 64px; background: var(--primary); border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff; margin-bottom: .75rem; }
.login-logo h1 { font-size: 1.75rem; color: var(--dark); }
.login-logo p  { color: var(--gray); font-size: .9rem; }
.login-card .card-body { padding: 2rem; }

/* ── 15. Public booking page ──────────────────────────────── */
.booking-page {
  min-height: 100vh;
  background: var(--light);
}
.booking-header {
  background: var(--primary);
  color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
}
.booking-header h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.booking-header p  { opacity: .85; font-size: .9rem; }
.booking-header .biz-phone { display: inline-flex; align-items: center; gap: .4rem; color: rgba(255,255,255,.9); font-size: .85rem; margin-top: .5rem; text-decoration: none; }

.booking-body { max-width: 600px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* Progress steps */
.booking-steps { display: flex; margin-bottom: 1.5rem; }
.booking-step {
  flex: 1;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-light);
  position: relative;
}
.booking-step::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: var(--border);
  margin-bottom: .4rem;
  border-radius: 2px;
  transition: background var(--transition);
}
.booking-step.active::before,
.booking-step.done::before  { background: var(--primary); }
.booking-step.active { color: var(--primary); }
.booking-step.done   { color: var(--success); }

/* Service cards */
.service-list { display: flex; flex-direction: column; gap: .75rem; }
.service-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}
.service-card:hover  { border-color: var(--primary); box-shadow: var(--shadow); }
.service-card.selected { border-color: var(--primary); background: var(--primary-light); }
.service-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.service-card-info { flex: 1; }
.service-card-name { font-weight: 600; font-size: .95rem; }
.service-card-meta { font-size: .8rem; color: var(--gray); margin-top: .15rem; }
.service-card-price { font-weight: 700; color: var(--primary); font-size: 1rem; }

/* Calendar */
.booking-calendar { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.cal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border); }
.cal-header h3 { font-size: 1rem; }
.cal-nav { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: all var(--transition); }
.cal-nav:hover { background: var(--primary-light); border-color: var(--primary); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-weekday  { text-align: center; padding: .5rem .2rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  cursor: pointer;
  border-radius: 50%;
  margin: .15rem auto;
  width: 2.25rem;
  transition: all var(--transition);
  font-weight: 500;
}
.cal-day:hover:not(.disabled):not(.empty) { background: var(--primary-light); color: var(--primary); }
.cal-day.today    { border: 2px solid var(--primary); color: var(--primary); font-weight: 700; }
.cal-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.disabled { color: var(--border); cursor: not-allowed; }
.cal-day.empty    { cursor: default; }
.cal-day.has-slots::after { content: ''; display: block; width: 4px; height: 4px; background: var(--success); border-radius: 50%; position: absolute; bottom: 2px; }
.cal-day { position: relative; }

/* Time slots */
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.time-slot {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .5rem;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover    { border-color: var(--primary); color: var(--primary); }
.time-slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.time-slot.booked   { background: var(--light); color: var(--border); cursor: not-allowed; text-decoration: line-through; }

/* Booking summary */
.booking-summary {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.booking-summary .label { color: var(--gray); font-size: .8rem; }
.booking-summary .value { font-weight: 600; }

/* Confirmation page */
.confirm-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2rem; text-align: center; }
.confirm-icon { width: 72px; height: 72px; background: #d1fae5; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; font-size: 2rem; }
.confirm-details { background: var(--light); border-radius: var(--radius); padding: 1rem; margin: 1.25rem 0; text-align: left; }
.confirm-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; font-size: .9rem; }
.confirm-row + .confirm-row { border-top: 1px solid var(--border); }
.confirm-row .label { color: var(--gray); }
.confirm-row .value { font-weight: 600; }
.confirm-actions { display: flex; flex-direction: column; gap: .75rem; }

/* ── 16. Admin: Calendar view ─────────────────────────────── */
.admin-calendar { display: grid; grid-template-columns: repeat(7,1fr); }
.admin-cal-header { background: var(--light); padding: .5rem; text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); border-bottom: 1px solid var(--border); }
.admin-cal-day { min-height: 80px; padding: .4rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.admin-cal-day:nth-child(7n) { border-right: none; }
.admin-cal-day-num { font-size: .75rem; font-weight: 700; color: var(--gray); margin-bottom: .3rem; }
.admin-cal-day.today .admin-cal-day-num { color: var(--primary); }
.admin-cal-event { font-size: .68rem; padding: .15rem .4rem; border-radius: 4px; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* ── 17. Client: Hours grid ───────────────────────────────── */
.hours-grid { display: grid; gap: .75rem; }
.hours-row { background: var(--white); border-radius: var(--radius-sm); padding: .9rem 1rem; border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hours-day { font-weight: 600; width: 80px; flex-shrink: 0; }
.hours-time { display: flex; align-items: center; gap: .5rem; flex: 1; flex-wrap: wrap; }
.hours-time .form-control { max-width: 120px; }
.hours-closed { color: var(--gray); font-style: italic; }

/* ── 18. Loader ───────────────────────────────────────────── */
.loader { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 19. Empty states ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--gray); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { color: var(--dark-2); margin-bottom: .5rem; }

/* ── 20. Dropdown ─────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + .5rem);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.dropdown-menu.active { display: block; animation: fadeInDown .15s ease; }
.dropdown-item { display: block; padding: .65rem 1rem; color: var(--dark); font-size: .875rem; transition: background var(--transition); cursor: pointer; text-decoration: none; }
.dropdown-item:hover { background: var(--light); text-decoration: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .25rem 0; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── 21. Pagination ───────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.page-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; cursor: pointer; background: var(--white); color: var(--dark); transition: all var(--transition); text-decoration: none; }
.page-btn:hover:not(.active) { background: var(--light); text-decoration: none; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 22. Search & Filter bar ──────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filter-bar .form-control { max-width: 200px; }
.search-input { position: relative; }
.search-input .form-control { padding-left: 2.5rem; }
.search-input::before { content: '🔍'; position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); font-size: .85rem; pointer-events: none; }

/* ── 23. Media Queries ────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar becomes a drawer on mobile */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .main-content { margin-left: 0; }
  .topbar-menu-btn { display: flex; }

  /* Overlay when sidebar open */
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199; }
  .sidebar-overlay.active { display: block; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 1rem; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-bar .form-control { max-width: none; }
  .modal-footer { flex-direction: column-reverse; }
  .btn-block-sm { width: 100%; }
  .confirm-actions { }
}

@media (min-width: 768px) {
  h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .booking-body { padding: 2rem 1rem 3rem; }
  .slots-grid { grid-template-columns: repeat(4, 1fr); }
  .confirm-actions { flex-direction: row; justify-content: center; }
  .booking-header { padding: 2.5rem 1rem; }
  .booking-header h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .admin-cal-day { min-height: 110px; }
}

/* ── 24. Print (booking confirmation) ────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .confirm-actions { display: none !important; }
  .main-content { margin-left: 0; }
  .confirm-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── 25. Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-light); }

/* ── 26. Install page ─────────────────────────────────────── */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-light) 0%, #fff 70%); padding: 1.5rem; }
.install-card { width: 100%; max-width: 560px; }
.install-steps { display: flex; gap: 0; margin-bottom: 2rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.install-step { flex: 1; padding: .7rem; text-align: center; font-size: .8rem; font-weight: 600; background: var(--white); color: var(--gray); }
.install-step.active { background: var(--primary); color: #fff; }
.install-step.done   { background: var(--success); color: #fff; }
