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

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  /* Swiss Modernism 2.0 — un único stack Helvetica/Inter para todo */
  --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: var(--font-body);
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 21px;
  --text-2xl: 26px;
  --text-3xl: 32px;
  --text-display: 40px;
  --primary: #1f1b2e;
  --primary-soft: #2a2440;
  --primary-text: #ffffff;
  --accent: #c69963;
  --accent-dark: #a87841;
  --accent-soft: #f5e9d8;
  --accent-text: #ffffff;
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #ece6dc;
  --success: #2f9e44;
  --danger: #e03131;
  --warning: #f59f00;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .03);
  --shadow: 0 4px 12px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .04);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, .14), 0 8px 16px rgba(15, 23, 42, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` evita el scroll horizontal SIN crear un scroll container
     ni un containing block — `hidden` rompe `position: fixed` en iOS
     PWA (el bottom-nav se "subía" al scrollear). */
  overflow-x: clip;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.shell { flex: 1; padding-bottom: 80px; max-width: 760px; margin: 0 auto; width: 100%; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--primary); color: var(--primary-text);
  padding: 18px 18px 14px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow);
}
.app-header h1 {
  font-size: 18px; font-weight: 700;
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 10px;
}
#adminBrandName {
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.view-toggle .icon-sm {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.app-header .badge { background: var(--accent); color: var(--accent-text); font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.app-header .logout { color: var(--primary-text); font-size: 14px; opacity: .85; }
.app-header .logout:hover { opacity: 1; text-decoration: underline; }

.container { padding: 18px; }
.tab-section { display: none; animation: fade .25s ease; }
.tab-section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.page-sub { color: var(--text-muted); margin-bottom: 18px; font-size: 14px; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px; min-height: 100vh;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-soft) 100%);
}
.auth-card {
  background: var(--card); width: 100%; max-width: 420px;
  border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .icon { font-size: 36px; }
.auth-logo h1 { font-size: 22px; margin-top: 6px; color: var(--primary); }
.auth-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 { font-size: 15px; font-weight: 600; }
.card .muted { color: var(--text-muted); font-size: 13px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.field label .req { color: var(--danger, #ef4444); font-weight: 700; margin-left: 2px; }

/* Phone input: selector de país (bandera + prefijo) + número. */
.phone-row {
  display: flex; gap: 8px;
  align-items: stretch;
}
.phone-row .cs-wrap.phone-country {
  flex: 0 0 auto;
  width: 140px;
}
.phone-row .cs-wrap.phone-country .cs-trigger {
  padding-right: 28px;
  padding-left: 12px;
  gap: 6px;
}
.phone-row .cs-wrap.phone-country .cs-current {
  white-space: nowrap;
  overflow: visible;
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
/* Bandera más pequeña en el trigger para dejar sitio al prefijo (algunos
   países como +351 son 4 caracteres y se cortaban). En el listado del
   popup se ve a tamaño normal. */
.phone-row .cs-wrap.phone-country .cs-trigger .phone-flag {
  font-size: 14px;
  margin-right: 0;
}
.phone-row .cs-wrap.phone-country .cs-trigger .phone-dial {
  color: var(--text);
  font-weight: 600;
}
.phone-row > input[type="tel"] {
  flex: 1; min-width: 0;
}
/* El popup del selector de país necesita más ancho que el trigger (120px)
   para que los nombres de país se vean enteros. Quitamos right:0 para
   que pueda extenderse hacia la derecha sobre el input de número.
   max-height: 220px → ~5 países visibles, el resto con scroll. */
.cs-pop.phone-country-pop,
.phone-country .cs-pop {
  right: auto;
  min-width: 260px;
  max-height: 220px;
}
.phone-country .cs-opt {
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.phone-country .cs-opt .phone-country-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.phone-flag {
  font-size: 16px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
}
.phone-dial {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.phone-country .cs-opt .phone-dial { margin-left: auto; padding-left: 8px; }

/* Píldora de rol para distinguir admins/staff que aparecen en la
   cartera de clientes (pueden reservar como cualquier cliente). */
.role-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 4px;
}
.role-pill-admin { background: #ede9fe; color: #6d28d9; }
.role-pill-staff { background: #dbeafe; color: #1e40af; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder, .field textarea::placeholder { color: #a8a8a8; }
.field input:hover, .field textarea:hover, .field select:hover {
  border-color: #d4ccc1;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--ring);
}
.field textarea { resize: vertical; min-height: 80px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 600; font-size: 15px;
  font-family: inherit;
  letter-spacing: .1px;
  transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary); color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-soft); box-shadow: var(--shadow); }
.btn-accent {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow);
}
.btn-outline {
  background: #fff; border-color: var(--border); color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: #d4ccc1; background: #fbfaf8; }
.btn-danger {
  background: #fff; border-color: #f5c6c6; color: var(--danger);
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover { background: #fff5f5; border-color: #f0a0a0; }
/* Variante "danger sólido": fondo rojo con texto blanco. Para acciones
   destructivas que queremos remarcar visualmente (cerrar sesión, etc.). */
.btn-danger-solid {
  background: var(--danger); border-color: var(--danger); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-danger-solid:hover {
  background: #b91c1c; border-color: #b91c1c; color: #fff;
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Bottom nav (móvil) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 4px max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 rgba(15,23,42,.02), 0 -8px 24px rgba(15,23,42,.04);
}
.bottom-nav button, .bottom-nav > a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1px;
  border-radius: 8px;
  transition: color .15s;
  min-height: 52px;
  text-decoration: none;
}
.bottom-nav button .icon, .bottom-nav > a .icon {
  width: 22px; height: 22px;
  display: block;
  stroke-width: 1.8;
  transition: stroke-width .15s, transform .15s;
}
.bottom-nav button.active, .bottom-nav > a.active {
  color: var(--primary);
  font-weight: 600;
}
.bottom-nav button.active .icon, .bottom-nav > a.active .icon {
  stroke-width: 2.2;
}
.bottom-nav button:hover:not(.active), .bottom-nav > a:hover:not(.active) { color: var(--text); }

/* Botón de cerrar sesión: acción destructiva, color rojo sutil. */
.bottom-nav button.logout { color: #b91c1c; }
.bottom-nav button.logout:hover { color: #991b1b; background: #fef2f2; }

/* En móvil (<1024px) el logout vive dentro del Perfil, no en el bottom-nav.
   En desktop (sidebar) sucede al revés. */
.logout-mobile-only { display: block; }
/* Botón "Cerrar sesión" del cliente: rojo sólido con texto blanco,
   más contundente que el btn-danger normal (outline) que usamos en
   acciones secundarias del admin. */
.btn.btn-danger.logout-mobile-only {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.btn-danger.logout-mobile-only:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
@media (min-width: 1024px) {
  .logout-mobile-only { display: none; }
}
@media (max-width: 1023px) {
  .bottom-nav button.logout { display: none; }
}

/* ---------- Booking ---------- */
.service-list { display: grid; gap: 10px; }
.service-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.service-item:hover { border-color: var(--accent); }
.service-item.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.service-item h3 { font-size: 15px; font-weight: 600; }
.service-item .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; color: var(--text-muted); font-size: 13px; }
.service-item .price { color: var(--accent-dark); font-weight: 700; font-size: 16px; }

.slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px; margin-top: 8px;
}
.slot {
  padding: 10px 4px; border-radius: 10px; text-align: center;
  background: #fff; border: 1px solid var(--border); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all .12s;
}
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot.selected { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.slot:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.step-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin: 16px 0 8px; }

/* ---------- Appointment cards ---------- */
.appt-card {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--border); margin-bottom: 10px; box-shadow: var(--shadow-xs);
  display: flex; gap: 14px; align-items: flex-start;
  transition: box-shadow .15s, transform .12s, border-color .15s;
}
.appt-card:hover { box-shadow: var(--shadow); border-color: #dad3c7; }
.appt-card .date-box {
  background: var(--primary);
  color: var(--primary-text); border-radius: 10px;
  padding: 10px 12px; text-align: center; min-width: 60px;
}
.appt-card .date-box .d {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; line-height: 1;
  letter-spacing: -.5px;
}
.appt-card .date-box .m { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; opacity: .9; font-weight: 600; }
.appt-card .info { flex: 1; min-width: 0; }
.appt-card .info h4 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -.2px;
  line-height: 1.25;
}
.appt-card .info .row { display: flex; gap: 12px; color: var(--text-muted); font-size: 13px; margin-top: 4px; flex-wrap: wrap; }
.status {
  display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}
.status.confirmed { background: #dcfce7; color: #166534; }
.status.cancelled { background: #fee2e2; color: #991b1b; }
.status.completed { background: #dbeafe; color: #1e40af; }

/* ---------- Stats ---------- */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.stat {
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.stat .value small { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ---------- Client list (admin) ---------- */
.client-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer; transition: border-color .12s;
}
.client-row:hover { border-color: var(--accent); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.client-row .info { flex: 1; min-width: 0; }
.client-row .info h4 { font-size: 15px; font-weight: 600; }
.client-row .info p { color: var(--text-muted); font-size: 13px; }
.client-row .meta { text-align: right; font-size: 12px; color: var(--text-muted); }
.client-row .meta b { color: var(--primary); font-size: 15px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  /* Evita que el scroll/swipe del modal se chain al body (rubber-band
     en iOS). Combinado con el body-scroll-lock en JS deja el fondo
     totalmente quieto durante el drag. */
  overscroll-behavior: contain;
}
.modal-backdrop.open { display: flex; }
/* Popover de detalle de cita: vive encima del modal del día (z:100) y
   del FAB de "Nueva cita" en modo día (z:110). No reemplaza el timeline,
   se superpone. A diferencia del modal-sheet bottom (anclado abajo con
   barrita drag-to-dismiss), el popover va CENTRADO con espacio en los
   laterales y sin la barrita — no es deslizable, se cierra por backdrop
   o por el botón Cerrar. */
.appt-popover-backdrop {
  z-index: 150;
  align-items: center;
  padding: 16px;
}

/* Google Places Autocomplete inyecta el dropdown como .pac-container
   directamente en <body>, con z-index: 1000 por defecto. Eso queda
   debajo de modales o sheets activos en PWA mobile. Forzamos z-index
   muy alto y ajustamos tipografía + bordes al estilo del proyecto. */
.pac-container {
  z-index: 99999 !important;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  font-family: inherit;
  margin-top: 4px;
  overflow: hidden;
}
.pac-container::after { display: none !important; }  /* oculta el logo "powered by google" en línea aparte */
.pac-item {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;
  border-top: 1px solid rgba(0,0,0,.04);
  cursor: pointer;
}
.pac-item:first-child { border-top: 0; }
.pac-item:hover, .pac-item-selected { background: rgba(0,0,0,.04); }
.pac-icon { display: none; }
.pac-item-query { font-weight: 600; }
/* Confirm popover: tercera capa por encima del popover de detalle. Permite
   que appConfirm aparezca sobre cualquier modal sin solaparse de forma rara
   con bottom-sheets ya abiertos. */
.confirm-popover-backdrop {
  z-index: 200;
  align-items: center;
  padding: 16px;
}
/* Doble clase para ganar al .modal base que mete border-radius 20px 20px
   0 0 (estilo bottom-sheet) y al .modal de mobile que añade padding-top
   extra para la barrita. */
.modal.appt-popover-card {
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  padding: 24px 20px;
  max-height: calc(100vh - 32px);
  animation: popIn .18s ease;
}
/* Anula la barrita arriba que .modal añade en móvil (solo aplica a los
   sheets bottom-anchored). */
.modal.appt-popover-card::before { display: none !important; }
@keyframes popIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
.modal {
  background: #fff; width: 100%; max-width: 520px;
  border-radius: 20px 20px 0 0; padding: 24px 20px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .25s ease;
  overscroll-behavior: contain;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -.4px;
  line-height: 1.2;
}
.modal .sub { color: var(--text-muted); margin-bottom: 18px; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ============================================================
   FAB de acceso rápido (.appts-fab) — botón fijo abajo a la derecha
   en la tab Citas para crear una cita sin entrar al detalle del día.
   Solo se muestra cuando la sección padre está activa.
   ============================================================ */
.appts-fab {
  display: flex; align-items: center; justify-content: center;
  position: fixed;
  right: 18px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.08);
  z-index: 40;
  transition: transform .12s ease, box-shadow .12s ease;
}
.appts-fab[hidden] { display: none; }
/* Cuando hay un modal de día abierto, el FAB queda por encima del
   backdrop (z:100) para que siga clicable como acceso directo a
   crear cita en esa fecha. */
body.day-modal-open .appts-fab { z-index: 110; }
.appts-fab svg { width: 28px; height: 28px; display: block; }
.appts-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.28); }
.appts-fab:active { transform: scale(.94); }
@media (min-width: 1024px) {
  /* En desktop el sidebar ocupa el lado izquierdo, no hay bottom-nav. */
  .appts-fab { bottom: 24px; right: 24px; }
}

/* ============================================================
   Custom dropdown (.cs-*) — sustituye <select> donde queremos que
   el desplegable abierto siga el tema (en iOS el <select> nativo
   abre la rueda del sistema). Usa variables del tema. Lógica JS
   en /js/custom-select.js (helper initCustomSelect).
   ============================================================ */
.cs-wrap { position: relative; }
.cs-trigger {
  width: 100%;
  padding: 13px 14px; padding-right: 38px;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-family: inherit; font-size: inherit;
  text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.cs-trigger:hover { border-color: var(--accent); }
.cs-trigger[aria-expanded="true"],
.cs-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cs-current.is-placeholder { color: var(--text-muted); }
.cs-chev {
  width: 16px; height: 16px;
  stroke: var(--accent); fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform .15s;
}
.cs-trigger[aria-expanded="true"] .cs-chev { transform: rotate(180deg); }
.cs-pop {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
/* Cuando el JS pasa el popup a position:fixed (porque algún ancestor
   lo recortaría), necesita estar por encima del modal-backdrop (z:100). */
.cs-pop[style*="position: fixed"],
.cs-pop[style*="position:fixed"] { z-index: 200; }
.cs-pop[hidden] { display: none; }
.cs-opt {
  display: block; width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit; font-size: 14px;
}
.cs-opt:hover, .cs-opt:focus { background: var(--accent-soft); outline: none; }
.cs-opt.selected {
  color: var(--accent-dark);
  font-weight: 600;
  background: var(--accent-soft);
}

/* ---- Calendar picker (.cs-cal) ---- */
/* Sobreescribe max-height del .cs-pop (260px no basta para mostrar
   las 6 filas completas del grid + cabecera + weekdays). Forzamos
   altura natural; el JS reposiciona si no cabe. */
.cs-pop.cs-cal { padding: 10px; min-width: 280px; max-height: none; }
.cs-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.cs-cal-title {
  font-weight: 700; font-size: 14px;
  text-transform: capitalize;
}
.cs-cal-nav {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 18px; line-height: 1;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.cs-cal-nav:hover { border-color: var(--accent); color: var(--accent-dark); }
.cs-cal-wd {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}
.cs-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cs-cal-gap { display: block; }
.cs-cal-day {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit; font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}
.cs-cal-day:hover:not(:disabled) { background: var(--accent-soft); }
.cs-cal-day.today { border-color: var(--accent); }
.cs-cal-day.selected {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 700;
}
.cs-cal-day.disabled, .cs-cal-day:disabled {
  color: var(--text-muted);
  opacity: .35;
  cursor: not-allowed;
}

/* ---- Time picker list (.cs-time-pop) ---- */
.cs-pop.cs-time-pop { max-height: 360px; }
.cs-time-pop .cs-opt {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Bottom-sheet handle (barrita arriba estilo iOS) — solo en móvil donde
   el modal aparece anclado al fondo. El gesto drag-to-dismiss vive en
   /js/modal-sheet.js. */
@media (max-width: 639px) {
  .modal { padding-top: 28px; position: relative; }
  .modal::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 5px;
    border-radius: 3px;
    background: rgba(0,0,0,.18);
    pointer-events: none;
  }
}

/* ---------- Search bar ---------- */
.search {
  position: relative; margin-bottom: 12px;
}
.search input {
  width: 100%; padding: 11px 14px 11px 38px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search::before {
  content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .6;
}

/* ---------- Empty / loading ---------- */
.empty {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty .icon { font-size: 52px; opacity: .35; margin-bottom: 14px; filter: grayscale(.4); }
.empty p { font-size: 14px; line-height: 1.5; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid #ddd; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-full { text-align: center; padding: 40px 0; }

/* ---------- Toast ----------
   Banner ancho que aparece sobre el bottom-nav, ocupando todo el ancho
   disponible con un margen lateral pequeño. En desktop limitamos el
   ancho máximo para que no se estire demasiado. */
.toast {
  position: fixed;
  /* Antes era 100px (encima de la tab bar). El admin pidió bajarlas casi
     al borde inferior — solo respetamos el safe-area-inset y un pelín
     de margen visual. Como el toast desaparece a los pocos segundos,
     que pase brevemente por encima de la tab bar es asumible. */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 12px; right: 12px;
  margin: 0 auto;
  max-width: 520px;
  /* Fondo con transparencia REAL (sin blur) — se ve el contenido detrás
     limpio, sin desenfoque. Borde con el color a opacidad completa para
     que el contorno destaque. */
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 14px; font-weight: 600; line-height: 1.4;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error {
  background: color-mix(in srgb, var(--danger) 30%, transparent);
  border-color: var(--danger);
  color: #7f1d1d;
}
.toast.success {
  background: color-mix(in srgb, var(--success) 30%, transparent);
  border-color: var(--success);
  color: #14532d;
}
@media (min-width: 1024px) {
  .toast { bottom: 24px; left: auto; right: 24px; margin: 0; max-width: 380px; text-align: left; }
}

/* ---------- Pills / filters ---------- */
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1px solid var(--border); font-weight: 500;
}
.pill.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* ---------- Tablet+ ---------- */
@media (min-width: 760px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .container { padding: 24px; }
}

/* ============================================================
   BOOKSY-STYLE CLIENT EXPERIENCE
   ============================================================ */

/* Cover / hero — Swiss Modernism: bloque sólido + acento sutil */
.cover {
  position: relative;
  height: 175px;
  background: var(--primary);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
/* Bloque de acento minimalista en esquina inferior derecha (Swiss asymmetric) */
.cover::before {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 40%; height: 100%;
  background: linear-gradient(135deg, transparent 0%, color-mix(in srgb, var(--accent) 18%, transparent) 100%);
  pointer-events: none; z-index: 0;
}
/* Fade inferior potente para asegurar legibilidad del contenido superpuesto */
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,.78) 100%);
  pointer-events: none; z-index: 1;
}
.cover .cover-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 22px 28px;
  z-index: 3;
}
.cover .cover-eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .75;
  margin-bottom: 12px;
}
.cover h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.cover .tagline {
  font-family: var(--font-body);
  font-size: 14px;
  opacity: .9;
  margin-top: 8px;
  letter-spacing: .2px;
  font-weight: 400;
}
.cover .rating-row {
  display: inline-flex; gap: 8px; align-items: center;
  margin-top: 16px; font-size: 13px;
  background: rgba(255,255,255,.13);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255,255,255,.18);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.cover .rating-row .stars {
  color: #fbbf24;
  letter-spacing: 1.5px;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.cover .rating-row .rating { font-weight: 700; }
.cover .open-pill {
  position: absolute; top: 18px; right: 18px; z-index: 4;
  background: rgba(34, 197, 94, .92);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.22);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* Banner subido: ajustar overlay */
.cover.has-banner::before { opacity: .4; }

@media (min-width: 640px) {
  .cover { height: 215px; }
  .cover h1 { font-size: 56px; letter-spacing: -2px; }
  .cover .tagline { font-size: 16px; }
  .cover .cover-content { padding: 32px 32px 36px; }
}

/* Salon info card right below cover */
.salon-info {
  background: #fff; margin: -32px 16px 16px;
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 3;
  border: 1px solid var(--border);
}
.salon-info .row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; font-size: 14px;
}
.salon-info .row + .row { border-top: 1px solid var(--border); }
.salon-info .row .ic { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }

/* Sub-tabs */
.sub-tabs {
  display: flex; gap: 4px; margin: 18px 0 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tabs button {
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.sub-tabs button.active { color: var(--primary); border-bottom-color: var(--accent); }

.sub-content { display: none; animation: fade .2s ease; }
.sub-content.active { display: block; }

/* Service category groups */
.svc-category-title {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px;
  margin: 24px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.svc-category-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
/* Sortable: drag handle y feedback visual durante el arrastre */
.svc-sortable-item { transition: transform .15s, box-shadow .15s; }
.svc-sortable-item.drag-over {
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.01);
}
.svc-drag-handle {
  cursor: grab;
  padding: 0 4px;
  font-weight: 700;
  letter-spacing: -2px;
  transform: rotate(90deg);
  display: inline-block;
}
.svc-drag-handle:active { cursor: grabbing; }
.svc-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 10px;
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.svc-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.svc-card .svc-body { flex: 1; min-width: 0; }
.svc-card h4 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  letter-spacing: -.2px;
  margin-bottom: 3px;
  line-height: 1.2;
}
.svc-card .svc-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; font-weight: 500; letter-spacing: .2px; }
.svc-card .svc-desc { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }
.svc-card .svc-action {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
.svc-card .svc-price {
  font-family: var(--font-display);
  font-weight: 700; color: var(--text);
  font-size: 19px;
  letter-spacing: -.3px;
}
.svc-card .svc-btn {
  background: var(--primary); color: var(--primary-text);
  padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: .3px;
  transition: background .15s, transform .08s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.svc-card .svc-btn:hover { background: var(--accent-dark); box-shadow: var(--shadow-sm); }
.svc-card .svc-btn:active { transform: scale(.94); }

/* Team / staff cards */
.team-grid { display: grid; gap: 10px; }
.team-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.team-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.team-card {
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s, border-color .15s, transform .12s;
}
.team-card:hover { box-shadow: var(--shadow); border-color: #dad3c7; transform: translateY(-1px); }
.team-card .info h4 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -.2px;
}
.team-card .info p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.team-card .info .star { color: var(--accent-dark); font-weight: 600; font-size: 13px; }

/* Info hours list */
.hours-list { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; }
.hours-list .hr-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14px;
}
.hours-list .hr-row + .hr-row { border-top: 1px solid var(--border); }
.hours-list .hr-row.today { font-weight: 700; color: var(--primary); }

/* ============================================================
   BOOKING BOTTOM SHEET
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(20,15,30,.55);
  z-index: 100; display: none;
  align-items: flex-end; justify-content: center;
}
.sheet-backdrop.open { display: flex; animation: fadeBg .2s ease; }
@keyframes fadeBg { from { background: rgba(0,0,0,0); } to { background: rgba(20,15,30,.55); } }

.sheet {
  background: var(--bg); width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; max-height: 88vh; }
}

.sheet-header {
  position: relative;
  padding: 14px 18px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  flex-shrink: 0;
}
.sheet-header::before {
  content: ""; display: block;
  width: 36px; height: 4px; background: #d8d2c9;
  border-radius: 2px; margin: 0 auto 12px;
}
.sheet-close {
  position: absolute; right: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text);
  font-size: 18px; font-weight: 600;
}
.sheet-header h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -.3px;
  padding-right: 36px;
  line-height: 1.2;
}
.sheet-header .meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

.sheet-body {
  flex: 1; overflow-y: auto; padding: 18px;
}

.sheet-footer {
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Stylist picker */
.stylist-list { display: grid; gap: 8px; }
.stylist-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  background: #fff; border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
  width: 100%; text-align: left;
  box-shadow: var(--shadow-xs);
}
.stylist-pick:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stylist-pick.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.stylist-pick .info { flex: 1; min-width: 0; }
.stylist-pick .info h4 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  letter-spacing: -.1px;
}
.stylist-pick .info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stylist-pick .check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; flex-shrink: 0;
}
.stylist-pick.selected .check { background: var(--accent); border-color: var(--accent); }
.stylist-pick.any .team-avatar { background: var(--primary); }

/* Horizontal day carousel */
.day-carousel {
  display: flex; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px;
  scroll-snap-type: x mandatory;
}
.day-carousel::-webkit-scrollbar { display: none; }
.day-pick {
  flex-shrink: 0; scroll-snap-align: start;
  width: 64px; padding: 10px 6px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; text-align: center;
  cursor: pointer; transition: all .12s;
}
.day-pick:hover { border-color: var(--accent); }
.day-pick.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.day-pick .wd { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.day-pick .dn { font-size: 20px; font-weight: 700; line-height: 1; margin-top: 4px; }
.day-pick .mo { font-size: 10px; text-transform: uppercase; margin-top: 4px; opacity: .6; }
.day-pick.today .wd { color: var(--accent-dark); opacity: 1; }
.day-pick.today.selected .wd { color: var(--accent-soft); opacity: 1; }

/* Time slots grouped */
.slot-group { margin-bottom: 18px; }
.slot-group-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* Summary card */
.summary-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-top: 16px;
}
.summary-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; font-size: 14px;
}
.summary-row + .summary-row { border-top: 1px solid var(--border); }
.summary-row .ic { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.summary-row .lbl { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.summary-row .val { font-weight: 600; margin-top: 1px; }
.summary-row .right { margin-left: auto; font-weight: 700; color: var(--accent-dark); }

.step-block { margin-bottom: 20px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: var(--primary-text);
  font-size: 12px; font-weight: 700; margin-right: 8px;
}
.step-title {
  display: flex; align-items: center; font-size: 14px; font-weight: 700;
  margin-bottom: 10px;
}
.step-block.locked { opacity: .4; pointer-events: none; }
.step-block.locked .step-num { background: var(--text-muted); }

/* Confirmation success */
.confirm-success {
  text-align: center; padding: 28px 20px;
}
.confirm-success .check-big {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(47,158,68,.3);
}
.confirm-success h2 { font-size: 22px; margin-bottom: 6px; }
.confirm-success p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* ============================================================
   ADMIN DASHBOARD — KPIs, chart, rankings
   ============================================================ */
.muted-sub { color: var(--text-muted); font-size: 12px; }

.next-appt-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--primary);
  color: var(--primary-text); padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.next-appt-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.next-appt-label { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.next-appt-main { font-size: 17px; font-weight: 600; margin-top: 2px; }
.next-appt-sub { font-size: 13px; opacity: .85; margin-top: 2px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
  min-height: 86px;
}
.kpi-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
}
.kpi-value {
  font-size: 24px; font-weight: 700; color: var(--primary);
  line-height: 1.1; margin: 6px 0 4px;
  letter-spacing: -.5px;
  display: flex; align-items: baseline; gap: 8px;
}
.kpi-value small { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: auto; }
.kpi-sub.muted { color: var(--text-muted); }
.kpi-trend { font-size: 11px; font-weight: 700; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.muted { color: var(--text-muted); font-weight: 500; }

.kpi-meta {
  display: flex; flex-wrap: wrap;
  gap: 6px 10px;
  margin: 14px 0 20px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.kpi-meta b { color: var(--text); font-weight: 700; }
.kpi-meta small { font-size: 10px; opacity: .8; }
.kpi-meta .sep { opacity: .35; }

.dash-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.dash-h {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 14px;
}
.dash-h h3 { font-size: 15px; font-weight: 700; }
.dash-two-col {
  display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px;
}
@media (min-width: 760px) {
  .dash-two-col { grid-template-columns: 1fr 1fr; }
  .dash-two-col .dash-card { margin-bottom: 0; }
}

/* Line + dot chart (revenue) */
.line-chart {
  width: 100%;
  height: 220px;
  display: block;
  overflow: visible;
}
.line-chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.line-chart .axis-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font-body); font-weight: 500; }
.line-chart .axis-label.today { fill: var(--primary); font-weight: 700; }
.line-chart .area { fill: url(#areaGradient); }
.line-chart .line { fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .dot { fill: var(--accent-dark); stroke: #fff; stroke-width: 1.5; transition: r .15s; }
.line-chart .dot:hover { r: 6; }
.line-chart .dot.today { fill: var(--primary); r: 5; }
.line-chart .dot.empty { fill: var(--border); stroke: #fff; }

.dash-card.clickable {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.dash-card.clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.dash-card .open-hint {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  letter-spacing: .3px;
}

/* Modal ancho para gráfica detalle */
.modal.wide { max-width: 920px; }

.preset-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.preset-pills .pill { font-size: 12px; padding: 6px 12px; }

.range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.range-inputs label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  display: block;
  margin-bottom: 4px;
}
.range-inputs input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; font-family: inherit;
}
.range-inputs input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.revenue-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .revenue-stats { grid-template-columns: repeat(4, 1fr); } }
.revenue-stat {
  background: var(--bg); padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border);
}
.revenue-stat .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.revenue-stat .value { font-size: 20px; font-weight: 700; color: var(--primary); margin-top: 4px; letter-spacing: -.4px; }
.revenue-stat .value small { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Bar chart (legacy, mantenido) */
.bar-chart {
  display: flex; gap: 4px; align-items: stretch;
  height: 200px; padding: 4px 0;
}
.bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.bar-val {
  font-size: 9px; color: var(--text-muted); height: 14px;
  font-weight: 600; line-height: 14px;
}
.bar {
  width: 100%; max-width: 26px; flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 4px 4px 0 0; min-height: 2px;
  transition: opacity .15s;
  align-self: flex-end;
}
.bar:hover { opacity: .85; }
.bar.weekend { background: linear-gradient(180deg, #d8c4a8 0%, #b89876 100%); }
.bar.today {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-soft) 100%);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.bar-label {
  font-size: 10px; color: var(--text-muted); line-height: 1.2; text-align: center;
}
.bar-label.today { color: var(--primary); font-weight: 700; }
.bar-day { font-size: 11px; font-weight: 600; }

/* Rankings */
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.rank-row + .rank-row { border-top: 1px solid var(--border); }
.rank-row.clickable { cursor: pointer; }
.rank-row.clickable:hover { background: var(--bg); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.rank-num {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.rank-num.gold { background: linear-gradient(135deg, #f5cb73, #d99e3b); color: #fff; }
.rank-info { flex: 1; min-width: 0; }
.rank-info h4 { font-size: 14px; font-weight: 600; }
.rank-info p { font-size: 12px; margin-top: 1px; }
.mini-bar {
  margin-top: 6px; height: 4px; background: var(--bg);
  border-radius: 999px; overflow: hidden; max-width: 200px;
}
.mini-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-radius: 999px;
}

/* ============================================================
   THEME EDITOR
   ============================================================ */
.palette-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (min-width: 480px) { .palette-grid { grid-template-columns: repeat(3, 1fr); } }
.palette-btn {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; background: #fff;
  border: 1.5px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: border-color .12s, transform .08s;
  width: 100%; text-align: left;
}
.palette-btn:hover { border-color: var(--accent); }
.palette-btn:active { transform: scale(.98); }
.palette-btn.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.palette-swatches { display: flex; gap: 4px; height: 22px; }
.palette-swatch {
  flex: 1; border-radius: 4px; border: 1px solid rgba(0,0,0,.06);
}
.palette-btn .palette-name { font-size: 12px; font-weight: 600; }

.theme-preview {
  border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden;
}
.theme-preview-head {
  background: var(--primary); color: var(--primary-text);
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
}
.theme-preview-head h4 { font-size: 14px; }
.theme-preview-body {
  background: var(--bg); padding: 16px;
}
.theme-preview-body .pv-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center;
}
.theme-preview-body .pv-card .price {
  background: var(--accent); color: var(--accent-text);
  padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
}

.color-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
}
.color-row + .color-row { border-top: 1px solid var(--border); }
.color-row .swatch-big {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); flex-shrink: 0; cursor: pointer;
  position: relative; overflow: hidden;
}
.color-row .swatch-big input[type="color"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; border: none;
}
.color-row .info { flex: 1; min-width: 0; }
.color-row .info h4 { font-size: 14px; font-weight: 600; }
.color-row .info p { font-size: 12px; color: var(--text-muted); }
.color-row .hex { font-family: 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--text-muted); }

/* ============================================================
   HORARIO — editor en admin
   ============================================================ */
.hours-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.hours-row:last-child { border-bottom: none; }
.hours-row-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.hours-day {
  font-weight: 700; font-size: 14px;
  letter-spacing: .1px;
}
.hours-closed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer;
}
.hours-closed input { width: 16px; height: 16px; cursor: pointer; }
.hours-shifts {
  display: flex; flex-direction: column; gap: 8px;
  padding-left: 0;
}
.hours-shift {
  display: flex; align-items: center; gap: 8px;
}
.hours-shift input[type="time"] {
  padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; font-family: inherit; font-size: 14px;
  font-variant-numeric: tabular-nums;
  width: 110px;
}
.hours-shift input[type="time"]:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.hours-sep { color: var(--text-muted); font-weight: 600; }
.hours-x {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  color: var(--danger); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.hours-x:hover { background: #fff5f5; border-color: #f0a0a0; }

/* ============================================================
   CITAS · Toggle vista + Calendario
   ============================================================ */
.view-toggle {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg); border-radius: 12px;
  margin-bottom: 14px;
}
.view-toggle button {
  flex: 1; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
}
.view-toggle button.active {
  background: #fff; color: var(--text);
  box-shadow: var(--shadow-sm);
}

.view-pane { display: none; animation: fade .2s ease; }
.view-pane.active { display: block; }

/* Cabecera del calendario */
.cal-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.cal-controls-left {
  display: flex; align-items: center; gap: 8px;
  justify-self: start;
}
.cal-controls-right { justify-self: end; }
.cal-month-wrap {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; justify-content: center;
}
.cal-month-wrap h3 {
  font-size: 19px; font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.cal-nav {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: var(--text);
  cursor: pointer; flex-shrink: 0;
  transition: background .12s, border-color .12s, transform .08s;
  box-shadow: var(--shadow-sm);
}
.cal-nav:hover { background: var(--bg); border-color: var(--accent); }
.cal-nav:active { transform: scale(.92); }

/* Grid del calendario — celdas blancas distintas */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  width: 100%;
  min-width: 0;
}
.cal-weekday {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 0 8px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  min-height: 64px;
  min-width: 0;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 8px 7px;
  position: relative;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  overflow: hidden;
}
.cal-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
  border-color: var(--accent);
}
.cal-cell:active { transform: translateY(0); transition-duration: .05s; }
.cal-cell.empty {
  background: transparent;
  border: 1.5px solid transparent;
  box-shadow: none;
  cursor: default; pointer-events: none;
}
.cal-cell.past:not(.today) {
  background: #fbfaf8;
  opacity: 0.7;
}
.cal-cell.past:not(.today) .cal-day { color: var(--text-muted); }

/* Día con citas: borde acento + barra superior */
.cal-cell.has-appts {
  border-color: var(--accent);
  border-width: 1.5px;
  opacity: 1;
  background: #ffffff;
}
.cal-cell.has-appts::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

/* Hoy: relleno con primary */
.cal-cell.today {
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  border-color: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.cal-cell.today .cal-day { color: var(--primary-text); }
.cal-cell.today::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.cal-day {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 2px;
}

/* Indicador de disponibilidad por día: bolita centrada abajo en la
   celda. Verde = libre, amarillo = llenándose, rojo = completo.
   Incluye citas confirmadas/completadas y bloqueos. */
.cal-availability {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin: auto auto 2px;
}
.cal-availability.green  { background: #22c55e; }
.cal-availability.yellow { background: #f59e0b; }
.cal-availability.red    { background: #ef4444; }
.cal-cell.today .cal-availability {
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.7);
}

/* Leyenda */
.cal-legend {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 14px;
  font-size: 12px; color: var(--text-muted);
  flex-wrap: wrap;
}
.cal-legend .dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 5px;
  vertical-align: middle;
}
.dot-avail-green  { background: #22c55e; }
.dot-avail-yellow { background: #f59e0b; }
.dot-avail-red    { background: #ef4444; }

/* Filtros mañana/tarde dentro del modal del día */
.day-pills {
  margin-bottom: 14px;
}
.day-pills .pill {
  display: inline-flex; align-items: center; gap: 6px;
}
.day-pills .pill .count {
  background: var(--bg);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.day-pills .pill.active .count {
  background: rgba(255, 255, 255, .22);
  color: var(--primary-text);
}

/* Day modal — listado de citas */
.day-appts {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.day-appt {
  display: flex; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.day-appt-time {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--primary);
  letter-spacing: -.4px;
  flex-shrink: 0; padding-top: 2px;
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}
.day-appt-body { flex: 1; min-width: 0; }

/* Sección de bloqueos manuales del día */
.day-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin: 18px 0 8px;
}
.day-blocks { display: flex; flex-direction: column; gap: 8px; }
.day-block-card {
  display: flex; align-items: center; gap: 12px;
  background: #fef9c3; border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 10px 14px;
}
.day-block-time {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: #92400e;
  flex-shrink: 0; min-width: 110px;
  font-variant-numeric: tabular-nums;
}
.day-block-body { flex: 1; min-width: 0; font-size: 13px; color: #78350f; }

/* Cards de "hueco libre" → al pulsar abren el modal de bloqueo */
.day-gaps { display: flex; flex-direction: column; gap: 6px; }
.day-gap-card {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-family: inherit; font-size: 14px;
  color: var(--text-muted); cursor: pointer; width: 100%;
  transition: background .15s, border-color .15s, color .15s;
}
.day-gap-card:hover { background: #fafafa; border-color: var(--accent); color: var(--text); }
.day-gap-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.day-gap-action { font-size: 12px; color: var(--accent-dark); font-weight: 600; }
.day-appt-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 2px;
}
.day-appt-head h4 { font-size: 14px; font-weight: 600; }

/* ============================================================
   DAY TIMELINE (vista tipo Google Calendar)
   ============================================================ */
.day-modal { display: flex; flex-direction: column; }
.day-modal-header { margin-bottom: 10px; }

.day-timeline-wrap {
  position: relative;
  max-height: 78vh;
  /* Espacio arriba para que la etiqueta de la primera hora (posicionada
     con top: -7px sobre su línea) no quede recortada por el overflow
     del wrap. Mismo padding abajo para simetría. */
  padding-top: 12px;
  padding-bottom: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.day-timeline {
  position: relative;
  margin-left: 56px;
  border-left: 1px solid var(--border);
}

.day-hour-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #f1f5f4;
  pointer-events: none;
  z-index: 1;
}
.day-hour-row:first-child { background: transparent; }
.day-hour-label {
  position: absolute;
  left: -52px;
  top: -7px;
  width: 46px;
  text-align: right;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

.day-timeline-click-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: copy;
}
.day-timeline-click-layer:hover {
  background: linear-gradient(transparent, rgba(16, 185, 129, 0.025));
}

.day-event {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 8px;
  padding: 4px 8px;
  overflow: hidden;
  z-index: 4;
  font-size: 12px;
  line-height: 1.25;
  box-sizing: border-box;
}

.day-event-appt {
  background: var(--primary);
  color: var(--primary-text, #fff);
  border-left: 3px solid var(--accent-dark);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  /* touch-action: none impide que el browser scrollee el timeline cuando
     el dedo arranca sobre una cita — necesario para que el long-press
     active el drag-to-move sin pelearse con el scroll de iOS. El scroll
     del timeline sigue funcionando desde la zona gris (huecos). */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.day-event-appt:hover {
  transform: translateX(1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.day-event-appt.is-cancelled {
  background: #f3f4f6;
  color: #6b7280;
  border-left-color: #d1d5db;
  text-decoration: line-through;
  text-decoration-color: rgba(0,0,0,.25);
}
/* Estado durante el drag: la cita se eleva visualmente y queda por
   encima de todo lo demás en el timeline. */
.day-event-appt.dragging {
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transform: scale(1.02);
  opacity: .95;
  cursor: grabbing;
  transition: none;
}
/* Si la posición destino solaparía con otra cita o un bloqueo, el borde
   y la sombra se vuelven rojos para avisar al admin que esa hora no
   está libre. Al soltar ahí, la cita vuelve a su posición original. */
.day-event-appt.dragging.collides {
  background: #ef4444;
  border-left-color: #b91c1c;
  box-shadow: 0 8px 24px rgba(239, 68, 68, .45);
}
/* Pill flotante con la nueva hora durante el drag. Va dentro de la cita
   y se posiciona arriba a la derecha para no tapar el contenido. */
.day-drag-tooltip {
  position: absolute;
  top: -10px; right: 8px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 11;
}

.day-event-block {
  background: repeating-linear-gradient(
    45deg,
    #fef3c7,
    #fef3c7 6px,
    #fde68a 6px,
    #fde68a 12px
  );
  color: #78350f;
  border-left: 3px solid #d97706;
  cursor: pointer;
}
.day-event-block:hover { filter: brightness(.97); }

.day-event-closed {
  background: repeating-linear-gradient(
    45deg,
    #f8fafc,
    #f8fafc 6px,
    #eef2f0 6px,
    #eef2f0 12px
  );
  left: 0;
  right: 0;
  border-radius: 0;
  padding: 0;
  z-index: 1;
  pointer-events: auto;
  cursor: not-allowed;
}

.day-event-time {
  font-size: 10px;
  font-weight: 600;
  opacity: .85;
  font-variant-numeric: tabular-nums;
}
.day-event-title {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-event-sub {
  font-size: 11px;
  opacity: .82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Push notifications row (super → Ajustes)
   ============================================================ */
.push-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.push-row-text { flex: 1; min-width: 0; }
.push-row-title { font-size: 14px; font-weight: 600; color: var(--text); }
.push-row-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   Period pills (super → App): 7d / 30d / 90d
   ============================================================ */
.period-pills {
  display: inline-flex; gap: 4px;
  background: #f3f4f6;
  padding: 3px;
  border-radius: 999px;
}
.period-pill {
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.period-pill:hover { color: var(--text); }
.period-pill.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* Filas de comparación periodo actual vs anterior */
.period-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.period-row:last-child { border-bottom: none; }
.period-row-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.period-row-value {
  font-family: var(--font-display, inherit);
  font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.period-row-meta { font-size: 12px; }
@media (max-width: 480px) {
  .period-row { grid-template-columns: 1fr auto; }
  .period-row-meta { grid-column: 1 / -1; }
}

/* ============================================================
   Pills + slide tabs (mismo patrón que tenant-home)
   Usado en admin → Servicios para alternar Servicios/Categorías
   ============================================================ */
.th-quick-nav {
  display: flex; gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.th-quick-nav::-webkit-scrollbar { display: none; }
.th-quick-pill {
  display: inline-flex; align-items: center;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s, transform .08s;
}
.th-quick-pill:hover { border-color: var(--accent); color: var(--text); }
.th-quick-pill:active { transform: scale(.97); }
.th-quick-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
.th-views { overflow: hidden; position: relative; }
.th-views.with-anim { transition: height .35s cubic-bezier(.4,0,.2,1); }
.th-views-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.th-view {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}
.th-view[aria-hidden="true"] { visibility: hidden; }

.day-now-indicator {
  position: absolute;
  left: -6px;
  right: 0;
  height: 0;
  border-top: 2px solid #ef4444;
  z-index: 6;
  pointer-events: none;
}
.day-now-dot {
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}

.day-fab {
  position: sticky;
  bottom: 12px;
  margin-left: auto;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text, #fff);
  border: none;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  z-index: 10;
  transition: transform .15s ease, box-shadow .15s ease;
  float: right;
  margin-top: -64px;
}
.day-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.day-fab:active { transform: scale(.97); }

.day-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  font-size: 14px;
}
.day-detail-grid > div { line-height: 1.5; }
.day-detail-grid b { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.day-detail-grid a { color: var(--accent-dark); }

@media (max-width: 480px) {
  .day-timeline-wrap { max-height: 72vh; }
  .day-timeline { margin-left: 44px; }
  .day-hour-label { left: -42px; width: 36px; font-size: 9px; }
  .day-event { left: 4px; right: 4px; padding: 3px 6px; }
  .day-event-title { font-size: 11px; }
  .day-event-sub { font-size: 10px; }
  .day-fab { width: 48px; height: 48px; font-size: 26px; margin-top: -60px; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 54px; padding: 6px 5px 5px; border-radius: 10px; }
  .cal-day { font-size: 14px; }
  .cal-badge { font-size: 10px; padding: 1px 5px; min-width: 18px; }
  .cal-grid { gap: 4px; }
  .cal-weekday { font-size: 10px; padding: 2px 0 6px; }
  .cal-nav { width: 36px; height: 36px; font-size: 18px; }
  .cal-month-wrap h3 { font-size: 16px; }
}

/* ============================================================
   DESKTOP LAYOUT (>= 1024px)
   Swiss Modernism: sidebar nav + grid de 12 columnas
   ============================================================ */
@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
    display: block;
  }

  /* === SHELL → desplazado a la derecha del sidebar === */
  .shell {
    margin-left: 240px;
    width: calc(100% - 240px);
    max-width: calc(100% - 240px);
    padding-bottom: 40px;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .container {
    width: 100%;
    max-width: 100%;
    padding: 28px 40px 40px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* === SIDEBAR (transforma el bottom-nav) === */
  .bottom-nav {
    position: fixed;
    top: 0; bottom: 0; left: 0; right: auto;
    width: 240px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 28px 14px 24px;
    border-top: none;
    border-right: 1px solid var(--border);
    box-shadow: none;
    gap: 2px;
    background: #fff;
  }
  .bottom-nav::before {
    content: "";
    display: block;
    width: 28px; height: 28px;
    margin: 6px 0 28px 14px;
    flex-shrink: 0;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='6' r='3'/><circle cx='6' cy='18' r='3'/><path d='M20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12'/></svg>") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='6' r='3'/><circle cx='6' cy='18' r='3'/><path d='M20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12'/></svg>") no-repeat center / contain;
  }
  .bottom-nav button {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 8px;
    width: 100%;
    font-weight: 500;
    color: var(--text-muted);
    transition: background .12s, color .12s;
  }
  .bottom-nav button:hover:not(.active) {
    background: var(--bg);
    color: var(--text);
  }
  .bottom-nav button.active {
    background: var(--bg);
    color: var(--primary);
    font-weight: 600;
  }
  /* En sidebar, el logout se empuja al fondo. */
  .bottom-nav button.logout {
    margin-top: auto;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding-top: 16px;
  }
  .bottom-nav button .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* === ADMIN HEADER: padding-left para que el contenido aparezca tras el sidebar
     (left: 240 no funciona fiable con position: sticky en bloques sin scroll horizontal) === */
  .app-header {
    padding: 18px 32px 14px 272px;
  }

  /* === COVER más grande, Swiss bold typography === */
  .cover { height: 440px; }
  .cover h1 {
    font-size: 68px;
    letter-spacing: -3px;
    line-height: .98;
  }
  .cover .tagline { font-size: 17px; margin-top: 12px; }
  .cover .cover-content { padding: 44px 56px 48px; max-width: 720px; }
  .cover .cover-eyebrow { font-size: 11px; margin-bottom: 16px; }
  .cover::before { width: 45%; }

  /* === PAGE TITLES más presencia === */
  .page-title { font-size: 28px; letter-spacing: -0.5px; margin-bottom: 2px; }
  .page-sub { margin-bottom: 16px; }

  /* === KPIs compactos en desktop también === */
  .kpi { padding: 16px 18px; min-height: 92px; }
  .kpi-value { font-size: 26px; letter-spacing: -.6px; }
  .kpi-label { font-size: 11px; }

  /* === CALENDARIO en desktop: rectangulares, sin scroll vertical === */
  .cal-cell {
    aspect-ratio: auto;
    height: 118px;
    min-height: 0;
    padding: 10px 12px 8px;
  }
  .cal-day { font-size: 18px; }
  .cal-grid { gap: 8px; }
  .cal-weekday { font-size: 11px; padding: 4px 0 10px; }
  .cal-nav { width: 38px; height: 38px; font-size: 20px; }
  .cal-month-wrap h3 { font-size: 20px; }
  .cal-controls { margin-bottom: 10px; }
  .cal-legend { margin-top: 12px; font-size: 12px; }
  .cal-badges { gap: 4px; }
  .cal-badge { font-size: 11px; padding: 2px 7px; min-width: 22px; }

  /* === View toggle: en la esquina superior derecha (debajo de "Salir") === */
  .tab-section[data-tab="appts"] {
    position: relative;
  }
  .tab-section[data-tab="appts"] .view-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    margin: 0;
    max-width: 280px;
  }

  /* === DASH CARDS más espacio === */
  .dash-card { padding: 24px 28px; margin-bottom: 18px; }
  .dash-h h3 { font-size: 16px; }

  /* === MODAL / SHEET más amplio === */
  .sheet { max-width: 680px; max-height: 86vh; }
  .modal { max-width: 580px; }

  /* === BOOKING SHEET en escritorio: pasos en 2 columnas opcionalmente === */
  .sheet-body { padding: 28px 32px; }
  .sheet-header { padding: 18px 32px 14px; }
  .sheet-footer { padding: 18px 32px; }

  /* === CARDS DE CITAS, SERVICIOS: más respiro === */
  .svc-card { padding: 20px 22px; }
  .appt-card { padding: 18px 22px; }

  /* === FORMS: inputs no super anchos === */
  .auth-card { max-width: 460px; }
  .container form, #profileForm, #passwordForm, #salonForm { max-width: 540px; }

  /* === SUB-TABS más grandes === */
  .sub-tabs button { padding: 12px 20px; font-size: 15px; }
}

@media (min-width: 1400px) {
  .container { padding: 32px 48px 48px; }
  .cal-cell { height: 130px; }
}
@media (min-width: 1800px) {
  .container { padding: 36px 56px 56px; }
  .cal-cell { height: 140px; }
}

/* ============================================================
   QR POSTER PREVIEW + IMPRESIÓN
   ============================================================ */
.qr-poster-print svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media print {
  /* Oculta todo */
  body * { visibility: hidden !important; }
  /* Muestra solo el poster */
  .qr-poster-print, .qr-poster-print * { visibility: visible !important; }
  .qr-poster-print {
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .qr-poster-print svg {
    max-width: 100% !important;
    max-height: 100vh !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  /* Página A4 con sin márgenes */
  @page { size: A4 portrait; margin: 0; }
}

/* ============================================================
   ============================================================
   TEMPLATE VARIANT: ESTÉTICA
   El banner principal y resto se quedan IGUAL que barbería.
   Lo único que cambia: la SECCIÓN DE SERVICIOS (booking area).
   Tabs scrollables + carrusel horizontal con cards compactas.
   Responsive de verdad: en móvil el carrusel hace "peek effect"
   del siguiente card para indicar scroll.

   Layout math:
   - .th-section tiene padding-horizontal: 24px desktop / 20px móvil
   - Carrusel: margin negativo igual al padding, padding interno igual
     → bordes alineados con texto + scroll va de borde a borde
   ============================================================
   ============================================================ */

[data-template="estetica"] #services {
  position: relative;
  overflow: hidden;
}

/* ── Tabs de categoría (CÍRCULOS estilo Booksy) ── */
/* margin-right negativo para que se extiendan hasta el borde derecho del viewport
   (la izquierda mantiene la alineación con el contenido del .th-section) */
[data-template="estetica"] .svc-category-tabs {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin: 4px -24px 18px 0;
  padding: 6px 0 14px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
[data-template="estetica"] .svc-category-tabs::-webkit-scrollbar { display: none; }

/* Cada tab es una columna: círculo con FOTO arriba + nombre debajo */
[data-template="estetica"] .svc-cat-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s;
}
/* Contenedor circular de la imagen — sin sombras (evitan clipping en el carrusel) */
[data-template="estetica"] .svc-cat-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: color-mix(in srgb, var(--accent) 40%, var(--primary));
  border: 2px solid transparent;
  transition: transform .2s, border-color .2s;
  position: relative;
}
[data-template="estetica"] .svc-cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}
[data-template="estetica"] .svc-cat-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
[data-template="estetica"] .svc-cat-tab:hover .svc-cat-img {
  transform: translateY(-2px);
}
[data-template="estetica"] .svc-cat-tab.active {
  color: var(--primary);
}
/* Activo: solo cambio de color de borde (sin glow) */
[data-template="estetica"] .svc-cat-tab.active .svc-cat-img {
  border-color: var(--primary);
  border-width: 3px;
}

/* Títulos de categoría originales ocultos (los reemplazan las tabs circulares) */
[data-template="estetica"] .svc-category-title { display: none; }

/* ── Subtítulo "Servicios disponibles" estilo Booksy "Visited and..." ── */
[data-template="estetica"] #services .sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 10px;
  margin-bottom: 14px;
}

/* ── Carrusel ── */
/* margin-right negativo igual que las tabs: alineación normal a la izq,
   se extiende hasta el borde derecho del viewport */
[data-template="estetica"] .service-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -24px 0 0;
  padding: 4px 0 18px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
[data-template="estetica"] .service-list::-webkit-scrollbar { display: none; }

/* ── PREMIUM CARDS estilo Booksy ──
   Imagen ocupa TODA la card. Gradient oscuro como pseudo ::after cubre
   los 2/3 inferiores del card. Footer flota sobre el gradient con texto
   blanco. Nombre + precio + botón Reservar en UNA sola fila al fondo. */
[data-template="estetica"] .svc-card {
  flex: 0 0 auto;
  width: 280px;
  height: 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: none;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform .25s, box-shadow .25s;
  background:
    var(--svc-img, none) center/cover no-repeat,
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 70%, var(--primary)) 0%,
      color-mix(in srgb, var(--accent) 40%, #fff) 100%);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.25);
}
[data-template="estetica"] .svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -10px rgba(0,0,0,.35);
}

/* Gradient oscuro ::after cubriendo abajo, se difumina hacia arriba.
   Empieza al 35% del card (transparente) y termina al 100% (negro 90%). */
[data-template="estetica"] .svc-card::after {
  content: '';
  position: absolute;
  inset: 35% 0 0 0;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 0, 0, .35) 35%,
    rgba(0, 0, 0, .72) 70%,
    rgba(0, 0, 0, .9) 100%);
  z-index: 1;
  pointer-events: none;
}

/* NO MÁS EMOJIS en cards (la imagen Unsplash es el único contenido visual) */
[data-template="estetica"] .svc-card::before { display: none; }

/* Rating chip arriba a la derecha — cristal */
[data-template="estetica"] .svc-card .svc-rating {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 3;
  letter-spacing: -.1px;
}

/* Footer SIN su propio fondo — el gradient ya está en ::after del card */
[data-template="estetica"] .svc-card .svc-footer {
  position: relative;
  z-index: 2;
  padding: 12px 14px 14px;
  background: transparent;
  color: #fff;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
}

/* Duración (línea pequeña arriba del footer) */
[data-template="estetica"] .svc-card .svc-meta {
  display: block;
  background: transparent;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 0;
  border-radius: 0;
  margin: 0;
}
[data-template="estetica"] .svc-card .svc-desc { display: none; }

/* Nombre del servicio (línea propia) */
[data-template="estetica"] .svc-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botón Reservar UNIFORME full-width usando CSS GRID (más predecible
   que flex para layouts row con elementos auto-width).
   Layout: [Reservar (1fr)] [precio (auto)] */
[data-template="estetica"] .svc-card .svc-btn {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 11px 18px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -.1px;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 60%, transparent);
  cursor: pointer;
  transition: filter .15s, transform .15s;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
}
[data-template="estetica"] .svc-card .svc-btn-label {
  text-align: left;
  white-space: nowrap;
}
[data-template="estetica"] .svc-card .svc-btn-price {
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
}
[data-template="estetica"] .svc-card .svc-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ── Responsive móvil (<720px) ── */
@media (max-width: 720px) {
  [data-template="estetica"] .svc-category-tabs {
    gap: 14px;
    margin: 4px -20px 18px 0;
    padding: 6px 0 14px 0;
  }
  [data-template="estetica"] .service-list {
    margin: 0 -20px 0 0;
    padding: 4px 0 18px 0;
  }
  [data-template="estetica"] .svc-cat-name { font-size: 11.5px; }
  [data-template="estetica"] .svc-cat-img {
    width: 72px; height: 72px;
  }
  [data-template="estetica"] .svc-card {
    width: 240px;
    height: 260px;
  }
  [data-template="estetica"] .svc-card h4 { font-size: 14px; }
  [data-template="estetica"] .svc-card .svc-btn {
    font-size: 12.5px;
    padding: 10px 16px;
  }
}

@media (max-width: 380px) {
  [data-template="estetica"] .svc-card { width: 220px; height: 250px; }
}

/* ============================================================
   FIN VARIANTE ESTÉTICA
   ============================================================ */


