/* ==========================================
   iOS 26 LIQUID GLASS - REPLICA DESIGN SYSTEM
   ========================================== */

:root {
    /* Base Colors & Gradients */
    --bg-dark: #000000;
    --bg-gradient-start: #1c1c1e;
    --bg-gradient-end: #000000;

    /* Liquid Glass Colors - Hyper Translucent */
    --glass-panel: rgba(30, 30, 30, 0.4);
    --glass-panel-heavy: rgba(40, 40, 40, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-light: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Accents - Neon Liquid */
    --accent-primary: #0A84FF;
    --accent-gradient: linear-gradient(180deg, #0A84FF 0%, #0056D2 100%);
    --accent-glow: 0 0 20px rgba(10, 132, 255, 0.5);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);

    /* Effects */
    --blur-base: 25px;
    --blur-deep: 50px;
    --noise-opacity: 0.03;

    /* Dimensions */
    --radius-screen: 44px;
    /* Curve of the phone structure */
    --radius-panel: 28px;
    --radius-button: 16px;
    --nav-height: 85px;

    /* Spacing */
    --safe-area-top: env(safe-area-inset-top, 47px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --padding-screen: 20px;
}

/* ==========================================
   RESET & ULTRA-FLUID SCROLL
   ========================================== */

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

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Enable smooth scrolling explicitly on body */
    overflow: hidden;
    /* Prevent body scroll, handle in containers */
    height: 100%;
    /* Subtle background gradient mesh */
    background: radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(94, 92, 230, 0.15) 0%, transparent 40%),
        var(--bg-dark);
    background-attachment: fixed;
    overscroll-behavior: none;
    /* Prevent pull-to-refresh effects */
}

/* Noise Texture Overlay for that 'Physical' Feel */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   CONTAINERS & SCREENS
   ========================================== */

/* Base screen logic - Hidden by default */
.screen {
    display: none !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Use dynamic viewport height */
    position: fixed;
    /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Main screen scrolls (Login/Register), App handles itself */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Active screen - Visible */
.screen.active {
    display: flex !important;
    flex-direction: column;
    opacity: 1;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Main app specific styling */
#appScreen {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    padding-bottom: 0;
    /* Remove bottom padding, let content handle it */
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Header must stay put */
/* Header must stay put */
.app-header {
    flex-shrink: 0;
    margin-bottom: 5px;
    /* Minimal margin */
    /* Minimal margin */
    padding: 10px 15px;
    padding-top: max(10px, var(--safe-area-top));
    /* Compact padding */
}

/* Ensure tab visibility is strict */
.tab-content {
    display: none !important;
    flex: 1;
    /* Ensure flex Item */
    width: 100%;
    padding: 0 0 calc(100px + var(--safe-area-bottom)) 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}


/* Calendar should scroll smoothly but look clean */
#historicoTab.tab-content {
    overflow-y: auto;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    /* scrollbar-width: none; Removed for normal scroll */
}

/* Removed ::-webkit-scrollbar hiding rule */

/* Mobile Tweak: Reduce padding if height is limited to avoid scroll */
@media (max-height: 800px) {
    #appScreen {
        padding: 10px;
        /* Tighter screen padding */
    }

    .tab-content {
        padding-bottom: 130px !important;
        /* Ensure content clears the nav bar completely */
    }
}

.tab-content.active {
    display: flex !important;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   GLASS PANELS (The "Liquid" look)
   ========================================== */

.glass-card,
.glass-time-picker,
.app-header {
    background: var(--glass-panel);
    backdrop-filter: blur(var(--blur-base));
    -webkit-backdrop-filter: blur(var(--blur-base));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-panel);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Inner rim light */
    position: relative;
    overflow: hidden;
}

.glass-signature-pad {
    touch-action: none;
    /* Only disable scroll here */
}




/* Specular Highlight (The "Glossy" top edge) */
.glass-card::before,
.glass-time-picker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    opacity: 0.8;
}

