/* --- Estilos Base --- */
:root {
    /* Colores por defecto, serán sobreescritos por JS */
    --primary-color: #333;
    --secondary-color: #007bff;
    --text-color: #333;
    --bg-color: #f4f4f4;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    
    /* --- BLOQUEO DE ZOOM Y REBOTE (CANDADO 1) --- */
    touch-action: manipulation; /* Deshabilita el zoom por doble toque */
    overscroll-behavior: none;  /* Evita el "rebote" elástico en iOS */
    -webkit-text-size-adjust: 100%; /* Evita ajuste automático de texto al rotar */
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: padding 0.3s ease-out;
}

/* --- NUEVO: Estilo del Logo (Corregido con Flexbox) --- */
.logo-container {
    padding-bottom: 10px;
    display: flex; /* Añadido */
    justify-content: center; /* Añadido */
}
#restaurant-logo {
    max-height: 80px;
    max-width: 200px;
    width: auto;
    height: auto;
    border-radius: 5px;
}

/* --- MODIFICADO: Estilos para los contenedores del Header --- */
.header-main-bottom {
    display: flex;
    justify-content: space-between; /* Mantiene el H1 a la izquierda */
    align-items: center;
    margin-bottom: 10px;
}

#header-title {
    margin: 0;
    transition: font-size 0.3s ease-out;
}

#open-feedback-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s, filter 0.2s;
}

#open-feedback-btn:hover {
    filter: brightness(0.9);
}

.call-waiter-btn {
    background-color: #dc3545; /* Rojo */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s, filter 0.2s;
}

/* --- NUEVO: Estilos Selector de Idioma --- */
#language-selector {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid #fff;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 0.9em;
    cursor: pointer;
}

#language-selector option {
    background-color: #333;
    color: white;
}

header.header-text-dark #language-selector { color: #333; border-color: #333; }
header.header-text-dark #language-selector option { background-color: #fff; color: #333; }
/* --- FIN NUEVO --- */

.call-waiter-btn:hover:not(:disabled) {
    background-color: #c82333; /* Rojo Oscuro */
}

.call-waiter-btn:disabled {
    background-color: #adb5bd !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.header-secondary {
    text-align: center;
}
/* --- FIN DE MODIFICACIÓN --- */


#active-menu-display {
    font-size: 1em;
    color: #ccc;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center; /* Asegura que esté centrado */
}

.category-filter-container {
    margin-bottom: 10px;
    text-align: center; /* Asegura que esté centrado */
}

.category-filter-container label {
    margin-right: 10px;
    color: #ccc;
}

#category-filter {
    padding: 5px 10px;
    font-size: 1em;
}

/* Estilo para nombre menú activo */
#active-menu-display {
    font-size: 1em;
    color: #ccc;
    font-weight: normal;
    margin-top: -10px; /* Ajusta según sea necesario */
    margin-bottom: 10px;
}

main#menu-container {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

/* --- Estilos Categorías Menú Cliente --- */
.category-title {
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    color: var(--text-color);
    font-size: 1.8em;
    font-weight: 700;
}
.category-items {
    display: grid;
    /* Diseño mobile-first, 1 columna por defecto */
    grid-template-columns: 1fr;
    gap: 20px;
}

/* --- NUEVO: Estilo de Platillos (Mobile-First y Futurista) --- */
.menu-item {
    position: relative;
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    /* Dirección de columna para imagen arriba, contenido abajo */
    flex-direction: column;
    overflow: hidden; /* Para que la imagen no se salga */
}
.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.menu-item-image-container {
    width: 100%;
    height: 180px; /* Altura fija para la imagen */
    overflow: hidden;
}
.menu-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio */
    transition: transform 0.3s ease;
}
.menu-item:hover .menu-item-image {
    transform: scale(1.05); /* Efecto zoom sutil */
}

.menu-item-content {
    padding: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ocupa el espacio restante */
}

/* --- REQ 1: Ocultar si no hay imagen --- */
.menu-item.no-image .menu-item-image-container {
    display: none;
}

.menu-item.no-image .menu-item-content {
    /* text-align: center; */ 
    min-height: 180px; 
}


.menu-item h2 {
    margin-top: 10px; 
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-color);
    flex-grow: 1; /* Empuja precio y botón abajo */
    margin-bottom: 10px;
}
.menu-item .price {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.25em;
    margin: 10px 0;
}


/* Estilo base para CUALQUIER botón en la tarjeta */
.menu-item button {
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: filter 0.2s, background-color 0.2s;
    margin-top: auto;
    width: 100%; /* Botón ocupa todo el ancho */
}

/* Botón principal "Agregar" */
.menu-item button.add-btn-simple {
    background-color: var(--secondary-color);
    color: white;
    margin-top: 10px; /* Espacio desde el precio */
}
.menu-item button.add-btn-simple:hover {
    filter: brightness(0.9);
}

/* Botón secundario "Personalizar" */
.menu-item button.add-btn-customize {
    background-color: #f0f0f0; /* Color discreto */
    color: #333;
    border: 1px solid #ccc;
    font-size: 0.9em;
    font-weight: 500;
    padding: 8px 12px;
    margin-top: 8px; /* Espacio entre los dos botones */
}
.menu-item button.add-btn-customize:hover {
    background-color: #e0e0e0;
    filter: none; /* Sobrescribe el filtro de brillo */
}


