/* Modern Beautiful Employee Management System CSS */

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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    
    --sidebar-bg: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --card-hover-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    
    --text-dark: #2c3e50;
    --text-medium: #7f8c8d;
    --text-light: #bdc3c7;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--primary-gradient);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: move 20s linear infinite;
}

@keyframes move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    animation: slideIn 0.5s ease-out;
}

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

.login-box h1 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--bg-light);
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.sidebar-header p {
    font-size: 13px;
    opacity: 0.8;
    font-weight: 400;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    padding-left: 30px;
}

.nav-menu a.active::before {
    transform: scaleY(1);
}

.logout-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.logout-btn a {
    background: rgba(231, 76, 60, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: block;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn a:hover {
    background: rgba(231, 76, 60, 0.4);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 30px;
}

.content-header {
    background: white;
    padding: 30px 35px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.content-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

/* ========== KPI CARDS ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.kpi-card h3 {
    font-size: 13px;
    color: var(--text-medium);
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.kpi-card .value {
    font-size: 42px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

/* ========== TABLES ========== */
.table-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8f9fa;
    padding: 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e1e8ed;
}

table td {
    padding: 18px;
    border-bottom: 1px solid #e1e8ed;
    color: var(--text-dark);
}

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

table tr:hover {
    background: #f8f9fa;
}

/* ========== STATUS BADGES ========== */
.status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.approved {
    background: #d4edda;
    color: #155724;
}

.status.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* ========== FORMS ========== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 40px;
    border-radius: 20px;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e8ed;
}

.modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.close {
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    color: var(--text-medium);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

/* ========== TOP EMPLOYEES CARDS ========== */
.top-employees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.employee-card {
    background: var(--primary-gradient);
    padding: 25px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.employee-card h4 {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 12px;
    font-weight: 500;
}

.employee-card .name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.employee-card .code {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 15px;
}

.employee-card .stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.employee-card .stat-item {
    text-align: center;
}

.employee-card .stat-value {
    font-size: 22px;
    font-weight: 800;
    display: block;
}

.employee-card .stat-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .top-employees {
        grid-template-columns: 1fr;
    }
}

/* ========== CAMERA MODAL ========== */
.camera-modal {
    text-align: center;
}

#video, #video2 {
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    border: 3px solid var(--primary);
}

.camera-controls {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.captured-image {
    max-width: 100%;
    border-radius: 16px;
    margin-top: 25px;
    border: 3px solid var(--success);
}

/* ========== CHARTS CONTAINER ========== */
.chart-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.chart-container h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
}

/* ========== ERROR & SUCCESS MESSAGES ========== */
.error-message {
    color: var(--danger);
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    padding: 12px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
}

.success-message {
    color: var(--success);
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    padding: 12px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

/* ========== ANIMATIONS ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== SECTION TITLE ========== */
.section-title {
    padding: 12px 25px;
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 25px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ========== ADDITIONAL IMPROVEMENTS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kpi-card .trend {
    margin-top: 12px;
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

/* Icon improvements */
.nav-menu a::after {
    content: '→';
    position: absolute;
    right: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    opacity: 1;
    right: 15px;
}

