/* =====================================================
   PLANTILLA LOCAL BUSINESS BOOKING
   Para cambiar colores: edita las variables CSS de abajo
   ===================================================== */

:root {
    --primary: #111111;
    --primary-light: #1c1c1c;
    /* Hover de los elementos negros/carbón — un tercer escalón,
       ligeramente más claro, para que el hover se note con buen
       contraste sobre fondo claro. */
    --primary-hover: #2a2a2a;
    /* --accent YA NO ES ROJO. Criterio visual definitivo (2026-09-13):
       el rojo queda reservado EXCLUSIVAMENTE a acciones destructivas
       (ver --danger y .btn-danger). Todo lo decorativo, informativo,
       de selección, navegación, foco y estados normales usa esta
       escala de negros/grises. Sobre fondos OSCUROS no vale el negro:
       esos casos concretos se sobrescriben a blanco donde toque
       (.info-block h3, .sidebar-nav a.active). */
    --accent: #111111;
    /* Gris medio para estados informativos que antes eran rojos
       (día cerrado, reserva cancelada, avisos): visible pero neutro. */
    --muted: #6c757d;
    --muted-dark: #41464b;
    --muted-bg: #e2e3e5;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --white: #ffffff;
    --border: #dee2e6;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Red de seguridad: el "lienzo" del documento (fuera de <body>) nunca tenia
   fondo propio, asi que cualquier hueco entre el body y el borde real de la
   pantalla (rebote elastico de iOS, redondeos de 100dvh, o el propio
   teclado en pantalla cambiando la altura visible) dejaba ver blanco puro.
   El footer de toda la app es oscuro, asi que ese es el color coherente de
   fondo por defecto en cualquier hueco, en vez de blanco. */
html { background: var(--primary); }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: -webkit-fill-available;
    /* 100svh = altura del viewport "pequeño" (asume barras/teclado visibles):
       suelo seguro que nunca sobreestima. 100dvh (dinamico) es lo mejor y
       gana si el navegador lo soporta; con navegadores que entienden dvh
       pero tienen algun caso raro de recalculo durante la animacion del
       teclado, 100svh de respaldo intermedio no hace nunca menos seguro. */
    min-height: 100svh;
    min-height: 100dvh;
}

/* Enlaces: negros. Al perder el color como señal, se subrayan por
   defecto para que sigan siendo reconocibles como enlaces (requisito
   de accesibilidad: no depender solo del color). Navbar, footer y
   sidebar tienen su propio color y quitan el subrayado más abajo. */
a { color: var(--primary); text-decoration: underline; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
    background: var(--primary);
    padding: 1rem 2rem;
    padding-top: max(1rem, calc(0.75rem + env(safe-area-inset-top, 0px)));
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.client-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: stretch;
}
.client-dashboard-grid > form {
    display: flex;
    margin: 0;
}

@media (max-width: 600px) {
    .client-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

#servicios, #contacto {
    /* Altura real del navbar medida: ~54px en movil, ~68px en escritorio
       (no hay media query especifica para esto). 70px es justo lo
       necesario para que el navbar sticky nunca tape el titulo de la
       seccion al saltar desde otra pagina, sin pasarse: un valor mayor
       (probado con 90px) deja ver de mas la cola de la seccion anterior
       (fondo blanco de #servicios) justo debajo del navbar al saltar a
       #contacto, un hueco blanco feo y evitable. */
    scroll-margin-top: 70px;
}

.navbar-brand {
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.navbar-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.navbar-nav a:hover { color: var(--white); text-decoration: none; }

.btn-nav {
    /* Negro/carbón en vez de rojo: es una acción normal (Reservar cita),
       no destructiva. Se usa --primary-light (en vez de --primary, igual
       que el fondo del navbar) + un borde sutil, para que el botón siga
       distinguiéndose del navbar en el que vive. */
    background: var(--primary-light);
    color: var(--white) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s !important;
}

.btn-nav:hover { background: var(--primary-hover) !important; }

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.1); }