/* --- Media Query para Tablets y Desktops --- */
@media (min-width: 600px) {
    .category-items {
        /* 2 columnas en pantallas medianas */
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 900px) {
    .category-items {
        /* 3 columnas en pantallas grandes */
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- REQ 2: Corregir insignia de cantidad --- */
.item-quantity-badge {
    position: absolute;
    top: 10px;  /* Movido adentro */
    right: 10px; /* Movido adentro */
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    z-index: 10; /* Asegura que esté sobre la imagen */
}

/* Estilo para platillos agotados */
.menu-item.sold-out {
    opacity: 0.7;
    background-color: #f9f9f9;
}
.menu-item.sold-out .menu-item-image-container {
    filter: grayscale(80%);
}
.menu-item.sold-out button.sold-out-btn {
    background-color: #dc3545;
    cursor: not-allowed;
    width: 100%;
}
.menu-item.sold-out button.sold-out-btn:hover {
    background-color: #c82333;
    filter: none;
}


/* --- ESTILOS DEL CARRITO (MODIFICADOS) --- */
#cart-section, #account-section { background-color: #fff; max-width: 600px; margin: 30px auto; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
#cart-section h2, #account-section h2 { text-align: center; margin-top: 0; color: #333; }

.cart-item {
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cart-items ul {
    font-size: 0.85em;
    color: #555;
    margin-left: 15px;
    margin-top: 5px;
    padding: 0;
    list-style-type: none;
}
#cart-items ul li {
    padding: 2px 0;
    border-bottom: none;
}

/* --- Estilos para controles de cantidad en carrito --- */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.quantity-controls .quantity-btn {
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 26px;
    text-align: center;
    padding: 0;
}
.quantity-controls .quantity-btn:hover {
    background-color: #ddd;
}
.item-quantity {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}
.remove-btn {
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    border: none;
    width: auto;
    padding: 4px 8px;
    height: 28px;
    line-height: 1;
    margin-left: 10px;
    cursor: pointer;
}

#account-items ul { list-style: none; padding: 0; }
#account-items li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dotted #ccc; gap: 10px; }
#account-items li:last-child { border-bottom: none; }
#place-order-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s, filter 0.2s;
}
#place-order-btn:hover {
    filter: brightness(0.9);
}


/* --- Estilos Indicador Carga --- */
.loader-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.loader { border: 8px solid #f3f3f3; border-top: 8px solid #3498db; border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* --- Estilos Modal Modificadores --- */
#modifier-modal { 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    padding: 25px; 
    min-width: 300px; 
    max-width: 90vw; 
    width: 500px; 
    position: fixed !important;  
    z-index: 90000 !important;   
}
#modifier-modal::backdrop { 
    background: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(3px); 
    z-index: 89999 !important;   
}
#modifier-modal h2 { margin-top: 0; text-align: center; color: #333; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
#modifier-form hr { border: 0; height: 1px; background: #eee; margin: 20px 0; }
.modifier-group { margin-bottom: 20px; padding: 15px; border: 1px solid #e0e0e0; border-radius: 5px; background-color: #f9f9f9; }
.modifier-group h3 { margin-top: 0; margin-bottom: 5px; font-size: 1.1em; color: #555; }
.modifier-group p.selection-rule { font-size: 0.9em; color: #777; margin-bottom: 15px; }
.modifier-option { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; background-color: #fff; padding: 8px 12px; border-radius: 4px; border: 1px solid #eee; }
.modifier-option label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex-grow: 1; }
.modifier-option input[type="radio"], .modifier-option input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--secondary-color); }
.modifier-option .option-price { font-size: 0.95em; color: var(--secondary-color); font-weight: bold; white-space: nowrap; margin-left: 10px; }
#modifier-modal .cancel-btn { background-color: #6c757d; color: white; padding: 10px 15px; border:none; border-radius: 5px; cursor: pointer; font-size: 1em; line-height: 1.4; margin: 2px; transition: background-color 0.2s ease; }
#modifier-modal .submit-btn { background-color: var(--secondary-color); color: white; padding: 10px 15px; border:none; border-radius: 5px; cursor: pointer; font-size: 1em; line-height: 1.4; margin: 2px; transition: background-color 0.2s, filter 0.2s; }
#modifier-modal .cancel-btn:hover { background-color: #5a6268; }
#modifier-modal .submit-btn:hover { filter: brightness(0.9); }

/* --- Estilos para Modificadores Colapsables (Admin) --- */
.modifier-group-header {
    cursor: pointer;
}
.modifier-group-card.collapsed .modifier-group-details {
    display: none;
}


.category-sort-list li {
    transition: transform 0.3s ease-in-out;
}

.category-sort-list li.moving-up {
    transform: none;
    /* transform will be set by JS */
}

.category-sort-list li.moving-down {
    transform: none;
    /* transform will be set by JS */
}

.category-order-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    margin: 0 2px;
}

.category-order-btn:hover {
    background-color: #5a6268;
}

.category-order-btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}



/* Estilos para el sistema de calificación por estrellas */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    font-size: 2.5em;
    color: #ccc;
    cursor: pointer;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    transition: color 0.2s;
}

/* --- Estilos Modal Feedback --- */
#feedback-modal {
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 25px;
    min-width: 300px;
    max-width: 90vw;
    width: 500px;
    position: fixed !important;
    z-index: 90000 !important; 
}

#feedback-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 89999 !important; 
}

#feedback-modal h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#feedback-form .form-group {
    margin-bottom: 15px;
}

#feedback-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

#feedback-form input[type="text"],
#feedback-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

