:root {
    --bg-color: #f8fafc;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent-color: #002b5c; /* Corporate Navy */
    --accent-hover: #001f42;
    --glass-bg: #ffffff;
    --glass-border: #e5e7eb;
    --error-color: #b91c1c; /* Corporate Red */
    --success-color: #15803d;
    --surface-hover: #f3f4f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Roboto', 'Google Sans', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}


/* Background Animation Removal */
.background-glow {
    display: none;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
}

/* Material Design Overrides */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    transition: box-shadow 0.2s;
}

.glass-header {
    background: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    border-radius: 0;
    box-shadow: none;
}

.dashboard {
    width: 100%;
    max-width: 800px;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Forms and Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

input, select {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

/* Buttons */


.btn-primary, .btn-secondary, 

.btn-primary:hover, .btn-secondary:hover, 









/* Big Interactive Check-in Button */
.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.check-circle {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 2rem;
}

.circle-inner {
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    box-shadow: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.check-circle:active .circle-inner {
    transform: scale(0.95);
}

.check-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    animation: pulsate 2s infinite ease-out;
    z-index: 1;
}

@keyframes pulsate {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

.status-info {
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: center;
}

/* Typography & Utilities */
h2, h3, h4 { color: var(--text-primary); }
h2 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.logo-area { text-align: center; margin-bottom: 2rem; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hidden { display: none !important; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.error-message { color: var(--error-color); text-align: center; font-size: 0.9rem; margin-top: 0.5rem; }

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

/* Tables and Forms */
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.input-col { display: flex; flex-direction: column; gap: 0.5rem; }
.row > * { flex: 1; min-width: 220px; }
.border-bottom { border-bottom: 1px solid var(--glass-border); }
.pb-2 { padding-bottom: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.table-container { 
    width: 100%; 
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem; 
    background: #ffffff; 
    border-radius: 2px; 
    border: 1px solid var(--glass-border); 
}
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 1rem; border-bottom: 1px solid var(--glass-border); }
.data-table th { background: #f8f9fa; color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:hover { background: var(--surface-hover); transition: background 0.2s; }

/* Modal Background override */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(32,33,36,0.6);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: #ffffff; padding: 2.5rem; border-radius: 2px;
    width: 90%; max-width: 900px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

/* Badges */
.badge { padding: 4px 10px; border-radius: 2px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; margin-right: 5px; }
.badge.success { background: #e6f4ea; color: #1e8e3e; border: 1px solid transparent; }
.badge.danger { background: #fce8e6; color: #d93025; border: 1px solid transparent; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #ffffff; border: 1px solid var(--glass-border); padding: 1rem 1.5rem; border-radius: 4px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); animation: slideInRight 0.3s ease; }
.toast.success { border-left: 6px solid var(--success-color); }
.toast.error { border-left: 6px solid var(--error-color); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =========================================
   📱 RESPONSIVE NATIVE WEBAPP (MOBILE)
   ========================================= */
@media screen and (max-width: 768px) {
    /* 1. Global Reset for Mobile Viewport */
    body { background-color: var(--bg-color); }
    .container { padding: 0; align-items: flex-start; min-height: 100vh; }
    .dashboard { min-height: 100vh; padding-bottom: 0px; margin: 0; max-width: 100%; border-radius: 0; }
    
    /* 2. Glass Card & Component Adjustments */
    .glass-card { 
        padding: 1.5rem; 
        border-radius: 12px;
        width: 94%; 
        margin: 0.8rem auto;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        border: 1px solid var(--glass-border);
    }
    
    .glass-header { 
        padding: 1rem; 
        border-radius: 0 0 12px 12px; 
    }

    input, select { padding: 0.8rem; font-size: 16px; /* evita el auto-zoom en iOS */ }
    
    /* Typography on mobile */
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.2rem; }
    
    .check-circle { width: 200px; height: 200px; margin: 2rem auto; }
    .check-text { font-size: 1.5rem; }

    /* 3. Grid & Layout Adjustments */
    .admin-grid { grid-template-columns: 1fr; padding: 0.5rem; gap: 0.5rem; }
    .admin-grid .glass-card { width: 100%; margin: 0; }
    .row { flex-direction: column; gap: 0.8rem; }
    .row > * { min-width: 100%; width: 100%; }
    
    /* 4. Table Resposiveness */
    .table-container { 
        border-radius: 8px; margin-top: 1rem; border: none; 
        box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .data-table th, .data-table td { padding: 0.8rem 0.5rem; font-size: 0.85rem; }

    /* 5. Modals & Toasts */
    .modal-content {
        width: 100%; height: 100%; 
        max-height: 100%; border-radius: 0; 
        margin: 0; padding: 1rem; border: none;
    }
    #toast-container { bottom: 85px; left: 10px; right: 10px; }
    .toast { width: 100%; padding: 0.8rem; font-size: 0.9rem; justify-content: center; }

    /* =======================================================
       📱 ESTRICTO PARA EMPLEADOS: BOTTOM NAVIGATION BAR
    ======================================================= */
    .dashboard {
        padding-bottom: 90px; 
    }

    .employee-navbar {
        position: fixed;
        bottom: 0px;
        left: 0px;
        width: 100%;
        background: #ffffff;
        border-radius: 0;
        border-top: 1px solid #e1e4e8;
        padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
        z-index: 9999;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
        margin: 0;
    }
    .employee-navbar .nav-brand { display: none; }
    .employee-navbar .nav-menu {
        flex: 1; display: flex; justify-content: space-around; gap: 5px; background: transparent; padding: 0; margin: 0;
    }
    .employee-navbar .nav-tab {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        padding: 8px 0; font-size: 0.70rem; color: #7f8c8d; border-radius: 8px; gap: 4px; font-weight: 500;
        background: transparent; border: none; box-shadow: none; transition: all 0.2s;
    }
    .employee-navbar .nav-tab.active {
        color: var(--accent-color); background: transparent; box-shadow: none; font-weight: 700;
    }
    .employee-navbar .nav-tab:active {
        transform: scale(0.95);
    }
    
    .employee-navbar .nav-tab::before { font-size: 1.6rem; display: block; margin-bottom: 4px;}
    .employee-navbar .nav-tab[data-tab="tab-home"]::before { content: "🏠"; } 
    .employee-navbar .nav-tab[data-tab="tab-leaves"]::before { content: "📋"; } 
    .employee-navbar .nav-tab[data-tab="tab-courses"]::before { content: "🎓"; } 
    
    /* Move action buttons logically on mobile, keeping header clean */
    .header-actions { margin-top: 10px; justify-content: flex-end; width: 100%; }
}

.btn-primary, .btn-secondary, .btn-outline {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    border: 1px solid var(--accent-color) !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
    min-width: auto;
    max-width: 100%;
    margin-bottom: 0.5rem;
    cursor: pointer;
    text-align: center;
}
.btn-primary:hover, .btn-secondary:hover {
    background: var(--accent-hover) !important;
    transform: none !important;
    box-shadow: none !important;
}
.btn-outline {
    background: transparent !important;
    color: var(--accent-color) !important;
}
.btn-outline:hover {
    background: var(--surface-hover) !important;
    transform: none !important;
}


/* =========================================
   NUEVO REDISEÑO EMPLEADO Y CURSOS
========================================= */

@media screen and (min-width: 769px) {
    .employee-navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #ffffff;
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem;
        border-radius: 0;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .nav-menu {
        display: flex;
        gap: 15px;
        background: #f8fafc;
        padding: 5px;
        border-radius: 2px;
        border: 1px solid var(--glass-border);
    }

    .nav-tab {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        padding: 8px 15px;
        border-radius: 2px;
        cursor: pointer;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .nav-tab:hover {
        color: var(--text-primary);
        background: var(--surface-hover);
    }

    .nav-tab.active {
        background: var(--accent-color);
        color: #fff;
        box-shadow: none;
    }

    .nav-user {
        display: flex;
        gap: 5px;
    }
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.active-tab {
    display: block;
}

.employee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media(min-width: 768px) {
    .employee-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cursos Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.course-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--accent-color);
}

.course-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
}

.course-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.course-info {
    padding: 1rem;
}

.course-info h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.course-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}


/* =========================================
   REDISEÑO ADMIN SIDEBAR (ESTILO FISCOCLIC)
========================================= */

.admin-layout-wrapper {
    display: flex;
    flex-direction: row !important;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #f4f6f9;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 250px;
    background: #ffffff;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    z-index: 10;
    transition: width 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 300; letter-spacing: 1px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    list-style: none;
}

.admin-nav-item {
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, border-left 0.2s;
    border-left: 4px solid transparent;
}

.admin-nav-item:hover {
    background: rgba(0,0,0,0.03);
}

.admin-nav-item.active {
    background: var(--surface-hover);
    border-left-color: var(--accent-color);
    font-weight: 500;
}

.admin-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Main Content Area */
.admin-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-topbar {
    background: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05); border-bottom:1px solid var(--glass-border);
    z-index: 5;
}

.admin-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}


/* UI MULTI-SELECT DROPDOWN */
.ms-container {
    position: relative;
    width: 100%;
}
.ms-button {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ms-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 4px;
    z-index: 100;
    max-height: 250px;
    display: flex;
    flex-direction: column;
}
.ms-dropdown.hidden {
    display: none;
}
.ms-search-box {
    padding: 8px;
    border-bottom: 1px solid #eee;
}
.ms-search-box input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}
.ms-list {
    overflow-y: auto;
    padding: 5px 0;
    flex: 1;
}
.ms-item {
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ms-item:hover {
    background: rgba(0,0,0,0.03);
}


/* ====== MOBILE RESPONSIVE TWEAKS ====== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin-right: 15px;
    color: var(--text-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 990;
    backdrop-filter: blur(2px);
}
.mobile-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block !important;
    }
    
    .admin-sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        width: 250px;
        max-width: 80%;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 10000;
        height: 100vh;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        border-right: none;
        background: #ffffff;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    
    .admin-topbar {
        padding-left: 10px; 
    }
    
    .admin-main-area {
        margin-left: 0 !important;
        width: 100% !important;
        padding-bottom: 2rem !important;
    }

    .modal-content {
        padding: 15px;
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .row {
        flex-direction: column;
        gap: 10px;
    }
    
    .data-table th, .data-table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
    }
}
