:root {
    --primary: #007aff;
    --primary-hover: #0056b3;
    --bg-dark: #000000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.15);
    --warning: #f59e0b;
} 

body.light-theme {
    --bg-dark: #A9A9A9;
    --card-bg: rgba(30, 41, 59, 0.6);
    --text-main: #ffffff;
    --text-muted: #f1f5f9;
    --border: rgba(255, 255, 255, 0.15);
}

body.royalblue-theme {
    --bg-dark: #4169E1;
    --card-bg: rgba(15, 23, 42, 0.4);
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --border: rgba(255, 255, 255, 0.2);
}

/* Transaction Switcher */
.transaction-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.switcher-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.switcher-btn.active[data-type="sale"] {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.switcher-btn.active[data-type="expense"] {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 2rem;
    text-align: center;
    background: #000;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.05); /* Soft blue light base */
}

.nav-btn:hover {
    border-color: rgba(0, 122, 255, 0.4);
    background: rgba(0, 122, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.2);
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
}

main {
    flex: 1;
    max-width: 1300px;
    margin: 0 auto;
    width: 95%;
    padding: 2.5rem 0 4rem 0;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

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

/* --- Presence Dashboard (Lateral) --- */
.dashboard-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    justify-content: center;
}

.registro-card {
    flex: 1.5; /* Reduced from 2 to make it narrower */
    margin-top: 0 !important;
}

.presence-dashboard {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 0 !important;
    min-width: 250px;
}

.presence-dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.presence-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.2rem;
    backdrop-filter: blur(10px);
}

.presence-column h3 {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

.presence-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.presence-tag {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 140px;
}

.presence-tag.active {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
}

.presence-tag.inactive {
    color: var(--text-muted);
    opacity: 0.7;
}

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

.registro-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2.5rem !important;
    min-height: 260px;
}
 /* Reduced from 320px */


/* Dashboard / Registro Styles */
.clock-container {
    text-align: left;
    flex: 1.2;
    min-width: 380px; /* Fixed space to prevent layout shifting */
    padding-right: 2rem;
    border-right: 1px solid var(--border);
}

#digital-clock {
    font-size: 3.8rem; /* Reduced slightly to prevent 2 lines */
    font-weight: 800;
    margin: 0.3rem 0;
    letter-spacing: 1px;
    line-height: 1;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    font-variant-numeric: tabular-nums; /* Monospace numbers to stop wiggling */
}

#date-display {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.action-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    flex: 1;
    margin-top: -20px;
}

#employee-select {
    width: 300px;
    padding: 1rem;
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
}

#employee-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.3);
}

#main-action-btn {
    width: 260px;
    height: 70px;
    border-radius: 16px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

/* Shine Effect */
#main-action-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    pointer-events: none;
}

#main-action-btn:hover::after {
    left: 100%;
    top: 100%;
}

#employee-info-display {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

#main-action-btn.check-in {
    background: linear-gradient(135deg, #39ff14, #1ed70e);
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 50px rgba(57, 255, 20, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#main-action-btn.check-out {
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Pulse Animation when active (More aggressive & Persistent) */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 50px rgba(57, 255, 20, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 80px rgba(57, 255, 20, 0.8), 0 10px 40px rgba(0, 0, 0, 0.6);
        transform: scale(1.05);
        /* Increased scale slightly */
    }

    100% {
        box-shadow: 0 0 50px rgba(57, 255, 20, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
        transform: scale(1);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), 0 10px 40px rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 50px rgba(239, 68, 68, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
        transform: scale(1.03);
    }

    100% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), 0 10px 40px rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }
}

#main-action-btn.check-in:not([style*="opacity: 0.5"]) {
    animation: pulse-green 1.5s infinite ease-in-out;
}

#main-action-btn.check-out:not([style*="opacity: 0.5"]) {
    animation: pulse-red 1.5s infinite ease-in-out;
}

#main-action-btn:hover {
    transform: scale(1.1) translateY(-8px);
    border-color: #39ff14;
    box-shadow: 0 15px 50px rgba(57, 255, 20, 0.4);
}