/* ==========================================
   LOGIN & REGISTER (Centered Layout)
   ========================================== */

.login-container {
    display: block;
    /* Force block layout for reliable scroll */
    flex: none;
    /* Disable flex item behavior if inherited */
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: var(--padding-screen);
    padding-top: 50px;
    padding-bottom: 80px;
    /* Extra padding for bottom */
    min-height: 100%;
    /* Ensure it fills at least the screen */
    height: auto;
    /* Allow it to grow */
    overflow: visible;
    /* Let the parent .screen handle the scroll */
}

.login-card {
    padding: 30px 20px;
    /* Reduced for mobile */
    background: rgba(30, 30, 30, 0.6);
}

.logo-glass {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.app-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 17px;
}

/* ==========================================
   INPUTS & FORMS
   ========================================== */

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.glass-input:focus-within,
input.glass-input:focus,
select.glass-select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

.glass-input input,
input.glass-input,
select.glass-select {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 17px;
    outline: none;
}

/* Standalone Input/Select Support */
input.glass-input,
select.glass-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
}

select.glass-select option {
    background: #1c1c1e;
    color: white;
}

/* ==========================================
   BUTTONS (Liquid Style)
   ========================================== */

.glass-button {
    width: 100%;
    padding: 14px;
    /* Reduced from 18px */
    border-radius: var(--radius-button);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    /* Reduced from 16px */
}

.glass-button:active {
    transform: scale(0.96);
}

/* Primary Action - "Liquid Blue" */
.glass-button.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Secondary Action - "Frosted" */
.glass-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

/* Icon Button (Round/Square for Nav) */
.glass-button.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Rounded for polish */
    flex-shrink: 0;
    /* Prevent squashing */
}

/* Specific overrides for calendar nav */
.calendar-header .glass-button.icon-btn {
    width: 36px;
    height: 36px;
    margin: 0;
}

/* ==========================================
   APP HEADER & USER
   ========================================== */

.app-header {
    margin: var(--padding-screen);
    margin-top: calc(var(--safe-area-top) + 10px);
    padding: 16px 20px;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9F0A, #FF375F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   CONTENT LAYOUT
   ========================================== */

.app-content {
    padding: 0 var(--padding-screen);
    padding-bottom: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* Parent doesn't scroll, children do */
    display: flex;
    flex-direction: column;
}

/* Ensure tab content takes remaining space and scrolls internally */
.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
    /* Space for nav */
}

/* Redundant tab-content rules removed to fix scroll and overlap */

.content-card {
    padding: 24px;
    margin-bottom: 24px;
    overflow: visible;
    /* Override glass-card overflow:hidden to allow scrolling */
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 30px;
}

/* ==========================================
   TIME PICKER (Large & Tactile)
   ========================================== */

.time-selectors {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Reduced from 20px */
}

