/* ========================================================================== */
/* USUARIO MODAL - Modal de Alta/Actualización de Usuarios                   */
/* ========================================================================== */

/* Overlay del modal con efecto glassmorphism */
.usuario-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    animation: fadeInOverlayUsuario 0.3s ease-out;
    padding: 1rem;
}

@keyframes fadeInOverlayUsuario {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Container del modal con efecto de entrada */
.usuario-modal-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 95%;
    max-width: 950px;
    max-height: 90vh;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideInModalUsuario 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

@keyframes slideInModalUsuario {
    from {
        transform: translateY(-60px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Efecto de brillo sutil en el borde superior */
.usuario-modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 116, 0, 0.5), rgba(0, 180, 255, 0.5), transparent);
}

/* ========================================================================== */
/* VIEW MODE - Modo solo lectura                                             */
/* ========================================================================== */

.usuario-modal-overlay.view-mode .usuario-modal-container {
    border-color: rgba(0, 180, 255, 0.3);
}

.usuario-modal-container.view-mode::before {
    background: linear-gradient(90deg, transparent, rgba(0, 180, 255, 0.6), rgba(0, 180, 255, 0.6), transparent);
}

/* Cursor de bloqueo para elementos en view mode */
.view-mode .input-wrapper.locked,
.view-mode .select-wrapper.locked,
.view-mode .celular-wrapper.locked,
.view-mode .filtro-tabs.locked,
.view-mode .autocomplete-container.locked,
.view-mode .filtros-list.locked,
.view-mode .input-autocomplete-wrapper.locked {
    cursor: not-allowed;
    position: relative;
}

.view-mode .input-wrapper.locked *,
.view-mode .select-wrapper.locked *,
.view-mode .celular-wrapper.locked *,
.view-mode .filtro-tabs.locked *,
.view-mode .autocomplete-container.locked *,
.view-mode .filtros-list.locked *,
.view-mode .input-autocomplete-wrapper.locked * {
    cursor: not-allowed !important;
    pointer-events: none;
}

.view-mode .input-wrapper.locked::after,
.view-mode .select-wrapper.locked::after,
.view-mode .celular-wrapper.locked::after,
.view-mode .input-autocomplete-wrapper.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: not-allowed;
    z-index: 10;
}

/* Badge de modo solo lectura */
.view-mode-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 180, 255, 0.2);
    border: 1px solid rgba(0, 180, 255, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #00b4ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-badge 2s ease-in-out infinite;
}

.view-mode-badge svg {
    width: 14px;
    height: 14px;
    stroke: #00b4ff;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================================================== */
/* HEADER DEL MODAL                                                          */
/* ========================================================================== */

.usuario-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    position: relative;
    overflow: hidden;
}

/* Efecto de onda decorativa en el header */
.usuario-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.usuario-modal-header::after {
    content: '';
    position: absolute;
    bottom: -70%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.usuario-modal-header .header-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.usuario-modal-header .header-icon-wrapper svg {
    width: 26px;
    height: 26px;
    stroke: white;
}

.usuario-modal-title {
    flex: 1;
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

.usuario-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    z-index: 1;
}

.usuario-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: white;
    transition: transform 0.3s ease;
}

.usuario-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.usuario-modal-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* ========================================================================== */
/* BODY DEL MODAL                                                            */
/* ========================================================================== */

.usuario-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-primary);
    overflow: visible;
    flex: 1;
    position: relative;
}

/* Grid de dos columnas */
.usuario-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    overflow: visible;
    flex: 1;
    align-items: stretch;
}

/* ========================================================================== */
/* SECCIONES                                                                 */
/* ========================================================================== */

.usuario-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.usuario-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Header de sección */
.usuario-section .section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.08), rgba(0, 180, 255, 0.08));
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
}

.usuario-section .section-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(240, 116, 0, 0.25);
    flex-shrink: 0;
}

