/* =========================================
   VARIABLES GLOBALES DEL TEMA (SaaS)
   ========================================= */
:root {
    --primary-color: #888888;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --bg-element: #f0f2f5;
    --text-main: #36454F;
    --highlight-bg: #ffe5e5;
    --icon-color: #36454F;

    /* NUEVO: Variables de Tipografía */
    --font-body: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-headings: var(--font-body);
    --font-brand: var(--font-headings);

    /* Valores por defecto de Tamaño y Grosor */
    /* Valores por defecto de Tamaño (px) y Grosor */
    --weight-brand: 700;
    --size-brand: 24px;

    --weight-headings: 700;
    --size-headings: 20px;

    --weight-body: 400;
    --size-body: 16px;
}

button,
input[type="button"],
input[type="submit"] {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    /* Fuerza a iOS a respetar tus bordes */
    opacity: 1;
    /* Previene el bug de botones translúcidos en iOS */
}

/* =========================================
   RESETEO BASE
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}



input,
select,
button,
textarea,
.action-menu-btn,
.tab-btn,
.slot,
.mini-calendar-day {
    font-family: inherit;
    /* ESTA ES LA MAGIA: Bloquea el zoom por doble toque y hace que el clic se sienta instantáneo */
    touch-action: manipulation;
}

.hidden:not(.modal-overlay) {
    display: none !important;
}

/* =========================================
   BODY Y CONTENEDOR PRINCIPAL
   ========================================= */

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: var(--weight-body, 400);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    font-size: var(--size-body, 16px);
}

h1,
h2,
h3,
h4,
.ticket-header-izq {
    font-family: var(--font-headings), var(--font-body);
    font-weight: var(--weight-headings, 700);
    margin-top: 0;
}

h1 {
    font-size: calc(var(--size-headings, 20px) * 1.5);
}

h2 {
    font-size: calc(var(--size-headings, 20px) * 1.25);
}

h3 {
    font-size: var(--size-headings, 20px);
}

h4 {
    font-size: calc(var(--size-headings, 20px) * 0.85);
}

/* Forzar tipografía en elementos rebeldes */
input,
select,
button,
textarea,
.action-menu-btn,
.tab-btn,
.slot,
.mini-calendar-day {
    font-family: var(--font-body) !important;
    touch-action: manipulation;
}

/* Aplicación de fuente de Títulos */
h1,
h2,
h3,
h4,
.ticket-header-izq {
    font-family: var(--font-headings), var(--font-body);
}

/* Aplicación de fuente de Marca (Logo) */
/* Aplicación de fuente de Marca (Logo) */
#logo-salon-texto,
#dashboard-salon-nombre,
#nombre-salon-texto,
#titulo-ajustes {
    font-family: var(--font-brand), var(--font-headings), var(--font-body) !important;
    font-weight: var(--weight-brand, 700) !important;
    font-size: var(--size-brand, 24px) !important;
}


.app-wrapper {
    width: 100%;
    max-width: 650px;
    min-height: 100vh;
    background-color: transparent;
    position: relative;
    padding-bottom: 40px;
}

/* =========================================
   ICONOS SVG UNIVERSALES
   ========================================= */
.svg-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    /* Magia: ahora copia el color del texto de su contenedor */
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    transition: 0.2s;
}

.svg-icon-btn {
    stroke: currentColor;
}

/* =========================================
   ENCABEZADO Y LOGO
   ========================================= */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    /* <-- Padding superior reducido */
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 15px 15px;

    top: 0;
    z-index: 40;
    border: 1px solid #e8e8e8;
    border-top: none;
}




/* =========================================
   ESTRUCTURA PRINCIPAL Y VISTAS
   ========================================= */
main {
    padding: 20px;
}

.card,
.settings-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
}

.card h3,
.settings-section h4 {
    color: var(--text-main);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BARRA DE NAVEGACIÓN Y BOTONES */
.action-menu-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
}

@media (max-width: 500px) {
    .action-menu-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.action-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    color: var(--text-main);
    transition: 0.2s;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
    max-height: 45px;
}



.action-menu-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.action-menu-btn:active {
    background: var(--highlight-bg);
    border-color: var(--primary-color);
    transform: translateY(0);
}