#feedback-form textarea {
    resize: vertical;
    min-height: 80px;
}

#feedback-modal .cancel-btn {
    background-color: #6c757d;
    color: white;
}

#feedback-modal .submit-btn {
    background-color: var(--secondary-color);
    color: white;
}

#feedback-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#feedback-modal .cancel-btn,
#feedback-modal .submit-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, filter 0.2s;
}

#feedback-modal .cancel-btn:hover {
    background-color: #5a6268;
}

#feedback-modal .submit-btn:hover {
    filter: brightness(0.9);
}

/* --- Estilos Contenedor Gráficas --- */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- NUEVO: Estilo para fondo de logo --- */
#restaurant-logo.logo-with-bg {
    background-color: white;
    padding: 5px; /* Opcional: añade un pequeño margen blanco */
    box-sizing: border-box; /* Asegura que el padding no rompa el tamaño */
}

/* --- NUEVO: Estilos de Texto de Header Dinámico --- */

/* Por defecto, el texto del header (h1) es blanco.
  Y los textos secundarios (h2, label) son #ccc.
  Estas nuevas clases anularán eso cuando el fondo sea muy claro.
*/

/* Si el fondo es CLARO (YIQ >= 128), usamos texto OSCURO */
header.header-text-dark {
    color: #222222; /* Color principal (para "Menú - Mesa #4") */
}
header.header-text-dark #active-menu-display,
header.header-text-dark .category-filter-container label {
    color: #444444; /* Color secundario (para "Menú: Comidas" y "Filtrar:") */
}
header.header-text-dark #category-filter {
    /* Opcional: ajustar el filtro si el fondo es claro */
    background: rgba(255,255,255,0.3);
    color: #000;
    border: 1px solid #555;
}


/* Si el fondo es OSCURO (YIQ < 128), usamos texto CLARO */
header.header-text-light {
    color: #FFFFFF; /* Color principal */
}
header.header-text-light #active-menu-display,
header.header-text-light .category-filter-container label {
    color: #E0E0E0; /* Color secundario */
}
header.header-text-light #category-filter {
    /* Opcional: Estilo por defecto del filtro para fondos oscuros */
    background: transparent;
    color: #FFF;
    border: 1px solid #E0E0E0;
}

/* --- Estilos para Banderas de Platillos (Solución Definitiva) --- */

/* 1. Crear un "espacio seguro" empujando el contenido hacia abajo
   SOLAMENTE si el platillo tiene una bandera */
.menu-item.badge-bestseller .menu-item-content,
.menu-item.badge-suggestion .menu-item-content {
    /* Empuja el H2 ("Agua de Horchata") 35px hacia abajo */
    padding-top: 35px; 
}

/* 2. Estilo y posición del badge (para que quepa en el espacio seguro) */
.menu-item .menu-item-badge {
    position: absolute;
    top: 10px;  /* 10px desde el borde superior de la tarjeta */
    left: 10px; /* 10px desde el borde izquierdo de la tarjeta */
    background-color: var(--secondary-color);
    color: white;
    padding: 4px 10px; /* Compacto */
    font-size: 0.8em;  /* Compacto */
    font-weight: 700;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    z-index: 5; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3. Colores (sin cambios) */
.menu-item.badge-bestseller .menu-item-badge {
    background-color: #007bff; /* Azul para "Más Vendido" */
}

.menu-item.badge-suggestion .menu-item-badge {
    background-color: #28a745; /* Verde para "Sugerencia" */
}

/* --- Estilos para Campos Extra del Carrito --- */
.cart-extra-field {
    margin: 15px 0;
}
.cart-extra-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}
.cart-extra-field textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box; /* Importante */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

/* Estilo especial para Alergias */
#order-allergies {
    border: 2px solid #dc3545; /* Borde rojo */
    background-color: #fff8f8;
}
#order-allergies:focus {
    outline-color: #dc3545;
}

/* --- Estilos para Sección de Propina --- */
.tip-section {
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
}
.tip-section h4 {
    margin: 0 0 10px 0;
    color: #444;
}
.tip-options-container {
    display: flex;
    flex-wrap: wrap; /* Permite que los botones pasen a la siguiente línea */
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}
.tip-btn {
    flex: 1 1 auto; /* Permite que los botones se ajusten */
    min-width: 60px; /* Ancho mínimo para cada botón */
    padding: 10px;
    font-size: 0.9em;
    font-weight: bold;
    border: 2px solid var(--secondary-color);
    background-color: #fff;
    color: var(--secondary-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tip-btn:hover {
    background-color: #f0f8ff;
}
.tip-btn.active {
    background-color: var(--secondary-color);
    color: white;
}
.tip-custom-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px; /* Espacio entre los formularios de propina */
}
.tip-custom-form label {
    font-size: 0.9em;
    color: #555;
    white-space: nowrap; /* Evita que se parta la etiqueta */
}
.tip-custom-form input {
    width: 100px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.tip-custom-form .submit-btn {
    padding: 8px 12px;
    font-size: 0.9em;
}

/* --- Estilos Resumen de Cuenta --- */
#account-summary {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
#account-summary p {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    margin: 8px 0;
}
#account-summary p.tip {
    color: #555;
}
#account-summary p.total {
    font-size: 1.3em;
    font-weight: bold;
    color: #000;
}
/* --- Estilos Desglose de Cuenta --- */
#account-summary p.detail {
    font-size: 0.95em;
    color: #777;
    margin: 4px 0;
}
#account-summary p.subtotal {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dotted #ccc;
}

