/* ========================================
   USER MANAGEMENT - NUEVA ESTRUCTURA VISUAL
   Estilos adicionales para la nueva interfaz
   ======================================== */

/* Container principal */
.user-management-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Tabs Navigation - EXACTAMENTE como Add Inventory */
.settings-tabs-user {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.tab-button-user {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #6e6e73;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-button-user:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.03);
}

.tab-button-user.active {
    color: #0071e3;
    border-bottom-color: #0071e3;
    background: white;
}

/* Tab Content */
.tab-content-user {
    display: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0 8px 8px 8px;
    padding: 24px;
    /* Asegurar que el área blanca cubra el espacio disponible con margen inferior igual al lateral */
    min-height: calc(100vh - 126px);
    margin-bottom: 15px;
    box-sizing: border-box;
}

.tab-content-user.active {
    display: block;
}

/* Configuration tab sin padding */
#tab-configuration-content {
    padding: 0;
}

/* Configuration Layout */
.config-layout {
    display: flex;
    gap: 0;
    height: 100%;
    min-height: 500px;
}

/* Sidebar */
.config-sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.config-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.config-menu-item:hover {
    background: #f9fafb;
    color: #1d1d1f;
}

.config-menu-item.active {
    background: #f0f7ff;
    color: #0071e3;
    border-left-color: #0071e3;
    font-weight: 600;
}

.config-menu-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.config-menu-text {
    flex: 1;
}

/* Content Area */
.config-content {
    flex: 1;
    background: #f9fafb;
    overflow-y: auto;
    padding: 24px;
}

/* Configuration Sections */
.config-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.config-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.config-section.active {
    display: block;
}

.config-section-header {
    background: #f9fafb;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.config-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.config-header-text {
    flex: 1;
}

.config-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.config-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-section-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.config-section-body {
    padding: 20px;
}

/* Config Form Groups */
.config-form-group {
    margin-bottom: 16px;
}

.config-form-group:last-child {
    margin-bottom: 0;
}

.config-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.config-input-group {
    display: flex;
    gap: 8px;
}

.config-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #1d1d1f;
    background: white;
}

.config-input-group input:read-only {
    background: #f9fafb;
    color: #6b7280;
}

.config-input-group input:focus {
    outline: none;
    border-color: #0071e3;
}

/* Config Buttons */
.btn-config-primary {
    padding: 10px 20px;
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-config-primary:hover {
    background: #0077ed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-config-secondary {
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-config-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-config-danger {
    padding: 10px 20px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-config-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-config-danger:active {
    transform: translateY(0);
}

.config-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 4px 0;
}

.empty-state small {
    font-size: 12px;
    color: #9ca3af;
}

/* Extension Credentials */
.extension-credentials {
    margin-bottom: 24px;
}

.extension-credentials h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.extension-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

/* Extension Instructions */
.extension-instructions {
    background: #f9fafb;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.extension-instructions h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 12px 0;
}

.instructions-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}

.instructions-list li {
    margin-bottom: 8px;
}

.instructions-list li:last-child {
    margin-bottom: 0;
}

/* User Email Cell */
.user-email-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-user-email {
    display: inline;
    cursor: pointer;
    transition: all 0.2s;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 13px; /* Mismo tamaño que las demás columnas */
    color: #1d1d1f; /* Mismo color que las demás columnas */
}

.table-user-email:hover {
    color: #0071e3;
    background: #f0f7ff;
    text-decoration: underline;
}

.btn-copy-email {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    opacity: 0.6;
    transition: all 0.2s;
    padding: 2px 4px;
    line-height: 1;
}

.btn-copy-email:hover {
    opacity: 1;
    color: #0071e3;
    transform: scale(1.15);
}

/* Botón de eliminar tarjeta (inline con número) */
.btn-eliminar-tarjeta {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 6px;
    opacity: 0.7;
    transition: all 0.2s ease;
    border-radius: 3px;
    line-height: 1;
}

.btn-eliminar-tarjeta:hover {
    opacity: 1;
    background: #fee2e2;
    color: #991b1b;
    transform: scale(1.15);
}

.btn-eliminar-tarjeta:active {
    transform: scale(1.05);
    background: #fecaca;
}

/* Contenedor de número de tarjeta */
.card-number-cell {
    display: inline-block;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-weight: 500;
}

/* Badges */
.badge-system,
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    height: 24px;
    min-width: 100px;
    box-sizing: border-box;
}

.badge-system {
    border: 1px solid;
}