/* =====================================================
   HERO
   ===================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* =====================================================
   BOTONES
   ===================================================== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    /* Botón principal = negro. El rojo (--danger) queda reservado
       EXCLUSIVAMENTE a acciones destructivas (.btn-danger). */
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--white); text-decoration: none; transform: translateY(-1px); }

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--white); text-decoration: none; }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #218838; color: var(--white); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82333; color: var(--white); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.875rem; border-radius: 20px; }

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-whatsapp:hover { background: #1da851; color: var(--white); text-decoration: none; }

/* Panel de cliente (/cliente/dashboard): los 4 accesos (Reservar, Mis
   reservas, Cambiar contraseña, Cerrar sesión) deben verse siempre del
   mismo tamaño Y con el texto realmente centrado. Bug real de la ronda
   anterior: esta clase estaba declarada ANTES de ".btn" en el fichero;
   como ".btn" tambien fija "display" (a inline-block) y viene DESPUES en
   la cascada, ganaba ".btn" y el "display:flex" de aqui quedaba anulado
   por completo — el alto minimo se seguia viendo bien (".btn" no toca
   min-height), pero el centrado real por flex nunca llegaba a aplicarse,
   de ahi que el texto se viera descentrado pese a que la altura medía
   bien. Declarada aqui, DESPUES de todas las reglas .btn*, para que este
   "display:flex" sea el que gane de verdad.
   IMPORTANTE: no fijar aqui "border" ni "background" — eso es justo lo
   que distingue a btn-primary de btn-outline, y como esta clase va
   DESPUES de ambas en la cascada, cualquier valor que se ponga aqui les
   ganaria y los 3 botones "outline" (Mis reservas/Contraseña/Cerrar
   sesion) perderian su contorno visible (ya paso una vez al escribir
   "border:none" aqui sin pensarlo). Solo tamaño/centrado/tipografia. */
.client-dashboard-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 5.5rem;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.3;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

/* =====================================================
   SECCIONES
   ===================================================== */
section { padding: 4rem 2rem; }

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* =====================================================
   CARDS DE SERVICIOS
   ===================================================== */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    border-top: 4px solid var(--accent);
    flex: 1 1 220px;
    max-width: 280px;
    min-width: 0;
}

.service-card:hover { transform: translateY(-4px); }

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.service-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.service-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
}