/* ================================== */
/* ==      CAMBIOS INICIAN AQUÍ      == */
/* =LETRA*/
/* ================================== */

/* --- INICIO: Estilos de Notificación (Toast) --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    width: 300px;
    max-width: 90%;
}

.toast {
    background-color: #007bff; /* 'info' por defecto */
    color: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 1em;
    font-weight: 500;
}

/* Esta clase SÓLO se usará al crear el toast */
.toast.toast-anim-in {
    animation: toast-slide-in 0.3s ease-out forwards;
}

/* Tipos de Toast */
.toast.toast-success {
    background-color: #28a745;
}

.toast.toast-error {
    background-color: #dc3545;
}

/* Animación de entrada (Sin cambios) */
@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 3. Creamos una animación SOLO para el fade-out */
@keyframes toast-fade-out-anim {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 4. Asignamos esa animación a la clase .toast-fade-out */
/* Esta regla anulará la animación de 'toast-slide-in' y ejecutará la de salida. */
.toast.toast-fade-out {
    animation: toast-fade-out-anim 0.5s ease-out forwards;
}
/* --- FIN: Estilos de Notificación (Toast) --- */
/* --- INICIO: Estilos de Comentario Personalizado --- */

/* 2. Campo de texto en el Modal de Modificadores (Caso 2) */
.custom-comment-group {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}
.custom-comment-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}
.custom-comment-group textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box; /* Importante */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

/* 3. Estilo para el comentario en el Carrito */
.cart-item-comment {
    background-color: #fdfdfd;
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-style: italic;
    color: #333;
    font-size: 0.95em;
    white-space: pre-wrap;
}

/* 4. Estilos para el Modal de Comentario Simple (Caso 1) */
#simple-comment-modal {
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 25px;
    min-width: 300px;
    max-width: 90vw;
    width: 500px;
    position: fixed !important; 
    z-index: 90000 !important;  
}
#simple-comment-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 89999 !important;  
}
#simple-comment-modal h2 {
    margin-top: 0;
}
#simple-comment-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- FIN: Estilos de Comentario Personalizado --- */

/* --- INICIO DE CÓDIGO NUEVO: Header Encogible (SOLUCIÓN FINAL) --- */
.header-top {
    /* Define el estado expandido */
    max-height: 150px; /* Altura suficiente para logo, botón y texto */
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
    overflow: hidden;
    transition: max-height 0.3s ease-out, 
                opacity 0.2s ease-out,
                transform 0.3s ease-out;
}
.header-bottom {
    /* El contenedor inferior no necesita animación, solo el H1 */
    transition: padding 0.3s ease-out;
}
header.header-scrolled {
    /* Encoge el padding general del header */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
header.header-scrolled .header-top {
    /* Colapsa el contenedor superior */
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
}
header.header-scrolled .header-bottom {
    /* Ajusta el padding del inferior para que se sienta más compacto */
    padding-top: 0;
}
header.header-scrolled #header-title {
    /* Achica el título principal (Mesa #) */
    font-size: 1.1em;
}
header.header-scrolled .category-filter-container {
    margin-bottom: 0;
}

/* ================================================================= */
/* ==                  ESTILOS DE IMPRESIÓN (TICKET)              == */
/* ================================================================= */

/* Ocultar todo lo de la app cuando se imprime */
@media print {
    body * {
        visibility: hidden;
    }
    
    /* Solo mostrar el área de impresión específica */
    #printable-area, #printable-area * {
        visibility: visible;
    }

    #printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Configuración de página para impresora térmica */
    @page {
        margin: 0;
        size: auto; /* Permite que la impresora defina el largo */
    }
}

/* Estilos visuales del ticket (Simulación en pantalla y papel) */
.ticket-container {
    width: 80mm; /* Estándar térmico (o 58mm) */
    max-width: 100%;
    padding: 10px;
    background: white;
    color: black;
    font-family: 'Courier New', Courier, monospace; /* Fuente tipo ticket */
    font-size: 12px;
    line-height: 1.2;
}

.ticket-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px dashed black;
    padding-bottom: 10px;
}

.ticket-logo {
    max-width: 60%;
    height: auto;
    margin-bottom: 5px;
    filter: grayscale(100%) contrast(200%); /* Mejor para térmicas */
}

