* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #333;
    overflow-x: hidden;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LOGIN PAGE */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    text-align: center;
}

.login-header h1 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #1976d2, #42a5f5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(25, 118, 210, 0.4);
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    color: #666;
    font-size: 14px;
}

/* DASHBOARD */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 30px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(25, 118, 210, 0.2);
    z-index: 1000;
}

.sidebar-header {
    text-align: center;
    padding: 0 30px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 18px 30px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #42a5f5;
    transform: translateX(5px);
}

.sidebar-footer {
    padding: 0 30px 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.user-info {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.logout-btn {
    display: block;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 30px;
    min-height: 100vh;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.stat-card.blue { border-left: 5px solid #1976d2; }
.stat-card.green { border-left: 5px solid #4caf50; }
.stat-card.purple { border-left: 5px solid #9c27b0; }

.stat-icon {
    font-size: 2.5rem;
}

.stat-card h3 {
    font-size: 2.2rem;
    color: #1976d2;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 0.95rem;
}

.tab-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    min-height: 600px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h2 {
    color: #1976d2;
    font-size: 1.8rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(45deg, #1976d2, #42a5f5);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: linear-gradient(45deg, #1976d2, #42a5f5);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.data-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tr:hover {
    background: #f8f9ff;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

/* SCAN QR */
.scan-section {
    text-align: center;
    max-width: 500px;
    margin: 0 auto 30px;
}

.scan-area {
    position: relative;
    height: 350px;
    margin-bottom: 30px;
    border: 4px dashed #42a5f5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #e3f2fd, #bbdefb);
}

.scanner-frame {
    width: 280px;
    height: 280px;
    position: relative;
    border: 4px solid #1976d2;
    border-radius: 20px;
    background: rgba(25, 118, 210, 0.05);
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #42a5f5, #1976d2, #42a5f5, transparent);
    animation: scan 2s infinite linear;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: calc(100% - 4px); }
}

.scan-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.scan-result {
    text-align: center;
    padding: 40px;
    background: linear-gradient(45deg, #d4edda, #c8e6c9);
    border-radius: 20px;
    border: 3px solid #4caf50;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-8px); }
}

#resultName {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Tambahkan di akhir file CSS */
.btn-small {
    padding: 8px 16px !important;
    font-size: 12px !important;
    margin: 0 2px;
}

.btn.danger {
    background: #f44336 !important;
    color: white !important;
}

.btn.danger:hover {
    background: #d32f2f !important;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4) !important;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal h3 {
    color: #1976d2;
    margin-bottom: 20px;
    text-align: center;
}

.modal input, .modal select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.modal .btn-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

#editAnakForm input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* QR Page Styles */
.qr-page h1 { color: #1976d2; margin-bottom: 10px; }
.qr-page p { color: #666; font-size: 1.1rem; margin-bottom: 20px; }