.glass-time-picker {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.time-input {
    font-size: 32px;
    /* Reduced from 42px */
    font-weight: 300;
    padding: 10px;
    /* Reduced form 15px */
    text-align: center;
    width: 100%;
    color: var(--text-primary);
    background: transparent;
    border: none;
    font-family: 'SF Pro Display', sans-serif;
    /* Monospaced numbers preferred if available */
}

/* ==========================================
   FICHAJE LIST (Scrollable Area)
   ========================================== */
.today-fichajes {
    margin-top: 20px;
    max-height: 200px;
    /* Fixed height for scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}


.fichaje-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fichaje-time {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    color: var(--text-primary);
}

/* ==========================================
   CALENDAR (Modern Grid)
   ========================================== */

/* ==========================================
   CALENDAR (Responsive Compact Grid)
   ========================================== */

#historicoTab .glass-card.content-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    /* Aumentado de 8px */
    margin-bottom: 10px;
    overflow: visible;
    background: var(--glass-panel-heavy);
    /* Fondo más visible */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.calendar-header {
    display: flex;
    /* Fix alignment */
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 5px;
    /* Minimal margin */
    width: 100%;
}

#calendarMonth {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(50px, auto);
    /* Changed from minmax(65px, 1fr) */
    gap: 3px;
    margin-bottom: 5px;
    width: 100%;
}

.calendar-header-row,
.calendar-day {
    /* aspect-ratio: 1; REMOVED to allow squash/stretch */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    position: relative;
    transition: all 0.3s;

    /* Allow cell to be whatever size the grid dictates */
    width: 100%;
    min-height: 65px;
    /* Ensure tall enough */
}

.legend {
    flex-shrink: 0;
    /* Don't shrink legend */
    margin-top: auto;
    /* Push to bottom if space permits */
    padding-top: 5px;
}

/* Mobile optimizations for small screens */
@media (max-height: 740px) {
    #historicoTab .glass-card.content-card {
        padding: 10px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .calendar-grid {
        gap: 2px;
    }

    .calendar-day {
        font-size: 11px;
        border-radius: 6px;
    }

    .calendar-day.header {
        font-size: 10px;
        padding-bottom: 1px;
    }

    .legend {
        margin-top: 5px;
        flex-shrink: 0;
        /* Ensure distinct separation from bottom */
        padding-bottom: 10px;
    }
}

/* ==========================================
   TOAST NOTIFICATION (Floating)
   ========================================== */
.toast {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    /* Above the floating nav bar (approx 80px space) */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(40, 40, 40, 0.9);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* REDUNDANT BLOCK REMOVED */

/* Mobile optimizations for 16:9 phones or when space is tight */
@media (max-height: 740px) {
    .section-title {
        font-size: 18px;
        margin-bottom: 4px;
        display: none;
        /* Hide title if extremely tight to prioritize calendar */
    }

    .section-subtitle {
        display: none;
        /* Hide subtitle */
    }

    #historicoTab .glass-card.content-card {
        padding: 5px;
        /* Minimal padding */
        padding-bottom: 5px;
    }

    .calendar-grid {
        gap: 2px;
        margin-bottom: 2px;
    }

    .calendar-day {
        font-size: 11px;
        border-radius: 6px;
    }

    .calendar-day.header {
        font-size: 10px;
        padding-bottom: 2px;
        flex: 0 0 auto;
        /* Header doesn't stretch */
        height: 25px;
    }

    .floating-tab-bar {
        bottom: 10px;
        transform: translateX(-50%) scale(0.85);
        /* Smaller dock */
        width: auto;
        /* Let it shrink if needed */
        min-width: 280px;
    }

    .glass-signature-pad.mini {
        height: 50px;
        /* Even smaller signature pads */
    }
}

.calendar-day.header {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    border-radius: 0;
    padding-bottom: 5px;
}

.calendar-day:not(.header):not(.empty) {
    background: rgba(255, 255, 255, 0.03);
}

.calendar-day.today {
    background: var(--text-primary);
    color: black;
    font-weight: 700;
}

/* Status dots in calendar */
.calendar-day .status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    margin-top: 2px;
}

.calendar-day.complete .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 4px #4CAF50;
}

.calendar-day.missing .status-dot {
    background-color: #FF5252;
    box-shadow: 0 0 4px #FF5252;
}

.calendar-day.future .status-dot {
    background-color: transparent;
}

/* ==========================================
   LEGEND (Clarified)
   ========================================== */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    /* Larger for visibility */
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Date Input Styling */
.date-selector-container {
    margin-bottom: 20px;
}

.date-selector-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.date-input-wrapper {
    background: rgba(0, 0, 0, 0.3);
    /* Slightly darker for contrast */
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 17px;
    font-family: 'SF Pro Display', sans-serif;
    outline: none;
    color-scheme: dark;
    /* Ensures calendar popup is dark mode */
}


.legend-dot.complete {
    background-color: #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
}