.action-menu-btn.nav-activo {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-menu-btn.nav-activo .svg-icon {
    stroke: white;
}

/* MÓDULOS DE VISTA */
.modulo-vista {
    display: none;
    animation: fadeIn 0.3s ease;
}

.modulo-vista.activa {
    display: block;
}

/* PANEL DE INGRESOS */
.ingresos-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ingresos-monto {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =========================================
   MODALES (AJUSTES, CITA, BLOQUEO)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    position: relative !important;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-close-modal {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    color: #888 !important;
    transition: 0.2s !important;
    padding: 5px !important;
    z-index: 10000 !important;
    width: auto !important;
    height: auto !important;
}

.btn-close-modal:hover {
    color: var(--primary-color) !important;
}

/* =========================================
   MINI CALENDARIO Y HORARIOS
   ========================================= */
.mini-calendar-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    padding-top: 10px;
    margin-bottom: 0px;
    scroll-behavior: smooth;
}

.mini-calendar-container::-webkit-scrollbar {
    height: 6px;
}

.mini-calendar-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.mini-calendar-day {
    min-width: 70px;
    padding: 10px 5px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #ccc;
    cursor: pointer;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}

.mini-calendar-day span {
    font-size: 0.8em;
    opacity: 0.8;
    text-transform: uppercase;
}

.mini-calendar-day strong {
    font-size: 1.2em;
}

.mini-calendar-day:hover:not(.past) {
    border-color: var(--primary-color);
}

.mini-calendar-day.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mini-calendar-day.selected span,
.mini-calendar-day.selected strong {
    color: white;
}

.mini-calendar-day.has-citas:not(.selected) {
    background: var(--highlight-bg);
    border-color: var(--primary-color);
}

.mini-calendar-day.past {
    background: #f0f0f0;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.5;
}

.mini-calendar-day.cerrado {
    background: rgba(184, 19, 33, 0.534) !important;
    border-color: rgba(255, 71, 87, 0.15) !important;
    color: #fafafa !important;
    opacity: 0.6;
}

.mini-calendar-day.cerrado span,
.mini-calendar-day.cerrado strong {
    color: #fffefe !important;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.slot {
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    transition: 0.2s;
    font-size: 0.9em;
    color: var(--text-main);
}

.slot:hover:not(.disabled) {
    border-color: var(--primary-color);
}

.slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.slot.selected-range {
    background-color: var(--highlight-bg);
    color: var(--text-main);
    border-color: var(--primary-color);
    font-weight: bold;
}

.slot.disabled {
    background-color: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
    border-color: #e0e0e0;
    text-decoration: line-through;
}

/* =========================================
   BOTONES, FORMULARIOS Y CHECKBOXES
   ========================================= */
.input-bonito {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg-element);
    color: var(--text-main);

    /* 👇 CAMBIO AQUÍ 👇 */
    font-size: max(16px, var(--size-body, 16px)) !important;
}

/* Resetear el diseño nativo de iOS para los selects y añadir una flecha unificada */
/* Resetear el diseño nativo de iOS para los selects y añadir una flecha unificada */
select.input-bonito {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Flecha SVG sutil */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    /* Posicionamos la flecha a 8px del borde derecho */
    background-size: 10px auto;
    /* Hacemos la flecha un poco más pequeña */

    /* ¡AQUÍ ESTÁ LA MAGIA! Forzamos el espacio derecho a pesar de los estilos en línea */
    padding-right: 24px !important;
}

.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-inline input,
.form-inline select {
    flex: 1;
    min-width: 100px;
}