.service-duration {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* =====================================================
   INFO SECTION (Horario + Contacto)
   ===================================================== */
.info-section { background: var(--primary); color: var(--white); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.info-block h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    /* Va sobre .info-section (fondo negro): aquí el negro de --accent
       sería invisible, así que este título usa blanco. */
    color: var(--white);
}

.info-block p, .info-block li {
    opacity: 0.85;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-block ul { list-style: none; }

/* Enlaces de la seccion oscura (telefono y email). La regla global
   "a { color: var(--primary) }" los pintaba de negro (#111111) sobre el
   fondo tambien negro de .info-section, dejandolos practicamente
   invisibles — y en movil afectaba tambien al enlace tel: que el propio
   navegador genera al autodetectar un numero de telefono. Aqui se fuerza
   blanco en TODOS los estados (incluido :visited, que si no volvia a
   aplicar el color heredado en cuanto se habia pulsado el enlace una vez).
   :not(.btn) deja fuera el boton de WhatsApp, que tiene su propio color.
   El ambito es solo esta seccion: los enlaces sobre fondo claro del resto
   de la web siguen siendo negros, sin cambios. */
.info-section a:not(.btn),
.info-section a:not(.btn):link,
.info-section a:not(.btn):visited,
.info-section a:not(.btn):hover,
.info-section a:not(.btn):focus,
.info-section a:not(.btn):active {
    color: var(--white);
    text-decoration: underline;
}
/* Refuerzo del subrayado al pasar por encima / enfocar: el color ya no
   puede servir de senal (todos los estados son blancos), asi que la
   respuesta visible es el grosor del subrayado. */
.info-section a:not(.btn):hover,
.info-section a:not(.btn):focus {
    text-decoration-thickness: 2px;
}
/* Foco por teclado: el contorno por defecto del navegador es oscuro y
   sobre este fondo no se distinguiria. */
.info-section a:not(.btn):focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
    border-radius: 2px;
}

/* =====================================================
   FORMULARIO DE RESERVA
   ===================================================== */
.booking-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.booking-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group label .required { color: var(--accent); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.2s;
    background: var(--white);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

/* Validación: antes en rojo. El rojo queda reservado a acciones
   destructivas, así que el error se señala con borde y texto negros
   (más contraste que el borde gris normal) + el propio mensaje. */
.form-control.error { border-color: var(--primary); }

.error-msg {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* Botón "ojo" para mostrar/ocultar contraseña. Reutilizable en cualquier
   pantalla con input type="password": envolver el input en
   .password-wrapper y añadir un <button class="password-toggle"> con los
   dos SVG (ver fragments/footer.html para el JS que los activa). Funciona
   con inputs que usan la clase .form-control y con inputs con estilos
   inline propios (algunas pantallas de admin no usan .form-control) porque
   solo depende de que el wrapper tenga position:relative, no del propio
   input. */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 2.75rem; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 6px;
}
.password-toggle:hover { color: var(--text); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.password-toggle svg { display: block; width: 20px; height: 20px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

.slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.slot-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.15s;
    color: var(--text);
}

.slot-btn:hover, .slot-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
}

.slots-loading { color: var(--text-light); font-style: italic; }
.slots-empty { color: var(--muted-dark); font-size: 0.9rem; }

/* =====================================================
   PÁGINA DE CONFIRMACIÓN / CANCELACIÓN
   ===================================================== */
.result-container {
    max-width: 600px;
    margin: 3rem auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-icon { font-size: 4rem; margin-bottom: 1rem; }

.result-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.booking-detail-box {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.booking-detail-box .detail-row {
    display: flex;
    justify-content: space-between;
    /* Espacio minimo garantizado entre etiqueta y valor: sin esto, una fecha
       larga ("miercoles, 2 septiembre 2026") en movil estrecho encogia ambos
       lados hasta tocarse ("Fechamiercoles..."), sin ningun hueco. */
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.booking-detail-box .detail-row:last-child { border-bottom: none; }
/* La etiqueta nunca se encoge (siempre es una palabra corta: "Fecha",
   "Hora"...); si algo tiene que ajustarse a poco espacio, es el valor. */
.booking-detail-box .detail-label { font-weight: 600; color: var(--text-light); flex-shrink: 0; }
.booking-detail-box .detail-value { font-weight: 600; color: var(--text); text-align: right; }

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    /* Margen simetrico: antes solo habia margin-bottom, asi que el hueco por
       ENCIMA del cajon dependia por completo del margen del elemento anterior
       (inconsistente segun la pagina). Al ser margenes de bloque, este
       margin-top colapsa con el de encima en vez de sumarse, asi que nunca
       duplica espacio: solo garantiza un minimo coherente en todas partes. */
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    /* Los mensajes de validacion agrupada usan "\n" para separar "Revisa
       estos campos:" de cada punto de la lista; sin esto, un div colapsaria
       esos saltos de linea en un espacio. No afecta a los mensajes de una
       sola linea que ya se usan en el resto de la app. */
    white-space: pre-line;
    /* Evita que una palabra larga sin espacios (un email largo, una URL)
       desborde el cajon o provoque scroll horizontal en movil. Se usa
       "anywhere" en vez de "break-all" porque solo rompe la palabra cuando
       de verdad no cabe, en vez de trocear cualquier palabra larga. */
    overflow-wrap: anywhere;
    word-break: normal;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
/* Antes rosa/rojo. Ahora neutro oscuro: sigue distinguiéndose de
   success (verde), info (azul) y warning (ámbar) por tono y peso,
   sin usar rojo (reservado a acciones destructivas). */
.alert-danger  { background: var(--muted-bg); color: var(--primary); border: 1px solid var(--muted); font-weight: 600; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* En movil, algo menos de aire horizontal (el propio contenedor de la
   pagina ya suele tener su propio margen) para que el texto tenga mas
   espacio util antes de tener que partir una linea. */
@media (max-width: 640px) {
    .alert {
        padding: 0.85rem 0.9rem;
        margin-bottom: 1.1rem;
    }
}

/* =====================================================
   MODAL DE CONFIRMACION PROPIO DE LA APP (sustituye confirm() nativo)
   Usado via AppUI.confirm() — ver /js/app-ui.js. Un unico modal reutilizado
   para toda la app (logout, cancelar reserva, eliminar servicio, etc.), en
   vez de un popup del navegador/dispositivo, para que se vea igual en
   iPhone, Android, Safari o Chrome.
   ===================================================== */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}
.app-modal-backdrop.open { opacity: 1; visibility: visible; }
.app-confirm-modal {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(12px);
    transition: transform 0.15s ease;
}
.app-modal-backdrop.open .app-confirm-modal { transform: translateY(0); }
.app-confirm-modal h3 { margin: 0 0 0.75rem; font-size: 1.15rem; color: var(--text); }
.app-confirm-modal p {
    margin: 0 0 1.5rem; color: var(--text-light); font-size: 0.95rem;
    line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
}
.app-confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }
.app-confirm-actions button { flex: 1 1 auto; min-width: 110px; }

/* =====================================================
   PANEL ADMIN
   ===================================================== */
.admin-layout {
    display: flex;
    /* 100vh en movil (Safari/Chrome) mide la altura MAXIMA de pantalla, como
       si la barra de direcciones y el teclado no existieran: al escribir en
       un campo (p.ej. la contrasena), el teclado reduce el area visible real
       pero .admin-layout seguia "creyendose" mas alto de lo que se ve, lo
       que permitia hacer scroll de mas y dejaba una franja en blanco debajo.
       100dvh (con el mismo fallback que ya usa <body>) se ajusta a la altura
       visible real en cada momento. */
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    color: var(--white);
    padding: 0;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block;
    color: var(--white);
    text-decoration: none;
}

.sidebar-nav { padding: 1rem 0; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    /* Sidebar de fondo oscuro: el indicador activo va en blanco
       (el negro de --accent no se vería). */
    border-left-color: var(--white);
}

.admin-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg);
    /* Transicion suave al cargar cada pantalla del panel (sin AJAX/SPA,
       solo una animacion CSS que se dispara en cada carga de pagina normal).
       Keyframe propio (no el "fadeIn" del flujo de reserva) para poder
       ajustar su sutileza sin afectar a esa otra animacion. */
    animation: adminContentIn 0.18s ease-out;
}

@keyframes adminContentIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: none; }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Tabla admin */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

table { width: 100%; border-collapse: collapse; }

th {
    background: var(--bg);
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

tr:hover td { background: #f9f9f9; }

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-confirmed { background: #d4edda; color: #155724; }
.badge-cancelled { background: var(--muted-bg); color: var(--muted-dark); }

/* Filtros admin */
.filter-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form input, .filter-form select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Login admin */
.login-container {
    /* Mismo motivo que .admin-layout: 100vh no se ajusta al teclado en
       movil y deja hueco/scroll de mas al escribir la contrasena. */
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.login-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* El widget flotante del chatbot (HTML + CSS + JS) se eliminó por
   completo — ver home.html. El endpoint /api/chatbot de backend se deja
   intacto (no aporta nada al negocio real de reservas, pero no hay
   motivo para tocar backend); estas reglas CSS ya no las usa ningún
   elemento del HTML, se han retirado para no dejar código muerto. */

/* =====================================================
   FOOTER
   ===================================================== */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 2rem;
    padding-bottom: max(2rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
    font-size: 0.9rem;
    margin-top: auto;
    flex-shrink: 0;
}

footer a { color: rgba(255,255,255,0.9); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* =====================================================
   LOGIN CLIENTE — sticky footer PWA
   ===================================================== */
body.client-login-page {
    display: flex;
    flex-direction: column;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: 100dvh;
    background: #111111;
}

body.client-login-page .client-login-main {
    flex: 1;
    background: var(--bg);
    width: 100%;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; padding-top: max(0.75rem, calc(0.5rem + env(safe-area-inset-top, 0px))); }
    .navbar-nav { gap: 0.6rem; }
    .navbar-nav a { font-size: 0.85rem; }

    .hero { padding: 3rem 1rem; }

    section { padding: 2.5rem 1rem; }

    .info-grid { grid-template-columns: 1fr; gap: 2rem; }

    .booking-container { padding: 1.5rem; }

    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    /* Fila unica, sin wrap: el numero de opciones y su orden nunca cambian ni
       se redistribuyen entre filas (evita que un item "desaparezca" o parezca
       moverse). Si no caben todas, se puede desplazar horizontalmente. */
    .sidebar-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }
    .sidebar-nav a { flex: 0 0 auto; white-space: nowrap; padding: 0.75rem 1rem; font-size: 0.85rem; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar-nav a.active { border-bottom-color: var(--white); border-left: none; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .table-container { overflow-x: auto; }
    .admin-content { min-width: 0; }

    table { font-size: 0.8rem; }
    th, td { padding: 0.6rem 0.5rem; }

    .result-container { padding: 2rem 1.5rem; margin: 1.5rem 1rem; }

    .share-container { margin: 1.5rem auto; }
    .share-card { padding: 1.5rem 1rem; }
    .share-url-box { flex-direction: column; }
    .share-url-box input { width: 100%; }
}

@media (max-width: 480px) {
    /* Navbar hamburguesa */
    .navbar {
        flex-wrap: wrap;
        gap: 0;
        padding-top: max(0.75rem, calc(0.5rem + env(safe-area-inset-top, 0px)));
        padding-bottom: 0.65rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .navbar-brand { font-size: 1.05rem; flex: 1; min-width: 0; }
    .nav-hamburger { display: flex; align-items: center; }
    .navbar-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0;
        border-top: 1px solid rgba(255,255,255,0.12);
    }
    .navbar-nav.open { display: flex; }
    .navbar-nav li { display: block !important; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .navbar-nav li:last-child { border-bottom: none; }
    .navbar-nav a { padding: 0.9rem 1.25rem; font-size: 0.95rem; display: block; width: 100%; }
    .btn-nav {
        margin: 0 !important;
        display: block !important;
        text-align: left !important;
        padding: 0.9rem 1.25rem !important;
        border-radius: 0 !important;
        font-size: 0.95rem !important;
        white-space: normal !important;
    }

    /* Antes: 2 columnas (calc(50% - gap)). Con el precio centrado en una
       tarjeta de la mitad de ancho, el texto quedaba cerca del borde derecho
       de la pantalla, justo donde vive el boton flotante del chatbot fijo
       (bottom-right) — a ciertas posiciones de scroll lo tapaba. A 1 columna
       a ancho completo, el precio (centrado) queda lejos del borde derecho
       sea cual sea el scroll, y las tarjetas tienen mas aire para respirar.
       La home es un poco mas larga en movil como consecuencia; es aceptable. */
    .service-card { flex: 1 1 100%; max-width: none; min-width: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }

    .booking-container { padding: 1rem; }
    .booking-steps { gap: 0.25rem; }
    .step-indicator { font-size: 0.75rem; }

    .result-container { padding: 1.5rem 1rem; margin: 1rem 0.5rem; }

    .modal-card { padding: 1.25rem; margin: 0.5rem; }
    .time-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}

/* =====================================================
   SERVICIO — COLOR BADGE
   ===================================================== */
.service-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
    color: var(--text);
}

/* =====================================================
   CALENDARIO DE RESERVAS
   ===================================================== */
.booking-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.step-indicator .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.step-indicator.active .step-num {
    background: var(--accent);
    color: var(--white);
}

.step-indicator.done .step-num {
    background: var(--success);
    color: var(--white);
}

.step-separator { color: var(--border); font-size: 1rem; }

/* Service picker grid */
.service-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.service-pick-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--white);
    text-align: left;
}

.service-pick-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.service-pick-card.selected {
    border-color: var(--accent);
    background: rgba(17, 17, 17, 0.05);
}

.service-pick-card .spk-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.service-pick-card .spk-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.service-pick-card .spk-info {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.service-pick-card .spk-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: 0.3rem;
}

/* Month calendar */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: capitalize;
}

.cal-nav {
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 0.3rem 0;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: none;
    color: var(--text);
    line-height: 1;
}

.cal-day.empty { cursor: default; }

.cal-day.available {
    background: var(--white);
    border-color: var(--border);
    color: var(--text);
}

.cal-day.available:hover {
    border-color: var(--accent);
    background: rgba(17,17,17,0.06);
}

.cal-day.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.cal-day.past, .cal-day.unavailable {
    color: var(--border);
    cursor: not-allowed;
}

.cal-day.today.available {
    border-color: var(--accent);
    font-weight: 800;
}

.cal-loading { text-align: center; color: var(--text-light); font-style: italic; padding: 1rem 0; }

/* Step sections */
.booking-step-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

.booking-step-section.visible { display: block; }

@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.selected-summary {
    background: var(--bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.selected-summary strong { color: var(--text); }

.change-link {
    margin-left: auto;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--accent);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}

/* =====================================================
   ADMIN — CALENDAR AVAILABILITY
   ===================================================== */
.avail-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 1rem;
}

.avail-day-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 0.4rem 0;
    text-transform: uppercase;
}

.avail-day {
    border-radius: 8px;
    padding: 0.5rem 0.25rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--border);
    background: var(--white);
    transition: all 0.15s;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.avail-day .day-num {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.4;
}

.avail-day .day-tag {
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.3;
}

.avail-day.empty { background: none; border-color: transparent; cursor: default; }
.avail-day.past { opacity: 0.4; cursor: not-allowed; }
.avail-day.closed-day { background: var(--muted-bg); border-color: var(--muted); }
.avail-day.closed-day .day-tag { background: var(--muted-dark); color: white; }
.avail-day.custom-day { background: #f2f2f2; border-color: var(--accent); }
.avail-day.custom-day .day-tag { background: var(--accent); color: white; }
.avail-day.default-day:hover, .avail-day.custom-day:hover, .avail-day.closed-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.modal-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--primary); }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-light);
}

.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.time-row label { font-size: 0.85rem; font-weight: 600; color: var(--text-light); margin-bottom: 0.25rem; display: block; }
.time-row input { width: 100%; padding: 0.5rem; border: 2px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.time-row input:focus { outline: none; border-color: var(--accent); }

/* =====================================================
   COMPARTIR PAGE
   ===================================================== */
.share-container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.share-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    text-align: center;
}

.share-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--primary); }

.share-url-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-url-box input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text);
}

#qrcode { margin: 0 auto; display: inline-block; }
#qrcode canvas, #qrcode img { border-radius: 8px; }
