/* ========================================================================== */
/* ACCESO CLIENTES PAGE - Administración De Accesos Clientes                  */
/* ========================================================================== */

/* Eliminar padding del main-content para esta página */
.main-content:has(.accesos-page) {
    padding: 0 !important;
}

.accesos-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 95px);
    width: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Ajuste del camara-panel para que ocupe todo el espacio */
.accesos-page .camara-panel {
    margin: 0;
    padding: 0.75rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Ajuste del camara-header */
.accesos-page .camara-header {
    margin: 0 0 0.5rem 0;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
}

/* Header principal con input de búsqueda y botón de exportar */
.accesos-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.accesos-main-header h4 {
    flex-shrink: 0;
}

/* Contenedor del input de búsqueda centrado */
.header-search-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 350px;
    margin: 0 auto;
    position: relative;
}

.header-search-container svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    pointer-events: none;
}

.header-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.header-search-input::placeholder {
    color: var(--text-secondary);
}

.header-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.15);
}

:root.light-mode .header-search-input,
.light-mode .header-search-input {
    background: #ffffff;
    border-color: #d0d0d0;
}

:root.light-mode .header-search-input:focus,
.light-mode .header-search-input:focus {
    border-color: var(--primary-color);
}

/* Botón de exportar en el header */
.btn-exportar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-exportar-header .btn-icon-svg {
    width: 18px;
    height: 18px;
}

.btn-exportar-header:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-exportar-header:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Botón verde gradiente (igual que en TagsDuplicados) */
.btn-green-gradient {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-green-gradient:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-green-gradient:active:not(:disabled) {
    transform: translateY(0);
}

/* Override de camara-body para layout horizontal */
.accesos-page .camara-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    padding: 0.5rem;
    flex: 1;
    min-height: 0;
}

/* ========================================================================== */
/* GRID DE ACCESOS - 2 Cards horizontales                                     */
/* ========================================================================== */

.accesos-grid {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* ========================================================================== */
/* ACCESO CARD                                                                */
/* ========================================================================== */

.acceso-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    min-height: 0;
    height: 100%;
}

/* Card de Clientes - 15% del width */
.acceso-card.clientes-card {
    flex: 0 0 15%;
    min-width: 150px;
    max-width: 250px;
}

/* Card de Usuarios - Resto del width (90%) */
.acceso-card.usuarios-card {
    flex: 1;
    min-width: 0;
}

/* Modo claro - fondo gris para el card */
:root.light-mode .acceso-card {
    background: #d9d9d9;
}

.light-mode .acceso-card {
    background: #d9d9d9;
}

/* Card Header con gradiente */
.acceso-card-header {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 38px;
    box-sizing: border-box;
}

.acceso-card-header h3 {
    color: white;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header del card de usuarios - título centrado con spacer */
.usuarios-card .acceso-card-header {
    justify-content: space-between;
}

.usuarios-card .acceso-card-header h3 {
    text-align: center;
    flex: 1;
}

/* Spacer para balancear el botón y centrar el título */
.header-spacer {
    width: 28px;
    min-width: 28px;
    height: 28px;
}

/* Contador de usuarios en header */
.usuarios-count {
    font-weight: 400;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.usuarios-count.activos {
    background: rgba(40, 167, 69, 0.2);
    color: #90EE90;
}

.usuarios-count.suspendidos {
    background: rgba(251, 51, 51, 0.2);
    color: #FF0000;
}

/* Botón de agregar cliente */
.acceso-btn-add {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.acceso-btn-add svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.acceso-btn-add:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.acceso-btn-add:active {
    transform: scale(0.95);
}

/* Card Body */
.acceso-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.65rem;
    gap: 0.5rem;
    overflow: hidden;
    min-height: 0;
}

/* Body del card de usuarios - permite scroll */
.usuarios-card .acceso-card-body {
    overflow: hidden;
    padding: 0.5rem;
}

/* ========================================================================== */
/* LISTA DE CLIENTES                                                          */
/* ========================================================================== */

.clientes-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 0.25rem;
}

/* Item de cliente */
.cliente-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--input-bg);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Modo claro - fondo blanco para items */
:root.light-mode .cliente-item {
    background: #ffffff;
    border-color: #e8e8e8;
}