.ticket-info {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.ticket-table th {
    text-align: left;
    border-bottom: 1px solid black;
    font-size: 0.9em;
}

.ticket-table td {
    padding: 4px 0;
    vertical-align: top;
}

.ticket-item-name {
    display: block;
    font-weight: bold;
}

.ticket-mods {
    font-size: 0.85em;
    font-style: italic;
    margin-left: 10px;
    display: block;
}

.ticket-totals {
    margin-top: 10px;
    border-top: 1px dashed black;
    padding-top: 5px;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.ticket-row.final {
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 5px;
    border-top: 1px solid black;
    padding-top: 5px;
}

.ticket-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}

/* ================================================================= */
/* ==               ESTILOS VISTA PREVIA TICKET (ADMIN)           == */
/* ================================================================= */

.ticket-config-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ticket-config-form-side {
    flex: 1;
    min-width: 300px;
}

.ticket-preview-side {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ticket-preview-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.85em;
}

/* Simulación de papel térmico */
.ticket-paper {
    background-color: white;
    width: 100%;
    max-width: 80mm;
    min-height: 400px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-top: 1px solid #eee;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.2;
    color: black;
    box-sizing: border-box;
    overflow: hidden;
}

/* Elementos internos de la vista previa (Igual que utils.js) */
.tp-center { text-align: center; }
.tp-right { text-align: right; }
.tp-bold { font-weight: bold; }
.tp-dashed { border-bottom: 1px dashed #000; margin: 8px 0; }
.tp-logo { max-width: 60%; height: auto; margin-bottom: 5px; filter: grayscale(100%); }
.tp-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.tp-table td { vertical-align: top; padding: 4px 0; }

/* NUEVO: Estilos para items y modificadores en vista previa */
.tp-item-name { font-weight: bold; display: block; }
.tp-mods-container { margin-left: 10px; margin-top: 2px; }
.tp-mod-line { font-size: 10px; font-style: italic; display: block; color: #333; }

.tp-total-row { font-size: 1.2em; font-weight: bold; border-top: 1px solid #000; padding-top: 5px; margin-top: 5px; }

/* --- Estilo para la Descripción del Platillo --- */
.menu-item-description {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-style: italic;
    /* Limitar a 3 líneas para no alargar demasiado la tarjeta */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- NUEVO: Estilo para resaltar coincidencias de búsqueda --- */
.highlight-text {
    background-color: #ffeb3b; /* Amarillo brillante */
    color: #212529; /* Texto oscuro para contraste */
    border-radius: 2px;
    padding: 0 2px;
    box-shadow: 0 0 2px rgba(255, 235, 59, 0.5);
    font-weight: bold;
}

/* --- ESTILOS BUSCADOR GLOBAL (SPOTLIGHT) --- */

/* Botón Lupa */
.global-search-btn {
    background-color: transparent;
    border: 2px solid #007bff;
    color: #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.global-search-btn:hover {
    background-color: #007bff;
    color: white;
    transform: scale(1.1);
}

/* Modal de Búsqueda */
#global-search-modal {
    width: 600px;
    max-width: 95%;
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    background: #fff;
}
#global-search-modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

/* Input del Buscador */
.global-search-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}
#global-search-input {
    width: 100%;
    border: none;
    font-size: 1.2em;
    outline: none;
    padding: 5px;
}

/* Resultados */
#search-results-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}
.search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s;
}
.search-result-item:hover, .search-result-item.selected {
    background-color: #f8f9fa;
    border-left-color: #007bff;
}
.search-result-title {
    font-weight: bold;
    color: #333;
    display: block;
}
.search-result-path {
    font-size: 0.85em;
    color: #888;
    margin-top: 3px;
    display: block;
}
.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* ================================================================= */
/* ==   SOLUCIÓN FINAL: Encabezado Flexible (Menus Ancho Completo) == */
/* ================================================================= */

/* 1. Nuevo contenedor que agrupa Título (Izq), Botones (Centro), Acciones (Der) */
.section-title-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;            /* Alineados verticalmente al centro */
    margin-bottom: 30px;            /* Espacio para que no se peguen los menús */
    border-bottom: 2px solid #eee;  /* (Opcional) Línea decorativa bajo el título */
    padding-bottom: 15px;
    flex-wrap: wrap; /* Para que se adapte si hay poco espacio */
}

/* Ajuste para que el título no tenga márgenes molestos */
.section-title-row h1 {
    margin: 0;
    padding-top: 5px; 
}

/* 2. Botones de Navegación del Centro (Estadísticas / Config) */
.header-nav-buttons {
    display: flex;
    gap: 10px;
    margin: 0 15px; /* Separación lateral */
}

/* 3. Actualización del contenedor de botones (SIN FLOAT) */
.top-action-container {
    display: flex;
    flex-direction: column; /* Un botón arriba del otro */
    gap: 10px;              /* Espacio entre botón volver y lupa */
    align-items: flex-end;  /* Pegados a la derecha */
    width: auto;            /* Que ocupe solo lo necesario */
    min-width: 200px;       /* Ancho mínimo para el botón de texto */
}

/* 4. El botón cuadrado (Spotlight) */
.btn-spotlight-square {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;    /* Cuadrado perfecto */
    height: 42px;
    padding: 0;
    background-color: #f1f3f4;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-spotlight-square:hover {
    background-color: #e2e6ea;
    border-color: #adb5bd;
    transform: scale(1.05);
}

/* Ajuste móvil */
@media (max-width: 700px) {
    .section-title-row {
        flex-direction: column; /* Uno debajo del otro en celular */
        gap: 15px;
        align-items: stretch;
    }
    .header-nav-buttons {
        margin: 0;
        justify-content: space-between; /* Botones ocupan el ancho */
    }
    .top-action-container {
        width: 100%; /* Botones anchos en celular */
        align-items: stretch;
    }
}

/* --- ESTILOS PARA NOTIFICACIONES DE ENTREGA --- */
.delivery-notification-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 130px; /* Ancho para aprox. 2 burbujas con su espacio */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 15px;
    z-index: 10;
}

.delivery-notification-container h4 {
    color: #444;
    margin: 0 0 5px 0;
    font-weight: bold;
    font-size: 1em;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    flex-basis: 100%;
    text-align: right;
}