.btn-secundario {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background-color: var(--bg-element);
    /* <-- CORREGIDO */
    color: var(--text-main);
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-secundario:hover {
    background-color: #e0e0e0;
}

.btn-primario {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
    transition: 0.2s;
}

.btn-primario:hover {
    opacity: 0.9;
}

.btn-primario:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   2. BOTONES OUTLINE (DÍAS Y COMIDA) CON SVGs
   ========================================= */
.dias-semana-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-toggle-ui {
    flex: 1 1 calc(25% - 8px);
    margin: 0;
    cursor: pointer;
}

.comida-toggle-container {
    width: 100%;
    display: block;
    margin-bottom: 15px;
}

.btn-toggle-ui input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ESTADO INACTIVO (Línea y Texto Rojo) */
.btn-toggle-ui span {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background-color: transparent;
    color: #ff4757;
    /* Texto Rojo */
    border: 2px solid #ff4757;
    /* Borde Rojo */
    padding: 10px 6px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: bold;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Dimensiones base para los SVG */
.btn-toggle-ui svg {
    width: 16px;
    height: 16px;
    transition: 0.2s;
}

/* Por defecto (inactivo): Mostrar X, Ocultar Check */
.btn-toggle-ui .icon-check {
    display: none;
}

.btn-toggle-ui .icon-x {
    display: block;
}


/* ESTADO ACTIVO (Línea y Texto Verde) */
.btn-toggle-ui input[type="checkbox"]:checked+span {
    color: #2ed573;
    /* Texto Verde */
    border-color: #2ed573;
    /* Borde Verde */
    background-color: rgba(46, 213, 115, 0.05);
    /* Fondo apenas tintado para resaltar (opcional) */
}

/* Al activar: Ocultar X, Mostrar Check */
.btn-toggle-ui input[type="checkbox"]:checked+span .icon-x {
    display: none;
}

.btn-toggle-ui input[type="checkbox"]:checked+span .icon-check {
    display: block;
}


/* Efectos de Hover y pulsación */
.btn-toggle-ui:hover span {
    background-color: rgba(0, 0, 0, 0.02);
}

.btn-toggle-ui input[type="checkbox"]:checked:hover+span {
    background-color: rgba(46, 213, 115, 0.1);
}

.btn-toggle-ui:active span {
    transform: scale(0.96);
}

/* =========================================
   AGENDA Y TARJETAS
   ========================================= */
.cita-card {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 15px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #ccc;
    margin-bottom: 15px;
    border-top: 1px solid #eee;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* DESPUÉS */
.cita-card.confirmada,
.cita-card.confirmado {
    border-left-color: #28a745 !important;
}

.cita-card.pasadas {
    border-left-color: #bdc3c7;
    background: rgba(240, 240, 240, 0.4);
    opacity: 0.55;
    filter: grayscale(100%);
    pointer-events: none;
    /* Evita interacciones accidentales */
}

/* Compatibilidad con el Glassmorphism del tenant */
body.glass-mode .cita-card.pasadas {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px dashed rgba(255, 255, 255, 0.4) !important;
    border-left: 4px solid #bdc3c7 !important;
}

/* Reactivamos los eventos solo para los botones interiores para poder borrar o ver el chat si se necesita */
.cita-card.pasadas .cita-acciones {
    pointer-events: auto;
}

.cita-info {
    flex: 1;
    color: var(--text-main);
}

.cita-info h3 {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 0;
}

.cita-acciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 120px;
    justify-content: center;
}

.cita-acciones .btn-secundario {
    background: rgba(30, 144, 255, 0.15) !important;
    color: #1e90ff !important;
    border: 1px solid rgba(30, 144, 255, 0.3) !important;
}

.cita-acciones .btn-secundario:hover {
    background: rgba(30, 144, 255, 0.25) !important;
}

.cita-acciones button {
    width: 100%;
    border-radius: 8px;
    /* Bordes un poco más suaves */
    padding: 12px;
    /* <-- Aumentado de 8px a 12px para mayor altura táctil */
    font-size: 0.9em;
    /* <-- Ligeramente más grande */
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid transparent;
}

.btn-accion-finalizar {
    /* Fondo verde fijo y translúcido, independiente de la variable del tenant */
    background: rgba(40, 167, 69, 0.15) !important;
    color: #1cb640 !important;
    /* Texto verde sólido */
    border: 1px solid rgba(40, 167, 69, 0.3) !important;
}

.btn-accion-finalizar:hover {
    background: rgba(40, 167, 69, 0.25) !important;
    /* Se oscurece ligeramente al tocarlo */
}

.btn-accion-eliminar {
    /* Fondo rojo fijo y translúcido, independiente de la variable del tenant */
    background: rgba(255, 77, 77, 0.15) !important;
    color: #ff4d4d !important;
    /* Texto rojo sólido */
    border: 1px solid rgba(255, 77, 77, 0.3) !important;
}

.btn-accion-eliminar:hover {
    background: rgba(255, 77, 77, 0.25) !important;
    /* Se oscurece ligeramente al tocarlo */
}

/* =========================================
   CHIPS Y LISTAS DE SERVICIOS
   ========================================= */
.service-list-admin {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.service-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    color: var(--text-main);
}

.service-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: 0.2s;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    color: var(--text-main);
}

.service-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.service-chip.selected .svg-icon {
    stroke: white;
}

.btn-icon-danger {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    padding: 0;
}

.btn-icon-danger:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-icon-danger .svg-icon {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* =========================================
   TABS Y PREVIEW (Ajustes)
   ========================================= */
.settings-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-color);
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 15px;
    gap: 5px;
    border: 1px solid #e0e0e0;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    /* Apila el icono arriba del texto para ahorrar espacio */
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    color: var(--text-main);
    transition: 0.2s;
    font-size: 0.85em;
    text-align: center;
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn.active .svg-icon {
    stroke: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.preview-crop-container {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 2px dashed #ccc !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 10px auto !important;
    background: var(--bg-color) !important;
    position: relative !important;
}

#preview-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

/* =========================================
   EDITOR DE COLOR FLOTANTE (FCE)
   ========================================= */
.floating-color-editor {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;

    /* CRISTAL ESMERILADO (Igual al Settings Header) */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    padding: 18px 22px;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.floating-color-editor.collapsed {
    transform: translate(-50%, 150%) !important;
    opacity: 0;
    pointer-events: none;
}

.fce-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 12px;
}

/* FORZAMOS EL TEXTO A OSCURO SIEMPRE */
.fce-title,
.fce-slider-group label,
.fce-glass-toggle-container label {
    color: #333333 !important;
}

/* Busca .fce-nav-btn (en la línea ~840 aprox) y actualízalo */
.fce-nav-btn {
    background: var(--bg-element);
    /* <-- CORREGIDO */
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-main);
}

.fce-nav-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.fce-slider-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.fce-slider-group label {
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.fce-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    outline: none;
    margin-bottom: 10px;
}

.fce-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333333 !important;
    /* Borde oscuro siempre */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hue-slider {
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}

.light-slider {
    background: linear-gradient(to right, #000, #fff);
}

.fce-glass-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }

    to {
        bottom: 20px;
        opacity: 1;
    }
}

