* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Logo Styles */
.logo-kai {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.logo-small {
    width: 40px;
    height: auto;
    margin-right: 15px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h2 {
    color: #1e3c72;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.btn-primary {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2a5298;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 5px;
}

.btn-danger:hover {
    background: #e53e3e;
}

.info-text {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #888;
}

/* App Container */
.app-container {
    min-height: 100vh;
    background: #f5f5f5;
}

.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand h3 {
    color: #1e3c72;
    margin-bottom: 5px;
}

.nav-brand span {
    font-size: 12px;
    color: #666;
}

.nav-menu {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f0f0f0;
}

.nav-btn.active {
    background: #1e3c72;
    color: white;
}

.logout-btn, .logout-btn-small {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.logout-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.main-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 32px;
    font-weight: bold;
    color: #1e3c72;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-hadir {
    color: #48bb78;
    font-weight: 500;
}

.status-terlambat {
    color: #f56565;
    font-weight: 500;
}

.status-belum {
    color: #a0aec0;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar input, .filter-bar select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex: 1;
    min-width: 150px;
}

/* Siswa Grid */
.siswa-list-container h2 {
    margin-bottom: 20px;
}

.search-box {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.siswa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.siswa-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.siswa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.siswa-card h3 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.siswa-card p {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

/* Shift Options */
.shift-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.shift-option {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.shift-option:hover {
    border-color: #1e3c72;
    background: #f0f4f8;
    transform: translateY(-2px);
}

.shift-option h4 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.shift-option p {
    color: #666;
    font-size: 12px;
}

/* Camera Styles */
.camera-container {
    margin: 20px 0;
    text-align: center;
}

#video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    margin-bottom: 10px;
}

#captureBtn {
    width: auto;
    padding: 10px 20px;
    margin-top: 10px;
}

#photoPreview {
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 600px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Foto Thumbnail */
.foto-thumb {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        justify-content: center;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .siswa-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
    
    .modal-large {
        margin: 10% auto;
    }
    
    th, td {
        padding: 8px;
        font-size: 12px;
    }
    
    .shift-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar input, .filter-bar select {
        width: 100%;
    }
}