#main-action-btn:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

.pin-input-container {
    text-align: center;
    margin-bottom: 2rem;
}

#pin-input {
    width: 250px;
    font-size: 1.5rem;
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(57, 255, 20, 0.5);
    border-radius: 16px;
    color: #39ff14;
    font-weight: 700;
    outline: none;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
    transition: all 0.3s ease;
}

#pin-input:focus {
    border-color: #39ff14;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-2px);
}

#pin-input::placeholder {
    color: #39ff14;
    opacity: 0.8;
}

#employee-info-display {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

#main-action-btn.check-in {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

#main-action-btn.check-out {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

#main-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Employee Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns inputs perfectly at the bottom */
    gap: 0.5rem;
    height: 100%;
}

input,
select {
    padding: 0.8rem;
    background: #1e293b; 
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

/* Fix Autofill white background in Chrome */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
    border: 1px solid var(--border) !important;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.4);
    background: #232f3e;
}

select option {
    background-color: #0f172a !important; /* Azul muy oscuro sólido */
    color: white !important;
    padding: 10px;
}

input[type="file"] {
    padding: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    width: 340px;
    /* Ensanchado un 30% respecto a 260px */
    overflow: hidden;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: all 0.3s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-hover);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0056b3);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0084ff, var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

#btn-employee-logout {
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.1);
    transition: all 0.3s ease;
}

#btn-employee-logout:hover {
    box-shadow: 0 0 25px rgba(0, 122, 255, 0.2);
    background: rgba(0, 122, 255, 0.08) !important;
    border-color: rgba(0, 122, 255, 0.4) !important;
    color: var(--text-main) !important;
}

.btn-export {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: var(--text-muted);
}

/* --- 👑 Membresía Premium Pro & Bloqueos --- */
.locked-feature {
    position: relative;
    cursor: default !important;
}

.locked-feature::after {
    content: '👑 PRO';
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4);
    z-index: 10;
}

.locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.3s ease;
}

.locked-feature:hover .locked-overlay {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
}