.fce-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.fce-nav-btn {
    background: var(--bg-color);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-main);
}

.fce-close-btn {
    background: transparent;
    border: none;
    font-size: 1.2em;
    color: #888;
    cursor: pointer;
}

.fce-close-btn:hover {
    color: var(--primary-color);
}

.fce-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    color: var(--text-main);
    font-size: 0.95em;
}

.fce-slider-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.fce-slider-group label {
    font-size: 0.8em;
    color: var(--text-main);
    margin-bottom: 5px;
    font-weight: bold;
}

.fce-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    outline: none;
    margin-bottom: 10px;
}

.fce-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hue-slider {
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}

.light-slider {
    background: linear-gradient(to right, #000, #fff);
}


/* =========================================
   PATRONES DE FONDO (ADMIN)
   ========================================= */
body.pattern-dots {
    background-image: radial-gradient(rgba(0, 0, 0, 0.08) 2px, transparent 2px);
    background-size: 25px 25px;
}

body.pattern-waves {
    background-image: repeating-radial-gradient(circle at 0 0, transparent 0, var(--bg-color) 14px, transparent 14px, rgba(0, 0, 0, 0.03) 28px);
}

body.bg-image {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.pattern-stripes {
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 15px);
}

body.pattern-grid {
    background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* =========================================
   ANIMACIÓN BORDER BEAM (LOGOS)
   ========================================= */
.logo-beam-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    padding: 4px;
    background: var(--card-bg);
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo-beam-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, transparent, transparent, var(--primary-color), #ffffff, transparent 60%);
    animation: rotateBeam 3s linear infinite;
    z-index: -2;
}

.logo-beam-wrapper::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--card-bg);
    border-radius: 50%;
    z-index: -1;
}

.logo-beam-wrapper img {
    border: none !important;
    box-shadow: none !important;
    position: relative;
    z-index: 1;
    display: block;
}