.usuario-section .section-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.usuario-section .section-header > span {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

/* Contenido de sección */
.usuario-section .section-content {
    padding: 1rem 1.25rem;
    border-radius: 0 0 16px 16px;
    background: var(--bg-secondary);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow: visible;
    position: relative;
}

/* Contenido especial para sección de accesos */
.usuario-section .section-content.accesos-content {
    overflow: visible;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Sección de datos debe permitir overflow para dropdowns y estar sobre la sección de accesos */
.usuario-section.datos-section {
    overflow: visible;
    z-index: 5;
}

/* Sección de accesos tiene z-index menor y se expande para llenar el espacio */
.usuario-section.accesos-section {
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================================================== */
/* INPUTS                                                                    */
/* ========================================================================== */

.usuario-section .input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.usuario-section .input-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.usuario-section .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.usuario-section .input-wrapper > svg:first-child {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    transition: stroke 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.usuario-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.usuario-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

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

.usuario-section .input-wrapper:focus-within > svg:first-child {
    stroke: var(--primary-color);
}

/* Modo claro */
:root.light-mode .usuario-input,
.light-mode .usuario-input {
    background: #ffffff;
    border-color: #d0d0d0;
}

/* ========================================================================== */
/* INPUT CON AUTOCOMPLETE (Grupo, URL Logo, Template PPT)                    */
/* ========================================================================== */

.input-autocomplete-wrapper {
    position: relative;
}

.input-autocomplete-wrapper .input-wrapper {
    position: relative;
}

/* Z-index decreciente para que los dropdowns de arriba estén sobre los inputs de abajo */
/* En section-content de datos: Grupo es el 4to, URL Logo el 5to, Template PPT el 6to */
.usuario-section.datos-section .section-content .input-group:nth-child(4) {
    position: relative;
    z-index: 30;
}

.usuario-section.datos-section .section-content .input-group:nth-child(5) {
    position: relative;
    z-index: 20;
}

.usuario-section.datos-section .section-content .input-group:nth-child(6) {
    position: relative;
    z-index: 10;
}

/* Input con chevron para indicar dropdown */
.input-autocomplete-wrapper .usuario-input {
    padding-right: 2.5rem;
}

.input-chevron {
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
    pointer-events: none;
    transition: transform 0.3s ease, stroke 0.3s ease;
    z-index: 2;
}

.input-chevron.rotated {
    transform: rotate(180deg);
    stroke: var(--primary-color);
}

.input-autocomplete-wrapper .input-wrapper:focus-within .input-chevron {
    stroke: var(--primary-color);
}

/* Dropdown para inputs con autocomplete */
.input-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 100;
    animation: dropdownSlideUsuario 0.2s ease-out;
    max-height: 280px;
    overflow-y: auto;
}


.input-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-primary);
}

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

.input-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.08), rgba(0, 180, 255, 0.08));
}

.input-dropdown-item.selected {
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.15), rgba(0, 180, 255, 0.15));
}

.input-dropdown-item .url-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    white-space: normal;
    word-break: break-all;
    line-height: 1.4;
}

.input-dropdown-item .check-icon {
    width: 16px;
    height: 16px;
    stroke: var(--primary-color);
    flex-shrink: 0;
}

/* Scrollbar para dropdown */
.input-dropdown::-webkit-scrollbar {
    width: 6px;
}

.input-dropdown::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.input-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 3px;
}

/* ========================================================================== */
/* SELECT                                                                    */
/* ========================================================================== */

.usuario-section .select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.usuario-section .select-wrapper > svg:first-child {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    transition: stroke 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.usuario-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.usuario-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(240, 116, 0, 0.15);
}

.select-chevron {
    position: absolute;
    right: 12px;
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.usuario-section .select-wrapper:focus-within .select-chevron {
    transform: rotate(180deg);
    stroke: var(--primary-color);
}

/* ========================================================================== */
/* CELULAR INPUT CON FORMATO                                                 */
/* ========================================================================== */

.celular-wrapper {
    position: relative;
}

.celular-wrapper > svg:first-child {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.celular-input-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    transition: all 0.3s ease;
    width: 100%;
}

.celular-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(240, 116, 0, 0.15);
}

.celular-prefix,
.celular-separator,
.celular-dash {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    user-select: none;
}

.celular-segment {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Fira Code', 'Consolas', monospace;
    letter-spacing: 2px;
    text-align: center;
    outline: none;
    padding: 0;
}

.celular-segment.lada {
    width: 40px;
}

.celular-segment.numero1,
.celular-segment.numero2 {
    width: 50px;
}

.celular-segment::placeholder {
    color: var(--border-color);
    letter-spacing: 4px;
}

/* ========================================================================== */
/* CONTADOR DE FILTROS                                                       */
/* ========================================================================== */

