.main-tab-btn {
    flex: 1 1 0;
    min-width: 0 !important;
    max-width: 100%;
    min-height: 44px;
    height: 44px;
    margin: 0 6px;
    border-radius: 16px;
    border: 2.5px solid #111;
    background: linear-gradient(135deg, #fffbe6 60%, #f8e7b6 100%);
    color: #b8860b;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 10px #e6c97a33;
    transition: all 0.18s cubic-bezier(.4,1.3,.5,1.1);
    outline: none;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 0.5em;
    white-space: nowrap;
}
.main-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    margin: 0 6px;
    border-radius: 16px;
    border: 2.5px solid #111;
    background: linear-gradient(135deg, #fffbe6 60%, #f8e7b6 100%);
    color: #b8860b;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 10px #e6c97a33;
    transition: all 0.18s cubic-bezier(.4,1.3,.5,1.1);
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5em;
    white-space: nowrap;
}
/* --- MAIN TABS CUSTOM --- */
.main-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    margin: 0 6px;
    border-radius: 16px;
    border: 2.5px solid #111;
    background: linear-gradient(135deg, #fffbe6 60%, #f8e7b6 100%);
    color: #b8860b;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 10px #e6c97a33;
    transition: all 0.18s cubic-bezier(.4,1.3,.5,1.1);
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5em;
}
.main-tab-btn:hover,
.main-tab-btn:focus {
    background: linear-gradient(135deg, #fffbe6 60%, #ffe9a7 100%);
    box-shadow: 0 4px 18px #d4af37cc, 0 0 0 2.5px #b8860b;
    color: #b8860b;
    border-color: #b8860b;
}
.main-tab-btn.active {
    background: linear-gradient(135deg, #fffbe6 60%, #ffe9a7 100%);
    color: #b8860b;
    border: 2.5px solid #111;
    box-shadow: 0 0 0 4px #d4af37cc, 0 8px 24px #b8860b55;
    filter: brightness(1.08);
}
/* --- END MAIN TABS CUSTOM --- */
/* =========================================
   TABS PRINCIPALES: ACTIVO ESTILO PERSONALIZADO
   ========================================= */
.ficha-tabs .tab-btn.tab-btn-main.active {
    background: linear-gradient(135deg, var(--cebado-charcoal), #111) !important;
    color: #b8860b !important;
    border-color: #1b1f24 !important;
    box-shadow: 0 8px 18px #b8860b;
}
.btn-historial.active,
.btn-look.active,
.btn-datos.active {
    background: #23272f !important;
    color: #fff !important;
    font-weight: 900 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    border: 2px solid #b8860b !important;
    box-shadow: 0 4px 16px #b8860b66, 0 1px 0 #fffbe6;
    letter-spacing: 0.04em;
    font-size: 1.08rem;
    border-radius: 14px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.btn-historial.active,
.btn-look.active,
.btn-datos.active {
    background: #b8860b !important;
    color: #fff !important;
    font-weight: 900 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    border: 2px solid #b8860b !important;
    box-shadow: 0 4px 16px #b8860b66, 0 1px 0 #fffbe6;
    letter-spacing: 0.04em;
    font-size: 1.08rem;
    border-radius: 14px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
/* =========================================
   BOTONES HISTORIAL/LOOK/DATOS: ACTIVO LEGIBLE
   ========================================= */
.btn-historial.active,
.btn-look.active,
.btn-datos.active {
    background: #b8860b !important;
    color: #fff !important;
    font-weight: 900;
    text-shadow: 0 2px 6px #7f7669, 0 0px 2px #fffbe6;
    border: 2px solid #b8860b !important;
    box-shadow: 0 4px 16px #b8860b66, 0 1px 0 #fffbe6;
    letter-spacing: 0.04em;
    font-size: 1.08rem;
    border-radius: 14px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
/* =========================================
   BOTONES HISTORIAL/LOOK/DATOS: CONTRASTE LEGIBLE
   ========================================= */
.btn-historial,
.btn-look,
.btn-datos {
    color: #fff !important;
    background: #23272f !important;
    border: 2px solid #b8860b !important;
    font-weight: 900;
    text-shadow: 0 2px 6px #b8860b, 0 0px 2px #fffbe6;
    letter-spacing: 0.04em;
    font-size: 1.08rem;
    border-radius: 14px;
    box-shadow: 0 4px 16px #b8860b66, 0 1px 0 #fffbe6;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
/* =========================================
   BOTONES Y TABS: CONTRASTE Y APP-LIKE EN MOVIL
   ========================================= */
@media screen and (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .icon-btn,
    .tab-btn {
        color: #2a2f36 !important;
        background: #fffbe6;
        border: 2px solid #b8860b;
        box-shadow: 0 2px 8px #b8860b33, 0 1px 0 #fffbe6;
        font-weight: 900;
        text-shadow: 0 1px 2px #fffbe6, 0 0px 2px #b8860b44;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 98vw;
        min-width: 0;
        font-size: 0.92rem;
        padding-left: 12px;
        padding-right: 12px;
        border-radius: 14px;
        transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    }
    .btn-mini {
        font-size: 0.78rem;
        padding-left: 8px;
        padding-right: 8px;
        max-width: 60vw;
    }
    .tab-btn.active,
    .tab-btn[data-active="true"] {
        color: #fff !important;
        background: linear-gradient(90deg, #b8860b 80%, #fffbe6 100%);
        border-bottom: 3px solid #b8860b;
        box-shadow: 0 4px 16px #b8860b66, 0 1px 0 #fffbe6;
        text-shadow: 0 2px 6px #b8860b, 0 0px 2px #fffbe6;
    }
    .tab-btn {
        max-width: 80vw;
        font-size: 0.82rem;
    }
    /* App-like: cards, modals, header, tabs */
    .card,
    .auth-card,
    .premium-card,
    .client-ficha {
        box-shadow: 0 8px 24px rgba(186, 134, 11, 0.09);
        border: 1.5px solid #f3e2c6;
        background: linear-gradient(180deg, #fffbe6 60%, #f8fafc 100%);
    }
    .modal-content {
        background: linear-gradient(180deg, #fffbe6 60%, #f8fafc 100%);
        border: 1.5px solid #f3e2c6;
        box-shadow: 0 8px 24px rgba(186, 134, 11, 0.09);
    }
    .app-header {
        background: linear-gradient(90deg, #fffbe6 60%, #f8fafc 100%);
        border-bottom: 2px solid #b8860b;
    }
    .tabs,
    .main-tabs-container {
        background: linear-gradient(90deg, #fffbe6 60%, #f8fafc 100%);
        border: 1.5px solid #f3e2c6;
        box-shadow: 0 6px 14px rgba(186, 134, 11, 0.07);
    }
}
/* =========================================
   TABS ACTIVOS: COLOR DORADO OSCURO EN MOVIL
   ========================================= */
@media screen and (max-width: 768px) {
    .tab-btn.active,
    .tab-btn[data-active="true"] {
        color: #b8860b !important; /* dorado oscuro, mejor legibilidad */
        background: linear-gradient(90deg, #f8fafc 60%, #fffbe6 100%);
        font-weight: 900;
        text-shadow: 0 1px 2px #fffbe6, 0 0px 2px #b8860b44;
        border-bottom: 2.5px solid #b8860b;
    }
    .tab-btn {
        transition: background 0.18s, color 0.18s;
    }
    /* App-like: cards, modals, header, tabs */
    .card,
    .auth-card,
    .premium-card,
    .client-ficha {
        box-shadow: 0 8px 24px rgba(186, 134, 11, 0.09);
        border: 1.5px solid #f3e2c6;
        background: linear-gradient(180deg, #fffbe6 60%, #f8fafc 100%);
    }
    .modal-content {
        background: linear-gradient(180deg, #fffbe6 60%, #f8fafc 100%);
        border: 1.5px solid #f3e2c6;
        box-shadow: 0 8px 24px rgba(186, 134, 11, 0.09);
    }
    .app-header {
        background: linear-gradient(90deg, #fffbe6 60%, #f8fafc 100%);
        border-bottom: 2px solid #b8860b;
    }
    .tabs,
    .main-tabs-container {
        background: linear-gradient(90deg, #fffbe6 60%, #f8fafc 100%);
        border: 1.5px solid #f3e2c6;
        box-shadow: 0 6px 14px rgba(186, 134, 11, 0.07);
    }
}
/* =========================================
   BOTONES Y TABS: TRUNCADO TEXTO EN MOVIL
   ========================================= */
@media screen and (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .icon-btn,
    .tab-btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 98vw;
        min-width: 0;
        font-size: 0.92rem;
        padding-left: 12px;
        padding-right: 12px;
    }
    .tab-btn {
        max-width: 80vw;
        font-size: 0.82rem;
    }
    .btn-mini {
        font-size: 0.78rem;
        padding-left: 8px;
        padding-right: 8px;
        max-width: 60vw;
    }
}
/* ==========================================================================
    🎨 GLOSS IQ - ESTILO LUXE (EFECTOS + FUNCIONALIDAD)
    ========================================================================== */

        /* NOTE: .btn-close rule is defined inline in index.html, removed here to avoid duplication */
        :root {
    /* Identidad Gloss IQ */
    --gloss-black: #080808;
    --gloss-night: #101214;
    --gloss-white: #FFFFFF;
    --gloss-gold: #D4AF37;
    --gold: var(--gloss-gold);
    --accent: #C99A2E;
    --gloss-charcoal: #15181D;
    --gloss-ink: #1F2630;
    --gloss-ivory: #F4EFE6;
    --gloss-bronze: #8A6932;
    --gloss-warm-gray: #7B7468;
    
    /* Textos */
    --text-main: #111111;
    --text-muted: #666666;

    /* Colores Funcionales (Elegantes) */
    --app-success: #2E8B57; /* Verde trabajando */
    --app-danger: #B03A2E;  /* Rojo salir/borrar */
    --app-warning: #D68910; /* Naranja pausas */

    /* Capas z-index (orden ascendente; ver tests/z-index.layers.test.mjs) */
    --z-local: 1;
    --z-sticky: 10;
    --z-header-float: 20;
    --z-search: 100;
    --z-sticky-tabs: 100;
    --z-header-mobile: 90;
    --z-tabs-mobile: 80;
    --z-below-modal: 9999;
    --z-modal: 10000;
    --z-modal-raised: 10005;
    --z-modal-profile: 10040;
    --z-dialog: 12050;
    --z-ceo: 12060;
    --z-floating-badges: 99998;
    --z-legacy-overlay: 99999;
    --z-fullscreen: 999999;
    --z-electron-chrome: 5000000;
    --z-update-max: 2147483647;
}
/* --- 1. FONDO ANIMADO (RECUPERADO) --- */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-main);
    padding: 20px;
    min-height: 100vh;
    
    /* EL GRADIENTE MOVIL */
    background: linear-gradient(-45deg, #080808, #121212, #1a1d22, #10141b);
    background-size: 400% 400%;
    animation: gradientMove 15s ease 2; /* 2 ciclos al cargar, luego estático */
}

.app-container { max-width: 600px; margin: 0 auto; position: relative; z-index: var(--z-sticky); }

/* --- 2. HEADER Y LOGO (CORREGIDO PARA NO TAPAR BOTONES) --- */
.app-header { 
    text-align: center; 
    margin-bottom: 30px; 
    position: relative;
    padding-top: 10px;
}

.app-logo-img { 
    height: 120px; /* Tamaño seguro */
    width: auto; 
    filter: drop-shadow(0 4px 6px rgba(102, 92, 92, 0.3));
    transition: transform 0.5s;
    pointer-events: none; /* ¡ESTO ES CLAVE! El clic atraviesa el logo */
}
.app-logo-img:hover { transform: scale(1.05); }

/* BOTÓN DARK MODE FLOTANTE (ACOMPAÑA EL SCROLL) */
#btn-theme-toggle {
    position: absolute;
    top: 92px;
    right: 0;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px);
    border: 2px solid #d9cfbf;
    color: #2a2f36; font-size: 1.5rem; cursor: pointer; z-index: var(--z-header-float);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#btn-theme-toggle:hover { background: #17191D; color: #f3e2c6; transform: scale(1.08); }
body.dark-mode #btn-theme-toggle { background: #333; border-color: #555; color: #f1c40f; }

#indicador-conexion {
    position: absolute !important;
    left: 0 !important;
    top: 104px !important;
    bottom: auto !important;
    z-index: var(--z-header-float);
}

.card, .auth-card, .premium-card, .client-ficha {
    background-color: #FFFFFF !important; /* Blanco puro y sólido */
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(18, 16, 12, 0.08);
    padding: 20px; 
    margin-bottom: 20px;
    border: 1px solid #e9dfcf;
}

/* --- 4. BOTONES QUE REBOTAN (RECUPERADOS) --- */
.btn {
    padding: 12px 20px; border-radius: 12px; font-weight: bold; border: none; width: 100%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; /* Efecto rebote */
}
.btn:hover { transform: translateY(-4px) scale(1.05) !important; box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important; filter: brightness(1.1); }
.btn:active { transform: scale(0.95) !important; }

.btn-primary { background: linear-gradient(135deg, var(--gloss-charcoal), #222833); color: #f8f0df; box-shadow: 0 5px 12px rgba(20, 20, 20, 0.28); }
.btn-secondary { background: #fff; color: #2a2f36; border: 1px solid #d9cfbf; }

.icon-btn {
    width: 45px !important; height: 45px !important; border-radius: 50%;
    background: white; color: var(--text-main); border: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.icon-btn:hover { transform: translateY(-4px) scale(1.1) !important; }
.icon-btn:active { transform: scale(0.9); }

/* --- 5. BUSCADOR (SOLUCIÓN FUNCIONAL) --- */
.search-box { 
    background: white; padding: 10px; border-radius: 50px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
    position: relative; z-index: var(--z-search); /* Siempre encima */
    border: 1px solid #e7dccb;
}
#search-input { border: none; background: transparent; padding: 5px; flex: 1; outline: none; }

/* --- 6. FIDELIZACIÓN --- */
.loyalty-card { background: #111; color: white; border-radius: 16px; padding: 20px; margin-bottom: 20px; position: relative; overflow: hidden; }
.loyalty-header { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; padding-right: 50px; }
.loyalty-header h4 { color: var(--gold); margin: 0; font-size: 1.1rem; }
.loyalty-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; justify-items: center; margin-right: 50px; }
.stamp { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: #777; font-size: 0.75rem; font-weight: bold;}
.stamp.active { background: var(--gold); color: black; box-shadow: 0 0 8px var(--gold); }
.stamp.gift-stamp { border: 2px solid rgba(212,175,55,0.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.stamp.gift-stamp.active { border-color: var(--gold); box-shadow: 0 0 12px var(--gold), inset 0 0 0 1px rgba(0,0,0,0.08); animation: loyaltyGiftPulse 1.4s ease-in-out infinite; }

@keyframes loyaltyGiftPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px var(--gold), inset 0 0 0 1px rgba(0,0,0,0.08); }
    50% { transform: scale(1.08); box-shadow: 0 0 16px var(--gold), inset 0 0 0 1px rgba(0,0,0,0.08); }
    100% { transform: scale(1); box-shadow: 0 0 10px var(--gold), inset 0 0 0 1px rgba(0,0,0,0.08); }
}
.btn-add-stamp { position: absolute; bottom: 15px; right: 15px; width: 50px; height: 50px; border-radius: 50%; background: white; color: black; border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.5); z-index: var(--z-sticky); }

/* --- 7. EXTRAS --- */
#dashboard-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.tabs { display: flex; gap: 10px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.tab-btn { background: none; border: none; padding: 8px 15px; cursor: pointer; color: #888; font-weight: 600; }
.tab-btn.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ccc; background-color: #fafafa; border-radius: 8px; font-size: 1rem; color: var(--text-main); }

/* --- 8. SEGURIDAD Y MODALES --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: var(--z-modal) !important; display: flex; justify-content: center; align-items: center; }

.modal-close-corner {
    position: absolute;
    top: 10px;
    right: 10px;
}

.modal-btn-flex-1 { flex: 1; }
.modal-btn-flex-2 { flex: 2; }

.modal-quimico-content {
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.modal-quimico-title {
    color: #c0392b;
    margin-top: 0;
}

.modal-quimico-copy {
    font-size: 0.85rem;
    color: #444;
    text-align: justify;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.modal-quimico-canvas {
    border: 2px dashed #e74c3c;
    background: #fffcfc;
    margin: 0 auto;
    display: block;
    border-radius: 10px;
}

.modal-quimico-img {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 10px;
}

.modal-quimico-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.modal-quimico-btn-accept {
    background: #e74c3c;
    color: #fff;
}

.modal-firma-canvas {
    border: 1px dashed #ccc;
    background: #fff;
    margin: 15px auto;
    display: block;
}

.modal-firma-img {
    width: 100%;
}

.modal-firma-actions {
    display: flex;
    gap: 10px;
}

.modal-lopd-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lopd-title {
    color: #c0392b;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-lopd-copy {
    font-size: 0.85rem;
    color: #444;
    text-align: justify;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    line-height: 1.45;
}

.modal-nfc-content {
    text-align: center;
    width: 400px;
}

.modal-nfc-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.modal-nfc-form {
    text-align: left;
    margin-top: 15px;
}

.modal-nfc-label {
    font-weight: bold;
    font-size: 0.8rem;
}

.modal-nfc-label-gap {
    margin-top: 10px;
}

.modal-nfc-input-up {
    text-transform: uppercase;
}

.modal-nfc-input-card {
    background: #e3f2fd;
    border-color: #2196f3;
    font-weight: bold;
}

.modal-nfc-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.panel-cumples-month {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--primary);
}

.panel-cumples-list {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.panel-cumples-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-team-content {
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.admin-team-title {
    margin: 0;
    color: #333;
}

.admin-team-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.admin-team-btn {
    color: #fff;
    border: none;
    padding: 12px;
    font-weight: bold;
}

.admin-team-btn-blue { background: #2980b9; }
.admin-team-btn-red { background: #c0392b; }
.admin-team-btn-purple { background: #8e44ad; }
.admin-team-btn-orange { background: #d35400; }
.admin-team-btn-ink { background: #2c3e50; }
.admin-team-btn-productividad {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.35);
}

.admin-team-btn-semaforo {
    background: linear-gradient(135deg, #16a085, #2ecc71);
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.3);
}

.admin-team-btn-span2 {
    grid-column: span 2;
}

.admin-team-btn-top-gap {
    margin-top: 5px;
}

.admin-team-btn-export {
    border-color: #27ae60;
    color: #27ae60;
}

.admin-team-live-title {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-team-live-icon {
    color: red;
}

.admin-team-list-container {
    background: #f4f6f8;
    padding: 10px;
    border-radius: 12px;
    min-height: 100px;
}

.ficha-apertura-traza {
    align-items: center;
    gap: 8px;
    margin: -10px 0 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f4c2a, #1a7a42);
    border: 1.5px solid #2ecc71;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 3px 10px rgba(46,204,113,0.25);
    letter-spacing: 0.3px;
}
.ficha-apertura-traza .visor-nombre {
    font-size: 1rem;
    font-weight: 900;
    color: #a7f3d0;
    text-transform: uppercase;
}
.ficha-apertura-traza .visor-cliente {
    font-size: 0.88rem;
    color: #d1fae5;
    font-weight: 700;
}
.fisor-pulse {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 0 0 rgba(46,204,113,0.7);
    animation: visor-ping 1.4s infinite;
    flex-shrink: 0;
}

body.modo-cliente .ficha-apertura-traza.is-client-label {
    background: linear-gradient(135deg, #0b3b66, #1d4ed8);
    border-color: #60a5fa;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
    color: #dbeafe;
    align-items: flex-start;
}

body.modo-cliente .ficha-apertura-traza.is-client-label .visor-nombre {
    color: #ffffff;
    display: block;
    margin-bottom: 2px;
}

body.modo-cliente .ficha-apertura-traza.is-client-label .visor-cliente {
    color: #bfdbfe;
    font-size: 0.8rem;
}

body.modo-cliente .ficha-apertura-traza.is-client-label .fisor-pulse {
    display: none;
}
@keyframes visor-ping {
    0%   { box-shadow: 0 0 0 0 rgba(46,204,113,0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

.modal-detalle-content {
    width: 450px;
    max-width: 95%;
}

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

.modal-detalle-title {
    margin: 0;
    color: #333;
}

.modal-detalle-resumen {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.modal-detalle-resumen-item {
    text-align: center;
}

.modal-detalle-resumen-label {
    font-size: 0.7rem;
    color: #666;
}

.modal-detalle-resumen-value {
    font-weight: bold;
}

.modal-detalle-resumen-descanso {
    color: #e67e22;
}

.modal-detalle-resumen-trabajado {
    color: #2ecc71;
}

.modal-detalle-subtitle {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #999;
}

.modal-detalle-list {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.vip-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: var(--z-fullscreen);
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.vip-screen-brand {
    color: #d4af37;
    margin-bottom: 5px;
    letter-spacing: 3px;
    text-align: center;
}

.vip-screen-subtitle {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.vip-card {
    background: linear-gradient(135deg, #2b2b2b 0%, #111 100%);
    width: 85%;
    max-width: 350px;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    border: 1px solid #333;
    text-align: center;
}

.vip-name {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
}

.vip-access {
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.vip-qr-wrap {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 20px;
}

.vip-qr-img {
    width: 180px;
    height: 180px;
    display: block;
}

.vip-fidelity-box {
    background: #000;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #222;
}

.vip-fidelity-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.vip-fidelity-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #d4af37;
}

.vip-screen-note {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #666;
}


.widget-bubble {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #f2ede4);
    border: 2px solid #d8c9b3;
    position: relative;
    box-shadow: 0 10px 18px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.widget-sofa {
    position: fixed;
    bottom: calc(76px + 1cm);
    left: 12px;
    z-index: var(--z-below-modal);
    width: auto;
    min-width: 56px;
    height: auto;
    padding: 8px 10px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget-sofa:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.2);
}

.widget-sofa-icon {
    font-size: 1.45rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5b4630;
    font-weight: 900;
}

.widget-sofa-label {
    display: block;
    margin-top: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    color: #5b4630;
    white-space: nowrap;
}

.widget-sofa-counter {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    position: absolute;
    top: -3px;
    right: -3px;
}

#widget-sala-espera {
    position: fixed;
    bottom: 68px;
    left: 12px;
    z-index: var(--z-below-modal);
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}

.widget-espera-bubble {
    pointer-events: auto;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 2px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 6px 14px rgba(0,0,0,0.16);
}

.widget-espera-bubble i {
    font-size: 1.3rem;
    color: #555;
}

.widget-espera-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #95a5a6;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.widget-espera-panel {
    pointer-events: auto;
    width: min(290px, calc(100vw - 24px));
    max-height: 65vh;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.18);
    overflow: hidden;
}

.widget-espera-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.widget-espera-title {
    font-weight: 800;
    font-size: 0.8rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-espera-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.widget-espera-tool {
    background: transparent;
    border: none;
    color: #7f8c8d;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-espera-tool--danger {
    color: #e74c3c;
}

.widget-espera-input {
    padding: 8px;
    border-bottom: 1px dashed #eee;
    display: flex;
    gap: 6px;
}

.widget-espera-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.widget-espera-input button {
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2c3e50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lista-espera {
    max-height: 210px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Reglas de Visibilidad */
body.modo-cliente .search-box, 
body.modo-cliente #dashboard-panel,
body.modo-cliente #btn-gestionar-equipo,
body.modo-cliente #btn-fichaje,
body.modo-cliente #btn-nuevo-cliente,
body.modo-cliente #add-sello-button,
body.modo-cliente #guardar-ficha,
body.modo-cliente #btn-borrar-ficha,
body.modo-cliente #panel-registro-rapido,
body.modo-cliente #btn-editar-receta,
body.modo-cliente #btn-guardar-receta { display: none !important; }

body.modo-personal #search-box, body.modo-personal #dashboard-panel { display: flex !important; }
body.modo-personal #dashboard-panel { display: grid !important; }

/* --- 9. SPLASH SCREEN ANIMADO (RECUPERADO) --- */
#splash-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(-45deg, #0b0f1a, #1f2937, #1e3a5f, #111827);
    background-size: 400% 400%; animation: gradientMove 15s ease infinite;
    z-index: var(--z-fullscreen); display: flex; justify-content: center; align-items: center; transition: opacity 1s ease;
}
#splash-screen.oculto { opacity: 0; pointer-events: none !important; }
.splash-logo-animada { 
    width: 280px; 
    animation: viajeDesdeLejos 4s cubic-bezier(0.22, 1, 0.36, 1) forwards; 
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)); 
}
@keyframes viajeDesdeLejos {
    0% { transform: scale(0) translateZ(-500px); opacity: 0; }
    10% { opacity: 1; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1) translateZ(0); }
}

/* --- 10. MODO OSCURO --- */
/* --- 10. MODO OSCURO — COMPLETO ─────────────────────────────────────── */
body.dark-mode {
    background: linear-gradient(-45deg, #000000, #0d1117, #141E30, #1a1f2e);
    background-size: 400% 400%;
    animation: gradientMove 15s ease 2;
    color: #e2e8f0;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
}

/* ── Superficies principales (clases CSS) ─────────────────────────────── */
body.dark-mode .card,
body.dark-mode .auth-card,
body.dark-mode .premium-card,
body.dark-mode .client-ficha,
body.dark-mode .modal-content {
    background: #1e2430 !important;
    border-color: #3a4455 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.5) !important;
}

/* ── Contenedores de zona (inline style white) ────────────────────────── */
body.dark-mode #zona-fichaje-container,
body.dark-mode #zona-agenda-container > div,
body.dark-mode #zona-salon-container > div {
    background: #1e2430 !important;
    color: #e2e8f0 !important;
    border-color: #3a4455 !important;
}

/* ── Panel sala: tarjeta de empleado FUERA (fondo claro) ──────────────── */
body.dark-mode #panel-equipo-sala [style*="background:#f8fafc"],
body.dark-mode #panel-equipo-sala [style*="background: #f8fafc"] {
    background: #252d3b !important;
    color: #94a3b8 !important;
}
body.dark-mode #panel-equipo-sala [style*="background:#fff"],
body.dark-mode #panel-equipo-sala [style*="background: #fff"],
body.dark-mode #panel-equipo-sala [style*="background: white"] {
    background: #1e2430 !important;
    color: #e2e8f0 !important;
}

/* ── Tarjetas empleado en Centro de Mando ─────────────────────────────── */
body.dark-mode #team-list-container > div {
    background: #1e2430 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
body.dark-mode #team-list-container > div > div { color: #e2e8f0 !important; }
body.dark-mode #team-list-container > div > div > div { color: #e2e8f0 !important; }
body.dark-mode #team-list-container button[style*="background: white"],
body.dark-mode #team-list-container button[style*="background:white"] {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border-color: #4a5568 !important;
}
body.dark-mode #team-list-container div[style*="text-align: center; background: white"] {
    background: #252d3b !important;
    color: #e2e8f0 !important;
    border-color: #3a4455 !important;
}

/* ── Inputs / Selects / Textareas ─────────────────────────────────────── */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #718096 !important; }
body.dark-mode .modal-nfc-input-card {
    background: #1a3a5c !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* ── Buscador ─────────────────────────────────────────────────────────── */
body.dark-mode .search-box {
    background: #1e2430 !important;
    border-color: #3a4455 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}
body.dark-mode #search-input { color: #e2e8f0 !important; }

/* ── Botones ──────────────────────────────────────────────────────────── */
body.dark-mode .btn-secondary {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border-color: #4a5568 !important;
}
body.dark-mode .icon-btn {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 1px solid #4a5568 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
body.dark-mode .btn-fast {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border-color: #4a5568 !important;
}
body.dark-mode .btn-select-pill {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #94a3b8 !important;
}
body.dark-mode .btn-select-pill.active-emp {
    background: #1a3a5c !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
body.dark-mode .tabs { border-bottom-color: #3a4455 !important; }
body.dark-mode .tab-btn { color: #64748b !important; }
body.dark-mode .tab-btn.active {
    color: var(--cebado-gold) !important;
    border-bottom-color: var(--cebado-gold) !important;
}
body.dark-mode #main-tabs {
    background: #12161f !important;
    border-color: #3a4455 !important;
}

/* ── Dashboard pills ──────────────────────────────────────────────────── */
body.dark-mode #dashboard-panel > * {
    background: #1e2430 !important;
    border-color: #3a4455 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* ── Admin / Centro de Mando ──────────────────────────────────────────── */
body.dark-mode .admin-team-content {
    background: #1e2430 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .admin-team-header { border-bottom-color: #3a4455 !important; }
body.dark-mode .admin-team-title { color: #e2e8f0 !important; }
body.dark-mode .admin-team-live-title { color: #94a3b8 !important; }
body.dark-mode .admin-team-list-container {
    background: #252d3b !important;
    color: #e2e8f0 !important;
}

/* ── Modal detalle empleado ───────────────────────────────────────────── */
body.dark-mode .modal-detalle-header { border-bottom-color: #3a4455 !important; }
body.dark-mode .modal-detalle-title { color: #e2e8f0 !important; }
body.dark-mode .modal-detalle-resumen {
    background: #252d3b !important;
    color: #e2e8f0 !important;
}
body.dark-mode .modal-detalle-resumen-label { color: #94a3b8 !important; }
body.dark-mode .modal-detalle-resumen-value { color: #e2e8f0 !important; }
body.dark-mode .modal-detalle-subtitle { color: #64748b !important; }
body.dark-mode #lista-movimientos-hoy li {
    border-bottom-color: #3a4455 !important;
    color: #e2e8f0 !important;
}

/* ── Modales firma / quimico / LOPD / NFC ────────────────────────────── */
body.dark-mode .modal-quimico-copy,
body.dark-mode .modal-lopd-copy {
    background: #252d3b !important;
    border-color: #3a4455 !important;
    color: #cbd5e1 !important;
}
body.dark-mode .modal-quimico-title,
body.dark-mode .modal-lopd-title { color: #fc8181 !important; }
body.dark-mode .modal-quimico-canvas,
body.dark-mode .modal-firma-canvas {
    background: #1a1f2e !important;
    border-color: #e74c3c !important;
}
body.dark-mode .modal-nfc-subtitle { color: #94a3b8 !important; }
body.dark-mode .modal-nfc-label { color: #cbd5e1 !important; }
body.dark-mode .panel-cumples-close { color: #e2e8f0 !important; }
body.dark-mode .panel-cumples-month { color: #e2e8f0 !important; }

/* ── Widget sala espera ───────────────────────────────────────────────── */
body.dark-mode .widget-espera-panel {
    background: #1e2430 !important;
    border-color: #3a4455 !important;
    box-shadow: 0 12px 26px rgba(0,0,0,0.5) !important;
}
body.dark-mode .widget-espera-head {
    background: #252d3b !important;
    border-bottom-color: #3a4455 !important;
}
body.dark-mode .widget-espera-title { color: #e2e8f0 !important; }
body.dark-mode .widget-espera-tool { color: #94a3b8 !important; }
body.dark-mode .widget-espera-input { border-bottom-color: #3a4455 !important; }
body.dark-mode .widget-espera-input input {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .widget-bubble {
    background: radial-gradient(circle at 30% 30%, #2d3748, #1e2430) !important;
    border-color: #4a5568 !important;
}
body.dark-mode .widget-espera-bubble {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}
body.dark-mode .widget-espera-bubble i { color: #94a3b8 !important; }
body.dark-mode .widget-sofa-icon { color: #94a3b8 !important; }

/* ── Textos genéricos ─────────────────────────────────────────────────── */
body.dark-mode p,
body.dark-mode label,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #e2e8f0; }
body.dark-mode small,
body.dark-mode .text-muted { color: #94a3b8 !important; }

/* ── Scrollbars ───────────────────────────────────────────────────────── */
body.dark-mode ::-webkit-scrollbar { width: 6px; height: 6px; }
body.dark-mode ::-webkit-scrollbar-track { background: #1e2430; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #4a5568; border-radius: 3px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Botones Google/Apple y Toast */
.btn-google-official { background: white !important; color: #3c4043 !important; border: 1px solid #dadce0 !important; display: flex !important; align-items: center; justify-content: center; gap: 12px; padding: 10px 15px !important; }
.btn-apple-official { background: black !important; color: white !important; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 15px !important; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: var(--z-below-modal); display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 10px; color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease-out forwards; }
.toast.success { background-color: #27ae60; } .toast.error { background-color: #e74c3c; } .toast.info { background-color: #3498db; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =========================================
   ✨ INTERACCIÓN Y MOVIMIENTO (CLIENTES) - ¡NUEVO EFECTO!
   ========================================= */

/* Estilo base del item */
.client-item {
    background: rgba(255, 255, 255, 0.95); /* Fondo más sólido */
    
    /* --- CAMBIO 1: BORDE VISIBLE --- */
    border: 2px solid #e0e0e0; /* Un borde gris claro pero definido */
    
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    
    /* La magia del movimiento suave */
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    position: relative;
}

/* EFECTO AL PASAR EL RATÓN (HOVER) */
.client-item:hover {
    transform: translateY(-3px) scale(1.01); /* Sube un poquito */
    
    /* --- CAMBIO 2: BORDE AZUL AL PASAR --- */
    border-color: var(--accent); /* Se ilumina el borde con el color principal */
    background: white;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    z-index: var(--z-sticky);
}

/* EFECTO AL TOCAR (ACTIVE) - ¡EL CHISPAZO! */
.client-item:active {
    transform: scale(0.97); /* Se hunde con ganas */
    
    /* --- CAMBIO 3: RESALTE TOTAL AL CLICAR --- */
    border-color: var(--accent) !important; /* Borde azul fuerte */
    background-color: #eef7fc !important;   /* Fondo azulito muy claro */
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.4) !important; /* Sombra azulada brillante */
}

/* AJUSTE PARA MODO OSCURO */
/* AJUSTE PARA MODO OSCURO */
body.dark-mode .client-item {
    background: #1e2430 !important;
    border-color: #3a4455 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .client-item:hover,
body.dark-mode .client-item:active {
    border-color: var(--accent) !important;
    background: #252d3b !important;
}
/* =================================================
   🚑 PARCHE DE EMERGENCIA: ICONOS GIGANTES
   ================================================= */

/* 1. FORZAR TAMAÑO DIMINUTO DE LOS LOGOS */
.login-logo-icon {
    width: 20px !important;       /* Ancho fijo pequeño */
    height: 20px !important;      /* Alto fijo pequeño */
    min-width: 20px !important;   /* Que no se aplaste */
    max-width: 20px !important;   /* Que no crezca JAMÁS */
    object-fit: contain !important; /* Que se vea la imagen entera */
    margin-right: 10px !important;  /* Espacio con el texto */
    display: block !important;
}

/* 2. ALINEAR EL CONTENIDO DEL BOTÓN */
.btn-google-official, 
.btn-apple-official {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important; /* El espacio lo da el margen del icono */
    padding: 10px 15px !important;
    overflow: hidden !important; /* Si algo intenta salirse, lo corta */
}
/* =========================================================
   🛡️ BLINDAJE DE SEGURIDAD PARA CLIENTES (COPIAR AL FINAL)
   ========================================================= */

/* 1. OCULTAR BOTONES DE ADMINISTRACIÓN EN PANELES */
body.modo-cliente #btn-descargar-horario,       /* Botón Excel en Equipo */
body.modo-cliente #btn-admin-registrar-tarjeta, /* Botón Registrar en Equipo */
body.modo-cliente .btn-delete-venta,            /* Papelera en Historial */
body.modo-cliente .ri-mic-line,                 /* Icono Micrófono */
body.modo-cliente #btn-limpiar-firma,           /* Botón Borrar Firma (Canvas) */
body.modo-cliente #btn-borrar-firma-existente { /* Botón Borrar Firma guardada */
    display: none !important;
}

/* 2. BLOQUEAR EDICIÓN DE DATOS (SOLO LECTURA) */
/* Esto hace que no puedan escribir ni clicar en los inputs */
body.modo-cliente #tab-datos input:not(#ficha-movil-input):not(#ficha-telefono-input):not(#ficha-instagram-input):not(#ficha-nacimiento-input),
body.modo-cliente #container-notas-tecnicas,    /* Bloque notas entero */
body.modo-cliente #ficha-notas-input {
    pointer-events: none !important; /* No se puede clicar */
    background: transparent !important; /* Se ve limpio */
    border: none !important;
    opacity: 0.8;
}

/* Excepción: Dejamos que el botón de WhatsApp e Instagram funcionen */
body.modo-cliente #btn-whatsapp,
body.modo-cliente #btn-ir-instagram {
    pointer-events: auto !important;
}

body.modo-cliente #container-notas-tecnicas,
body.modo-cliente #btn-whatsapp,
body.modo-cliente #widget-sofa,
body.modo-cliente #widget-sala-espera {
    display: none !important;
}

/* 3. LOPD (SEGURIDAD) */
/* Si es cliente, ocultamos el botón de firmar si ya está firmado */
body.modo-cliente .lopd-firmado-btn {
    display: none !important;
}
/* =========================================================
   🛡️ PERMISOS DE CLIENTE: INSTAGRAM Y FOTOS
   ========================================================= */

/* 1. Bloqueamos las notas pero PERMITIMOS Instagram */
body.modo-cliente #ficha-notas-input {
    pointer-events: none !important;
    background: rgba(0,0,0,0.02) !important;
}

body.modo-cliente #ficha-instagram-input,
body.modo-cliente #ficha-movil-input,
body.modo-cliente #ficha-telefono-input,
body.modo-cliente #ficha-nacimiento-input {
    pointer-events: auto !important;
    background: #ffffff !important;
    border: 2px solid var(--accent) !important;
    opacity: 1 !important;
}

body.modo-cliente #btn-guardar-datos-cliente {
    display: flex !important;
}

body.modo-cliente #ficha-telefono-input,
body.modo-cliente #ficha-nacimiento-input {
    pointer-events: auto !important;
    background: #ffffff !important;
    border: 2px solid var(--accent) !important;
}

/* 2. OCULTAR PAPELERA SOLO EN VENTAS */
body.modo-cliente .btn-delete-venta {
    display: none !important;
}

/* 3. PERMITIR BOTÓN DE SUBIR FOTO */
body.modo-cliente #btn-upload-look {
    display: flex !important; /* Aseguramos que el cliente vea el botón de subir */
}

/* 4. PERMITIR PAPELERA EN HAIR JOURNEY PARA CLIENTE */
body.modo-cliente .btn-delete-foto {
    display: flex !important;
}

/* Compatibilidad con reglas previas */
body.modo-cliente .btn-delete-foto,
body.modo-cliente .btn-delete-venta {
    pointer-events: auto;
}
/* =========================================
   🚀 BOTONES RÁPIDOS VIVOS (HISTORIAL)
   ========================================= */

/* Botones de Registro Rápido (Corte, Barba, etc) */
.btn-fast {
    background: white;
    border: 2px solid #eee;
    padding: 15px 10px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Efectos al pasar el ratón (Hover) */
.btn-fast:hover {
    transform: translateY(-5px) scale(1.05) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    border-color: var(--accent);
    background-color: #f8fbfe;
}

/* Efecto al pulsar (Active) */
.btn-fast:active {
    transform: scale(0.95) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Colores de acento para los bordes de los botones rápidos */
.btn-fast:nth-child(1):hover { border-color: #3498db; color: #3498db; } /* Corte */
.btn-fast:nth-child(2):hover { border-color: #e67e22; color: #e67e22; } /* Barba */
.btn-fast:nth-child(3):hover { border-color: #9b59b6; color: #9b59b6; } /* Peinado */
.btn-fast:nth-child(4):hover { border-color: #27ae60; color: #27ae60; } /* Producto */

/* Botón "Añadir" Manual */
#tab-historial .btn-primary {
    border-radius: 10px;
    padding: 10px 20px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* Estilo para resaltar que es el Instagram de la Pelu */
#btn-ir-instagram {
    position: relative;
}

#btn-ir-instagram::after {
    content: '@cebadogranvia_2';
    position: absolute;
    bottom: -15px;
    font-size: 0.6rem;
    color: var(--accent);
    font-weight: bold;
}
.modal-content {
    /* ... tus estilos actuales ... */
    background-color: #fefefe;
    margin: 5% auto; /* 5% desde arriba en lugar de 15% para ganar espacio */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; 
    max-width: 500px; /* Ancho máximo */
    border-radius: 20px;
    
    /* 🔥 ESTAS SON LAS LÍNEAS MÁGICAS PARA ARREGLARLO: */
    max-height: 90vh;       /* Altura máxima: 90% de la altura de la pantalla */
    overflow-y: auto;       /* Si el contenido se pasa, pon barra de scroll vertical */
    position: relative;     /* Para asegurar posición */
}
/* Estilos para el Modal de Decisión de Fichaje */
.fichaje-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}
.btn-fichaje-opt {
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.btn-fichaje-opt:active { transform: scale(0.95); }
.btn-fichaje-opt i { font-size: 2rem; }

/* Colores específicos */
.opt-salida { background: linear-gradient(135deg, #ff9966, #ff5e62); grid-column: span 2; } /* Ocupa todo el ancho */
.opt-pausa { background: linear-gradient(135deg, #56ab2f, #a8e063); }
.opt-comida { background: linear-gradient(135deg, #4568dc, #b06ab3); }
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
/* --- PANTALLA DE CARGA DE ACTUALIZACIÓN --- */
.update-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 18, 0.95); /* Fondo oscuro casi opaco */
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--z-update-max);
  transition: opacity 0.3s ease;
  font-family: sans-serif;
}

/* Clase para ocultarlo */
.update-overlay.hidden {
  display: none;
}

/* Texto */
.update-overlay h2 {
  margin-top: 20px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #00E676; /* Verde moderno */
}

.update-overlay p {
  color: #aaa;
  margin-top: 5px;
  font-size: 0.9rem;
}

/* Spinner (Círculo giratorio) */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #00E676;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Remix Icon: el CSS del CDN no siempre define .ri-spin */
i.ri-spin,
.ri-spin {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.team-member-card-premium {
    padding: 15px;
    border-radius: 18px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.avatar-circle {
    width: 45px; 
    height: 45px; 
    background: #333; 
    color: white; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 1.2rem;
}

.badge-status {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.trabajando { background: #2ecc71; color: white; }
.descanso { background: #f39c12; color: white; }
.fuera { background: #95a5a6; color: white; }

/* =========================================
   🏝️ BOTÓN DE VACACIONES (MEJORADO V16)
   ========================================= */

.btn-mini {
    background: white;
    border: 1.5px solid #eee;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #555;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-mini:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    background: #fff;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-mini:active {
    transform: scale(0.95);
}

/* Estilo cuando el empleado ya ESTÁ de vacaciones (Botón Volver) */
/* Buscamos el texto "Volver" o el emoji de palmera dentro del botón */
.team-member-card-premium[style*="background: rgba(0, 0, 0, 0.03)"] .btn-mini,
.team-member-card-premium .btn-mini:contains("Volver") {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

/* --- AJUSTE DE LA TARJETA CUANDO ESTÁ EN VACACIONES --- */
.team-member-card-premium {
    position: relative;
    overflow: hidden;
}

/* Si el avatar está gris, bajamos la opacidad de la tarjeta para indicar inactividad */
.avatar-circle[style*="background: rgb(187, 187, 187)"] + div {
    opacity: 0.6;
}

/* Badge de Vacaciones (Más llamativo) */
.badge-status.fuera {
    background: #607d8b; /* Gris azulado legal */
    color: white;
    font-weight: 900;
}
/* Botón Oficial de Microsoft */
.btn-microsoft-official {
    background: white !important;
    color: #5e5e5e !important;
    border: 1px solid #8c8c8c !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px !important;
    font-family: 'Segoe UI', sans-serif; /* Tipografía oficial de Microsoft */
}

/* Ajuste para los iconos de login */
.login-logo-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
/* =========================================
   📡 MONITOR EN VIVO (ESTILO JEFE)
   ========================================= */

/* Animación de pulso para estados activos */
@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); }
    70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.live-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Colores de estado */
.status-working {
    background-color: #2ecc71; /* Verde */
    box-shadow: 0 0 0 rgba(46, 204, 113, 0.4);
    animation: pulse-live 2s infinite;
}

.status-pause {
    background-color: #f39c12; /* Naranja (Café/Cigarro) */
    box-shadow: 0 0 0 rgba(243, 156, 18, 0.4);
    animation: pulse-live 2s infinite;
}

.status-food {
    background-color: #9b59b6; /* Morado (Comida) */
    box-shadow: 0 0 0 rgba(155, 89, 182, 0.4);
    animation: pulse-live 2s infinite;
}

.status-offline {
    background-color: #95a5a6; /* Gris (Fuera) */
    opacity: 0.5;
}

/* Tarjeta de empleado mejorada */
.monitor-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    border-left: 5px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

/* Bordes de color según estado */
.monitor-card.is-working { border-left-color: #2ecc71; }
.monitor-card.is-pause { border-left-color: #f39c12; background: #fffcf5; }
.monitor-card.is-food { border-left-color: #9b59b6; background: #fbf5fc; }
.monitor-card.is-off { border-left-color: #bdc3c7; opacity: 0.8; }

/* Animación suave para el botón de vacaciones */
.btn-mini {
    transition: all 0.3s ease;
}
.btn-mini:active {
    transform: scale(0.9);
}
/* Cuando está activo (de vacaciones), que pulse suavemente */
.team-member-card-premium[style*="background: rgba(0, 0, 0, 0.03)"] .btn-mini {
    animation: pulse-vacation 2s infinite;
}
@keyframes pulse-vacation {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}
/* Botones de selección de empleado */
.btn-emp-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px; /* Redonditos */
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Efecto al seleccionar */
.btn-emp-select.selected {
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(21, 101, 192, 0.3);
    transform: translateY(-2px);
}
/* =========================================
   📱 MODO MÓVIL Y ADAPTABILIDAD (GRILLAS)
   ========================================= */

/* Clases base para ordenador/tablet (Reemplazan tus style="") */
.grid-manias { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.grid-tecnicos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.grid-etiquetas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 15px; padding: 12px; background: linear-gradient(180deg, #f8f5ef, #f3efe8); border-radius: 10px; border: 2px dashed #d8ccba; }

/* Espacio base para la barra flotante inferior */
body { padding-bottom: 90px; }

/* REGLA PARA MÓVILES (Pantallas de menos de 768px) */
@media screen and (max-width: 768px) {
    /* 1. Manías y Faltas: De 2 columnas pasan a 1 vertical */
    .form-fila-50-50, .form-fila-40-60 {
        grid-template-columns: 1fr !important; /* Pone una cosa debajo de otra en móvil */
    }
    .grid-manias {
        grid-template-columns: 1fr !important;
    }

    /* 2. Botones de Tinte, Mechas, Tratamiento: De 3 pasan a 1 vertical para que no se aplasten */
    .grid-tecnicos {
        grid-template-columns: 1fr 1fr !important;
    }

    /* 3. Etiquetas VIP, Alergia, etc: De 4 en línea pasan a un cuadrado de 2x2 */
    .grid-etiquetas {
        grid-template-columns: 1fr 1fr !important;
    }

    #ficha-tabs .tab-btn.tab-btn-main {
        font-size: 0.84rem;
        padding: 9px 6px;
    }

    .btn-nota-inteligente {
        min-height: 42px;
        font-size: 0.8rem !important;
    }
}
/* =========================================
   📱 FORMULARIO DE DATOS (ORDEN Y AJUSTES)
   ========================================= */
.formulario-datos {
    display: flex;
    flex-direction: column;
    gap: 15px; 
    margin-top: 15px;
}

.formulario-datos label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-fila {
    display: grid;
    gap: 10px;
    width: 100%;
    align-items: end; /* Alinea los cajones por abajo por si un texto es más largo */
}

/* Distribución 50% - 50% */
.form-fila-50-50 {
    grid-template-columns: 1fr 1fr;
}

/* Distribución 40% - 60% (Instagram es el 60%) */
.form-fila-40-60 {
    grid-template-columns: 0.8fr 1.2fr; 
}

.form-fila-actions-vip {
    margin-bottom: 20px;
}

.btn-ficha-action {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    padding: 10px;
    margin: 0;
    flex: 1;
}

.btn-ficha-action-vip {
    background: #111;
    color: #d4af37;
    border: 1px solid #d4af37;
}

.btn-ficha-action-review {
    background: #fff;
    color: #b8945a;
    border: 2px solid #b8945a;
}

.input-with-action {
    display: flex;
    gap: 8px;
}

/* =========================================
   🧱 FASE 1 REFÁCTOR SEGURO (solo estructura)
   Estas clases duplican el estilo inline actual para preparar limpieza
   sin cambiar comportamiento visual.
   ========================================= */
.agenda-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.agenda-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-toolbar-title {
    margin: 0;
    color: #2c3e50;
    font-weight: 800;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-toolbar-title-icon {
    color: #b8945a;
}

.agenda-date-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    background: #fff;
    border: 1px solid #e7dccb;
    border-radius: 12px;
    padding: 6px;
}

.agenda-day-nav {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #d9cfbf;
    background: #fff;
    color: #2c3e50;
    padding: 0;
    font-size: 1.2rem;
    z-index: 3;
    flex-shrink: 0;
}

.agenda-date-icon {
    display: none;
}

.agenda-date-input {
    padding: 8px 10px;
    border: 2px solid #e7dccb;
    border-radius: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-width: 160px;
    text-align: center;
}

.agenda-date-input,
#ficha-nacimiento-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(180deg, #ffffff 0%, #fbf9f5 100%);
    border: 2px solid #e7dccb;
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.agenda-date-input:focus,
#ficha-nacimiento-input:focus {
    border-color: #c8a77a;
    box-shadow: 0 0 0 3px rgba(184, 148, 90, 0.18), 0 4px 10px rgba(44, 62, 80, 0.08);
    transform: translateY(-1px);
}

.agenda-date-input::-webkit-calendar-picker-indicator,
#ficha-nacimiento-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.75;
    padding: 2px;
    border-radius: 6px;
    transition: background-color .2s ease, opacity .2s ease;
}

.agenda-date-input:hover::-webkit-calendar-picker-indicator,
#ficha-nacimiento-input:hover::-webkit-calendar-picker-indicator {
    background-color: rgba(184, 148, 90, 0.16);
    opacity: 1;
}

.agenda-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-top: 5px;
}

.btn-agenda-action {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    font-weight: 700;
    padding: 8px 12px;
    font-size: 0.8rem;
    width: auto;
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.22);
}

.btn-agenda-sauron { background: linear-gradient(135deg, var(--gloss-ink), var(--gloss-charcoal)); color: #fff; }
.btn-agenda-caja { background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; }
.btn-agenda-caja-auto { background: linear-gradient(135deg, #1f7a8c, #155e75); color: #fff; }
.btn-agenda-migrar { background: linear-gradient(135deg, var(--gloss-bronze), var(--gloss-gold)); color: #fff; }
.btn-agenda-ia { background: linear-gradient(135deg, #3a2a1f, #4a3a2e); color: #fff; }

/* =========================================
   🧱 FASE 2 REFÁCTOR SEGURO (ficha)
   Duplicado semántico del estilo actual para
   preparar limpieza sin mover nada.
   ========================================= */
.ficha-tabs-shell {
    background: linear-gradient(180deg, #f6f2ea 0%, #f1ece3 100%);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 1px 0 rgba(255,255,255,0.7);
}

.ficha-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.ficha-card {
    background: #fff;
    border: 1px solid #ebe6dd;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(35, 32, 27, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ficha-card-vip { border-top: 4px solid var(--cebado-gold); }
.ficha-card-faltas { border-top: 4px solid #b03a2e; align-items: center; justify-content: center; }

.ficha-vip-label {
    color: #7a5a34;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ficha-vip-textarea {
    flex: 1;
    min-height: 80px;
    border: 1px solid #eadfcf;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    resize: none;
    background: #fbf8f2;
    outline: none;
    color: #2a2f36;
}

.ficha-faltas-label {
    color: #c0392b;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ficha-faltas-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8f1eb;
    padding: 10px 12px;
    border-radius: 50px;
}

.ficha-faltas-reset {
    margin-top: 10px;
    width: auto;
    min-width: 130px;
    border-radius: 10px;
    border: 1px solid #e5ddd0;
    background: #fff;
    color: #7a5a34;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 7px 10px;
}

.ficha-faltas-btn {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0;
}

.ficha-faltas-btn-minus {
    background: #fff;
    color: #e74c3c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ficha-faltas-btn-plus {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 6px rgba(231,76,60,0.3);
}

.ficha-faltas-input {
    width: 92px;
    min-width: 92px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    border: none;
    background: transparent;
    color: #c0392b;
    padding: 0 2px;
    outline: none;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.ficha-faltas-input::-webkit-outer-spin-button,
.ficha-faltas-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ficha-faltas-input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.alerta-fianza-badge {
    font-size: 0.7rem;
    color: #fff;
    font-weight: bold;
    margin-top: 10px;
    background: #c0392b;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ficha-consent-card {
    margin-top: 20px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ficha-consent-card-lopd {
    background: #f8f5ef;
    border: 1px solid #e8ddcc;
}

.ficha-consent-card-quimico {
    margin-top: 10px;
    background: #f8f1eb;
    border-left: 4px solid #9b3a30;
}

.ficha-consent-title {
    font-weight: bold;
}

.ficha-consent-title-quimico {
    color: #7a5a34;
}

.ficha-consent-status {
    font-weight: bold;
}

.ficha-consent-status-quimico {
    font-size: 0.8rem;
    color: #9b3a30;
}

.ficha-consent-btn {
    width: auto;
    padding: 8px 15px;
}

.ficha-consent-btn-quimico {
    background: linear-gradient(135deg, #7a5a34, #b8945a);
    color: #fff;
}

.ficha-antiguedad-card {
    background: #f8f5ef;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #e7dccb;
}

.ficha-antiguedad-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ficha-antiguedad-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ficha-antiguedad-icon {
    color: #7a5a34;
}

.ficha-antiguedad-text {
    font-size: 0.8rem;
    color: #7a5a34;
}

.ficha-antiguedad-badge {
    font-size: 0.75rem;
    font-weight: bold;
    background: #fff;
    color: #7a5a34;
    padding: 2px 8px;
    border-radius: 10px;
}

.hair-prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-receta-editar {
    border: 1px solid var(--accent);
    background: #ffffff;
    color: var(--accent);
    font-weight: 800;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all .15s ease;
}

.btn-receta-editar:hover {
    background: var(--accent);
    color: #fff;
}

.hair-prescription-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.hair-prescription-rutina {
    margin-top: 10px;
    background: rgba(0,0,0,0.05);
    padding: 10px;
    border-radius: 10px;
}

.btn-receta-guardar {
    width: 100%;
    margin-top: 10px;
}

.hair-journey-title {
    text-align: center;
    margin: 20px 0 10px;
    opacity: 0.5;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.hair-journey-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    min-height: 100px;
}

.hair-journey-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.hair-journey-actions-row {
    display: flex;
    gap: 10px;
}

.hair-journey-btn-half {
    flex: 1;
}

.hair-journey-btn-ig {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    border: none;
}

.hair-journey-btn-compare {
    width: 100%;
    background: #111;
    color: #d4af37;
    border: 1px solid #d4af37;
    font-weight: 900;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.is-hidden-file {
    display: none;
}

.ficha-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ficha-id-badge {
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-family: monospace;
}

.ficha-actions-wrap {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    background: linear-gradient(180deg, #f8f4ec 0%, #f2ece2 100%);
    border-radius: 12px;
    padding: 6px;
    border: 1px solid #e3d9ca;
    align-items: center;
}

.ficha-actions-divider {
    display: none;
}

.ficha-action-btn {
    width: 100%;
    box-shadow: none;
    border-radius: 10px;
    padding: 9px 10px;
    gap: 6px;
    min-height: 42px;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ficha-action-btn i {
    font-size: 1rem;
}

.ficha-action-privacy {
    background: #fff;
    color: #3b4f66;
    border-color: #dce6f2;
}

/* ── Help-chip bubble tooltip ─────────────────────────────────── */
@keyframes inflaGlobo {
    0%   { transform: scale(0) translateY(4px); opacity: 0; }
    65%  { transform: scale(1.08) translateY(-3px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.help-chip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
}

.tenant-help-chip {
    border: none;
    background: #e2e8f0;
    color: #334155;
    border-radius: 999px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.tenant-help-chip:hover,
.tenant-help-chip:focus {
    background: #334155;
    color: #fff;
    transform: scale(1.2);
    outline: none;
}

.help-chip-bubble {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.76rem;
    line-height: 1.4;
    padding: 8px 11px;
    border-radius: 10px;
    width: max-content;
    max-width: 240px;
    white-space: normal;
    pointer-events: none;
    z-index: var(--z-below-modal);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.help-chip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}
.help-chip-bubble-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    margin-bottom: 3px;
    color: #93c5fd;
}

.help-chip-wrap:hover .help-chip-bubble,
.help-chip-wrap:focus-within .help-chip-bubble {
    display: block;
    animation: inflaGlobo 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}


.ficha-action-sofa {
    background: #fff;
    color: #7a5a34;
    border-color: #e9dcc6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    gap: 5px;
}


.ficha-action-close {
    background: #fff;
    color: #9b3a30;
    border-color: #f2d6d2;
}

.ficha-action-caja {
    background: #fff;
    color: #1f7a46;
    border-color: #cdebd8;
    box-shadow: 0 2px 4px rgba(39,174,96,0.12);
}

.ficha-action-privacy.is-active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.notas-panel {
    margin-top: 25px;
}

.notas-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.notas-panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #23272e;
}

.notas-panel-title-icon {
    color: #7a5a34;
}

.notas-btn-dictado {
    background: #fff;
    color: #23272e;
    border: 1px solid #d9cfbf;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
}

.notas-atajos-tecnicos {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nota-tecnico-btn-fill {
    flex: 1;
}

.nota-tecnico-btn-clock {
    border-color: #c9b79f;
    background: #faf7f1;
}

.notas-etiquetas-wrap {
    margin-bottom: 20px;
}

.notas-input-wrap {
    position: relative;
    overflow: hidden;
}

.notas-textarea {
    height: 120px;
    width: 100%;
    border: none;
    padding: 5px 0 46px 0;
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
    transition: filter 0.3s;
    filter: none;
}

.notas-btn-guardar {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: auto;
    padding: 8px 12px;
}

@media screen and (max-width: 768px) {
    .notas-panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .notas-btn-dictado {
        width: 100%;
    }
}

/* =========================================
   ✨ ATAJOS INTELIGENTES + TABS FICHA
   ========================================= */
#ficha-tabs .tab-btn.tab-btn-main {
    border: 1px solid #ddd5c7;
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--cebado-warm-gray);
    background: rgba(255,255,255,0.75);
    transition: all 0.2s ease;
}

#ficha-tabs .tab-btn.tab-btn-main:hover {
    color: var(--cebado-ink);
    background: #ffffff;
}

#ficha-tabs .tab-btn.tab-btn-main.active {
    background: linear-gradient(135deg, var(--cebado-charcoal), #111) !important;
    color: #b8860b !important;
    border-color: #1b1f24 !important;
    box-shadow: 0 8px 18px #b8860b;
}

.btn-nota-inteligente {
    min-height: 46px;
    font-size: 0.84rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
}

.btn-tecnico-premium.btn-nota-inteligente {
    padding: 10px 6px !important;
    gap: 4px !important;
}

.btn-tecnico-premium.btn-nota-inteligente i {
    font-size: 1.25rem !important;
}

.btn-etiqueta-premium.btn-nota-inteligente {
    min-height: 44px;
    background: #fff;
    border: 1px solid #e5ddd0;
}

.btn-etiqueta-premium.btn-nota-inteligente:hover,
.btn-tecnico-premium.btn-nota-inteligente:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

/* Ajuste salvavidas para botones WhatsApp e Insta en móviles pequeños */
.btn-form-icon {
    padding: 0 12px !important;
    width: auto !important;
    height: 42px; /* Misma altura que el cajón de texto */
    flex-shrink: 0; /* Impide que la pantalla los aplaste */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-form-icon i {
    font-size: 1.2rem;
    margin: 0;
}

.btn-form-whatsapp {
    background: #25d366;
    color: #fff;
    border: 1px solid #1ea952;
    border-radius: 8px;
}

.btn-form-instagram {
    background: linear-gradient(140deg, #feda75 0%, #fa7e1e 24%, #d62976 52%, #962fbf 78%, #4f5bd5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
}
/* NOTE: 3D tactile button system is defined inline in index.html now; keeping only one copy to avoid duplication */

#modal-productividad .modal-content.productividad-modal {
    width: 740px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 18px;
    border: 1px solid #d5ebe8;
    background: linear-gradient(180deg, #fbfffe 0%, #effaf8 100%);
}

.productividad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d8ece8;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.productividad-title {
    margin: 0;
    color: #0f4f4a;
}

.productividad-sub {
    margin: 5px 0 0;
    color: #3a6d68;
    font-size: 0.82rem;
}

.productividad-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.productividad-card {
    background: #fff;
    border: 1px solid #deefec;
    border-left: 6px solid #86d3c8;
    border-radius: 14px;
    padding: 14px;
}

.productividad-card.is-top {
    border-left-color: #14b8a6;
    background: linear-gradient(90deg, #ffffff 0%, #f1fffb 100%);
}

.productividad-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.productividad-emp {
    font-size: 1.05rem;
    font-weight: 900;
    color: #1f2937;
}

.productividad-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
}

.productividad-pill {
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 8px;
    background: #e9f7f4;
    color: #22645d;
}

.productividad-stats {
    display: flex;
    gap: 10px;
}

.productividad-stat {
    min-width: 82px;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #d9ece9;
    background: #f8fffd;
}

.productividad-stat b {
    display: block;
    font-size: 1.25rem;
    color: #243447;
}

.productividad-stat span {
    font-size: 0.64rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #7f7669;
    font-weight: 800;
}

/* =========================================
   APP MOVIL GLOBAL (MODO APP WEB)
   ========================================= */
@media screen and (max-width: 768px) {
    body {
        padding: 10px 10px calc(86px + env(safe-area-inset-bottom));
        background-size: 220% 220%;
    }

    body .app-container {
        max-width: 100% !important;
        margin: 0 auto;
    }

    body .app-header {
        position: sticky;
        top: 0;
        z-index: var(--z-header-mobile);
        padding: 8px 8px 12px;
        margin: -2px -2px 12px;
        border-radius: 0 0 16px 16px;
        backdrop-filter: blur(10px);
        background: rgba(7, 8, 10, 0.72);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    body .app-logo-img {
        height: 76px;
    }

    body #btn-theme-toggle {
        top: 56px;
        right: 6px;
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
    }

    body #indicador-conexion {
        top: 62px !important;
        left: 6px !important;
    }

    body .card,
    body .auth-card,
    body .premium-card,
    body .client-ficha {
        border-radius: 18px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 8px 20px rgba(8, 12, 18, 0.09);
    }

    body .btn,
    body .btn-primary,
    body .btn-secondary {
        min-height: 48px;
        border-radius: 14px;
        font-size: 0.92rem;
        font-weight: 800;
    }

    body .icon-btn {
        width: 42px !important;
        height: 42px !important;
    }

    body input,
    body select,
    body textarea {
        min-height: 44px;
        border-radius: 12px;
        font-size: 16px;
        padding: 11px 12px;
    }

    body textarea {
        min-height: 92px;
    }

    body #dashboard-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body .tabs,
    body .main-tabs-container {
        position: sticky;
        top: 92px;
        z-index: var(--z-tabs-mobile);
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        padding: 8px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid #e5e7eb;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
    }

    body .tabs::-webkit-scrollbar,
    body .main-tabs-container::-webkit-scrollbar {
        display: none;
    }

    body .tab-btn {
        min-width: max-content;
        padding: 9px 12px;
        border-radius: 10px;
        font-size: 0.82rem;
    }

    body .search-box {
        border-radius: 14px;
        padding: 8px 10px;
        gap: 8px;
    }

    body #search-input {
        font-size: 16px;
    }

    body .modal-content,
    body #modal-historial .modal-content,
    body #modal-productividad .modal-content,
    body #modal-fichaje-opciones .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 !important;
        margin: 0;
        padding: 14px;
        overflow-y: auto;
    }

    body .modal-overlay {
        align-items: stretch;
    }

    body .fichaje-options-grid {
        grid-template-columns: 1fr;
    }

    body .opt-salida {
        grid-column: auto;
    }

    body .loyalty-grid {
        margin-right: 0;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }

    body .btn-add-stamp {
        width: 46px;
        height: 46px;
        right: 12px;
        bottom: 12px;
    }

    body .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    body .widget-bubble,
    body .widget-sofa,
    body .widget-espera-bubble {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    body .widget-sofa {
        bottom: calc(76px + 1cm + env(safe-area-inset-bottom));
    }
}

/* ===== Pack responsive base (tablet + movil) ===== */
@media screen and (max-width: 1024px) {
    body #user-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    body #dashboard-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .admin-team-actions-grid {
        grid-template-columns: 1fr !important;
    }

    body .admin-team-btn-span2 {
        grid-column: auto !important;
    }
}

@media screen and (max-width: 640px) {
    body #dashboard-panel {
        grid-template-columns: 1fr !important;
    }

    body .ficha-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    body #app-version-display-inline {
        right: 10px !important;
        bottom: 10px !important;
        font-size: 0.68rem !important;
        padding: 4px 9px !important;
    }
}

@media screen and (max-width: 430px) {
    body {
        padding: 8px 8px calc(92px + env(safe-area-inset-bottom));
    }

    body .app-logo-img {
        height: 64px;
    }

    body .card,
    body .auth-card,
    body .premium-card,
    body .client-ficha {
        padding: 12px;
        border-radius: 16px;
    }

    body #dashboard-panel {
        grid-template-columns: 1fr;
    }

    body .btn,
    body .btn-primary,
    body .btn-secondary {
        min-height: 46px;
        font-size: 0.88rem;
    }

    body .tab-btn {
        font-size: 0.78rem;
        padding: 8px 10px;
    }
}

/* =========================================
   RESPONSIVE GLOBAL MODALES + HEADER MOVIL
   ========================================= */

/* Base modal/dialog responsive en escritorio y tablet */
.swal2-popup {
    width: min(92vw, 860px) !important;
    max-width: 92vw !important;
}

.swal2-container {
    z-index: var(--z-dialog) !important;
}

.swal2-html-container {
    max-height: min(64vh, 560px);
    overflow: auto;
    overflow-x: hidden;
}

.swal-policy-actions .swal2-confirm.swal-policy-btn,
.swal-policy-actions .swal2-cancel.swal-policy-btn,
.swal-policy-actions .swal2-deny.swal-policy-btn {
    min-height: 44px;
}

.modal-overlay {
    padding: 12px;
}

.modal-content {
    width: min(900px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
}

@media screen and (max-width: 1024px) {
    .swal2-popup {
        width: min(95vw, 760px) !important;
        max-width: 95vw !important;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .swal-policy-actions {
        gap: 10px !important;
        width: 100%;
    }

    .swal-policy-actions .swal2-confirm.swal-policy-btn,
    .swal-policy-actions .swal2-cancel.swal-policy-btn,
    .swal-policy-actions .swal2-deny.swal-policy-btn {
        min-height: 54px !important;
        font-size: 1rem !important;
        padding: 0.7rem 1.25rem !important;
        border-radius: 12px !important;
    }
}

@media screen and (max-width: 768px) {
    /* El header ya no se queda fijo al hacer scroll en movil */
    body .app-header {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        margin: 0 0 10px !important;
        border-radius: 14px !important;
    }

    body .tabs,
    body .main-tabs-container {
        top: 10px !important;
    }

    .swal2-popup {
        width: 96vw !important;
        max-width: 96vw !important;
        margin: 0 auto !important;
        border-radius: 14px !important;
        max-height: 88dvh !important;
    }

    .swal2-html-container {
        max-height: 62dvh !important;
        overflow-y: auto !important;
        padding-right: 2px;
    }

    .swal2-actions {
        width: 100%;
        gap: 8px;
        padding: 0 6px 8px;
        flex-wrap: wrap;
    }

    .swal2-actions .swal2-confirm,
    .swal2-actions .swal2-cancel,
    .swal2-actions .swal2-deny {
        flex: 1 1 48%;
        min-height: 44px;
        margin: 0 !important;
    }

    .modal-overlay {
        align-items: stretch !important;
        padding: 0;
    }

    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0 !important;
        padding: 14px;
        overflow-y: auto;
        margin: 0;
    }
}