@keyframes rotateBeam {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   PATRONES DE FONDO DINÁMICOS (FIX CRISTAL / MÓVIL)
   ========================================= */
/* 1. Prevenir que el body intente renderizar el fondo directamente (Evita estiramientos) */
body[class*="pattern-"],
body.bg-image {
    background-image: none !important;
    background-attachment: scroll !important;
}

/* 2. Crear una capa fija (fixed) inamovible anclada a la pantalla (Viewport) */
body[class*="pattern-"]::before,
body.bg-image::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -100;
    /* Se asegura de quedar hasta atrás */
    pointer-events: none;
}

/* 3. Inyectar los patrones exclusivamente a esta capa fija */
body.pattern-dots::before {
    background-image: radial-gradient(rgba(0, 0, 0, 0.08) 2px, transparent 2px);
    background-size: 25px 25px;
}

body.pattern-waves::before {
    background-image: repeating-radial-gradient(circle at 0 0, transparent 0, var(--bg-color) 14px, transparent 14px, rgba(0, 0, 0, 0.03) 28px);
}

body.pattern-stripes::before {
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 15px);
}

body.pattern-grid::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

body.pattern-rhombus::before {
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(225deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(315deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%);
    background-position: 15px 0, 15px 0, 0 0, 0 0;
    background-size: 30px 30px;
}

/* Para imágenes personalizadas usamos una variable CSS */
body.bg-image::before {
    background-image: var(--custom-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* =========================================
   PATRONES EN EL MODAL DE AJUSTES
   ========================================= */
body.pattern-dots #modal-settings .modal-content {
    background-image: radial-gradient(rgba(0, 0, 0, 0.08) 2px, transparent 2px);
    background-size: 25px 25px;
    background-attachment: fixed;
}

body.pattern-waves #modal-settings .modal-content {
    background-image: repeating-radial-gradient(circle at 0 0, transparent 0, var(--bg-color) 14px, transparent 14px, rgba(0, 0, 0, 0.03) 28px);
    background-attachment: fixed;
}

body.pattern-stripes #modal-settings .modal-content {
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 15px);
    background-attachment: fixed;
}

body.pattern-grid #modal-settings .modal-content {
    background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    background-attachment: fixed;
}

body.pattern-rhombus #modal-settings .modal-content {
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(225deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(315deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%);
    background-position: 15px 0, 15px 0, 0 0, 0 0;
    background-size: 30px 30px;
    background-attachment: fixed;
}

body.bg-image #modal-settings .modal-content {
    background-image: var(--custom-bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* =========================================
   EFECTO CRISTAL SEPARADO (TRANSPARENCIA VS BLUR)
   ========================================= */

/* 1A. PANELES: Transparencia (Muy ligero para GPU) */
body.glass-panels-transparent .card,
body.glass-panels-transparent .cita-card,
body.glass-panels-transparent .timeline-slot-empty,
body.glass-panels-transparent .settings-section,
body.glass-panels-transparent .action-menu-container,
body.glass-panels-transparent header,
body.glass-panels-transparent .chat-panel {
    /* .modal-content ELIMINADO de aquí para que sea sólido */
    background: color-mix(in srgb, var(--card-bg) calc(var(--glass-opacity-val, 0.65) * 100%), transparent) !important;
    border: 1px solid color-mix(in srgb, var(--text-main) 12%, transparent) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
    transition-property: background, border-color, box-shadow, transform, color !important;
}

/* 1B. PANELES: Desenfoque / Blur (Pesado para GPU) */
body.glass-panels-blur .card,
body.glass-panels-blur .cita-card,
body.glass-panels-blur .timeline-slot-empty,
body.glass-panels-blur .settings-section,
body.glass-panels-blur .action-menu-container,
body.glass-panels-blur header,
body.glass-panels-blur .chat-panel {
    /* .modal-content ELIMINADO de aquí */
    backdrop-filter: blur(var(--glass-blur-val, 16px)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur-val, 16px)) !important;
}

/* 2A. ELEMENTOS: Transparencia */
body.glass-elements-transparent .action-menu-btn,
body.glass-elements-transparent .btn-secundario,
body.glass-elements-transparent .input-bonito,
body.glass-elements-transparent .service-item-admin,
body.glass-elements-transparent .service-chip,
body.glass-elements-transparent .mini-calendar-day,
body.glass-elements-transparent .slot,
body.glass-elements-transparent .staff-pill-admin {
    background: color-mix(in srgb, var(--bg-element) calc(var(--glass-opacity-val-element, 0.65) * 100%), transparent) !important;
    border: 1px solid color-mix(in srgb, var(--text-main) 8%, transparent) !important;
    transition-property: background, border-color, box-shadow, transform, color !important;
}

