/* Estilos base y tipografía */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #fcfcfc;
    color: #1e293b;
}

.grecaptcha-badge {
    display: none !important;
}

/* --- Personalización de la barra de scroll --- */
/* Para navegadores basados en WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0; /* slate-200 */
    border-radius: 20px;
    border: 2px solid transparent; /* Crea un efecto de padding */
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1; /* slate-300 */
    background-clip: content-box;
}

/* Estilo específico para contenedores internos con scroll (como el historial) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #e2e8f0;
}

/* Soporte para Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

/* Contenedores con efecto cristal */
.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* Animaciones de carga y aparición */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Botón principal estilo "Black" */
.btn-black {
    background: #000;
    color: #fff;
    font-weight: 800;
    transition: all 0.2s;
}

.btn-black:hover {
    background: #222;
    transform: translateY(-1px);
}

/* ── Navegación por pestañas ──────────────────────────────────────────────
   Uso: <div class="tab-nav"> + <button class="tab-btn [active]"> en ambos
   admin.php e index.php. CSS como única fuente de verdad.
──────────────────────────────────────────────────────────────────────── */

/* Contenedor de la barra de tabs */
.tab-nav {
    display: flex;
    gap: 1.5rem;           /* gap-6 */
    padding: 0 1.5rem;     /* px-6 */
    border-bottom: 1px solid #e2e8f0;  /* border-slate-100 */
    overflow-x: auto;
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
}

/* Ocultar scrollbar en Chrome/Safari/Edge pero mantener el scroll táctil */
.tab-nav::-webkit-scrollbar {
    display: none;
}

/* Botón individual */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;           /* gap-2 */
    color: #94a3b8;        /* slate-400 */
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    padding: 1rem 0;       /* 16px arriba y abajo — mismo espacio en ambas páginas */
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;   /* solapa el border-b del .tab-nav → línea de subrayado limpia */
    transition: color 0.2s, border-color 0.2s;
    background: none;
    cursor: pointer;
}

/* Estado activo */
.tab-btn.active {
    color: #000;
    border-bottom-color: #000;
}

/* Animaciones y Modales */
.modal {
    transition: opacity 0.25s ease;
}

.modal-active {
    overflow-x: hidden;
    overflow-y: visible !important;
}

/* Animación de pulso para cuando el usuario está trabajando */
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-red {
    animation: pulse-red 2s infinite;
}

/* Estilos para tablas */
table thead th {
    letter-spacing: 0.05em;
}

/* Ajustes para dispositivos táctiles */
@media (max-width: 640px) {
    .glass {
        padding: 1.5rem;
    }
}

/* Estilos para botones de SweetAlert2 */
.swal-button-confirm {
    background-color: black;
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin: 0.5rem;
    cursor: pointer;
}
.swal-button-confirm-red {
    background-color: #ef4444;
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin: 0.5rem;
    cursor: pointer;
}
.swal-button-cancel {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin: 0.5rem;
    cursor: pointer;
}

/* Custom Tippy Theme */
.tippy-box[data-theme~='jornada'] {
    background-color: white;
    color: black;
    border: 1px solid black;
    border-radius: 8px;
    font-weight: 800;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Calendario (Vacaciones y Festivos) --- */
.day-btn {
    background-color: transparent;
    color: #64748b; /* slate-500 */
    position: relative;
    border: 1px solid transparent;
}

.day-btn.is-weekend {
    color: #f87171 !important; /* red-400 */
}

.day-btn.has-worked::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #059669; /* emerald-600 */
}

.day-btn.is-vacation.has-worked::after {
    background-color: #fff;
}

.day-btn.is-vacation {
    background-color: #000 !important;
    color: #fff !important;
    transform: scale(0.9);
}

.day-btn.is-holiday {
    background-color: #ef4444 !important;
    color: #fff !important;
}

.day-btn.is-holiday.is-vacation {
    background: linear-gradient(135deg, #000000 0%, #ef4444 100%) !important;
    color: #fff !important;
}

.day-btn.is-today {
    border-color: #64748b !important;
}

.day-btn:hover:not(.is-vacation):not(.is-holiday) {
    border-color: #e2e8f0;
}

/* ── HOY.PHP ────────────────────────────────────────────────────────────── */

.sun-arc-wrapper {
    width: 100%;
    max-width: 280px;
}

.weather-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
}

.forecast-day {
    min-width: 72px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 0.75rem 0.5rem;
}

.forecast-day:first-child {
    background: #000;
    color: #fff;
    border-color: #000;
}

.forecast-day:first-child p {
    color: #fff !important;
}

/* --- Notificación de Frase Motivadora --- */
.phrase-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: toast-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.phrase-toast-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #64748b;
}

.phrase-toast-body {
    font-size: 15px;
    line-height: 1.6;
    font-weight: 600;
    color: #0f172a;
}

.phrase-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #000;
    width: 100%;
    transform-origin: left;
    animation: toast-progress 8s linear forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(30px) scale(0.95); }
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 640px) {
    .phrase-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
        padding: 1.25rem 1.5rem;
    }
}

/* ── TFA.PHP ─────────────────────────────────────────────────────────────── */

.tfa-shield-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 50%;
    margin: 0 auto 0.25rem;
}

/* Input de código TOTP: espaciado entre caracteres */
#tfa_code {
    letter-spacing: 0.4em;
}

/* Animación de entrada para el icono shield */
@keyframes shield-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.tfa-shield-icon {
    animation: shield-pulse 3s ease-in-out infinite;
}

/* ── Medidor de fortaleza de contraseña (modal usuario, M-3) ───────────── */

.pw-meter-track {
    height: 6px;
    border-radius: 9999px;
    background-color: #f1f5f9; /* slate-100 */
    overflow: hidden;
}

.pw-meter-fill {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    background-color: #cbd5e1; /* slate-300 */
    transition: width 0.25s ease, background-color 0.25s ease;
}

.pw-meter-fill.level-1 { background-color: #ef4444; } /* red-500 — muy débil */
.pw-meter-fill.level-2 { background-color: #f59e0b; } /* amber-500 — débil */
.pw-meter-fill.level-3 { background-color: #84cc16; } /* lime-500 — aceptable */
.pw-meter-fill.level-4 { background-color: #10b981; } /* emerald-500 — fuerte */

.pw-meter-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8; /* slate-400 */
    white-space: nowrap;
}

.pw-meter-label.level-1 { color: #ef4444; } /* red-500 */
.pw-meter-label.level-2 { color: #d97706; } /* amber-600 */
.pw-meter-label.level-3 { color: #65a30d; } /* lime-600 */
.pw-meter-label.level-4 { color: #059669; } /* emerald-600 */

.pw-meter-hint {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8; /* slate-400 */
}