﻿/* ============================================
   TIENDA FORMS - ESTILOS UNIFICADOS
   Versión: 1.0
   ============================================ */

/* ============================================
   1. RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fb;
    color: #2d3e50;
    line-height: 1.5;
}

/* ============================================
   2. CONTENEDORES PRINCIPALES
   ============================================ */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.form-container {
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    max-width: 500px;
    margin: 2rem auto;
}

.form-admin-container {
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    max-width: 1100px;
    margin: 2rem auto;
}

/* ============================================
   3. HEADERS Y NAVEGACIÓN
   ============================================ */
.admin-header,
.form-header,
.details-header {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #eef2f7;
}

.admin-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1rem;
}

.admin-breadcrumb {
    color: #64748b;
    font-size: 14px;
}

    .admin-breadcrumb a {
        color: #3b82f6;
        text-decoration: none;
    }

        .admin-breadcrumb a:hover {
            text-decoration: underline;
        }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 15px;
    transition: color 0.2s;
}

    .back-link:hover {
        color: #3b82f6;
    }

/* ============================================
   4. STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    }

.stat-title {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #1e293b;
}

.stat-label {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 5px;
}

/* ============================================
   5. BLOQUES DE FORMULARIO
   ============================================ */
.form-box {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.form-admin-box {
    width: 100%;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.form-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* ============================================
   6. BARRA DE HERRAMIENTAS Y FILTROS
   ============================================ */
.toolbar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #eef2f7;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    flex: 2;
    min-width: 300px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input-group {
    display: flex;
    flex: 1;
    min-width: 250px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 14px;
    outline: none;
}

.search-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

    .search-button:hover {
        background: #2563eb;
    }

.filter-select {
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 150px;
    outline: none;
}

.export-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

    .export-button:hover {
        background: #059669;
    }

/* Filtros avanzados */
.filters-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eef2f7;
}

.filters-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .filter-group label {
        font-size: 13px;
        font-weight: 500;
        color: #475569;
    }

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

.date-input {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.amount-input {
    width: 120px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.clear-filters {
    color: #ef4444;
    text-decoration: none;
    font-size: 13px;
    margin-left: 10px;
}

    .clear-filters:hover {
        text-decoration: underline;
    }

/* ============================================
   7. TABLAS
   ============================================ */
.table-container {
    background: white;
    min-height: 1000px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

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

    .users-table th {
        background: #f8fafc;
        padding: 16px 20px;
        text-align: left;
        font-weight: 600;
        font-size: 13px;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #e2e8f0;
    }

    .users-table td {
        padding: 16px 20px;
        border-bottom: 1px solid #eef2f7;
        font-size: 14px;
    }

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

    .users-table tr:hover {
        background: #f8fafc;
    }

/* ============================================
   8. AVATARES E INFORMACIÓN DE USUARIO
   ============================================ */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin-right: 15px;
}

.user-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
}

.order-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

    .user-info-header h3 {
        color: #1e293b;
        margin-bottom: 5px;
    }

    .user-info-header p {
        color: #64748b;
        font-size: 14px;
    }

.user-details {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-weight: 500;
    color: #1e293b;
}

.user-name {
    font-size: 13px;
    color: #64748b;
}

.user-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-title-info h1 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 5px;
}

.user-title-info p {
    color: #64748b;
    font-size: 16px;
}

/* ============================================
   9. BADGES Y ETIQUETAS
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
}

/* Badges de roles */
.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #dbeafe;
    color: #1e40af;
}

.badge-manager {
    background: #e0f2fe;
    color: #0369a1;
}