/* 2B. ELEMENTOS: Desenfoque / Blur */
body.glass-elements-blur .action-menu-btn,
body.glass-elements-blur .btn-secundario,
body.glass-elements-blur .input-bonito,
body.glass-elements-blur .service-item-admin,
body.glass-elements-blur .service-chip,
body.glass-elements-blur .mini-calendar-day,
body.glass-elements-blur .slot,
body.glass-elements-blur .staff-pill-admin {
    backdrop-filter: blur(var(--glass-blur-val-element, 8px)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur-val-element, 8px)) !important;
}

/* 3. Compatibilidad para Citas Pasadas y Modales Oscuros */
body.glass-panels-transparent .cita-card.pasadas,
body.glass-elements-transparent .cita-card.pasadas {
    background: color-mix(in srgb, var(--card-bg) 30%, transparent) !important;
    border: 1px dashed color-mix(in srgb, var(--text-main) 20%, transparent) !important;
    border-left: 4px solid #bdc3c7 !important;
}

body.glass-panels-transparent .modal-overlay,
body.glass-elements-transparent .modal-overlay {
    background: rgba(0, 0, 0, 0.25) !important;
}

body.glass-panels-blur .modal-overlay,
body.glass-elements-blur .modal-overlay {
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}




/* =========================================
   TOGGLE SWITCH (INTERRUPTOR)
   ========================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Color gris estándar para apagado (puedes cambiarlo a #ff4d4d si prefieres rojo puro al apagar) */
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

/* AQUÍ ESTÁ EL CAMBIO: Quitamos var(--primary-color) y forzamos el Verde universal */
input:checked+.slider {
    background-color: #34C759;
    /* Verde clásico de sistema */
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}


/* =========================================
   LÍNEA DE TIEMPO DE AGENDA (ULTRA COMPACTA)
   ========================================= */
.timeline-slot-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    /* Más gorditas para parecer tarjetas */
    border-left: 4px solid #ccc;
    background: var(--card-bg);
    /* Toma el color de las tarjetas del tenant */
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #ddd;
    margin-bottom: 12px;
    /* Gap entre tarjetas */
    color: var(--text-main);
    font-size: 0.9em;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.timeline-slot-empty.media-hora {
    border-left: 4px solid #f0f0f0;
    opacity: 0.85;
}

.timeline-slot-empty:hover:not(.descanso) {
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.timeline-slot-empty.descanso {
    border-left-color: #ff7675;
    background: rgba(255, 118, 117, 0.05);
    color: #d63031;
    cursor: not-allowed;
}

.timeline-slot-empty .time {
    font-weight: bold;
    min-width: 40px;
}

.timeline-slot-empty .status {
    font-weight: 500;
    opacity: 0.8;
}

/* STAFF PILLS (AGENDA ADMIN) */
.staff-pills-admin-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    margin-top: 15px;
}

.staff-pills-admin-container::-webkit-scrollbar {
    height: 4px;
}

.staff-pills-admin-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.staff-pill-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    transition: 0.2s;
    background: var(--bg-element);
    /* <-- CORREGIDO */
    color: var(--text-main);
    white-space: nowrap;
}

.staff-pill-admin.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}



@keyframes glowingPulse {
    0% {
        box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color);
        transform: scale(1.01);
    }

    100% {
        box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
        transform: scale(1);
    }
}

/* =========================================
   ANIMACIÓN RGB (EDITOR DE COLORES FCE)
   ========================================= */