.filtros-counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    background: var(--bg-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.filtros-counter .counter-value {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filtros-counter .counter-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================================================== */
/* TABS DE FILTRO                                                            */
/* ========================================================================== */

.filtro-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.filtro-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filtro-tab svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.filtro-tab span {
    white-space: nowrap;
}

.filtro-tab:hover:not(.tab-locked) {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.filtro-tab.active {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    color: white;
    box-shadow: 0 3px 10px rgba(240, 116, 0, 0.3);
}

/* Tab bloqueado - mantiene diseño pero con cursor de bloqueo */
.filtro-tab.tab-locked {
    cursor: not-allowed;
    opacity: 0.5;
}

.filtro-tab.tab-locked:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* Badge contador en tab */
.tab-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    font-weight: 700;
}

.filtro-tab:not(.active) .tab-badge {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* ========================================================================== */
/* BUSCADOR DE FILTROS EN SECCIÓN ACCESOS                                    */
/* ========================================================================== */

.input-autocomplete-wrapper.filtros-search {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}

.input-autocomplete-wrapper.filtros-search .usuario-input {
    padding-right: 2.5rem;
}

.input-dropdown.filtros-dropdown {
    max-height: 200px;
    overflow-y: auto;
}

.input-dropdown.filtros-dropdown .item-id {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
    flex-shrink: 0;
}

.input-dropdown.filtros-dropdown .item-nombre {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-dropdown.filtros-dropdown .input-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Botón limpiar búsqueda */
.clear-search-btn {
    position: absolute;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.clear-search-btn:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* ========================================================================== */
/* LISTA DE FILTROS SELECCIONADOS                                            */
/* ========================================================================== */

.filtros-seleccionados-container {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.filtros-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.05), rgba(0, 180, 255, 0.05));
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.filtros-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filtros-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-color);
}

.clear-all-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-all-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.clear-all-btn:hover {
    background: rgba(220, 53, 69, 0.2);
}

.filtros-list {
    flex: 1;
    padding: 0.6rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Estado vacío */
.filtros-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    height: 100%;
    color: var(--text-secondary);
}

.filtros-empty svg {
    width: 28px;
    height: 28px;
    stroke: var(--border-color);
}

.filtros-empty span {
    font-size: 0.8rem;
    text-align: center;
}

/* Chips de filtros */
.filtro-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: chipSlideIn 0.2s ease-out;
}

@keyframes chipSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filtro-chip:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chip-id {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0.15rem 0.35rem;
    background: linear-gradient(135deg, rgba(240, 116, 0, 0.15), rgba(0, 180, 255, 0.15));
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
}

.chip-nombre {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-remove {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chip-remove svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.chip-remove:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* ========================================================================== */
/* FOOTER DEL MODAL                                                          */
/* ========================================================================== */

.usuario-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.usuario-modal-footer .modal-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.usuario-modal-footer .modal-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Botón Cancelar */
.usuario-modal-footer .btn-cancel {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.usuario-modal-footer .btn-cancel svg {
    stroke: var(--text-secondary);
}

.usuario-modal-footer .btn-cancel:hover {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.usuario-modal-footer .btn-cancel:hover svg {
    stroke: #dc3545;
}

.usuario-modal-footer .btn-cancel:active {
    transform: scale(0.98);
}

/* Botón Aceptar/Crear */
.usuario-modal-footer .btn-accept {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 116, 0, 0.3);
}

.usuario-modal-footer .btn-accept svg {
    stroke: white;
}

.usuario-modal-footer .btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 116, 0, 0.4);
}

.usuario-modal-footer .btn-accept:active {
    transform: translateY(0);
}

.usuario-modal-footer .btn-accept:disabled {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: rgba(255, 255, 255, 0.6);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.usuario-modal-footer .btn-accept:disabled:hover {
    transform: none;
    box-shadow: none;
}

.usuario-modal-footer .btn-accept:disabled svg {
    stroke: rgba(255, 255, 255, 0.6);
}

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

@media (max-width: 900px) {
    .usuario-modal-grid {
        grid-template-columns: 1fr;
    }

    .usuario-modal-container {
        max-width: 100%;
        max-height: 95vh;
    }

    .filtros-seleccionados-container {
        min-height: 100px;
    }
}

@media (max-width: 768px) {
    .usuario-modal-overlay {
        padding: 0.5rem;
    }

    .usuario-modal-container {
        border-radius: 16px;
    }

    .usuario-modal-header {
        padding: 1rem 1.25rem;
    }

    .usuario-modal-header .header-icon-wrapper {
        width: 42px;
        height: 42px;
    }

    .usuario-modal-header .header-icon-wrapper svg {
        width: 22px;
        height: 22px;
    }

    .usuario-modal-title {
        font-size: 1.15rem;
    }

    .view-mode-badge {
        display: none;
    }

    .usuario-modal-body {
        padding: 1rem;
    }

    .usuario-section .section-content {
        padding: 1rem;
    }

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

    .filtro-tab {
        flex: 1 1 calc(33.33% - 0.5rem);
        min-width: 0;
    }

    .filtro-tab span {
        display: none;
    }

    .filtro-tab svg {
        width: 18px;
        height: 18px;
    }

    .usuario-modal-footer {
        padding: 0.65rem 1rem;
        gap: 0.75rem;
    }

    .usuario-modal-footer .modal-btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .usuario-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .usuario-modal-container {
        max-height: 100vh;
        border-radius: 20px 20px 0 0;
        animation: slideUpModalUsuario 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes slideUpModalUsuario {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .usuario-modal-header {
        padding: 1rem;
    }

    .usuario-modal-header .header-icon-wrapper {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .usuario-modal-header .header-icon-wrapper svg {
        width: 20px;
        height: 20px;
    }

    .usuario-modal-title {
        font-size: 1.05rem;
    }

    .usuario-modal-close {
        width: 34px;
        height: 34px;
    }

    .usuario-modal-close svg {
        width: 18px;
        height: 18px;
    }

    .usuario-section .section-header {
        padding: 0.75rem 1rem;
    }

    .usuario-section .section-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .usuario-section .section-icon svg {
        width: 18px;
        height: 18px;
    }

    .usuario-section .section-header > span {
        font-size: 0.9rem;
    }

    .usuario-section .section-content {
        padding: 0.85rem;
    }

    .usuario-input,
    .autocomplete-input,
    .usuario-select {
        padding: 0.65rem 0.9rem 0.65rem 2.5rem;
        font-size: 0.85rem;
    }

    .usuario-section .input-wrapper > svg:first-child,
    .autocomplete-input-wrapper > svg:first-child,
    .usuario-section .select-wrapper > svg:first-child {
        left: 10px;
        width: 16px;
        height: 16px;
    }

    .celular-input-container {
        padding: 0.65rem 0.75rem 0.65rem 2.5rem;
    }

    .celular-segment {
        font-size: 0.85rem;
    }

    .filtro-tab {
        padding: 0.5rem;
    }

    .filtros-counter {
        padding: 0.25rem 0.6rem;
    }

    .filtros-counter .counter-value {
        font-size: 1rem;
    }

    .filtros-seleccionados-container {
        min-height: 80px;
    }

    .filtros-header {
        padding: 0.5rem 0.75rem;
    }

    .filtros-title {
        font-size: 0.8rem;
    }

    .filtros-list {
        padding: 0.5rem;
    }

    .filtro-chip {
        padding: 0.35rem 0.5rem;
    }

    .chip-id {
        min-width: 32px;
        font-size: 0.65rem;
    }

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

    .usuario-modal-footer {
        padding: 0.6rem 1rem;
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .usuario-modal-footer .modal-btn {
        width: 100%;
        padding: 0.5rem;
    }
}

/* ========================================================================== */
/* iOS SPECIFIC FIXES                                                        */
/* ========================================================================== */

@supports (-webkit-touch-callout: none) {
    .usuario-modal-body {
        -webkit-overflow-scrolling: touch;
    }

    .usuario-modal-container {
        max-height: -webkit-fill-available;
    }

    .usuario-input,
    .autocomplete-input,
    .usuario-select,
    .celular-segment,
    .filtro-tab,
    .modal-btn,
    .filtro-chip,
    .autocomplete-item,
    .chip-remove,
    .clear-search-btn,
    .clear-all-btn,
    .input-dropdown-item {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ========================================================================== */
/* SCROLLBAR PERSONALIZADO                                                   */
/* ========================================================================== */

.filtros-list::-webkit-scrollbar,
.usuario-modal-body::-webkit-scrollbar {
    width: 6px;
}

.filtros-list::-webkit-scrollbar-track,
.usuario-modal-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.filtros-list::-webkit-scrollbar-thumb,
.usuario-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 3px;
}

.filtros-list::-webkit-scrollbar-thumb:hover,
.usuario-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #d86700, #009ae0);
}