.badge-hostinger {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.badge-mailcow {
    background: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

.badge-status {
    border: none;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.badge-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Actions Dropdown */
.actions-dropdown {
    position: relative;
}

.btn-actions-dropdown {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-actions-dropdown:hover {
    color: #1d1d1f;
    background: #f3f4f6;
    border-radius: 4px;
}

.dropdown-menu-actions {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 10000;
    overflow: hidden;
}

/* Si el dropdown está cerca del final, abrirlo hacia arriba */
tr:nth-last-child(-n+3) .dropdown-menu-actions {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.dropdown-menu-actions.active {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f9fafb;
    color: #1d1d1f;
}

.dropdown-item:active {
    background: #f3f4f6;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Edit User Modal Specific Styles */
.edit-user-info {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.edit-user-badge {
    flex-shrink: 0;
}

.edit-user-email {
    flex: 1;
    font-size: 15px;
    color: #1d1d1f;
    min-width: 200px;
}

.edit-user-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.btn-edit-action {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-edit-action.disable {
    background: #dc2626;
    color: white;
}

.btn-edit-action.disable:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-edit-action.enable {
    background: #10b981;
    color: white;
}

.btn-edit-action.enable:hover {
    background: #059669;
    transform: translateY(-1px);
}

.edit-deletion-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
}

.timer-icon {
    font-size: 14px;
}

.timer-text {
    font-weight: 600;
}

.input-readonly {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

.password-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-input-group input {
    flex: 1;
}

.btn-toggle-password {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-toggle-password:hover {
    background: #e5e7eb;
}

.input-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Confirmation Modals */
.modal-confirm .modal-content-user {
    max-width: 500px;
}

.confirm-warning,
.confirm-info {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
}

.confirm-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
}

.confirm-info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
}

.warning-icon,
.info-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.warning-content,
.info-content {
    flex: 1;
}

.warning-content h4,
.info-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.warning-email,
.info-email {
    font-size: 14px;
    font-weight: 600;
    color: #0071e3;
    margin: 0 0 16px 0;
}

.warning-details,
.info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.warning-details p,
.info-details p {
    font-size: 13px;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

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

.btn-danger-user:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Table Header Filters */
.th-with-filter {
    position: relative;
}

.th-header-content {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}

.th-title-text {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-column-filter {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-column-filter:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.filter-arrow {
    font-size: 8px;
    color: #6b7280;
    line-height: 1;
}

.column-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.column-filter-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.filter-dropdown-option:hover {
    background: #f9fafb;
}

.filter-dropdown-option.active {
    background: #f0f7ff;
    border-left-color: #0071e3;
}

.option-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.filter-dropdown-option.active .option-label {
    color: #0071e3;
    font-weight: 600;
}

.option-badge {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.filter-dropdown-option.active .option-badge {
    background: #dbeafe;
    color: #0071e3;
}

/* Stats Grid */
.stats-grid-user {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card-user {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.stat-number-user {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.stat-label-user {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Section */
.filters-section-user {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Add User Dropdown Container */
.add-user-dropdown-container {
    position: relative;
}

.add-user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

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

.dropdown-option:hover {
    background: #f9fafb;
}

.dropdown-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.dropdown-text {
    flex: 1;
}

.dropdown-title {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.dropdown-subtitle {
    font-size: 11px;
    color: #6b7280;
}

.filter-input-wrapper-user {
    position: relative;
    flex: 1;
    min-width: 130px;
}

.filter-input-user {
    width: 100%;
    height: 37px;
    padding: 0 15px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}

.filter-input-user:focus {
    outline: none;
    border-color: #4a90e2;
}

.filter-input-user::placeholder {
    color: #9ca3af;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 500;
}

select.filter-input-user {
    cursor: pointer;
}

.btn-add-user-filter {
    padding: 10px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 110px;
}

.btn-add-user-filter:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-filter-user {
    height: 37px;
    padding: 0 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.btn-filter-user:hover {
    background: #3a7bc8;
}

.btn-clean-filter {
    height: 37px;
    padding: 0 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.btn-clean-filter:hover {
    background: #4b5563;
}

/* Table */
.table-container-user {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

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

.table-users-new thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table-users-new th {
    padding: 12px 8px !important;
    text-align: left !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6e6e73;
    letter-spacing: 0.5px;
    vertical-align: middle;
    height: 44px;
}

/* Anchos y paddings específicos ELIMINADOS - Ahora se usan los definidos en HTML con style="width:" */

.table-users-new td {
    padding: 12px 8px !important;
    text-align: left !important;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #1d1d1f;
    vertical-align: middle;
}

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

.table-users-new tbody tr:hover {
    background: #f9fafb;
}

/* Email with copy icon */
.email-with-copy-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-email-user {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: all 0.2s;
}

.btn-copy-email-user:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Badges */
.badge-user {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-hostinger {
    background: #ff9500;
    color: white;
}

.badge-mailcow {
    background: #4a90e2;
    color: white;
}

.badge-active {
    background: #34c759;
    color: white;
}

.badge-inactive {
    background: #9ca3af;
    color: white;
}

/* Actions Menu */
.actions-menu-user {
    position: relative;
    display: inline-block;
}

.btn-actions-menu-user {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-actions-menu-user:hover {
    background: #f9fafb;
    border-color: #4a90e2;
    color: #4a90e2;
}

.actions-dropdown-user {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 100;
}

.actions-dropdown-user.show {
    display: block;
}

.action-item-user {
    padding: 10px 16px;
    font-size: 13px;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

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

.action-item-user:hover {
    background: #f9fafb;
    color: #4a90e2;
}

.action-item-user.danger:hover {
    background: #fee;
    color: #ff3b30;
}

/* Config Panel */
.config-panel {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 24px;
}

.config-panel h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.config-card-user {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.config-card-user h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.config-item-user {
    margin-bottom: 16px;
}

.config-item-user label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.config-item-user input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}

.btn-config-user {
    padding: 10px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-config-user:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Modals */
.modal-user-new {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay-user {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content-user {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

/* Modal más ancho cuando muestra tabla DNS */
#modalAddDomain .modal-content-user:has(#dnsConfigSection[style*="display: block"]),
#modalAddDomain .modal-content-user:has(#dnsConfigSection[style*="display: none"]:not([style*="display: none"])) {
    max-width: 900px;
}

/* Modal compacto para Add Mailcow User */
#modalAddMailcow .modal-content-user {
    max-width: 550px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header-user {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-user h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.btn-close-modal-user {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close-modal-user:hover {
    background: #f3f4f6;
    color: #1d1d1f;
}

.modal-body-user {
    padding: 24px;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.btn-pagination {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #0071e3;
    color: #0071e3;
}

.btn-pagination.active {
    background: #0071e3;
    border-color: #0071e3;
    color: white;
}

.btn-pagination:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0071e3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Action List (Rows) */
.action-list-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-row-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-row-user:hover {
    background: #f0f7ff;
    border-color: #0071e3;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

.action-icon-user {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.action-content-user {
    flex: 1;
}

.action-content-user h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
}

.action-content-user p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.action-arrow-user {
    font-size: 20px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.2s;
}

.action-row-user:hover .action-arrow-user {
    color: #0071e3;
    transform: translateX(4px);
}

/* Type Selector */
.tipo-selector-user {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tipo-card-user {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.tipo-card-user:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #4a90e2;
    background: white;
}

.tipo-icono-user {
    font-size: 48px;
    margin-bottom: 12px;
}

.tipo-card-user h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.tipo-card-user p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* Form Groups */
.form-group-user {
    margin-bottom: 20px;
}

.form-group-user label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.form-group-user input,
.form-group-user select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.form-group-user input:focus,
.form-group-user select:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-group-user small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.form-divider-user {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    margin: 24px 0;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer-user {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-modal-user {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-user {
    background: #f5f5f7;
    color: #1d1d1f;
}

.btn-cancel-user:hover {
    background: #e8e8ed;
}

.btn-confirm-user {
    background: #4a90e2;
    color: white;
}

.btn-confirm-user:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid-user {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-user {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-section-user {
        flex-direction: column;
    }
    
    .filter-input-wrapper-user {
        min-width: 100%;
    }
}

/* ========================================
   DNS RECORDS CARDS
   ======================================== */
.dns-record-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
}

.dns-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dns-record-header strong {
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
}

.dns-record-priority {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.dns-record-subdomain {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
}

.dns-record-value {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #374151;
    word-break: break-all;
    margin-bottom: 8px;
    line-height: 1.5;
}

.btn-copy-dns {
    background: #0071e3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-copy-dns:hover {
    background: #0077ed;
    transform: translateY(-1px);
}

.btn-copy-dns:active {
    transform: translateY(0);
}

.btn-copy-dns-mini {
    background: #0071e3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-dns-mini:hover {
    background: #0077ed;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.btn-copy-dns-mini:active {
    transform: translateY(0);
}

/* Domain Card in List */
.domain-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.domain-card:hover {
    border-color: #0071e3;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

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

.domain-card-icon {
    font-size: 24px;
}

.domain-card-details h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.domain-card-details p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.domain-card-actions {
    display: flex;
    gap: 8px;
}

.btn-domain-action {
    background: #f3f4f6;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.btn-domain-action:hover {
    background: #e5e7eb;
}

.btn-domain-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-domain-delete:hover {
    background: #fecaca;
}

/* ========================================
   IP COLUMN & FINGERPRINT POPOVER
   ======================================== */

/* Celda de IP */
.ip-cell {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

/* IP clickable */
.ip-clickable {
    color: #0071e3;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.ip-clickable:hover {
    background: #e8f3ff;
    text-decoration: underline;
}

/* IP no disponible */
.ip-not-available {
    color: #9ca3af;
    font-size: 14px;
}

/* Popover de Fingerprint */
.fingerprint-popover {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    width: 320px;
    z-index: 10000;
    font-size: 11px;
    animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flechita cuando está arriba */
.fingerprint-popover.popover-above::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Flechita cuando está abajo */
.fingerprint-popover.popover-below::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

/* Header del popover */
.fingerprint-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
}

.fingerprint-header strong {
    color: #0071e3;
}

/* Contenido del popover */
.fingerprint-content {
    padding: 12px 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* Item de fingerprint */
.fingerprint-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.fingerprint-label {
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
    margin-right: 12px;
}

.fingerprint-value {
    color: #1f2937;
    text-align: right;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Scrollbar personalizado para el popover */
.fingerprint-content::-webkit-scrollbar {
    width: 6px;
}

.fingerprint-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.fingerprint-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.fingerprint-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================ */
/* BOTÓN DE FINGERPRINT (ON-DEMAND)            */
/* ============================================ */

.btn-fingerprint {
    padding: 6px 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
}

.btn-fingerprint:hover:not(:disabled) {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-fingerprint:disabled {
    background: #9ca3af;
    cursor: wait;
    opacity: 0.7;
}

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

.fingerprint-not-available {
    color: #9ca3af;
    font-size: 14px;
}

/* ===================================================== */
/* BADGES DE PROVEEDOR - Nueva Arquitectura Posiciones */
/* ===================================================== */

.badge-proveedor {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    min-height: 24px;
}

.badge-parkwhiz {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.badge-spothero {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===================================================== */
/* BADGE DE ESTADO DISPONIBLE */
/* ===================================================== */

.badge-available {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* ===================================================== */
/* BOTONES + EN HEADERS DE COLUMNAS */
/* ===================================================== */

/* Header de Email/User con botón + */
.th-card-header,
.th-email-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

/* Botón + en header Email/User - MISMO ESTILO QUE CARD */
.btn-add-user-header {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-add-user-header:hover {
    background: #059669;
    transform: scale(1.05);
}

/* ===================================================== */
/* BOTÓN IMPORT FILE EN MODAL MAILCOW */
/* ===================================================== */

.btn-import-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 42px;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.btn-import-file:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.btn-import-file:active {
    transform: translateY(0);
}

/* Botones de selección de proveedor */
.btn-provider-select {
    transition: all 0.2s ease;
}

/* Botones de toggle Active/Disabled */
.btn-view-toggle {
    height: 37px;
    padding: 0 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.btn-view-toggle:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-view-toggle.active {
    background: #0071e3;
    color: white;
    border-color: #0071e3;
}

.btn-view-toggle.active:hover {
    background: #0077ed;
}

/* Botón bulk delete disabled - SIN estilos especiales, usa el mismo estilo default que btn-bulk-delete-cards */

/* ===================================================== */
/* TABLA CON HEADER FIJO Y SCROLL EN TBODY */
/* ===================================================== */

.table-container-user-fixed {
    max-height: calc(100vh - 350px);
    min-height: calc(100vh - 350px);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
}

.table-fixed-layout {
    table-layout: fixed;
    width: 100%;
}

.table-header-fixed {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-bottom: 2px solid #e5e7eb;
}

.table-header-fixed th {
    vertical-align: middle;
    text-align: left;
    padding: 12px 8px;
}

.table-users-new tbody td {
    text-align: left !important;
    padding: 12px 8px;
    vertical-align: middle;
}

.table-users-new thead th {
    text-align: left !important;
    padding: 12px 8px;
    vertical-align: middle;
}

.td-card-cell {
    text-align: left !important;
}

.badge-status,
.badge-proveedor {
    margin: 0;
}

.table-body-scrollable::-webkit-scrollbar {
    width: 8px;
}

.table-body-scrollable::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.table-body-scrollable::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.table-body-scrollable::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.btn-provider-select:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-provider-select:active:not(:disabled) {
    transform: translateY(0);
}

.btn-provider-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
