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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.login-header h1 {
    color: #1a237e;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.4);
}

/* Navbar */
.navbar {
    background: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #1a237e;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    gap: 5px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f0f2f5;
    color: #1a237e;
}

.nav-link.active {
    background: #e8eaf6;
    color: #1a237e;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: #666;
    background: #e8eaf6;
    padding: 2px 8px;
    border-radius: 10px;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e8eaf6;
    color: #1a237e;
}

.btn-logout {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ffebee;
    color: #f44336;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1a237e;
    cursor: pointer;
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #1a237e;
}

/* Attendance Card */
.attendance-card {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    color: white;
}

.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.attendance-date h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.attendance-date p {
    opacity: 0.8;
}

.attendance-time {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.attendance-status {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-bottom: 15px;
}

.attendance-status.weekend {
    background: rgba(255, 152, 0, 0.3);
}

.attendance-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-clock {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-clock-in {
    background: #4CAF50;
    color: white;
}

.btn-clock-out {
    background: #f44336;
    color: white;
}

.btn-clock:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attendance-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.attendance-info-item {
    text-align: center;
}

.attendance-info-item label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 4px;
}

.attendance-info-item span {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-icon.green { background: #4CAF50; }
.stat-icon.blue { background: #2196F3; }
.stat-icon.orange { background: #FF9800; }
.stat-icon.purple { background: #9C27B0; }

.stat-info h3 {
    font-size: 1.5rem;
    color: #333;
}

.stat-info p {
    font-size: 0.8rem;
    color: #888;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    background: #f8f9fc;
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.data-table tr {
    border-bottom: 1px solid #eee;
}

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

/* Status Badge */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-hadir { background: #e8f5e9; color: #2e7d32; }
.status-izin { background: #fff3e0; color: #ef6c00; }
.status-sakit { background: #ffebee; color: #c62828; }
.status-cuti { background: #e3f2fd; color: #1565c0; }

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.event-header {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    padding: 15px;
}

.event-header h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.event-date {
    font-size: 0.85rem;
    opacity: 0.9;
}

.event-body {
    padding: 15px;
}

.event-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #666;
    font-size: 0.9rem;
}

.event-info i {
    color: #1a237e;
    width: 16px;
}

.event-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* KPI */
.kpi-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kpi-bar {
    width: 80px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.kpi-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.kpi-excellent { background: #4CAF50; }
.kpi-good { background: #2196F3; }
.kpi-average { background: #FF9800; }
.kpi-poor { background: #f44336; }

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: #1a237e;
    color: white;
}

.btn-primary:hover {
    background: #283593;
}

.btn-danger {
    background: #ffebee;
    color: #f44336;
    padding: 6px 12px;
}

.btn-danger:hover {
    background: #f44336;
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.2rem;
    color: #1a237e;
}

.close {
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

/* Form */
form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a237e;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

.toast.show { display: flex; }
.toast.success { background: #4CAF50; }
.toast.error { background: #f44336; }

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

/* Empty & Loading */
.loading, .empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading i { animation: spin 1s linear infinite; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .navbar-user .user-badge {
        display: none;
    }
    
    .attendance-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .attendance-time {
        font-size: 1.8rem;
    }
    
    .attendance-actions {
        flex-direction: column;
    }
    
    .btn-clock {
        width: 100%;
        justify-content: center;
    }
    
    .attendance-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-info h3 {
        font-size: 1.2rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .page-header .btn {
        justify-content: center;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

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