.light-mode .cliente-item {
    background: #ffffff;
    border-color: #e8e8e8;
}

.cliente-item:hover:not(.selected) {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.1), rgba(0, 180, 255, 0.1));
    border-color: var(--primary-color);
}

:root.light-mode .cliente-item:hover:not(.selected),
.light-mode .cliente-item:hover:not(.selected) {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.15), rgba(0, 180, 255, 0.15));
    border-color: var(--primary-color);
}

/* Item seleccionado */
.cliente-item.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.cliente-item.selected .cliente-nombre {
    font-weight: 600;
    color: white;
}

.cliente-item.selected:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    filter: brightness(1.1);
    box-shadow: 0 2px 6px rgba(240, 116, 0, 0.4);
}

/* Modo claro - item seleccionado */
:root.light-mode .cliente-item.selected,
.light-mode .cliente-item.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Nombre del cliente */
.cliente-nombre {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

/* Botón de editar cliente - Estilo azul como en Catalogos */
.cliente-btn-edit {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 4px;
    border: 1px solid #00b4ff;
    background: linear-gradient(135deg, #00b4ff, #0099dd);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cliente-btn-edit svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

.cliente-btn-edit:hover {
    box-shadow: 0 2px 8px rgba(0, 180, 255, 0.4);
    transform: scale(1.05);
}

.cliente-btn-edit:active {
    transform: scale(0.95);
}

.cliente-item.selected .cliente-btn-edit {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.cliente-item.selected .cliente-btn-edit:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

/* Mensaje cuando no hay clientes */
.clientes-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0.5rem;
}

/* ========================================================================== */
/* USUARIOS - GRID DE TARJETAS                                                */
/* ========================================================================== */

/* Mensaje cuando no hay usuarios o no se ha seleccionado cliente */
.usuarios-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
    gap: 1rem;
}

.usuarios-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-secondary);
    opacity: 0.5;
}

/* Spinner de carga de usuarios */
.usuarios-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contenedor de tarjetas de usuario con flexbox */
.usuarios-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.75rem;
    padding-right: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    align-content: flex-start;
}

.usuarios-grid .usuario-card {
    flex: 0 0 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
}

/* ========================================================================== */
/* USUARIO CARD - Tarjeta de presentación ejecutiva                          */
/* ========================================================================== */

.usuario-card {
    display: flex;
    flex-direction: column;
    background: var(--input-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    height: fit-content;
    cursor: pointer;
}

.usuario-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Estado visual por status */
.usuario-card.activo {
    border-left: 4px solid #28a745;
}

.usuario-card.suspendido {
    border-left: 4px solid #dc3545;
    opacity: 0.85;
}

.usuario-card.suspendido:hover {
    opacity: 1;
}

/* Modo claro */
:root.light-mode .usuario-card,
.light-mode .usuario-card {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

:root.light-mode .usuario-card:hover,
.light-mode .usuario-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========================================================================== */
/* USUARIO CARD HEADER                                                        */
/* ========================================================================== */

.usuario-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}

:root.light-mode .usuario-card-header,
.light-mode .usuario-card-header {
    background: transparent;
}

/* Avatar del usuario - sin imagen (con SVG) */
.usuario-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    max-width: 52px;
    max-height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(240, 116, 0, 0.35);
    flex-shrink: 0;
}

.usuario-avatar svg {
    width: 30px;
    height: 30px;
    stroke: white;
    flex-shrink: 0;
}

/* Avatar con imagen - cuadrado con bordes redondeados */
.usuario-avatar.has-image {
    background: #ffffff;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    width: auto;
    min-width: 52px;
    max-width: 70px;
}

