.qr-attendance-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.attendance-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.attendance-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.attendance-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.attendance-btn:not(:disabled) {
    background: #007cba;
    color: white;
}

.attendance-btn:not(:disabled):hover {
    background: #005a87;
    transform: translateY(-2px);
}

.attendance-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

#qr-container {
    text-align: center;
    padding: 20px;
    border: 2px dashed #007cba;
    border-radius: 8px;
    margin-bottom: 20px;
}

#qrcode {
    display: inline-block;
    margin: 15px 0;
}

.qr-note {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

.attendance-rules {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.attendance-rules h4 {
    margin-top: 0;
    color: #856404;
}

.attendance-rules ul {
    margin-bottom: 0;
}

.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Status Badges untuk Student View */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

.status-tepat {
    background: #d4edda;
    color: #155724;
}

.status-telat {
    background: #fff3cd;
    color: #856404;
}

.status-pulang {
    background: #d1ecf1;
    color: #0c5460;
}

.status-tidak-hadir {
    background: #f8d7da;
    color: #721c24;
}

.status-manual {
    background: #e2e3e5;
    color: #383d41;
}

/* Admin Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    color: #007cba;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.quick-action-btn {
    display: block;
    background: #fff;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: #007cba;
}

.quick-action-btn h3 {
    margin: 15px 0 10px 0;
}

.quick-action-btn p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.table-actions {
    margin-bottom: 15px;
}

#scanner-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

#reader {
    border: 2px solid #007cba;
    border-radius: 8px;
    overflow: hidden;
}

#scanner-result, #student-info {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#result-content {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    min-height: 60px;
    border: 1px solid #ddd;
}

.scanner-controls {
    margin-top: 20px;
}

/* Modal Styles */
#edit-attendance-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .attendance-buttons {
        flex-direction: column;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    #scanner-container {
        flex-direction: column;
    }
}

/* Attendance History Styles */
.attendance-history-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.attendance-history-section h3 {
    margin-top: 0;
    color: #007cba;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.filter-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.attendance-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.attendance-filter label {
    font-weight: 600;
    margin-right: 5px;
}

.attendance-filter select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.attendance-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.attendance-history-table th {
    background: #007cba;
    color: white;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.attendance-history-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.attendance-history-table tr:nth-child(even) {
    background: #f8f9fa;
}

.attendance-history-table tr:hover {
    background: #e9ecef;
}

.attendance-summary {
    background: #e7f3ff;
    border-left: 4px solid #007cba;
}

.attendance-summary h4 {
    margin-top: 0;
    color: #0056b3;
}

.attendance-summary p {
    margin: 5px 0;
    font-size: 14px;
}

/* Responsive Table */
@media (max-width: 768px) {
    .attendance-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .attendance-filter select {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .attendance-history-table {
        font-size: 14px;
    }
    
    .attendance-history-table th,
    .attendance-history-table td {
        padding: 8px 5px;
    }
}