.legend-dot.missing {
    background-color: #FF5252;
    box-shadow: 0 0 5px #FF5252;
}

.legend-dot.future {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* Status dots in calendar */
.calendar-day .status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    margin-top: 2px;
    /* Colors handled by JS classes */
}

.calendar-day.complete .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 4px #4CAF50;
}

.calendar-day.missing .status-dot {
    background-color: #FF5252;
    box-shadow: 0 0 4px #FF5252;
}

.calendar-day.future .status-dot {
    background-color: transparent;
}





/* Indicators below the number */
.day-indicator {
    position: absolute;
    bottom: 6px;
    width: 5px;
    height: 5px;

}

.calendar-day.complete .day-indicator {
    background: #32D74B;
    box-shadow: 0 0 8px #32D74B;
}

.calendar-day.missing .day-indicator {
    background: #FF453A;
    box-shadow: 0 0 8px #FF453A;
}

/* ==========================================
   FLOATING DOCK - Figma Implementation
   ========================================== */

/* ==========================================
   FLOATING DOCK - Pure Liquid Glass
   ========================================== */

/* Compact Form Layout */
.time-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.time-group-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.time-group-compact label {
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.signatures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {

    /* Keep 2 columns but reduced gap */
    .signatures-grid {
        gap: 8px;
    }
}

.mini-sig-container {
    margin-top: 0;
    /* Reset */
    display: flex;
    flex-direction: column;
}

/* Base Signature Pad */
.glass-signature-pad {
    background: #FFFFFF;
    /* Pure White */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    touch-action: none;
    /* Disable scroll on pad */
}

.glass-signature-pad canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.glass-signature-pad.mini {
    height: 60px;
    background: #FFFFFF !important;
    /* Force white background for mini pads */
}

/* Mobile optimizations for main signature pad */
@media (max-height: 800px) {
    #signaturePad {
        /* This ID selector might need to be on the CONTAINER class if the canvas is sized by JS */
        /* But CSS can force container height */
    }

    .signature-section {
        margin-top: 5px;
    }

    .signature-section .glass-signature-pad {
        height: 180px;
        /* Reduce from default 300px? Canvas is 300px height attr */
    }
}

@media (max-height: 600px) {
    .signature-section .glass-signature-pad {
        height: 140px;
        /* Even smaller */
    }
}

/* Restore text-btn */
.text-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 12px;
    padding: 5px 0;
    cursor: pointer;
    margin-top: 2px;
    opacity: 0.8;
}

.text-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================
   FLOATING DOCK - Pure Liquid Glass
   ========================================== */
