/* Estilos generales */
.qrs-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.qrs-header {
    text-align: center;
    margin-bottom: 20px;
}

.qrs-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Pestañas */
.qrs-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.qrs-tab-button {
    padding: 10px 15px;
    margin-right: 5px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.qrs-tab-button:hover {
    background: #e9e9e9;
}

.qrs-tab-button.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.qrs-tab-content {
    display: none;
    padding: 15px 0;
}

/* Escáner */
.qrs-scanner-wrapper {
    margin-bottom: 20px;
}

#qrs-reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 15px;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qrs-controls {
    text-align: center;
    margin-top: 15px;
}

/* Búsqueda manual */
.qrs-manual-search {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qrs-search-container {
    display: flex;
    margin-bottom: 15px;
}

.qrs-search-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.qrs-search-container button {
    padding: 8px 16px;
    border-radius: 0 4px 4px 0;
}

.qrs-search-results {
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.qrs-search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.qrs-search-result-item:last-child {
    border-bottom: none;
}

.qrs-search-result-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.qrs-search-result-code {
    color: #666;
    font-size: 14px;
}

.qrs-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* Resultados */
.qrs-result-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.qrs-result-header h3 {
    margin: 0;
    font-size: 18px;
}

.qrs-close-result {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.qrs-result-message {
    padding: 15px;
}

.qrs-result-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 15px 15px;
}

@media (min-width: 600px) {
    .qrs-result-details {
        grid-template-columns: 1fr 1fr;
    }
}

.qrs-person-info {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.qrs-person-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.qrs-person-codes {
    margin-top: 10px;
}

.qrs-person-code-item {
    margin-bottom: 5px;
}

.qrs-scan-info {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.qrs-scan-item {
    margin-bottom: 8px;
}

/* Estados y mensajes */
.qrs-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.qrs-status-success {
    background-color: #e7f7ea;
    color: #46b450;
}

.qrs-status-duplicate {
    background-color: #fff8e5;
    color: #ffb900;
}

.qrs-status-error {
    background-color: #fbeaea;
    color: #dc3232;
}

.qrs-success {
    color: #46b450;
    font-weight: bold;
}

.qrs-error {
    color: #dc3232;
    font-weight: bold;
}

.qrs-alert {
    padding: 10px 15px;
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
    margin-bottom: 10px;
    font-weight: bold;
    color: #856404;
}

.qrs-loading {
    text-align: center;
    padding: 15px;
    color: #666;
}

/* Estilos admin */
.qrs-admin-container {
    max-width: 1200px;
}

.qrs-admin-section {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qrs-upload-container {
    margin-bottom: 20px;
}

.qrs-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.qrs-form-row input[type="file"] {
    flex: 1;
    margin-right: 10px;
}

.qrs-csv-info {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qrs-no-csv-warning {
    padding: 15px;
    background-color: #fbeaea;
    border-left: 4px solid #dc3232;
    margin-bottom: 20px;
}

.qrs-instruction-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.qrs-instruction-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.qrs-instruction-card ul {
    margin-left: 20px;
}

/* Estadísticas */
.qrs-stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.qrs-stat-card {
    flex: 1;
    min-width: 150px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qrs-stat-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.qrs-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #444;
}

.qrs-stat-success .qrs-stat-value {
    color: #46b450;
}

.qrs-stat-duplicate .qrs-stat-value {
    color: #ffb900;
}

.qrs-stat-error .qrs-stat-value {
    color: #dc3232;
}

.qrs-stat-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.qrs-stat-actions button {
    margin-bottom: 5px;
}

.qrs-empty-logs {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Logs table */
.qrs-logs-table {
    margin-top: 15px;
}

.qrs-pagination {
    margin-top: 20px;
    text-align: center;
}

/* Responsive media queries */
@media (max-width: 782px) {
    .qrs-form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .qrs-form-row input[type="file"] {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .qrs-stats-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .qrs-stats-container {
        grid-template-columns: 1fr;
    }
    
    .qrs-search-container {
        flex-direction: column;
    }
    
    .qrs-search-container input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .qrs-search-container button {
        border-radius: 4px;
        width: 100%;
    }
}