/* Badges de estado */
.badge-locked {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-confirmed {
    background: #dcfce7;
    color: #166534;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Badges de pedidos */
.badge-pendiente_pago {
    background: #fef3c7;
    color: #92400e;
}

.badge-pago_iniciado {
    background: #dbeafe;
    color: #1e40af;
}

.badge-pagado {
    background: #dcfce7;
    color: #166534;
}

.badge-rembolsado {
    background: #f1f5f9;
    color: #475569;
}

.badge-error_pago {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-iniciado {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 15px;
}

.badge-item-count {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 8px;
}

/* Roles container */
.roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.role-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
}

    .role-badge.admin {
        background: #fef3c7;
        color: #92400e;
    }

    .role-badge.manager {
        background: #e0f2fe;
        color: #0369a1;
    }

    .role-badge.user {
        background: #dbeafe;
        color: #1e40af;
    }

/* ============================================
   10. MENÚ DE ACCIONES (DROPDOWN)
   ============================================ */
.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-button {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    width: 100%;
    white-space: nowrap;
}

    .actions-button:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

.actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
}

    .actions-menu:hover .actions-dropdown,
    .actions-dropdown:hover {
        display: block;
    }

.actions-menu::after {
    content: '';
    position: absolute;
    height: 10px;
    width: 100%;
    bottom: -10px;
    left: 0;
    background: transparent;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

    .action-item:last-child {
        border-bottom: none;
    }

    .action-item:hover {
        background: #f1f5f9;
    }

    .action-item.delete:hover {
        color: #dc2626;
        background: #fee2e2;
    }

.action-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* ============================================
   11. CARDS DE INFORMACIÓN (DETAILS)
   ============================================ */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card-title {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    padding: 8px 0;
    border-bottom: 1px dashed #eef2f7;
}

.info-label {
    width: 140px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    flex: 1;
    color: #1e293b;
    font-size: 15px;
    font-weight: 500;
}

    .info-value.confirmed {
        color: #059669;
    }

    .info-value.pending {
        color: #d97706;
    }

/* ============================================
   12. FORMULARIOS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
}

    .form-control:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    }

    .form-control.is-invalid {
        border-color: #ef4444;
        background: #fef2f2;
    }

    .form-control:read-only {
        background: #f8fafc;
        border-color: #e2e8f0;
        color: #64748b;
    }

.input-text {
    width: 100%;
    padding: 0.75rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.input-label {
    position: absolute;
    top: -0.6rem;
    left: 0.5rem;
    font-size: 0.85rem;
    background-color: #fff;
    padding: 0 0.25rem;
    color: #555;
}

.validation-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 5px;
}

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

/* Checkbox groups */
.checkbox-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

    .checkbox-item:hover {
        background: #f1f5f9;
    }

    .checkbox-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 12px;
        cursor: pointer;
    }

    .checkbox-item label {
        cursor: pointer;
        color: #1e293b;
        font-weight: 500;
        flex: 1;
    }

.checkbox-description {
    color: #64748b;
    font-size: 13px;
    margin-left: 30px;
    margin-top: -10px;
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.checkbox-input {
    margin-right: 0.5rem;
}

/* Password requirements */
.password-requirements {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}

    .password-requirements ul {
        list-style: none;
        padding-left: 0;
        margin-top: 8px;
    }

    .password-requirements li {
        margin-bottom: 5px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.requirement-met {
    color: #10b981;
}

.requirement-unmet {
    color: #ef4444;
}

/* Info boxes */
.info-box {
    background: #eff6ff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    color: #1e40af;
    font-size: 14px;
    border-left: 4px solid #3b82f6;
}

.info-text {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

/* Texto informativo / enlaces */
.info-text {
    color: #2980b9;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

    .info-text a {
        color: #007bff;
        text-decoration: none;
    }

        .info-text a:hover {
            text-decoration: underline;
        }

/* ============================================
   13. BOTONES
   ============================================ */
.btn {
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #111;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    padding: 0.75rem;
    cursor: pointer;
}

    .btn-primary:hover {
        background-color: #333;
    }

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
}

    .btn-secondary:hover {
        background-color: #5a6268;
    }

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

    .btn-danger:hover {
        background: #dc2626;
    }

.btn-warning {
    background: #f59e0b;
    color: white;
}

    .btn-warning:hover {
        background: #d97706;
    }

.btn-large {
    font-size: 1.1rem;
    padding: 0.85rem;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

    .btn-outline-secondary:hover:not(:disabled) {
        background: #6c757d;
        color: #fff;
    }

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

.btn-logout {
    background: none;
    border: none;
    color: #007bff;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

    .btn-logout:hover {
        color: #0056b3;
    }

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.w-full {
    width: 100%;
}

/* Botones de login externo */
.external-btn {
    margin-bottom: 0.5rem;
}

/* ============================================
   14. 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;
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background: white;
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

    .modal-content h3 {
        font-size: 22px;
        color: #1e293b;
        margin: 0 0 20px 0;
    }

    .modal-content p {
        color: #64748b;
        margin-bottom: 25px;
    }

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    border-top: 2px solid #f1f5f9;
    padding-top: 20px;
}

/* ============================================
   15. IMAGE SELECTOR COMPONENT
   ============================================ */
.image-selector-component {
    margin-bottom: 1.5rem;
}

    .image-selector-component .selected-preview {
        margin-bottom: 1rem;
    }

    .image-selector-component .preview-container {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 0.5rem;
        min-height: 120px;
    }

        .image-selector-component .preview-container img {
            max-height: 100px;
            width: auto;
            object-fit: contain;
        }

    .image-selector-component .image-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        max-height: 300px;
        overflow-y: auto;
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
        margin-top: 0.5rem;
    }

    .image-selector-component .image-item {
        cursor: pointer;
        border: 2px solid transparent;
        border-radius: 4px;
        padding: 2px;
        background: white;
        transition: all 0.2s ease;
        position: relative;
    }

        .image-selector-component .image-item:hover {
            border-color: #6c757d;
            transform: scale(1.02);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .image-selector-component .image-item.selected {
            border-color: #0d6efd;
            background-color: rgba(13,110,253,0.05);
        }

            .image-selector-component .image-item.selected::after {
                content: "✓";
                position: absolute;
                top: 2px;
                right: 2px;
                background: #0d6efd;
                color: white;
                width: 18px;
                height: 18px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                font-weight: bold;
            }

        .image-selector-component .image-item img {
            width: 100%;
            height: 70px;
            object-fit: cover;
            border-radius: 2px;
        }

    .image-selector-component .btn-clear {
        background-color: #6c757d;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        cursor: pointer;
        transition: background-color 0.2s;
        margin-top: 0.5rem;
    }

        .image-selector-component .btn-clear:hover {
            background-color: #5a6268;
        }

    .image-selector-component .search-box {
        width: 100%;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 0.9rem;
    }

        .image-selector-component .search-box:focus {
            outline: none;
            border-color: #0d6efd;
            box-shadow: 0 0 0 2px rgba(13,110,253,0.25);
        }

    .image-selector-component .form-group {
        margin-bottom: 1rem;
        position: relative;
    }

    .image-selector-component .input-text {
        width: 100%;
        padding: 0.75rem 0.5rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 1rem;
    }

    .image-selector-component .btn-outline-secondary {
        background: transparent;
        border: 1px solid #6c757d;
        color: #6c757d;
        padding: 0.4rem 0.8rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9rem;
    }

        .image-selector-component .btn-outline-secondary:hover {
            background: #6c757d;
            color: #fff;
        }

/* ============================================
   16. IMAGE DIALOG
   ============================================ */
.image-dialog {
    width: min(90%, 900px);
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

    .image-dialog::backdrop {
        background: rgba(0,0,0,0.5);
    }

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 8px 8px 0 0;
}

.dialog-title {
    margin: 0;
    font-size: 1.25rem;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.dialog-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 0 0 8px 8px;
    text-align: right;
}

/* ============================================
   17. PAGINACIÓN
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 25px;
    background: white;
    border-top: 1px solid #eef2f7;
}

.pagination-info {
    color: #64748b;
    font-size: 14px;
}

.pagination-link {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.2s;
}

    .pagination-link:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

    .pagination-link.disabled {
        color: #cbd5e1;
        pointer-events: none;
        border-color: #e2e8f0;
    }

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* ============================================
   18. ALERTAS Y MENSAJES
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-left-color: #22c55e;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #b91c1c;
}

.alert-info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

/* Mensajes de error / alerta */
.header-error {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
}

.title-error {
    color: #c0392b;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.message-error {
    color: #e74c3c;
    font-size: 1.1rem;
}

.error-text,
.error-summary {
    color: #c0392b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ============================================
   19. HEADERS ESPECÍFICOS
   ============================================ */
.header-logout {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
}

.logout-form {
    margin: 1rem 0;
}

.login-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.login-links {
    text-align: center;
    margin-top: 1rem;
}

    .login-links a {
        color: #007bff;
        text-decoration: none;
    }

        .login-links a:hover {
            text-decoration: underline;
        }

/* ============================================
   20. RECOVERY CODES
   ============================================ */
.recovery-codes {
    margin-top: 1rem;
}

.recovery-code {
    display: inline-block;
    padding: 0.4rem 0.6rem;
    margin: 0.25rem;
    background: #f5f5f5;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.95rem;
}

/* ============================================
   21. ICONOS
   ============================================ */
.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.lock-icon::after {
    content: "🔒";
}

.unlock-icon::after {
    content: "🔓";
}

.edit-icon::after {
    content: "✏️";
}

.delete-icon::after {
    content: "🗑️";
}

.roles-icon::after {
    content: "👥";
}

/* ============================================
   22. UTILIDADES
   ============================================ */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.gap-3 {
    gap: 1rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.mb-3 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* ============================================
   23. RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .users-table {
        display: block;
        overflow-x: auto;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
    }

    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }

    .user-title {
        flex-direction: column;
        text-align: center;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-title,
    .title-error {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1.25rem;
    }

    .form-box {
        padding: 1.5rem;
    }

    .message-error {
        font-size: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-actions,
    .action-buttons {
        flex-direction: column;
    }

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

    .checkbox-item {
        flex-wrap: wrap;
    }
}

/* ============================================
   24. UTILIDADES ESPECÍFICAS
   ============================================ */
/* Asegurar que las miniaturas ocultas no ocupen espacio */
.image-grid .image-item[style*="display: none"] {
    display: none !important;
}

/* Mejora visual para el mensaje de "no resultados" */
#noResults_@inputId {
    background: #f8f9fa;
    border-radius: 4px;
    font-style: italic;
}