.premium-locked-nav {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* --- Modal Premium (Diseño Unificado Pikis Hub Pro) --- */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.premium-modal-card.glass-premium {
    background: #0a0a0b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    scrollbar-width: none;
}

.premium-modal-card::-webkit-scrollbar { display: none; }

.premium-modal-header {
    position: relative;
    height: 120px;
    background: linear-gradient(to bottom right, rgba(217, 119, 6, 0.15), rgba(37, 99, 235, 0.08), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
}

.crown-icon-box {
    margin-bottom: 0.5rem;
    padding: 10px;
    background: linear-gradient(to top right, #f59e0b, #fef08a);
    border-radius: 12px;
    color: #451a03;
    font-size: 1.4rem;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
    z-index: 1;
}

.premium-modal-header h2 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin: 0;
    color: white;
}

.premium-modal-header h2 span { color: #f59e0b; }
.premium-modal-header p { font-size: 0.85rem; color: #94a3b8; font-weight: 500; margin-top: 2px; }

.premium-modal-body { padding: 1.5rem; }

/* Paso 1: Email Resaltado */
.email-step-container {
    position: relative;
    padding: 1rem;
    border: 2px solid #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.step-tag {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #f59e0b;
    color: #451a03;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 1px;
}

.email-step-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
}

.email-step-container input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.email-step-container input:focus { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }

.input-wrapper { position: relative; }
.valid-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.feature-attempt-msg {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(255,255,255,0.03);
    padding: 8px;
    border-radius: 10px;
}
#premium-feature-name { color: #f59e0b; font-weight: 800; }

/* Planes Grid v2 */
.premium-plans-grid-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plan-card-v2 {
    position: relative;
    padding: 1.5rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.plan-card-v2.disabled { opacity: 0.3; filter: grayscale(1); pointer-events: none; }

.plan-card-v2.monthly { border-color: rgba(37, 99, 235, 0.3); background: rgba(37, 99, 235, 0.05); }
.plan-card-v2.annual { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); box-shadow: 0 0 20px rgba(245, 158, 11, 0.1); }

.plan-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
    border-radius: 100px;
}

.plan-badge.annual-best { background: #f59e0b; color: #451a03; }

.plan-icon {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}
.monthly .plan-icon { background: rgba(37, 99, 235, 0.1); color: #60a5fa; }
.annual .plan-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.plan-card-v2 h3 { font-size: 1.1rem; color: white; margin-bottom: 0.2rem; }

.plan-price-box { display: flex; align-items: baseline; gap: 4px; margin-bottom: 1rem; }
.plan-price-box .currency { font-size: 1rem; font-weight: 800; color: white; }
.plan-price-box .amount { font-size: 1.6rem; font-weight: 900; color: white; }
.plan-price-box .period { font-size: 0.6rem; font-weight: 800; color: #94a3b8; }

.plan-features-v2 { list-style: none; padding: 0; margin-bottom: 1.2rem; }
.plan-features-v2 li { font-size: 0.75rem; color: #cbd5e1; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.monthly .plan-features-v2 li i { color: #3b82f6; }
.annual .plan-features-v2 li i { color: #f59e0b; }

.plan-btn {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: none;
    font-weight: 900;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.monthly .plan-btn { background: #2563eb; color: white; }
.annual .plan-btn { background: #f59e0b; color: #451a03; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3); }

.sync-manual-footer {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    text-align: center;
}

.sync-manual-footer p { font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.8rem; }

#btn-sync-manual-premium {
    width: 100%;
    background: transparent;
    border: 2px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

#btn-sync-manual-premium:not(:disabled):hover { background: rgba(245, 158, 11, 0.1); border-color: #f59e0b; transform: scale(0.98); }
#btn-sync-manual-premium:disabled { opacity: 0.2; pointer-events: none; }

.premium-modal-footer { padding: 1rem 1.5rem 2rem; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; }
.premium-modal-footer p { font-size: 0.7rem; color: #64748b; margin-bottom: 8px; }
.premium-modal-footer a { color: #94a3b8; text-decoration: none; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.premium-error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.plan-option:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-5px);
    border-color: #007aff;
}

.plan-option.popular {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #000;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 20px;
}

.plan-name { font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.plan-price { font-size: 1.8rem; font-weight: 900; margin: 10px 0; color: #fff; }
.plan-period { font-size: 0.8rem; color: #94a3b8; }

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* Welcome Splash Screen */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
}

.welcome-card {
    width: 95%;
    max-width: 400px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.5); /* Borde azul suave */
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.4), inset 0 0 20px rgba(37, 99, 235, 0.1); /* Sombra exterior e interior azul vibrante */
    background: rgba(10, 15, 30, 0.8); /* Ajustar el fondo para mayor contraste con el glow */
}

.welcome-header .logo-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-header .logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.welcome-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

@media (max-width: 480px) {
    .welcome-card { padding: 2rem 1rem; }
    .welcome-header h1 { font-size: 1.5rem; }
    .welcome-header p { font-size: 0.8rem; margin-bottom: 1.5rem; }
}

.welcome-header h1 span {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-header p { color: #94a3b8; font-size: 0.9rem; margin-bottom: 2rem; }

.info-badge {
    background: rgba(37, 99, 235, 0.1);
    border: 1px dashed rgba(37, 99, 235, 0.3);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2rem;
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
}

.input-group-v2 { text-align: left; margin-bottom: 2rem; }
.input-group-v2 label { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: #64748b; 
    margin-bottom: 8px; 
    display: block; 
    font-weight: 800; 
}

.input-container {
    position: relative;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: all 0.3s;
}

.input-container:focus-within {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.input-container i { color: #64748b; margin-right: 12px; }

.input-container input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 14px 0;
    width: 100%;
    outline: none;
    font-weight: 500;
}

.btn-welcome-start {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-welcome-start:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #1e293b;
    box-shadow: none;
}

.welcome-footer { margin-top: 2rem; font-size: 0.7rem; color: #475569; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.05); }

/* History Control Buttons */
.btn-query,
.btn-reset,
.btn-export-pdf {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-query {
    background: linear-gradient(135deg, var(--primary), #0056b3);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.btn-query:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 122, 255, 0.3);
    background: linear-gradient(135deg, #0084ff, var(--primary));
}

.btn-reset {
    background: rgba(239, 68, 68, 0.08);
    /* Soft Red */
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #f87171;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-export-pdf {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.btn-export-pdf:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Action Buttons */
.btn-action {
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-edit {
    background: rgba(0, 122, 255, 0.08);
    color: var(--primary);
    border-color: rgba(0, 122, 255, 0.15);
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    transform: translateY(-2px);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    /* Reduced font size */
}

th {
    text-align: left;
    padding: 0.8rem;
    /* Slightly reduced padding */
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.8rem;
    /* Slightly reduced padding */
    border-bottom: 1px solid var(--border);
}

.extra-hours {
    color: var(--danger);
    font-weight: bold;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.summary-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Modern Chart Cards */
.chart-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.chart-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* --- License & Trial Modals --- */
.license-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 10, 26, 0.95) 0%, #050510 100%);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.license-modal {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.license-header {
    margin-bottom: 2rem;
}

.icon-box {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.license-modal h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.license-body h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #fff;
}

.license-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.benefit-item {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 16px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.divider {
    position: relative;
    margin: 2rem 0;
    height: 1px;
    background: rgba(255,255,255,0.05);
}

.divider span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0a0a1a;
    padding: 0 15px;
    font-size: 0.65rem;
    font-weight: 800;
    color: rgba(255,255,255,0.2);
    letter-spacing: 1px;
}

.machine-id-box {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.machine-id-box label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.5rem;
}

.copy-id {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.copy-id code {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.copy-id button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.copy-id button:hover {
    opacity: 1;
}

/* --- Employee Mobile Dashboard Styles --- */
.employee-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    margin-bottom: 1.5rem;
}

#emp-dash-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

#qr-reader {
    border: 4px solid var(--primary) !important;
    border-radius: 20px !important;
    overflow: hidden;
    background: black;
}

/* --- Loans UI Layout --- */
.loans-panel-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}
.loan-form-container {
    padding-right: 2rem;
    border-right: 1px solid var(--border);
}
.loan-submit-btn {
    width: 100%;
}

/* --- History Section Responsiveness --- */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.history-actions {
    display: flex;
    gap: 0.8rem;
}
/* Text format responsividad */
.hide-on-mobile { display: inline; }
.show-on-mobile { display: none; }

@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: inline !important; }

    /* Compresión Avanzada de Tarjetas Summary para Móviles */
    .summary-cards { gap: 0.8rem; margin-bottom: 1.5rem; }
    .summary-card { padding: 0.8rem 1.2rem; }
    .summary-card h3 { margin-bottom: 0.2rem; font-size: 0.85rem; }
    .summary-card .value { font-size: 1.4rem; line-height: 1.1; }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }
    .history-actions {
        flex-wrap: wrap;
        width: 100%;
        gap: 0.6rem;
    }
    .history-actions button {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }
    
    /* Mobile Employee Layout Overrides */
    .employee-actions-grid {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
    }
    .employee-actions-grid button {
        width: 100% !important;
        justify-content: center;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-layout {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    /* Mobile Loans Container Overrides */
    .loans-panel-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .loan-form-container {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding-bottom: 1.5rem;
    }
    
    /* Transform Tables into Cards for Mobile */
    .mobile-cards-table table, 
    .mobile-cards-table tbody, 
    .mobile-cards-table th, 
    .mobile-cards-table td, 
    .mobile-cards-table tr { 
        display: block; 
    }
    .mobile-cards-table thead {
        display: none;
    }
    .mobile-cards-table tr { 
        margin-bottom: 1rem; 
        border: 1px solid rgba(255,255,255,0.08); 
        border-radius: 12px; 
        background: rgba(30, 41, 59, 0.4); 
        padding: 0.5rem;
    }
    .mobile-cards-table td { 
        border: none;
        position: relative;
        padding: 0.6rem 0.5rem 0.6rem 40%; 
        min-height: 2.2rem;
        text-align: right;
        border-bottom: 1px solid rgba(255,255,255,0.02);
    }
    .mobile-cards-table td:last-child {
        border-bottom: none;
    }
    .mobile-cards-table td::before { 
        position: absolute;
        top: 0.6rem;
        left: 0.5rem;
        width: 35%; 
        padding-right: 5px; 
        white-space: nowrap;
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
    }
    .mobile-cards-table td:nth-of-type(1)::before { content: "Empleado"; }
    .mobile-cards-table td:nth-of-type(2)::before { content: "Fecha"; }
    .mobile-cards-table td:nth-of-type(3)::before { content: "Tipo"; }
    .mobile-cards-table td:nth-of-type(4)::before { content: "Monto"; }
    .mobile-cards-table td:nth-of-type(5)::before { content: "Estado"; }
    .mobile-cards-table td:nth-of-type(6)::before { content: "Acción"; }
    .mobile-cards-table td:nth-of-type(6) {
        display: flex;
        justify-content: flex-end;
    }

    nav {
        flex-wrap: wrap;
    }

    .main-nav {
        gap: 0.5rem;
        background: rgba(15, 23, 42, 0.6) !important;
        padding: 0.5rem !important;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.05) !important;
        margin-top: 2rem !important; /* Más margen arriba para despejar la cabecera limpia */
    }

    .main-nav .nav-btn {
        flex: 1 1 calc(50% - 0.5rem);
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 12px;
        border: none;
        background: transparent;
        font-weight: 700;
        transition: all 0.2s;
    }

    .main-nav .nav-btn.active {
        background: var(--primary) !important;
        box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4) !important;
        color: white !important;
    }

    #nav-main-admin {
        flex: 1 1 100%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1.5rem !important; /* Descenso pronunciado para dar espacio total */
    }

    #nav-main-admin.active {
        background: linear-gradient(135deg, var(--primary), #0056b3) !important;
        border-color: rgba(0, 122, 255, 0.5);
    }

    #admin-submenu {
        gap: 0.6rem !important;
        padding: 1rem !important;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 20px;
        margin-top: 1.5rem !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .sub-nav-btn {
        flex: 1 1 calc(50% - 0.6rem);
        font-size: 0.82rem;
        padding: 1rem 0.4rem;
        text-align: center;
        margin: 0;
        border-radius: 14px;
        background: rgba(30, 41, 59, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        color: white;
        font-weight: 700;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        transition: transform 0.1s, background 0.2s;
    }
    
    .sub-nav-btn:active {
        transform: scale(0.95);
        background: var(--primary);
    }

    #btn-admin-change-pin, #btn-admin-logout {
        flex: 1 1 100%;
        flex-direction: row;
        margin-top: 0.5rem;
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    #btn-admin-logout {
        display: flex !important;
    }

    .card, .license-modal {
        padding: 1.5rem;
        border-radius: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    /* Fix fixed widths breaking mobile frame */
    #employee-select, 
    #main-action-btn, 
    #pin-input, 
    input[type="file"] {
        width: 100%;
        max-width: 100%;
    }

    .registro-card {
        flex-direction: column;
        padding: 1.5rem !important;
        gap: 1.5rem;
    }
    
    .clock-container {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 1.5rem;
        text-align: center;
        width: 100%;
    }
    
    #digital-clock {
        font-size: 2.6rem;
    }
    
    .presence-dashboard {
        width: 100%;
        min-width: auto;
    }

    .presence-dashboard-bottom {
        grid-template-columns: 1fr;
    }
}
/* --- Premium Cloud Sync Indicator --- */
#cloud-sync-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#cloud-sync-container:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.cloud-icon {
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

#cloud-sync-container.syncing .cloud-icon {    
    color: #3b82f6; /* AZUL para Sincronizando */
}

#cloud-sync-container.success .cloud-icon {
    color: #10b981; /* VERDE para Sincronizado */
}

#cloud-sync-container.offline .cloud-icon {
    color: #f97316; /* NARANJA para Desconectado/Local */
}

#sync-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: inline-block;
    min-width: 140px;
    text-align: left;
}

@keyframes sync-pulse {
    left: -30%;
    width: 35px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: btn-laser-sweep 3.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    pointer-events: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
.border-runner { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; pointer-events: none; z-index: 10; }
.br-t, .br-r, .br-b, .br-l { position: absolute; }
.br-t { top: 0; left: -100%; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-t 0.4s linear forwards; opacity: 0; animation-delay: 0.1s; }
.br-r { top: -100%; right: 0; width: 3px; height: 100%; background: linear-gradient(180deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-r 0.4s linear forwards; animation-delay: 0.5s; opacity: 0; }
.br-b { bottom: 0; right: -100%; width: 100%; height: 3px; background: linear-gradient(270deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-b 0.4s linear forwards; animation-delay: 0.9s; opacity: 0; }
.br-l { bottom: -100%; left: 0; width: 3px; height: 100%; background: linear-gradient(360deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-l 0.4s linear forwards; animation-delay: 1.3s; opacity: 0; }
@keyframes br-anim-t { 0% { left: -100%; opacity: 1; } 100% { left: 100%; opacity: 1; } }
@keyframes br-anim-r { 0% { top: -100%; opacity: 1; } 100% { top: 100%; opacity: 1; } }
@keyframes br-anim-b { 0% { right: -100%; opacity: 1; } 100% { right: 100%; opacity: 1; } }
.sync-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: none;
}

@keyframes btn-flip-3d {
    0% { transform: perspective(800px) rotateX(0deg); opacity: 1; }
    49% { transform: perspective(800px) rotateX(90deg); opacity: 0; }
    50% { transform: perspective(800px) rotateX(-90deg); opacity: 0; }
    100% { transform: perspective(800px) rotateX(0deg); opacity: 1; }
}

button.btn-scanner-premium.btn-flip-3d-active {
    animation: btn-flip-3d 1.2s ease-in-out, btn-soft-glow 3.5s infinite ease-in-out !important;
}

.reports-central-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.reports-central-grid > .report-card {
    flex: 1 1 calc(33.333% - 1.5rem);
    min-width: 280px;
    max-width: calc(33.333% - 1.5rem);
}

@media (max-width: 950px) {
    .reports-central-grid > .report-card {
        max-width: 100%;
        flex-basis: 100%;
    }
}

@keyframes btn-laser-sweep {
    0% { left: -30%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 130%; opacity: 0; }
}

@keyframes btn-soft-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1), 0 0 0px rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25), 0 0 15px rgba(255, 255, 255, 0.15); }
}

.btn-scanner-premium {
    position: relative;
    overflow: hidden;
    animation: btn-soft-glow 3.5s infinite ease-in-out !important;
}

.btn-scanner-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -30%;
    width: 35px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: btn-laser-sweep 3.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    pointer-events: none;
}

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.8; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

.border-runner { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; pointer-events: none; z-index: 10; }
.br-t, .br-r, .br-b, .br-l { position: absolute; }
.br-t { top: 0; left: -100%; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-t 0.4s linear forwards; opacity: 0; animation-delay: 0.1s; }
.br-r { top: -100%; right: 0; width: 3px; height: 100%; background: linear-gradient(180deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-r 0.4s linear forwards; animation-delay: 0.5s; opacity: 0; }
.br-b { bottom: 0; right: -100%; width: 100%; height: 3px; background: linear-gradient(270deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-b 0.4s linear forwards; animation-delay: 0.9s; opacity: 0; }
.br-l { bottom: -100%; left: 0; width: 3px; height: 100%; background: linear-gradient(360deg, transparent, rgba(255,255,255,0.9)); animation: br-anim-l 0.4s linear forwards; animation-delay: 1.3s; opacity: 0; }
@keyframes br-anim-t { 0% { left: -100%; opacity: 1; } 100% { left: 100%; opacity: 1; } }
@keyframes br-anim-r { 0% { top: -100%; opacity: 1; } 100% { top: 100%; opacity: 1; } }
@keyframes br-anim-b { 0% { right: -100%; opacity: 1; } 100% { right: 100%; opacity: 1; } }
@keyframes br-anim-l { 0% { bottom: -100%; opacity: 1; } 100% { bottom: 100%; opacity: 1; } }

/* --- Global Mobile Pagination Size Reduction --- */
@media (max-width: 768px) {
    #loans-pagination button,
    #attendance-pagination button,
    #unified-records-pagination button,
    #pending-payroll-pagination button {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.70rem !important;
        border-radius: 6px !important;
        margin: 0 0.1rem !important;
        min-width: 25px !important;
    }
}


/* Manual Button Animation */
#btn-download-manual {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
#btn-download-manual:hover {
    transform: scale(1.05) translateY(-3px) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}
#btn-download-manual:active {
    transform: scale(0.95) translateY(0) !important;
}

/* ==========================================================================
   CSS: NUEVO MÓDULO VISUAL [DESBLOQUEAR PRO]
   ========================================================================== */
.locked-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(5px) grayscale(40%);
    -webkit-backdrop-filter: blur(5px) grayscale(40%);
    background: rgba(10, 10, 26, 0.55);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}

.btn-pro-unlock {
    background: linear-gradient(135deg, #0055ff, #00a8ff);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5); /* Borde acentuado */
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.btn-pro-unlock:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 168, 255, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.9); /* Borde brilla al pasar el ratón */
}

.btn-pro-unlock:active {
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 168, 255, 0.3);
    outline: none;
}

/* Efecto Shimmer Premium Pro (InmoControl -> GestiónPro) */
@keyframes shimmer-sweep-pro {
    0% { left: -100%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 200%; opacity: 0; }
}
.shimmer-pro-desktop {
    position: relative;
    overflow: hidden;
}
.shimmer-pro-desktop::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shimmer-sweep-pro 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    pointer-events: none;
}

/* COMPRESIÓN DE LA CORONA MÓVIL (EXCLUSIVA PROPIETARIOS) */
@media (max-width: 768px) {
    #gp-license-btn.owner-mobile-crown {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        position: relative;
        background: #080808 !important;
        border: 2px solid #ffffff !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.5) !important;
        overflow: visible !important;
    }
    
    /* El destello láser desactivado por solicitud del usuario en móvil */
    #gp-license-btn.owner-mobile-crown::after {
        display: none !important;
        animation: none !important;
    }

    #gp-license-btn.owner-mobile-crown .btn-text-content {
        font-size: 0 !important;
        line-height: 0 !important;
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0; left: 0;
    }
    
    #gp-license-btn.owner-mobile-crown.is-free-status::before {
        content: '\f521';
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        color: #ffffff;
        font-size: 1.15rem;
        z-index: 10;
        position: relative;
    }
    
    #gp-license-btn.owner-mobile-crown.is-free-status .btn-text-content::after {
        content: '\f00d';
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        color: #ffffff;
        position: absolute;
        bottom: -3px;
        right: -3px;
        font-size: 0.65rem;
        z-index: 15;
        background: #080808;
        width: 15px;
        height: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,0.3);
        box-sizing: border-box;
    }
    
    #gp-license-btn.owner-mobile-crown.is-premium-status::before {
        content: '\f521';
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        color: #fbbf24;
        font-size: 1.25rem;
        z-index: 10;
        position: relative;
    }
}

/* --- PWA Install Banner --- */
.install-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 10px rgba(37, 99, 235, 0.2);
    z-index: 999999;
    animation: slideDownFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #000;
    padding: 2px;
    border: 1px solid rgba(255,255,255,0.1);
}

.install-text h4 {
    margin: 0 0 4px 0;
    color: #fff;
    font-size: 1rem;
}

.install-text p {
    margin: 0;
    color: #9ca3af;
    font-size: 0.8rem;
    line-height: 1.3;
}

.install-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.btn-cancel-install {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 1.2rem;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 8px;
}

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

.btn-install-accept {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@keyframes slideDownFade {
    0% { opacity: 0; transform: translate(-50%, -20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}