/* Modo claro - mantener fondo original */
:root.light-mode .usuario-avatar.has-image,
.light-mode .usuario-avatar.has-image {
    background: var(--bg-secondary);
}

.usuario-avatar img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
}

/* Imagen dentro de avatar con imagen - sin border-radius circular */
.usuario-avatar.has-image img {
    width: auto;
    max-width: 100%;
    height: 44px;
    object-fit: contain;
    border-radius: 0;
}

/* Info del header (nombre y grupo) */
.usuario-info-header {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.usuario-nombre {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usuario-grupo {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge de status con efecto glow */
.usuario-status-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.usuario-status-badge.activo {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.usuario-status-badge.suspendido {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}

/* Dot pulsante del status */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.usuario-status-badge.activo .status-dot {
    background: #28a745;
    box-shadow: 0 0 6px #28a745;
}

.usuario-status-badge.suspendido .status-dot {
    background: #dc3545;
    box-shadow: 0 0 6px #dc3545;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* ========================================================================== */
/* USUARIO CARD BODY                                                          */
/* ========================================================================== */

.usuario-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    flex: 1;
}

/* Fila de información */
.usuario-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
}

.usuario-info-row svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    stroke: var(--primary-color);
    opacity: 0.8;
}

.usuario-info-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge de tipo de acceso */
.usuario-tipo-acceso {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(0, 180, 255, 0.15);
    color: #00b4ff;
}

.usuario-tipo-acceso.full {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.2), rgba(0, 180, 255, 0.2));
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================================================== */
/* USUARIO CARD FOOTER - Botones de acción                                   */
/* ========================================================================== */

.usuario-card-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

:root.light-mode .usuario-card-footer,
.light-mode .usuario-card-footer {
    background: rgba(0, 0, 0, 0.03);
}

/* Botones de acción */
.usuario-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.usuario-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.usuario-btn:hover {
    transform: scale(1.1);
}

.usuario-btn:active {
    transform: scale(0.95);
}

/* Botón Editar - Azul */
.usuario-btn-edit {
    background: linear-gradient(135deg, #00b4ff, #0099dd);
    box-shadow: 0 2px 6px rgba(0, 180, 255, 0.3);
}

.usuario-btn-edit:hover {
    box-shadow: 0 4px 12px rgba(0, 180, 255, 0.5);
}

/* Botón Activar - Verde */
.usuario-btn-activate {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.usuario-btn-activate:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
}

/* Botón Suspender - Naranja/Amarillo */
.usuario-btn-suspend {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.usuario-btn-suspend:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.5);
}

.usuario-btn-suspend svg {
    stroke: #333;
}

/* Botón Eliminar - Rojo */
.usuario-btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.usuario-btn-delete:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

/* Botón de agregar usuario deshabilitado */
.acceso-btn-add:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.acceso-btn-add:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================================================== */
/* RESPONSIVE                                                                 */
/* ========================================================================== */

@media (max-width: 1200px) {
    .usuarios-grid {
        gap: 1.1rem;
        padding: 0.65rem;
        padding-right: 0.9rem;
    }

    .usuarios-grid .usuario-card {
        flex: 0 0 calc(50% - 0.6rem);
        max-width: calc(50% - 0.6rem);
    }
}

@media (max-width: 1024px) {
    .acceso-card.clientes-card {
        flex: 0 0 18%;
        min-width: 130px;
        max-width: 220px;
    }

    .acceso-card-header h3 {
        font-size: 0.85rem;
    }

    .usuarios-grid {
        gap: 1rem;
        padding: 0.6rem;
        padding-right: 0.85rem;
    }

    .usuarios-grid .usuario-card {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
        min-height: 190px;
    }

    .usuario-card-header {
        padding: 0.9rem;
    }

    .usuario-avatar {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        max-width: 46px;
        max-height: 46px;
    }

    .usuario-avatar img {
        width: 46px;
        height: 46px;
        object-fit: contain;
    }

    .usuario-avatar.has-image img {
        width: auto;
        max-width: 100%;
        height: 40px;
    }

    .usuario-avatar svg {
        width: 26px;
        height: 26px;
    }

    .usuario-nombre {
        font-size: 0.9rem;
    }

    .usuario-card-body {
        padding: 0.9rem;
    }

    .usuario-card-footer {
        padding: 0.75rem;
    }

    .usuario-btn {
        width: 36px;
        height: 36px;
    }

    .usuario-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    /* Header con búsqueda y exportar - responsive */
    .accesos-main-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-search-container {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        margin: 0.25rem 0 0 0;
    }

    .header-search-input {
        padding: 0.4rem 0.6rem 0.4rem 2.2rem;
        font-size: 0.8rem;
    }

    .header-search-container svg {
        left: 10px;
        width: 16px;
        height: 16px;
    }

    .btn-exportar-header {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .btn-exportar-header .btn-icon-svg {
        width: 16px;
        height: 16px;
    }

    .accesos-page {
        gap: 0.75rem;
        height: calc(100vh - 95px);
        min-height: calc(100vh - 95px);
        max-height: calc(100vh - 95px);
        overflow: hidden;
    }

    .accesos-page .camara-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
        padding: 0.5rem;
    }

    .accesos-page .camara-header {
        flex-shrink: 0;
    }

    .accesos-page .camara-body {
        flex: 1;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        padding: 0.35rem;
    }

    /* En móvil, cambiar a layout vertical */
    .accesos-grid {
        flex-direction: column;
        gap: 0.5rem;
        overflow-y: auto;
    }

    .acceso-card.clientes-card {
        flex: 0 0 auto;
        min-width: 100%;
        max-width: 100%;
        max-height: 35%;
    }

    .acceso-card.usuarios-card {
        flex: 1;
        min-height: 200px;
    }

    .acceso-card-header {
        padding: 0.4rem 0.65rem;
    }

    .acceso-card-header h3 {
        font-size: 0.8rem;
    }

    .usuarios-count {
        font-size: 0.75rem;
        padding: 0.08rem 0.3rem;
    }

    .acceso-btn-add {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    .acceso-btn-add svg {
        width: 14px;
        height: 14px;
    }

    .header-spacer {
        width: 24px;
        min-width: 24px;
        height: 24px;
    }

    .acceso-card-body {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .cliente-item {
        padding: 0.4rem 0.55rem;
    }

    .cliente-nombre {
        font-size: 0.75rem;
    }

    .cliente-btn-edit {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .cliente-btn-edit svg {
        width: 12px;
        height: 12px;
    }

    /* Tarjetas de usuario responsive */
    .usuarios-grid {
        gap: 0.9rem;
        padding: 0.5rem;
        padding-right: 0.75rem;
    }

    .usuarios-grid .usuario-card {
        flex: 0 0 100%;
        max-width: 100%;
        border-radius: 10px;
        min-height: 180px;
    }

    .usuario-card-header {
        padding: 0.85rem;
        gap: 0.6rem;
    }

    .usuario-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
        max-height: 44px;
    }

    .usuario-avatar img {
        width: 44px;
        height: 44px;
        object-fit: contain;
    }

    .usuario-avatar.has-image img {
        width: auto;
        max-width: 100%;
        height: 38px;
    }

    .usuario-avatar svg {
        width: 24px;
        height: 24px;
    }

    .usuario-nombre {
        font-size: 0.85rem;
    }

    .usuario-grupo {
        font-size: 0.7rem;
    }

    .usuario-status-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.45rem;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .usuario-card-body {
        padding: 0.85rem;
        gap: 0.5rem;
    }

    .usuario-info-row {
        gap: 0.6rem;
        padding: 0.3rem 0;
    }

    .usuario-info-row svg {
        width: 16px;
        height: 16px;
        min-width: 16px;
    }

    .usuario-info-text {
        font-size: 0.8rem;
    }

    .usuario-tipo-acceso {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

    .usuario-card-footer {
        padding: 0.7rem;
        gap: 0.5rem;
    }

    .usuario-btn {
        width: 34px;
        height: 34px;
        border-radius: 6px;
    }

    .usuario-btn svg {
        width: 15px;
        height: 15px;
    }

    .usuarios-empty {
        padding: 1.5rem;
        font-size: 0.85rem;
    }

    .usuarios-empty svg {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    /* Header responsive móvil pequeño */
    .btn-exportar-header {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }

    .btn-exportar-header .btn-icon-svg {
        width: 14px;
        height: 14px;
    }

    .header-search-input {
        padding: 0.35rem 0.5rem 0.35rem 2rem;
        font-size: 0.75rem;
    }

    .header-search-container svg {
        left: 8px;
        width: 14px;
        height: 14px;
    }

    .accesos-page {
        height: calc(100vh - 95px);
        min-height: calc(100vh - 95px);
        max-height: calc(100vh - 95px);
        overflow: hidden;
    }

    .accesos-page .camara-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
        padding: 0.35rem;
    }

    .accesos-page .camara-header {
        flex-shrink: 0;
        padding: 0.2rem 0.35rem;
    }

    .accesos-page .camara-body {
        flex: 1;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        padding: 0.25rem;
    }

    .acceso-card.clientes-card {
        max-height: 30%;
    }

    .acceso-card-header h3 {
        font-size: 0.75rem;
    }

    .usuarios-count {
        font-size: 0.7rem;
    }

    .acceso-btn-add {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .acceso-btn-add svg {
        width: 12px;
        height: 12px;
    }

    .header-spacer {
        width: 22px;
        min-width: 22px;
        height: 22px;
    }

    .cliente-item {
        padding: 0.35rem 0.5rem;
    }

    .cliente-nombre {
        font-size: 0.7rem;
    }

    .cliente-btn-edit {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    .cliente-btn-edit svg {
        width: 11px;
        height: 11px;
    }

    /* Tarjetas de usuario en móvil pequeño */
    .usuarios-grid {
        gap: 0.85rem;
        padding: 0.4rem;
        padding-right: 0.6rem;
    }

    .usuarios-grid .usuario-card {
        flex: 0 0 100%;
        max-width: 100%;
        border-radius: 10px;
        min-height: 170px;
    }

    .usuario-card:hover {
        transform: none;
    }

    .usuario-card-header {
        padding: 0.8rem;
        gap: 0.6rem;
    }

    .usuario-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        max-width: 42px;
        max-height: 42px;
    }

    .usuario-avatar img {
        width: 42px;
        height: 42px;
        object-fit: contain;
    }

    .usuario-avatar.has-image img {
        width: auto;
        max-width: 100%;
        height: 36px;
    }

    .usuario-avatar svg {
        width: 22px;
        height: 22px;
    }

    .usuario-nombre {
        font-size: 0.85rem;
    }

    .usuario-grupo {
        font-size: 0.68rem;
    }

    .usuario-status-badge {
        font-size: 0.6rem;
        padding: 0.18rem 0.4rem;
        gap: 0.3rem;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .usuario-card-body {
        padding: 0.8rem;
        gap: 0.45rem;
    }

    .usuario-info-row {
        gap: 0.55rem;
        padding: 0.25rem 0;
    }

    .usuario-info-row svg {
        width: 15px;
        height: 15px;
        min-width: 15px;
    }

    .usuario-info-text {
        font-size: 0.78rem;
    }

    .usuario-tipo-acceso {
        font-size: 0.7rem;
        padding: 0.12rem 0.4rem;
    }

    .usuario-card-footer {
        padding: 0.65rem;
        gap: 0.5rem;
    }

    .usuario-btn {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .usuario-btn svg {
        width: 14px;
        height: 14px;
    }

    .usuarios-empty {
        padding: 1.25rem;
        font-size: 0.8rem;
        gap: 0.85rem;
    }

    .usuarios-empty svg {
        width: 40px;
        height: 40px;
    }

    .usuarios-loading-spinner {
        width: 34px;
        height: 34px;
    }
}