.floating-tab-bar {
    position: fixed;
    bottom: calc(10px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 290px;
    height: 62px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;

    /* Crystal Clear Glass */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Refractive Borders */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;

    /* Subtle Glow/Shadow */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Padding for inner spacing */
    padding: 0;
}

/* Mini Signature Pads */
.mini-sig-container {
    margin-top: 10px;
}

.mini-sig-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.glass-signature-pad.mini {
    height: 60px;
    /* Heavily reduced from 100px to fit screen */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 12px;
    padding: 5px 0;
    cursor: pointer;
    margin-top: 2px;
    opacity: 0.8;
}

.text-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.tabs-container {
    position: relative;
    width: 280px;
    /* Leave some padding margin */
    height: 52px;
    /* Leave some padding margin */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

/* Sliding Indicator - The "Lupa" */
.active-tab-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 5px;
    /* Initial left */
    width: 0;
    /* JS will set width and position */
    height: 54px;
    background: rgba(237, 237, 237, 0.9);
    border-radius: 27px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        width 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 0;
    pointer-events: none;
}

.tab-btn {
    position: relative;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Distribute space evenly */
    height: 100%;
    cursor: pointer;
    z-index: 2;
    padding: 0;

    /* Inactive State */
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.tab-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
    margin-bottom: 2px;
}

.tab-btn span {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

/* Active State Styles - when on top of the indicator */
.tab-btn.active {
    color: #0088FF;
    /* Apple Blue */
}

.tab-btn.active svg {
    stroke-width: 2.5px;
    transform: scale(1.05);
}

.tab-btn.active span {
    font-weight: 600;
}

@media (max-width: 380px) {
    .floating-tab-bar {
        transform: translateX(-50%) scale(0.9);
        bottom: 10px;
    }
}

/* ==========================================
   ADMIN & SIGNATURE
   ========================================== */

.admin-stats {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.admin-stats::-webkit-scrollbar {
    display: none;
}

.stat-card {
    min-width: 140px;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.employee-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 12px;
    /* Optimized for mobile */
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removed gap, using margins instead */
}

.download-btn {
    padding: 12px;
    border-radius: 12px;
    background: var(--glass-border-light);
    color: var(--accent-primary);
    border: none;
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE TWEAKS for MOBILE
   ========================================== */

/* Small screens - reduce padding and font sizes */
@media (max-height: 700px) {
    .login-container {
        padding-top: calc(10px + var(--safe-area-top));
        padding-bottom: 20px;
    }

    .login-card {
        padding: 20px 15px;
    }

    .input-group {
        margin-bottom: 16px;
    }

    .app-title {
        font-size: 24px;
    }

    .glass-button {
        padding: 12px;
        margin-bottom: 10px;
    }
}

/* Very small screens */
@media (max-height: 600px) {
    .login-container {
        padding: 15px;
    }

    .logo-glass {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .app-title {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .app-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
}

/* Mobile width optimizations */
@media (max-width: 400px) {
    #appScreen {
        padding: 15px;
    }

    .floating-tab-bar {
        width: 260px;
        bottom: calc(5px + var(--safe-area-bottom));
    }

    .tab-content {
        padding-bottom: 120px;
    }
}

/* ==========================================
   MODAL - Glass & Blur
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    max-height: 90vh;
    /* Limit height */
    overflow-y: auto;
    /* Enable internal scroll */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-btn.confirm {
    background: var(--primary-color);
    color: #fff;
}

/* ==========================================
   RESPONSIVE ADMIN TABLE SYSTEM
   ========================================== */

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

.admin-table-container {
    overflow-x: auto;
    background: rgba(30, 30, 30, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9F0A, #FF375F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.table-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.table-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-delete {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
}

.btn-pdf {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

.btn-pdf-hist {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

/* ==========================================
   CUSTOM MODAL (GLASSMORPHISM)
   ========================================== */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-modal-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
    width: 90%;
    padding: 32px 28px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.custom-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.custom-modal-icon.warning {
    background: rgba(255, 149, 0, 0.15);
    color: #FF9500;
}

.custom-modal-icon.danger {
    background: rgba(255, 59, 48, 0.15);
    color: #FF3B30;
}

.custom-modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 12px 0;
    color: #fff;
}

.custom-modal-body {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 28px 0;
}

.custom-modal-buttons {
    display: flex;
    gap: 12px;
}

.custom-modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal-btn.cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.custom-modal-btn.confirm {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.custom-modal-btn.confirm:hover {
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.4);
    transform: translateY(-1px);
}

.custom-modal-btn.confirm.danger {
    background: linear-gradient(180deg, #FF3B30 0%, #D32F2F 100%);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.custom-modal-btn.confirm.danger:hover {
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
}

.custom-modal-btn:active {
    transform: scale(0.96);
}

/* ==========================================
   SEARCH BAR & BULK ACTIONS
   ========================================== */

.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.2);
    animation: slideInFromTop 0.3s ease;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-actions-bar span {
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-blue);
}

.bulk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

/* ==========================================
   STAGGERED ANIMATIONS
   ========================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-table tbody tr,
.employee-card {
    animation: slideInUp 0.4s ease backwards;
}

/* Stagger delay for rows */
.admin-table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.admin-table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.admin-table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.admin-table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.admin-table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.admin-table tbody tr:nth-child(6) {
    animation-delay: 0.3s;
}

.admin-table tbody tr:nth-child(7) {
    animation-delay: 0.35s;
}

.admin-table tbody tr:nth-child(8) {
    animation-delay: 0.4s;
}

.admin-table tbody tr:nth-child(9) {
    animation-delay: 0.45s;
}

.admin-table tbody tr:nth-child(10) {
    animation-delay: 0.5s;
}

/* Stagger delay for cards */
.employee-card:nth-child(1) {
    animation-delay: 0.05s;
}

.employee-card:nth-child(2) {
    animation-delay: 0.1s;
}

.employee-card:nth-child(3) {
    animation-delay: 0.15s;
}

.employee-card:nth-child(4) {
    animation-delay: 0.2s;
}

.employee-card:nth-child(5) {
    animation-delay: 0.25s;
}

.employee-card:nth-child(6) {
    animation-delay: 0.3s;
}

.employee-card:nth-child(7) {
    animation-delay: 0.35s;
}

.employee-card:nth-child(8) {
    animation-delay: 0.4s;
}

/* ==========================================
   SKELETON LOADING
   ========================================== */

.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

/* Checkbox for bulk selection */
.user-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--neon-blue);
}

/* Sortable column headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.sortable-header:hover {
    color: var(--text-primary);
}

.sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.5;
}

.sortable-header.active .sort-indicator {
    opacity: 1;
    color: var(--neon-blue);
}

/* ==========================================
   MOBILE CARD ENHANCEMENTS
   ========================================== */

.employee-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.employee-card .user-avatar {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.employee-card h4 {
    letter-spacing: -0.3px;
}

.employee-card .download-btn {
    font-weight: 600;
    transition: all 0.2s;
}

.employee-card .download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.employee-card .download-btn:active {
    transform: scale(0.95);
}

/* Mobile checkbox styling */
@media (max-width: 900px) {
    .user-checkbox {
        width: 20px;
        height: 20px;
    }
}

/* ==========================================
   DESKTOP LAYOUT ENHANCEMENTS
   ========================================== */

/* Wider desktop layout */
@media (min-width: 1200px) {
    #appScreen {
        max-width: 1400px;
    }

    .content-card {
        padding: 32px 40px;
    }

    /* Enhanced admin stats grid */
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-bottom: 32px;
    }

    .stat-card {
        padding: 24px;
        min-height: 120px;
    }

    .stat-card h3 {
        font-size: 32px;
        margin-bottom: 4px;
    }

    .stat-card p {
        font-size: 12px;
    }
}

/* Enhanced admin table for desktop */
@media (min-width: 900px) {
    .admin-table th {
        font-size: 11px;
        padding: 20px 16px;
    }

    .admin-table td {
        padding: 18px 16px;
        font-size: 14px;
    }

    .table-user-info {
        gap: 14px;
    }

    .table-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Sticky toolbar */
.admin-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    padding: 16px 0;
    margin: -16px 0 20px 0;
}

/* Better mobile card spacing */
@media (max-width: 900px) {
    .employee-card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .employee-card .user-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .employee-card h4 {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .employee-card .download-btn {
        padding: 12px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* ==========================================
   NEW TABS STYLING
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.report-section,
.config-section {
    background: rgba(255, 255, 255, 0.02);
}

.report-section h3,
.config-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================
   BIG FICHAJE BUTTON & STATUS
   ========================================== */

.fichaje-status-card {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1) 0%, rgba(191, 90, 242, 0.1) 100%);
    border: 1px solid rgba(10, 132, 255, 0.2);
}

.big-fichaje-btn {
    width: 100%;
    padding: 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.3);
}

.big-fichaje-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(10, 132, 255, 0.4);
}

.big-fichaje-btn:active {
    transform: scale(0.98);
}

.big-fichaje-btn.salida {
    background: linear-gradient(180deg, #FF3B30 0%, #D32F2F 100%);
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.big-fichaje-btn.salida:hover {
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.4);
}

@media (max-width: 600px) {
    .big-fichaje-btn {
        font-size: 18px;
        padding: 20px;
    }
}

/* ==========================================
   DASHBOARD GRID
   ========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Navigation & More Menu */
.more-menu {
    position: absolute;
    bottom: 90px;
    right: 16px;
    width: 200px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border: 1px solid var(--glass-border);
    transform-origin: bottom right;
    animation: scaleIn 0.2s ease-out;
}

.more-menu.active {
    display: flex;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: left;
}

.more-menu-item:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.98);
}

.more-menu-item.active {
    color: var(--accent-primary);
    background: rgba(10, 132, 255, 0.1);
}

.more-trigger {
    display: flex;
    /* Always visible */
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive Logic */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .more-trigger {
        display: flex !important;
    }
}

/* Admin Mobile Optimization */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .search-container {
        width: 100%;
    }

    .bulk-actions-bar {
        width: 100%;
        overflow-x: auto;
    }

    .employee-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .employee-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==========================================
   PREMIUM VISUAL UPGRADE v2.0
   ========================================== */

/* 2. TABLAS FLOTANTES (Floating Rows) */
.admin-table {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    /* Separación vertical */
    margin-top: -10px;
    /* offset layout shift */
}

.admin-table-container {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.admin-table tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-table tr:hover {
    transform: translateY(-2px) scale(1.005);
    z-index: 10;
    position: relative;
}

.admin-table td {
    background: rgba(30, 30, 30, 0.6);
    /* Fondo semi-transparente oscuro */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
    border-left: none;
    padding: 18px 24px !important;
}

.admin-table td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
    padding-bottom: 8px !important;
    padding-left: 24px !important;
    background: transparent !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px !important;
    opacity: 0.7;
}

/* 3. ANIMACIONES EN CASCADA (Staggered Fade) */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-stagger {
    animation: slideUpFade 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    /* opacity: 0; REMOVED to prevent disappearance issues */
}

/* 5. GLOW BUTTONS (Premium Feel) */
.glass-button.primary {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.8), rgba(0, 86, 210, 0.8)) !important;
    box-shadow:
        0 4px 15px rgba(10, 132, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.glass-button.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center top, rgba(255, 255, 255, 0.3), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-button.primary:hover::after {
    opacity: 1;
}

/* 6. IOS BOTTOM SHEET (Mobile More Menu) */
@media (max-width: 900px) {
    .more-menu {
        position: fixed !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto;
        padding: 24px 20px 40px 20px !important;
        /* Extra bottom padding for home indicator */
        border-radius: 32px 32px 0 0 !important;
        background: rgba(22, 22, 24, 0.95) !important;
        backdrop-filter: blur(40px) !important;
        -webkit-backdrop-filter: blur(40px) !important;
        border: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
        animation: none !important;
        /* Disable default scale animation */
        display: flex !important;
        /* Siempre flex, controlado por visibility/transform */
        flex-direction: column;
        gap: 12px;
        z-index: 2000;
        visibility: hidden;
    }

    .more-menu.active {
        transform: translateY(0);
        visibility: visible;
    }
}

/* Backdrop overlay (Universal) */
.more-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Backdrop activation logic */
body.menu-open .more-menu-backdrop,
.more-menu.active+.more-menu-backdrop {
    opacity: 1;
    pointer-events: all;
}

/* Grab handle for bottom sheet */
@media (max-width: 900px) {
    .more-menu::before {
        content: '';
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 3px;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .more-menu-item {
        background: rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        padding: 16px;
        font-size: 17px;
        color: white !important;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 16px;
    }
}

/* v8.7 force deploy - debug overlay */
.more-trigger {
    z-index: 5000 !important;
    position: relative !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    outline: 1px dashed rgba(0, 255, 0, 0.3);
    /* DEBUG: Highlight clickable area */
}