.delivery-notification-bubble {
    background-color: #28a745; /* Verde para 'listo' */
    color: white;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.4em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    user-select: none; /* Evita que el texto se seleccione al mantener presionado */
    -webkit-user-select: none;
    transition: transform 0.1s ease-out, background-color 0.2s;
    animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.delivery-notification-bubble:hover {
    transform: scale(1.1);
}

.delivery-notification-bubble:active {
    transform: scale(0.95);
    background-color: #218838;
}

@keyframes pop-in {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- ESTILOS PARA MODAL DE VISTA PREVIA (PEEK) --- */
.peek-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 2000;
    padding: 20px;
    pointer-events: none; /* El modal en sí no es interactivo */
    opacity: 0;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    transform-origin: center;
}

.peek-modal:not(.hidden) {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.peek-modal.hidden {
    transform: translate(-50%, -50%) scale(0.95);
}

.peek-modal-content h3 {
    margin-top: 0;
    font-size: 1.4em;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.peek-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

.peek-modal-body li {
    font-size: 1.1em;
    padding: 8px 5px;
    border-bottom: 1px dotted #ccc;
}

.peek-modal-body li:last-child {
    border-bottom: none;
}

.peek-modal-statuses {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.status-indicator {
    text-align: center;
    font-weight: bold;
}

.status-indicator span {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.status-indicator-light {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ccc; /* Gris por defecto */
}

.status-indicator-light.complete {
    background-color: #28a745; /* Verde */
    box-shadow: 0 0 10px #28a745;
}

.status-indicator-light.incomplete {
    background-color: #ffc107; /* Amarillo */
    box-shadow: 0 0 10px #ffc107;
}

.status-indicator-light.not-applicable {
    background-color: #f8f9fa; /* Casi blanco */
    border: 1px solid #ddd;
}

/* ================================================================= */
/* ==                     ESTILOS VISTA HOST                      == */
/* ================================================================= */

.pin-login-active {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f2f5; /* Un fondo claro para light mode */
}

/* Restaurar ancho del contenedor de login cuando está centrado */
.pin-login-active #pin-login-section {
    width: 100%;
}

#host-main-section {
    padding: 20px;
}

#host-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#host-logout-btn {
    padding: 8px 16px;
    font-size: 1em;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#tables-grid-container {
    display: flex;
    gap: 20px;
    overflow-x: auto; /* Permite scroll horizontal si hay muchos meseros */
    padding-bottom: 15px;
}

.waiter-column {
    flex: 1 1 280px; /* Base de 280px, pueden crecer y encogerse */
    min-width: 250px; /* Ancho mínimo para legibilidad */
    background-color: var(--card-bg, #ffffff);
    border-radius: 12px;
    box-shadow: var(--card-shadow, 0 4px 12px rgba(0,0,0,0.08));
    padding: 15px;
}

.waiter-column h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color, #007bff);
    color: var(--text-color, #333);
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tables-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center; /* Centra las mesas en la columna */
}

.table-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.table-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.table-number {
    font-size: 2em;
    font-weight: bold;
}

.table-capacity {
    font-size: 0.9em;
    font-weight: 300;
}

/* Colores de estado de las mesas */
.table-circle.status-libre {
    background-color: #28a745; /* Verde */
}

.table-circle.status-ocupada {
    background-color: #dc3545; /* Rojo */
}

.table-circle.status-sucia {
    background-color: #ffc107; /* Amarillo */
    color: #333; /* Texto oscuro para mejor contraste en amarillo */
}

.table-circle.status-sobremesa {
    background-color: #007bff; /* Azul */
}

/* --- ESTILOS TOGGLE KDS (Cocina/Bar) --- */
.kds-view-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}
.kds-view-toggle .view-toggle-btn {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: 2px solid var(--secondary-color);
    background-color: transparent;
    color: white;
    border-radius: 5px;
    transition: all 0.2s;
    font-weight: bold;
}
.kds-view-toggle .view-toggle-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

/* --- ESTILOS ITEMS CANCELADOS KDS --- */
.cancelled-item {
    text-decoration: line-through;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1) !important;
    opacity: 0.8;
}

/* --- ESTILOS VISTA MESERO AGRUPADA --- */
.waiter-order-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
    background-color: #fff;
    overflow: hidden;
}
.waiter-order-header {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: bold;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.waiter-order-items {
    padding: 0;
    margin: 0;
    list-style: none;
}
.waiter-order-items li {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}
.waiter-order-items li:last-child {
    border-bottom: none;
}

/* --- KDS TIMERS (Cronómetros) --- */
.order-timer {
    float: right;
    font-family: monospace;
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: #28a745; /* Verde inicial */
    font-size: 0.8em;
}

.order-time-static {
    float: right;
    font-size: 0.7em;
    color: #aaa;
    font-weight: normal;
}

.order-card.timer-warning {
    border: 2px solid #ffc107 !important; /* Amarillo */
}
.order-card.timer-warning .order-timer {
    color: #ffc107;
}

.order-card.timer-danger {
    border: 2px solid #dc3545 !important; /* Rojo */
    animation: pulse-border-red 2s infinite;
}
.order-card.timer-danger .order-timer {
    color: #dc3545;
}

@keyframes pulse-border-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* --- ESTILOS DIVIDIR CUENTA --- */
.secondary-action-btn {
    display: block;
    width: 100%;
    padding: 12px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: filter 0.2s;
}
.secondary-action-btn:hover { filter: brightness(0.9); }

/* Modal Fullscreen para Split */
dialog.fullscreen-modal {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    border: none; border-radius: 0; padding: 0; margin: 0;
    display: none; flex-direction: column;
}
dialog.fullscreen-modal[open] { display: flex; } /* Override default block */

.modal-header {
    padding: 15px; background: #f8f9fa; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { margin: 0; font-size: 1.2em; }
.close-modal-btn { background: none; border: none; font-size: 1.5em; cursor: pointer; color: #555; }

.split-content { flex: 1; overflow-y: auto; padding: 15px; background: #fff; }
.split-section { margin-bottom: 25px; }
.split-section h3 { font-size: 1em; color: #007bff; border-bottom: 2px solid #eee; padding-bottom: 5px; margin-bottom: 10px; }

/* Personas */
.add-person-form { display: flex; gap: 10px; margin-bottom: 10px; }
.add-person-form input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.add-person-form button { background: #28a745; color: white; border: none; width: 40px; border-radius: 4px; font-size: 1.2em; cursor: pointer; }
.people-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip {
    background: #e9ecef; padding: 5px 10px; border-radius: 15px; font-size: 0.9em;
    display: flex; align-items: center; gap: 5px; border: 1px solid #ddd;
}
.person-chip button { background: none; border: none; color: #dc3545; font-weight: bold; cursor: pointer; font-size: 1.1em; padding: 0 2px; }

/* Items Split */
.split-item-row {
    border: 1px solid #eee; border-radius: 8px; padding: 10px; margin-bottom: 10px;
    background: #fff;
}
.split-item-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 8px; }
.split-assign-options { display: flex; flex-wrap: wrap; gap: 5px; }
.assign-btn {
    background: #fff; border: 1px solid #ccc; padding: 5px 10px; border-radius: 4px;
    font-size: 0.85em; cursor: pointer; transition: all 0.2s;
}
.assign-btn.selected {
    background: #007bff; color: white; border-color: #007bff;
}
.assign-btn.assign-all-btn {
    font-weight: bold;
    border-color: #6c757d;
}

/* Propinas Split */
.split-tip-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px dotted #eee;
}
.split-tip-row input { width: 70px; padding: 5px; border: 1px solid #ccc; border-radius: 4px; text-align: right; }

.split-footer {
    padding: 15px; background: #f8f9fa; border-top: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
#split-totals-preview { font-weight: bold; font-size: 1.1em; }

.tip-type-toggle {
    padding: 4px 8px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    min-width: 35px;
    font-weight: bold;
    transition: all 0.2s;
    text-align: center;
}
.tip-type-toggle.tip-toggle-percent {
    background-color: #e2e3e5;
    border: 1px solid #d6d8db;
    color: #495057;
}
.tip-type-toggle.tip-toggle-percent:hover { background-color: #d3d5d7; }
.tip-type-toggle.tip-toggle-fixed {
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
}
.tip-type-toggle.tip-toggle-fixed:hover { background-color: #b8daff; }

#save-split-btn {
    background-color: rgb(0, 160, 0);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: filter 0.2s;
}
#save-split-btn:hover {
    filter: brightness(0.9);
}

/* Ticket Cut Line (Para impresión) */
.cut-line {
    border-bottom: 1px dashed #000;
    margin: 20px 0;
    text-align: center;
    font-size: 10px;
    padding-top: 10px;
}
.cut-line::after {
    content: '✂️ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -';
    background: #fff;
    padding: 0 5px;
    position: relative;
    top: 10px;
}

/* --- CHATBOT STYLES --- */
.chat-toggle-btn {
    position: fixed;
    bottom: 90px; /* Arriba del botón de dividir cuenta si está visible, o en una zona segura */
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    font-family: 'Orbitron', 'Courier New', sans-serif; /* Fuente futurista */
    font-size: 1.2em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 9990;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.chat-toggle-btn:hover { transform: scale(1.1); }

#chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 450px;
    max-height: 60vh;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eee;
}
#chatbot-widget.hidden { display: none; }

.chat-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header button { background: none; border: none; color: white; font-size: 1.2em; cursor: pointer; }

.chat-messages { flex: 1; padding: 15px; overflow-y: auto; background-color: #f9f9f9; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { padding: 8px 12px; border-radius: 8px; max-width: 80%; font-size: 0.95em; line-height: 1.4; white-space: pre-wrap; }
.chat-msg.bot { background-color: #e9ecef; color: #333; align-self: flex-start; border-bottom-left-radius: 0; }
.chat-msg.user { background-color: var(--secondary-color); color: white; align-self: flex-end; border-bottom-right-radius: 0; }

.chat-input-area { display: flex; border-top: 1px solid #eee; padding: 10px; background: white; }
.chat-input-area input { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 20px; outline: none; padding-left: 15px; }
.chat-input-area button { background: none; border: none; color: var(--secondary-color); font-size: 1.5em; margin-left: 10px; cursor: pointer; }
.chat-input-area button:disabled { color: #ccc; }

/* --- CHATBOT GERENTE (ADMIN) --- */
.admin-chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #6f42c1; /* Morado Estratégico */
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-chat-btn:hover { transform: scale(1.05); }

#admin-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.25);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ccc;
}
#admin-chat-widget.hidden { display: none; }

/* --- ESTILOS MODAL PAGO --- */
.payment-options-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}
.payment-option-btn {
    width: 120px;
    height: 120px;
    border: 2px solid #eee;
    border-radius: 12px;
    background-color: #f9f9f9;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}
.payment-option-btn:hover { transform: scale(1.05); background-color: #e9ecef; }

.admin-chat-header {
    background-color: #6f42c1;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-chat-header button { background: none; border: none; color: white; font-size: 1.5em; cursor: pointer; }

.chat-msg.admin-bot { background-color: #f3e5f5; color: #333; align-self: flex-start; border-bottom-left-radius: 0; border: 1px solid #e1bee7; }
.chat-msg.admin-user { background-color: #6f42c1; color: white; align-self: flex-end; border-bottom-right-radius: 0; }

/* ================================================================= */
/* ==                  NUEVO DISEÑO DASHBOARD (GERENTE)           == */
/* ================================================================= */

/* Contenedor principal del Dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: #f4f6f8;
    margin: 0;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* Barra Lateral */
.dashboard-sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background-color: #1a252f;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #fff;
    font-weight: 600;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 10px 0;
}

.sidebar-link {
    display: block;
    width: 100%;
    padding: 12px 20px;
    color: #bdc3c7;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background-color: #34495e;
    color: #fff;
}

.sidebar-link.active {
    background-color: #34495e;
    color: #fff;
    border-left-color: #007bff;
}

.sidebar-divider {
    height: 1px;
    background-color: #34495e;
    margin: 10px 0;
}

/* Área de Contenido Principal */
.dashboard-main {
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    background-color: #f4f6f8;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 20px 30px;
    background-color: #1a252f; /* Mismo color que sidebar-header */
    color: #fff;
    border-bottom: 1px solid #34495e;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 90;
}

.dashboard-header h1 {
    margin: 0;
    color: #fff;
    font-size: 1.8em;
}

/* Pestañas de contenido (Secciones) */
.dashboard-tab {
    display: none;
    animation: fadeIn 0.3s ease-out;
    padding: 30px;
}

.dashboard-tab.active {
    display: block;
}

/* Ajustes para las tarjetas dentro del dashboard */
.dashboard-tab .section-header {
    display: none;
}

.dashboard-tab .section-content {
    padding: 0;
    border: none;
    max-height: none;
}

/* --- ESTILO MARCA DE AGUA SOFTWARE --- */
.software-watermark {
    max-width: 80px !important; /* Más discreto */
    opacity: 0.5; /* Transparente */
    filter: grayscale(100%); /* Blanco y negro (opcional, se ve más profesional) */
    position: fixed;
    bottom: 15px;
    right: 15px;
    margin: 0 !important;
    z-index: 10000;
    pointer-events: none;
}

/* --- Estilos Editor de Horarios (Admin) --- */
#weekly-hours-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}
.day-hours-container {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: opacity 0.3s;
}
.day-hours-container.day-closed {
    opacity: 0.6;
    background-color: #f9f9f9;
}
.day-hours-container.day-closed .add-interval-btn,
.day-hours-container.day-closed .intervals-list {
    display: none;
}
.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}
.day-header label { cursor: pointer; }
.intervals-list { list-style: none; padding: 0; margin: 0; }
.interval-item {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
    background-color: #f8f9fa; padding: 8px; border-radius: 5px;
}
.interval-item span { font-size: 0.9em; color: #555; }
.interval-item input[type="time"] { padding: 5px; border: 1px solid #ccc; border-radius: 4px; }
.delete-interval-btn {
    background-color: #dc3545; color: white; border: none; border-radius: 50%;
    width: 24px; height: 24px; line-height: 24px; text-align: center;
    cursor: pointer; font-size: 0.8em; margin-left: auto;
}
.add-interval-btn {
    background-color: transparent; color: #007bff; border: 1px dashed #007bff;
    border-radius: 5px; padding: 8px; width: 100%; cursor: pointer;
    margin-top: 5px; transition: background-color 0.2s;
}
.add-interval-btn:hover { background-color: #e7f1ff; }

/* --- ESTILOS FORMULARIO PAGO MEJORADO --- */
.payment-modal-content { padding: 0; overflow: hidden; border-radius: 12px; }

.payment-header {
    text-align: center; padding: 20px; background-color: #f8f9fa;
    border-bottom: 1px solid #eee; position: relative;
}
.payment-header h2 { margin: 0 0 5px 0; color: #333; font-size: 1.4em; }
.payment-total { font-size: 1.1em; color: #555; margin: 0; }
.payment-total span { font-weight: bold; color: var(--secondary-color); font-size: 1.3em; }

.payment-header .close-btn { top: 15px; right: 15px; }

.payment-form-container {
    padding: 25px; background: #fff;
}

.payment-provider-badge {
    text-align: center; font-size: 0.85em; color: #777; margin-bottom: 20px;
    background: #f0f4f8; padding: 6px 12px; border-radius: 20px;
    display: table; margin-left: auto; margin-right: auto; /* Centrado */
}

.card-element-container {
    min-height: 40px; padding: 12px; border: 1px solid #e0e0e0;
    border-radius: 8px; background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); margin-bottom: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card-element-container:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.payment-errors { color: #dc3545; margin-top: 10px; font-size: 0.9em; text-align: center; min-height: 20px; }

.pay-btn {
    margin-top: 15px; width: 100%; padding: 14px; font-size: 1.1em; font-weight: bold;
    background: linear-gradient(to right, #28a745, #218838); border: none;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2); transition: transform 0.1s, box-shadow 0.1s;
}
.pay-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 8px rgba(40, 167, 69, 0.3); filter: brightness(1.05); }
.pay-btn:active { transform: translateY(1px); box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2); }

.payment-footer { text-align: center; margin-top: 15px; color: #999; font-size: 0.85em; }

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}
.close-btn:hover { color: #333; }

/* --- Estilos Layout Formulario Pago --- */
.payment-row {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}
.payment-col {
    flex: 1;
}
.payment-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
}

/* --- Botones Selección Persona Pago --- */
.person-select-btn, .person-pay-select {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border-radius: 8px;
}