/* 1. Para Componentes (Sobrevive al Glassmorphism usando outline) */
@keyframes rgbBorderGlow {
    0% {
        outline: 3px solid #ff0000;
        outline-offset: 1px;
        box-shadow: 0 0 12px #ff0000;
    }

    16% {
        outline: 3px solid #ff7f00;
        outline-offset: 1px;
        box-shadow: 0 0 12px #ff7f00;
    }

    33% {
        outline: 3px solid #ffff00;
        outline-offset: 1px;
        box-shadow: 0 0 12px #ffff00;
    }

    50% {
        outline: 3px solid #00ff00;
        outline-offset: 1px;
        box-shadow: 0 0 12px #00ff00;
    }

    66% {
        outline: 3px solid #00bfff;
        outline-offset: 1px;
        box-shadow: 0 0 12px #00bfff;
    }

    83% {
        outline: 3px solid #8a2be2;
        outline-offset: 1px;
        box-shadow: 0 0 12px #8a2be2;
    }

    100% {
        outline: 3px solid #ff0000;
        outline-offset: 1px;
        box-shadow: 0 0 12px #ff0000;
    }
}

/* 2. Para el Fondo de la App (Hacia adentro 'inset' para no salirse de la pantalla) */
@keyframes rgbInsetGlow {
    0% {
        box-shadow: inset 0 0 0 4px #ff0000, inset 0 0 25px #ff0000;
    }

    16% {
        box-shadow: inset 0 0 0 4px #ff7f00, inset 0 0 25px #ff7f00;
    }

    33% {
        box-shadow: inset 0 0 0 4px #ffff00, inset 0 0 25px #ffff00;
    }

    50% {
        box-shadow: inset 0 0 0 4px #00ff00, inset 0 0 25px #00ff00;
    }

    66% {
        box-shadow: inset 0 0 0 4px #00bfff, inset 0 0 25px #00bfff;
    }

    83% {
        box-shadow: inset 0 0 0 4px #8a2be2, inset 0 0 25px #8a2be2;
    }

    100% {
        box-shadow: inset 0 0 0 4px #ff0000, inset 0 0 25px #ff0000;
    }
}

@keyframes rgbSvgGlow {
    0% {
        stroke: #ff0000;
        filter: drop-shadow(0 0 4px #ff0000);
    }

    33% {
        stroke: #00ff00;
        filter: drop-shadow(0 0 4px #00ff00);
    }

    66% {
        stroke: #00bfff;
        filter: drop-shadow(0 0 4px #00bfff);
    }

    100% {
        stroke: #ff0000;
        filter: drop-shadow(0 0 4px #ff0000);
    }
}

.fce-highlight-animated {
    outline: 3px solid #00bfff !important;
    outline-offset: 2px !important;
    border-color: transparent !important;
    z-index: 100 !important;

    /* Mantenemos apagadas las transiciones para evitar choques visuales */
    transition: none !important;
}

.fce-highlight-inset {
    /* Sombra interna estática para el fondo de la app */
    box-shadow: inset 0 0 0 4px #00bfff !important;
    z-index: 100 !important;
    transition: none !important;
}

/* Los SVG no usan box-shadow, usan filtros y stroke */
svg.fce-highlight-animated {
    box-shadow: none !important;
    outline: none !important;
    stroke: #00bfff !important;
    border: none !important;
}

/* =========================================
   AJUSTE DE CONTRASTE PESTAÑAS (TABS)
   ========================================= */
.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    /* Sombra más fuerte para que resalte sin importar el color del fondo */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.floating-color-editor {
    /* Agrega transición de transform para el colapso */
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.floating-color-editor.collapsed {
    transform: translate(-50%, 150%) !important;
    opacity: 0;
    pointer-events: none;
}




/* =========================================
   INPUT GROUP Y CHIPS (RECOMPENSAS FIDELIDAD)
   ========================================= */
#input-group-valor:focus-within {
    border-color: var(--primary-color) !important;
}

.fidelidad-service-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    background: var(--card-bg);
    color: var(--text-main);
    transition: 0.2s;
    user-select: none;
}

.fidelidad-service-chip input {
    display: none;
}

.fidelidad-service-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}



/* =========================================
   CUSTOM DROPDOWN (AUTOCOMPLETADO CLIENTES)
   ========================================= */
.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: -8px; /* Ajuste sutil para que pegue con el input */
}

.custom-dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    transition: background 0.2s;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown-item:hover {
    background: var(--highlight-bg);
}

.custom-dropdown-item:hover .custom-dropdown-name {
    color: var(--primary-color);
}

.custom-dropdown-name {
    font-weight: bold;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.custom-dropdown-phone {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
}