@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Color Palette - Deep & Professional */
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Neutral Palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-600: #475569;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Admin Specific Tokens */
    --sidebar-width: 280px;
    --admin-bg: #f8fafc;
    --admin-card: #ffffff;
    --admin-text: #0f172a;
    --accent-glass: rgba(79, 70, 229, 0.08);
}

#mobileCloseWrapper {
    display: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--slate-100);
    color: var(--slate-800);
    line-height: 1.5;
}

/* Utilities */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.text-gradient {
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Auth / Login Page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top left, #e0e7ff 0%, #f1f5f9 50%, #f8fafc 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--slate-200);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    display: block;
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--slate-900);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

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

/* Navbar */
.nav-main {
    position: fixed;
    top: 0;
    width: 100%;
    height: 72px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.nav-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--slate-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Dashboard Panels */
.dashboard-main {
    padding-top: 100px;
    padding-bottom: 40px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.panel-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--slate-200);
}

/* Tables Professional */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: var(--slate-50);
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-600);
    border-bottom: 1px solid var(--slate-200);
}

td {
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-800);
}

tr:hover td {
    background: var(--slate-50);
}

/* Clock & Date */
.clock-premium {
    font-size: 4.5rem;
    font-weight: 900;
    text-align: center;
    color: var(--slate-900);
    letter-spacing: -2px;
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
}

.date-premium {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
}

/* Alerts */
.alert-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .dashboard-main {
        width: 95%;
        padding-top: 80px;
    }
}

@media (max-width: 768px) {
    .nav-main {
        padding: 0 1rem;
        height: 64px;
    }
    
    .nav-logo span {
        font-size: 0.9rem;
    }

    .dashboard-main {
        padding-top: 72px; /* Reduced from 88px */
    }

    .panel-card {
        padding: 1.25rem;
    }

    .clock-premium {
        font-size: 2.75rem;
        letter-spacing: -1px;
        margin: 0.5rem 0;
    }

    .date-premium {
        font-size: 0.75rem;
    }

    .auth-card {
        padding: 2rem;
        border-radius: var(--radius-md);
    }

    .auth-title {
        font-size: 1.5rem;
    }
    
    /* Reorder grid for mobile - Action first */
    #dashboard-grid {
        display: flex !important;
        flex-direction: column-reverse; /* Action panel (right) moves to top */
        gap: 1.5rem !important;
    }

    .dashboard-header-mobile {
        margin-bottom: 2rem !important;
    }

    #main-title-mobile {
        font-size: 1.75rem !important;
    }

    .info-card-mobile {
        min-height: 200px !important;
    }

    .action-card-mobile {
        min-height: auto !important;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        box-shadow: none;
        border: none;
        background: white; /* Changed from transparent to fixed dark background issue */
    }

    .clock-premium {
        font-size: 2.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
    }
}

/* Face Recognition Components */
canvas {
    position: absolute;
    top: 0;
    left: 0;
}

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

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-red {
    animation: pulse-red-animation 0.8s infinite;
    color: #fecaca !important;
}

@keyframes pulse-red-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Admin Specific Components */
.sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    padding: 2.5rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem;
    box-sizing: border-box;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease;
}

.admin-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--slate-200);
    margin-bottom: 2rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--slate-100);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Stats Grid for Admin Dashboard */
.top-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
    .top-stats-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-header {
    display: none;
    background: #0f172a;
    color: white;
    padding: 1rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 1024px) {
    .sidebar {
        left: -100%;
    }
    .sidebar.show {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem; /* Reduced padding on mobile */
        padding-top: 80px;
    }
    .mobile-header {
        display: flex;
    }
    #mobileCloseWrapper {
        display: block !important;
    }
}

/* Admin Dashboard & Tables */
.admin-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* Space between rows */
}

th {
    text-align: left;
    padding: 1.2rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 12px;
}

td {
    padding: 1.5rem 1.2rem;
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
}

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

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
}

.badge-admin { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.badge-empleado { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.status-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.8rem;
}
.status-registered { color: #10b981; }
.status-pending { color: #f59e0b; }

/* Consolidated Admin Link Styles */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-premium {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-premium:hover {
    background: #1e293b;
    transform: translateY(-2px);
}
/* Button Adjustments */
.btn-premium {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .admin-card {
        padding: 1.5rem;
    }
    
    .table-container th, .table-container td {
        padding: 1rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-premium {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}
