/* =============================================
   Estilos personalizados de la aplicación
   ============================================= */

/* =============================================
   VARIABLES GLOBALES DE COLOR
   Modifica estos valores para cambiar rápidamente 
   la paleta de colores de toda la aplicación.
   ============================================= */
:root, [data-bs-theme="dark"] {
    /* Color Principal (Botones primarios, enlaces activos, etc. - Cloudflare Orange) */
    --bs-primary: #F38020 !important;
    --bs-primary-rgb: 243, 128, 32 !important;
    --bs-primary-bg-subtle: rgba(243, 128, 32, 0.15) !important;
    --bs-primary-text-emphasis: #c4600e !important;

    /* Color Secundario (Gris Neutro / Slate) */
    --bs-secondary: #64748b !important;
    --bs-secondary-rgb: 100, 116, 139 !important;
    --bs-secondary-bg-subtle: rgba(100, 116, 139, 0.12) !important;
    --bs-secondary-text-emphasis: #475569 !important;

    /* Color de Éxito (Emerald Green) */
    --bs-success: #34c759 !important;
    --bs-success-rgb: 52, 199, 89 !important;
    --bs-success-bg-subtle: rgba(52, 199, 89, 0.15) !important;

    /* Color de Peligro / Error (El rojo/granate vibrante) */
    --bs-danger: #b31b34 !important;
    --bs-danger-rgb: 179, 27, 52 !important;
    --bs-danger-bg-subtle: rgba(179, 27, 52, 0.15) !important;
    --bs-danger-text-emphasis: #d82b4a !important;

    /* Color de Advertencia (Cloudflare Yellow/Amber) */
    --bs-warning: #FAAD14 !important;
    --bs-warning-rgb: 250, 173, 20 !important;
    --bs-warning-bg-subtle: rgba(250, 173, 20, 0.15) !important;

    /* Color de Información */
    --bs-info: #539bff !important;
    --bs-info-rgb: 83, 155, 255 !important;
    --bs-info-bg-subtle: rgba(83, 155, 255, 0.15) !important;

    /* Color de Código */
    --bs-code-color: var(--bs-primary) !important;
}

/* Color para etiquetas y clases de código */
code,
.code {
    color: var(--bs-primary) !important;
}

/* Forzar Primary en componentes específicos */
.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}
.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* Switches y Checkboxes en Primary (Orange) */
.form-check-input:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}
.form-check-input:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(243, 128, 32, 0.25) !important;
}

/* Botones secundarios neutrales (Gris / Slate, sin tonos azules) */
.btn-outline-secondary {
    color: var(--bs-body-color, #475569) !important;
    border-color: var(--bs-border-color, #cbd5e1) !important;
    background-color: transparent !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary:focus {
    color: var(--bs-body-color, #1e293b) !important;
    background-color: rgba(100, 116, 139, 0.1) !important;
    border-color: var(--bs-border-color, #94a3b8) !important;
}
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
    background-color: transparent !important;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:active,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: #475569 !important;
}

/* =============================================
   TABS Y NAVEGACIÓN: PRIMARY (ORANGE) Y TAMAÑO SM
   ============================================= */
.nav-tabs {
    border-bottom: 0 !important;
    gap: 0.5rem;
    margin-bottom: 1.5rem !important;
}

.nav-tabs .nav-link,
.nav-pills .nav-link,
#adminTabs .nav-link {
    font-size: 0.8125rem !important; /* sm */
    font-weight: 500 !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: 6px !important;
    color: var(--bs-body-color, #7c8fac) !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease-in-out;
}

.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover,
#adminTabs .nav-link:hover {
    color: var(--bs-primary, #F38020) !important;
    background-color: var(--bs-primary-bg-subtle, rgba(243, 128, 32, 0.15)) !important;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active,
#adminTabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: #ffffff !important;
    background-color: var(--bs-primary, #F38020) !important;
    border-color: var(--bs-primary, #F38020) !important;
    box-shadow: none !important;
}

/* =============================================
   INTEGRACIÓN SELECTS Y SELECT2 (DARK / LIGHT)
   ============================================= */
select, option {
    color-scheme: light dark;
}
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] option {
    color-scheme: dark !important;
    background-color: #202936 !important;
    color: #e2e8f0 !important;
}

.select2-container--default .select2-selection--single {
    height: 40px !important;
    border-radius: 7px !important;
    border: 1px solid var(--bs-border-color) !important;
    background-color: var(--bs-body-bg) !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color) !important;
    line-height: 38px !important;
    padding-left: 12px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 8px !important;
}
/* Focus y Open neutros sin encendido naranja ni sombras */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: #4a5d6a !important;
    box-shadow: none !important;
    outline: none !important;
}

.select2-dropdown {
    border-radius: 8px !important;
    border: 1px solid var(--bs-border-color) !important;
    background-color: var(--bs-body-bg) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    z-index: 1055 !important;
}
[data-bs-theme="dark"] .select2-dropdown {
    background-color: #202936 !important;
    border-color: #334155 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}
.select2-container--default .select2-results__option {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    color: var(--bs-body-color) !important;
}
.select2-container--default .select2-results__option[aria-disabled="true"] {
    display: none !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option {
    color: #cbd5e1 !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--selected {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border-radius: 6px !important;
    border: 1px solid var(--bs-border-color) !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    padding: 6px 10px !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #1a222e !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

/* Forzar Warning en componentes específicos con texto en blanco */
.btn-warning,
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: var(--bs-warning) !important;
    border-color: var(--bs-warning) !important;
    color: #ffffff !important;
}

/* Forzar Danger en componentes específicos */
.btn-danger {
    background-color: var(--bs-danger) !important;
    border-color: var(--bs-danger) !important;
    color: #fff !important;
}
.btn-danger:hover {
    filter: brightness(0.9);
}

/* Forzar Success en componentes específicos */
.btn-success {
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
    color: #fff !important;
}
.btn-success:hover {
    background-color: #2ba84b !important;
    border-color: #2ba84b !important;
    color: #fff !important;
}

/* --- Avatar circular con inicial del usuario --- */
.user-avatar-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

/* --- Modal de confirmación de eliminación --- */
.delete-modal-icon {
    width: 64px;
    height: 64px;
}

/* --- Tabla de usuarios --- */
#users-table tbody tr {
    transition: background-color 0.15s ease;
}

/* --- Botones de acción en tablas --- */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

/* --- Indicador circular para badges (estilo Modernize) --- */
.round-8 {
    width: 8px;
    height: 8px;
    min-width: 8px;
}

/* --- Paginación personalizada (estandarizada a tamaño sm 30px / 6px radius) --- */
.pagination .page-link {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 3px;
    font-size: 0.8125rem;
    border: none;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-heading-color, #2A3547);
    background-color: var(--bs-secondary-bg, #f8f9fa);
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.25);
}

.pagination .page-item.disabled .page-link {
    background-color: transparent !important;
    opacity: 0.4;
}

.pagination .page-link:hover:not(.disabled) {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

@media (max-width: 767.98px) {
    .pagination .page-link {
        width: 34px;
        height: 34px;
        font-size: 0.875rem;
        margin: 0 2px;
        border-radius: 6px !important;
    }
}

/* ==========================================================================
   REGLA 6 (DESIGN_UI): INSIGNIAS Y BADGES UNIFICADOS
   - Escala Tipográfica Pequeña Unificada (~11px) y padding compacto px-2 py-1
   - Esquinas Moderadas como Botones: border-radius: 6px (nunca rounded-pill)
   - Alto contraste en Modo Claro (Light Mode) y fondos sutiles en Modo Oscuro
   ========================================================================== */
/* ==========================================================================
   BADGES Y PILLS DEL SISTEMA - UNIFICACIÓN TOTAL CON BORDES
   - Bordes de 1px a juego con el color del texto (opacidad 0.35)
   - Fondos sutiles (rgba con opacidad 0.12)
   - Color oficial NetCrew:
     * Success: #34c759 (el verde unificado de toda la web)
     * Primary: #F38020
     * Warning: #FAAD14
     * Danger:  #b31b34
     * Info:    #539bff
     * Dark/Secondary: #7c8fac (dark) / #475569 (light)
   ========================================================================== */
.badge {
    font-size: 0.6875rem !important; /* ~11px texto pequeño unificado como en la app */
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    border-radius: 6px !important;
    padding: 0.25rem 0.55rem !important;
    line-height: 1.2 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-audit,
.badge-action {
    width: 7.5rem !important;
    min-width: 7.5rem !important;
    max-width: 7.5rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    padding: 0.3rem 0.6rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    text-transform: lowercase !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Badges de estado e indicadores en tablas con tamaño homogéneo universal */
.badge-table,
.badge-status,
.table td .badge-table,
.table td .badge-status {
    width: 5.25rem !important;
    min-width: 5.25rem !important;
    max-width: 5.25rem !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    line-height: 1 !important;
    padding: 0 0.45rem !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    gap: 0.25rem !important;
}

/* Variante ligeramente más ancha para textos compuestos como 'Por Caducar' */
.badge-table-wide,
.table td .badge-table-wide {
    width: 6.25rem !important;
    min-width: 6.25rem !important;
    max-width: 6.25rem !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    line-height: 1 !important;
    padding: 0 0.45rem !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    gap: 0.25rem !important;
}

/* Evitar forma de píldora exagerada en todo el sistema según Regla 6 */
.badge.rounded-pill {
    border-radius: 6px !important;
}

/* --- BADGES Y PILLS: TRANSPARENTES CON BORDE EXACTO DEL COLOR DEL TEXTO --- */
.badge,
.badge.border,
[data-bs-theme="dark"] .badge,
[data-bs-theme="dark"] .badge.border,
[data-bs-theme="light"] .badge,
[data-bs-theme="light"] .badge.border {
    border: 1px solid currentColor !important;
}

.badge.text-success,
.badge.bg-success-subtle,
.badge.border-success,
.status-pill-success,
[data-bs-theme="dark"] .badge.text-success,
[data-bs-theme="dark"] .badge.bg-success-subtle,
[data-bs-theme="dark"] .badge.border-success {
    color: #34c759 !important;
    border-color: #34c759 !important;
    background-color: rgba(52, 199, 89, 0.12) !important;
}
a.badge.text-success:hover,
a.badge.text-success:focus,
a.badge.bg-success-subtle:hover,
a.badge.bg-success-subtle:focus {
    background-color: rgba(52, 199, 89, 0.22) !important;
    color: #34c759 !important;
    border-color: #34c759 !important;
}

.badge.text-primary,
.badge.bg-primary-subtle,
.badge.border-primary,
.status-pill-primary,
[data-bs-theme="dark"] .badge.text-primary,
[data-bs-theme="dark"] .badge.bg-primary-subtle,
[data-bs-theme="dark"] .badge.border-primary {
    color: #F38020 !important;
    border-color: #F38020 !important;
    background-color: rgba(243, 128, 32, 0.12) !important;
}

.badge.text-warning,
.badge.bg-warning-subtle,
.badge.border-warning,
.status-pill-warning,
[data-bs-theme="dark"] .badge.text-warning,
[data-bs-theme="dark"] .badge.bg-warning-subtle,
[data-bs-theme="dark"] .badge.border-warning {
    color: #F38020 !important;
    border-color: #F38020 !important;
    background-color: rgba(243, 128, 32, 0.12) !important;
}

.badge.text-danger,
.badge.bg-danger-subtle,
.badge.border-danger,
.status-pill-danger,
[data-bs-theme="dark"] .badge.text-danger,
[data-bs-theme="dark"] .badge.bg-danger-subtle,
[data-bs-theme="dark"] .badge.border-danger {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background-color: rgba(220, 38, 38, 0.12) !important;
}
a.badge.text-danger:hover,
a.badge.text-danger:focus,
a.badge.bg-danger-subtle:hover,
a.badge.bg-danger-subtle:focus {
    background-color: rgba(220, 38, 38, 0.22) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.badge.text-info,
.badge.bg-info-subtle,
.badge.border-info,
.status-pill-info,
[data-bs-theme="dark"] .badge.text-info,
[data-bs-theme="dark"] .badge.bg-info-subtle,
[data-bs-theme="dark"] .badge.border-info {
    color: #539bff !important;
    border-color: #539bff !important;
    background-color: rgba(83, 155, 255, 0.12) !important;
}

.badge.text-secondary,
.badge.bg-secondary-subtle,
.badge.border-secondary,
.status-pill-secondary,
[data-bs-theme="dark"] .badge.text-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge.border-secondary {
    color: #7c8fac !important;
    border-color: #7c8fac !important;
    background-color: rgba(124, 143, 172, 0.12) !important;
}

[data-bs-theme="light"] .badge.text-secondary,
[data-bs-theme="light"] .badge.bg-secondary-subtle,
[data-bs-theme="light"] .status-pill-secondary {
    background-color: rgba(71, 85, 105, 0.08) !important;
    color: #475569 !important;
    border-color: #475569 !important;
}

/* --- Menú Desplegable (Dropdown) - Tema Claro y Oscuro --- */
[data-bs-theme="light"] .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}
[data-bs-theme="light"] .dropdown-item:not(.text-danger):not(.text-warning):not(.text-success):not(.text-info):not(.text-primary):not(.text-secondary):not(.text-muted) {
    color: #2A3547 !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #121a1f !important;
    border: 1px solid #384656 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
}
[data-bs-theme="dark"] .dropdown-item:not(.text-danger):not(.text-warning):not(.text-success):not(.text-info):not(.text-primary):not(.text-secondary):not(.text-muted) {
    color: #a8b6c2 !important;
}
[data-bs-theme="light"] .dropdown-item:hover,
[data-bs-theme="light"] .dropdown-item:focus {
    background-color: rgba(243, 128, 32, 0.08) !important;
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--bs-primary) !important;
}

.profile-dropdown .dropdown-item {
    border-radius: 8px;
    margin: 4px 12px;
    width: auto;
    transition: all 0.15s ease;
}

.dropdown-menu .badge {
    border: none !important;
    border-radius: 50rem !important;
}

/* --- Dropzone Avatar sin fondo con borde discontinuo gris como las cards --- */
.dropzone-modern-wrapper {
    background-color: transparent !important;
    border-color: var(--bs-border-color, #dfe5ef) !important;
    border-style: dashed !important;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

[data-bs-theme="dark"] .dropzone-modern-wrapper {
    background-color: transparent !important;
    border-color: #374853 !important;
}

/* --- Barra de búsqueda mejorada --- */
.input-group:focus-within {
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.15);
    border-radius: var(--bs-border-radius);
}

/* --- Clases para responsive y regla 9 --- */
.badge-status {
    display: inline-block;
    width: 105px;
    text-align: center;
    font-size: 0.68rem !important;
}

.text-login-time {
    font-size: 0.8rem;
}

.search-form-responsive {
    width: 100%;
}

/* =============================================
   Light Theme Overrides
   ============================================= */
[data-bs-theme="light"] body {
    background-color: #00000004 !important;
}


/* =============================================
   Premium Dark Theme Overrides (Apuestas Style)
   Solo aplica cuando data-bs-theme="dark"
   ============================================= */
[data-bs-theme="dark"] {
    /* Backgrounds Base */
    --bs-body-bg: #0b1114 !important;
    --bs-body-bg-rgb: 11, 17, 20 !important;
    --bs-dark: #0b1114 !important;
    --bs-dark-rgb: 11, 17, 20 !important;
    
    /* Superficies y Tarjetas */
    --bs-card-bg: #121a1f !important;
    --bs-secondary-bg: #121a1f !important;
    --bs-tertiary-bg: #1a262d !important;
    
    /* Bordes Generales en Dark Mode (Gris más claro y definido) */
    --bs-border-color: #374853 !important;

    /* Subtle Dark */
    --bs-dark-bg-subtle: #121a1f !important;
    --bs-dark-border-subtle: #374853 !important;
}

/* Cabecera y Menú Lateral Oscuros */
[data-bs-theme="dark"] .left-sidebar,
[data-bs-theme="dark"] .topbar {
    background-color: #0b1114 !important;
    border-color: #374853 !important;
}

[data-bs-theme="dark"] .left-sidebar {
    border-right: 1px solid #374853 !important;
}

/* Bordes de Tarjetas, Tablas y Separadores en Dark Mode */
[data-bs-theme="dark"] .card.border,
[data-bs-theme="dark"] .border:not(.badge),
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: #374853 !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-border-color: #374853 !important;
}

/* Controles de Formulario, Input Groups y Buscador */
.input-group-text {
    border-color: #dfe5ef;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    border: 1px solid #374853 !important;
    color: #a8b6c2 !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0b1114 !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .input-group:focus-within .input-group-text {
    border-color: #5a6a85 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0b1114 !important;
    box-shadow: none !important;
    outline: none !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #8c9ca6 !important;
}

/* Ocultar placeholder al hacer focus para que se borre de inmediato al escribir/enfocar */
.form-control:focus::placeholder,
.form-control:focus::-webkit-input-placeholder,
.form-control:focus::-moz-placeholder,
input:focus::placeholder,
textarea:focus::placeholder {
    color: transparent !important;
}

/* Botones acoplados dentro de input-group: alineación y altura 100% integradas */
.input-group > .btn,
.input-group > .btn.btn-sm {
    height: auto !important;
    min-height: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin-left: -1px !important;
    padding: 0 0.85rem !important;
}
[data-bs-theme="dark"] .input-group > .btn-outline-secondary,
[data-bs-theme="dark"] .input-group > .btn-dark,
[data-bs-theme="dark"] .input-group > .btn-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid #374853 !important;
    border-left: 0 !important;
    color: #e5e7eb !important;
}
[data-bs-theme="dark"] .input-group > .btn-outline-secondary:hover,
[data-bs-theme="dark"] .input-group > .btn-dark:hover,
[data-bs-theme="dark"] .input-group > .btn-light:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: #5a6a85 !important;
    color: #ffffff !important;
}

/* ==============================================================
   TARJETAS DE ACCIÓN RÁPIDA (QUICK ACTION TILES)
   ============================================================== */
.quick-action-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background-color: transparent;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: inherit;
}

.quick-action-tile:hover {
    background-color: var(--bs-tertiary-bg) !important;
    border-color: var(--bs-border-color) !important;
    transform: translateX(4px);
}

.quick-action-tile .action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.quick-action-tile:hover .action-icon {
    transform: scale(1.05);
}

.quick-action-tile .action-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bs-heading-color);
    margin-bottom: 2px;
}

.quick-action-tile .action-desc {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
}

.quick-action-tile .action-arrow {
    color: var(--bs-secondary-color);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.quick-action-tile:hover .action-arrow {
    color: var(--bs-heading-color) !important;
    transform: translateX(3px);
}

/* --- Select2 Premium Custom Styles --- */
body .select2-container {
    display: inline-block !important;
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 39px !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 4px !important;
    padding-right: 20px !important;
    line-height: normal !important;
    height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none !important;
    width: 7px !important;
    height: 7px !important;
    border-right: 2px solid #8c9ca6 !important;
    border-bottom: 2px solid #8c9ca6 !important;
    transform: rotate(45deg) !important;
    display: inline-block !important;
    transition: transform 0.2s ease !important;
    position: static !important;
    margin-top: -3px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(-135deg) !important;
    margin-top: 3px !important;
}

/* Light Theme Styles for Select2 */
[data-bs-theme="light"] .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border: 1px solid #dfe5ef !important;
    color: #2A3547 !important;
}

[data-bs-theme="light"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #2A3547 !important;
}

[data-bs-theme="light"] .select2-container--default.select2-container--focus .select2-selection--single,
[data-bs-theme="light"] .select2-container--default.select2-container--open .select2-selection--single,
[data-bs-theme="light"] .select2-container--default .select2-selection--single:focus {
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Dark Theme Styles for Select2: Mismo gris #374853 que el resto de inputs del formulario */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: #0b1114 !important;
    border: 1px solid #374853 !important;
    color: #a8b6c2 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #a8b6c2 !important;
}

[data-bs-theme="dark"] .select2-dropdown {
    background-color: #121a1f !important;
    border: 1px solid #374853 !important;
    color: #a8b6c2 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="light"] .select2-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #dfe5ef !important;
    color: #2A3547 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0b1114 !important;
    border: 1px solid #1a262d !important;
    color: #f8f9fa !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: rgba(var(--bs-primary-rgb), 0.5) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

[data-bs-theme="light"] .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: #5d87ff !important;
    box-shadow: 0 0 0 0.25rem rgba(93, 135, 255, 0.2) !important;
}

.select2-results__option {
    padding: 8px 14px !important;
    font-size: 0.875rem !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

[data-bs-theme="dark"] .select2-results__option {
    color: #a8b6c2 !important;
}

[data-bs-theme="light"] .select2-results__option {
    color: #2A3547 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--selected,
[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: rgba(243, 128, 32, 0.15) !important;
    color: var(--bs-primary) !important;
    font-weight: 600 !important;
}

[data-bs-theme="light"] .select2-container--default .select2-results__option--selected,
[data-bs-theme="light"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: rgba(243, 128, 32, 0.12) !important;
    color: var(--bs-primary) !important;
    font-weight: 600 !important;
}

[data-bs-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single:focus {
    border-color: #4a5d6a !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Integración de Select2 dentro de input-group con icono */
.input-group > .select2-unified-wrapper {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--multiple,
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--single {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--multiple {
    min-height: 38px;
}
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--single {
    height: 38px !important;
}
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    padding-left: 12px !important;
}
.input-group > .select2-unified-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: #0b1114 !important;
    border: 1px solid #374853 !important;
    color: #a8b6c2 !important;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    color: #a8b6c2 !important;
    background-color: transparent !important;
}
[data-bs-theme="light"] .select2-container--default .select2-selection--multiple {
    background-color: #ffffff !important;
    border: 1px solid #dfe5ef !important;
    color: #2A3547 !important;
}
[data-bs-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--multiple,
[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #5a6a85 !important;
    background-color: #0b1114 !important;
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: transparent !important;
    border: 1px solid #6c757d !important;
    color: #6c757d !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
}
[data-bs-theme="dark"] body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    border-color: #6c757d !important;
    color: #adb5bd !important;
}
body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    background-color: transparent !important;
    border: none !important;
    color: inherit !important;
    opacity: 0.75;
    position: static !important;
    margin-right: 5px !important;
    padding: 0 !important;
}
body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: transparent !important;
    color: #ef4444 !important;
    opacity: 1;
}

/* Soporte nativo para form-select en tema oscuro y claro */
[data-bs-theme="dark"] select.form-select option,
[data-bs-theme="dark"] select.form-control option {
    background-color: #121a1f !important;
    color: #f8f9fa !important;
}

[data-bs-theme="light"] select.form-select option,
[data-bs-theme="light"] select.form-control option {
    background-color: #ffffff !important;
    color: #2A3547 !important;
}

/* Tablas Premium Dark */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: #f8f9fa !important;
    --bs-table-border-color: rgba(255, 255, 255, 0.05) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
    --bs-table-hover-bg: rgba(var(--bs-primary-rgb), 0.05) !important;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #121a1f !important;
    color: #f6f9fc !important;
    border-bottom: 2px solid #1a262d !important;
}

[data-bs-theme="dark"] .table tbody td {
    background-color: #0b1114 !important;
    color: #f8f9fa !important;
}

/* --- Slide-Over Panel (Drawer) --- */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background-color: var(--bs-card-bg, #fff);
    z-index: 1050;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--bs-border-color, #e5e5e5);
}

.drawer.show {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--bs-border-color, #e5e5e5);
    background-color: var(--bs-tertiary-bg, #fcfcfc);
}

/* --- QR Code Container & Styling --- */
.qr-container {
    background-color: #fff;
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qr-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

/* --- Config Area for WireGuard --- */
.config-pre {
    background-color: #1a262d;
    color: #e5e5e5;
    padding: 1rem;
    border-radius: 8px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

/* --- Hover and transition for nodes list --- */
.device-item {
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-bottom: 1px solid var(--bs-border-color, #e5e5e5);
    padding: 0.75rem 0;
}

.device-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
}

/* --- Botones pequeños y botón cuadrado perfectamente sincronizados --- */
.btn-sm,
.btn.btn-sm {
    height: 30px;
    min-height: 30px;
    padding: 0 0.65rem !important;
    font-size: 0.8125rem !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-square,
.btn-square.btn-sm,
.btn-sm.btn-square {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* --- Contenedor de caja de búsqueda con icono --- */
.search-box-container {
    width: 100%;
}
.search-box-container .form-control {
    padding-left: 2.25rem;
}
.search-box-container .search-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.text-primary-hover {
    transition: color 0.15s ease-in-out;
}
.text-primary-hover:hover {
    color: var(--bs-primary) !important;
}

.network-icon-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

/* --- Wireguard Peer Premium Status CSS --- */
.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator-dot.status-online {
    background-color: var(--bs-success);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
    animation: status-pulse-green 1.8s infinite;
}

.status-indicator-dot.status-offline {
    background-color: #6c757d;
}

.status-indicator-dot.status-checking {
    background-color: var(--bs-warning);
    box-shadow: 0 0 0 0 rgba(250, 173, 20, 0.7);
    animation: status-pulse-yellow 1.8s infinite;
}

@keyframes status-pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(52, 199, 89, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

@keyframes status-pulse-yellow {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(250, 173, 20, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(250, 173, 20, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(250, 173, 20, 0);
    }
}

.peer-transfer-info {
    font-size: 0.72rem;
    letter-spacing: -0.2px;
    font-weight: 500;
}

.peer-endpoint-info {
    font-size: 0.68rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Punto de estado online/offline para móvil/desktop --- */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.online {
    background-color: #34c759; /* Success Green */
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.6);
}

.status-dot.offline {
    background-color: #dc2626; /* Rojo Real */
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

.cursor-pointer {
    cursor: pointer !important;
}
.switch-custom-size {
    width: 2.5em !important;
    height: 1.25em !important;
    cursor: pointer !important;
}
.display-inline-block {
    display: inline-block !important;
}
.overflow-visible {
    overflow: visible !important;
}
.relative-z0 {
    position: relative !important;
    z-index: 0 !important;
}

/* =============================================
   ESTILOS DE LA LANDING PAGE (NETCREW)
   ============================================= */
.landing-body {
    background-color: #0b1114;
    color: #f8f9fa;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
}

.landing-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(11, 17, 20, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1030;
}

.landing-logo {
    height: 30px;
    width: auto;
}

.landing-nav-link {
    color: #a8b6c2;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.landing-nav-link:hover {
    color: var(--bs-primary);
}

.landing-z-index-2 {
    z-index: 2;
}

/* Hero Section */
.landing-hero {
    min-height: 80vh;
    background: radial-gradient(circle at 80% 20%, rgba(243, 128, 32, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(73, 190, 255, 0.05) 0%, transparent 50%);
}

.landing-hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
}

.landing-hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
}

.text-gradient {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #ff9e4f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero-img-wrapper {
    position: relative;
    display: inline-block;
    animation: landing-float 6s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

.landing-hero-img {
    max-height: 480px;
    object-fit: cover;
}

@keyframes landing-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

.landing-hero-gradient-ball-1 {
    position: absolute;
    width: 350px;
    height: 350px;
    top: 15%;
    right: 5%;
    background: radial-gradient(circle, rgba(243, 128, 32, 0.15) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    pointer-events: none;
}

.landing-hero-gradient-ball-2 {
    position: absolute;
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 5%;
    background: radial-gradient(circle, rgba(73, 190, 255, 0.1) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 1;
    pointer-events: none;
}

/* Feature Cards (Glassmorphism) */
.landing-feature-card {
    background: rgba(18, 26, 31, 0.5) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.landing-feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--bs-primary-rgb), 0.3) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3) !important;
}

.landing-feature-icon-wrapper {
    width: 75px;
    height: 75px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.max-w-700 {
    max-width: 700px;
}

.landing-section-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Steps Timeline */
.landing-step-item {
    background: rgba(18, 26, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    transition: border-color 0.3s ease;
}

.landing-step-item:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.landing-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
}

/* Benefits & CTA Card */
.landing-cta-card {
    background: linear-gradient(135deg, rgba(18, 26, 31, 0.9) 0%, rgba(18, 26, 31, 0.6) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 24px !important;
    position: relative;
    overflow: hidden;
}

.landing-cta-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(243, 128, 32, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

/* Buttons and Micro-animations */
.landing-btn-pulse {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-btn-pulse:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(var(--bs-primary-rgb), 0.3) !important;
}

.landing-btn-primary-gradient {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #ff9e4f 100%) !important;
    border: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.landing-btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), 0.4) !important;
}

/* =============================================
   ESTILOS DEL LOGIN DIVIDIDO (MODERNIZE STYLE)
   ============================================= */
.auth-max-width {
    max-width: 450px;
    margin: 0 auto;
}

html.auth-no-scroll,
body.auth-no-scroll {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

.auth-screen-fit {
    height: 100vh;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

.bg-primary-gradient {
    background: linear-gradient(-45deg, #d35400, #F38020, #e67e22, #f39c12);
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =============================================
   VISTA MÓVIL: TARJETAS RESPONSIVAS (MOBILE CARDS)
   ============================================= */
.mobile-card-item {
    background: transparent;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.875rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}

@media (hover: hover) and (pointer: fine) {
    .mobile-card-item:hover {
        transform: translateY(-2px);
        background-color: var(--bs-tertiary-bg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}

.mobile-card-item:active {
    transform: translateY(0);
    background-color: var(--bs-tertiary-bg);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--bs-body-color);
}

.mobile-card-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.mobile-card-label {
    color: var(--bs-secondary-color, #8c98a4);
    font-size: 0.83rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.mobile-card-value {
    font-weight: 500;
    text-align: left;
    word-break: break-word;
}

/* =============================================
   RESPONSIVIDAD Y APROVECHAMIENTO DE BORDES MÓVIL
   (Márgenes optimizados en smartphones y tablets)
   ============================================= */
/* =============================================
   RESPONSIVIDAD Y EXPERIENCIA APP NATIVA MÓVIL
   (Estilo NetCrew Stitch Technical Dark & App Feel)
   ============================================= */

/* Safe area insets para notch en iOS / Android */
body {
    -webkit-tap-highlight-color: transparent;
}

/* =============================================
   VISTA MÓVIL: TARJETAS RESPONSIVAS (MOBILE CARDS)
   ============================================= */
.mobile-card-item {
    background-color: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.875rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .mobile-card-item {
    background-color: rgba(28, 32, 38, 0.75);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .mobile-card-item {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mobile-card-item:hover {
    border-color: var(--bs-border-color);
}

.mobile-card-item:active {
    transform: scale(0.985);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
}

[data-bs-theme="dark"] .mobile-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--bs-heading-color, var(--bs-body-color));
}

.mobile-card-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.mobile-card-label {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.83rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.mobile-card-value {
    font-weight: 500;
    text-align: left;
    word-break: break-word;
    color: var(--bs-body-color);
}

/* =============================================
   100% FULL WIDTH LAYOUT (Sin restricción de ancho)
   ============================================= */
.body-wrapper,
.body-wrapper > .container-fluid,
html[data-boxed-layout=boxed] .container-fluid,
html[data-boxed-layout=boxed] .container-lg,
html[data-boxed-layout=boxed] .container-xl,
html[data-boxed-layout=boxed] .container-xxl {
    max-width: 100% !important;
    width: 100% !important;
}
.body-wrapper > .container-fluid {
    padding-left: 24px !important;
    padding-right: 24px !important;
}
@media (max-width: 767.98px) {
    .body-wrapper > .container-fluid {
        padding-left: max(8px, env(safe-area-inset-left)) !important;
        padding-right: max(8px, env(safe-area-inset-right)) !important;
    }
}

/* =============================================
   ALERTAS Y MENSAJES VACÍOS CON SOPORTE DE TEMA
   ============================================= */
.alert-dark {
    background-color: var(--bs-tertiary-bg, #f8f9fa) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .alert-dark {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--bs-body-color) !important;
}

@media (max-width: 767.98px) {
    /* Corregir corte superior: topbar fija + safe-area notch + altura del topbar */
    .topbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(64px + env(safe-area-inset-top)) !important;
        padding-top: env(safe-area-inset-top) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        background: rgba(16, 20, 26, 0.92) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        z-index: 1030 !important;
    }

    [data-bs-theme="light"] .topbar {
        background: rgba(255, 255, 255, 0.92) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    /* Espacio superior para que el contenido NUNCA se corte bajo el topbar */
    .page-wrapper {
        margin-left: 0 !important;
        padding-top: calc(72px + env(safe-area-inset-top)) !important;
    }

    .body-wrapper {
        padding-top: 0 !important;
        max-width: 100% !important;
    }

    /* Espacio inferior */
    body {
        padding-bottom: env(safe-area-inset-bottom) !important;
    }

    .body-wrapper > .container-fluid {
        padding-left: max(8px, env(safe-area-inset-left)) !important;
        padding-right: max(8px, env(safe-area-inset-right)) !important;
        padding-top: 8px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Ley 3: Anti-Zoom iOS Safari (Inputs >= 16px) */
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px !important;
    }

    /* Ley 2: Touch Targets mínimos >= 44px */
    .mobile-card-item .btn,
    .mobile-card-item a.badge {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .body-wrapper > .container-fluid > .row,
    .metrics-summary-row {
        margin-left: -4px !important;
        margin-right: -4px !important;
    }

    .body-wrapper > .container-fluid > .row > [class*="col-"],
    .metrics-summary-row > [class*="col-"] {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* Tarjetas con acabado técnico refinado */
    .card {
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.07) !important;
        background: rgba(22, 27, 34, 0.85) !important;
        margin-bottom: 12px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    }

    [data-bs-theme="light"] .card {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.07) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    }

    .card > .card-body {
        padding: 1.1rem 1rem !important;
    }

    /* Ajuste en el encabezado/breadcrumb en móviles */
    .card-body h4 {
        font-size: 1.15rem !important;
    }

    /* Tarjetas de nodos para móvil */
    .mobile-card-item {
        background: rgba(28, 32, 38, 0.75) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 12px !important;
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        transition: transform 0.15s ease, border-color 0.15s ease;
    }

    .mobile-card-item:active {
        transform: scale(0.985);
    }

    .mobile-card-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        padding-bottom: 0.65rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Botones touch-friendly y estilizados */
    .btn:not(.btn-sm) {
        min-height: 44px;
        border-radius: 10px !important;
        font-weight: 600;
    }

    .btn.btn-sm {
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
    }

    .btn-square,
    .btn-square.btn-sm,
    .btn-sm.btn-square {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        border-radius: 8px !important;
    }

    /* Touch target mínimo de 44x44px para botones de acción e iconos en móvil (WCAG 2.5.5) */
    .mobile-card-item .dropdown > .btn,
    .mobile-card-header .dropdown > .btn,
    .mobile-card-item .btn-sm.p-1,
    .table td .dropdown > .btn,
    .table td .btn-sm.p-1,
    .btn-touch-target {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
    }

    /* Prevención de auto-zoom no deseado en iOS Safari al enfocar inputs */
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px !important;
    }
}




/* ==========================================================================
   LISTADO DE REDES (/networks) - pase unslop
   Estado con punto estático, cifras en mono tabular, jerarquía por color
   ========================================================================== */
.net-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.net-dot-on {
    background-color: #34c759;
}

.net-dot-off {
    background-color: var(--bs-secondary-color);
    opacity: 0.6;
}

[data-bs-theme="dark"] .net-dot-on {
    background-color: #34c759;
}

.net-name {
    color: var(--bs-body-color);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-bs-theme="dark"] .net-name {
    color: #ededed;
}

a.net-name:hover {
    color: var(--bs-primary);
}

.net-mono {
    font-family: var(--bs-font-monospace);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color);
}

.net-mono.text-body {
    color: var(--bs-body-color) !important;
}

.net-table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
}

.net-table thead th {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    border-bottom: 1px solid var(--bs-border-color);
}

/* ==========================================================================
   DASHBOARD - pase unslop
   Cifras tabulares, fila de salud con separadores hairline, sin estilos inline
   ========================================================================== */
.dash-figure {
    font-variant-numeric: tabular-nums;
}

.dash-stat-card {
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dash-stat-card:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.35) !important;
}
.dash-stat-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
@media (min-width: 768px) {
    .dash-stat-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 1.15rem;
    }
}
.dash-stat-number {
    font-size: 1.45rem;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .dash-stat-number {
        font-size: 1.85rem;
    }
}

.dash-chart-lg {
    min-height: 330px;
}

.dash-chart-md {
    min-height: 250px;
}

.dash-health-cell {
    padding: 0.25rem 0.5rem;
}

.dash-health-row > [class*="col-"] + [class*="col-"] {
    border-left: 1px solid var(--bs-border-color);
}

/* ==========================================================================
   VISTAS VARIAS - pase unslop (sin estilos inline en las vistas)
   ========================================================================== */
.swal-output {
    font-size: 0.8125rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

.connect-page {
    background-color: #0b1114;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.connect-card {
    max-width: 520px;
    width: 100%;
    background: #141c22;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.connect-note {
    font-size: 0.6875rem;
}

/* =============================================
   PALETA DANGER: ROJO REAL (LIGHT & DARK)
   ============================================= */
:root,
[data-bs-theme="light"] {
    --bs-red: #dc2626 !important;
    --bs-danger: #dc2626 !important;
    --bs-danger-rgb: 220, 38, 38 !important;
    --bs-danger-text-emphasis: #991b1b !important;
    --bs-danger-bg-subtle: #fee2e2 !important;
    --bs-danger-border-subtle: #fca5a5 !important;
}

[data-bs-theme="dark"] {
    --bs-red: #ef4444 !important;
    --bs-danger: #ef4444 !important;
    --bs-danger-rgb: 239, 68, 68 !important;
    --bs-danger-text-emphasis: #fca5a5 !important;
    --bs-danger-bg-subtle: rgba(239, 68, 68, 0.15) !important;
    --bs-danger-border-subtle: rgba(239, 68, 68, 0.35) !important;
}

/* Botones Danger Sólidos (Rojo Real) */
.btn-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.25) !important;
}

[data-bs-theme="dark"] .btn-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .btn-danger:hover,
[data-bs-theme="dark"] .btn-danger:focus,
[data-bs-theme="dark"] .btn-danger:active,
[data-bs-theme="dark"] .btn-danger.active {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

/* Textos y Badges Danger */
.text-danger {
    color: #dc2626 !important;
}
[data-bs-theme="dark"] .text-danger {
    color: #ef4444 !important;
}

.bg-danger {
    background-color: #dc2626 !important;
}

.border-danger {
    border-color: #dc2626 !important;
}
[data-bs-theme="dark"] .border-danger {
    border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Alertas Danger */
.alert-danger {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}
[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

/* =============================================
   FORM WIZARD (MODERNIZE JQUERY-STEPS REFINED)
   ============================================= */
.wizard-content .wizard {
    width: 100% !important;
}

/* Steps list structure */
.wizard-content .wizard > .steps {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 2rem !important;
}
.wizard-content .wizard > .steps > ul {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.wizard-content .wizard > .steps > ul > li {
    display: table-cell !important;
    width: auto !important;
    vertical-align: top !important;
    text-align: center !important;
    position: relative !important;
    float: none !important;
}

/* Link and step title */
.wizard-content .wizard > .steps > ul > li a {
    position: relative !important;
    padding-top: 54px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
    color: var(--bs-body-color, #a8b6c2) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    outline: none !important;
    cursor: pointer !important;
}
.wizard-content .wizard > .steps > ul > li a:hover {
    color: var(--bs-emphasis-color, #ffffff) !important;
}
.wizard-content .wizard > .steps > ul > li.current > a {
    color: var(--bs-emphasis-color, #ffffff) !important;
    font-weight: 600 !important;
}

/* Circular step badge: Centrado exacto encima de la línea */
.wizard-content .wizard.wizard-circle > .steps .step {
    width: 44px !important;
    height: 44px !important;
    line-height: 38px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    margin-left: -22px !important;
    z-index: 2 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 3px solid #374853 !important;
    background-color: #202936 !important;
    color: #a8b6c2 !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out;
}
.wizard-content .wizard > .steps > ul > li a:hover .step {
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* Paso actual */
.wizard-content .wizard.wizard-circle > .steps > ul > li.current .step {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* Paso completado (Siempre primary sin colorines) */
.wizard-content .wizard.wizard-circle > .steps > ul > li.done .step {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* Líneas conectoras: A la altura exacta del centro del círculo (top: 22px) detrás del badge (z-index: 1) */
.wizard-content .wizard.wizard-circle > .steps > ul > li:before,
.wizard-content .wizard.wizard-circle > .steps > ul > li:after {
    content: "" !important;
    z-index: 1 !important;
    display: block !important;
    position: absolute !important;
    top: 22px !important;
    margin-top: -1px !important;
    height: 2px !important;
    width: 50% !important;
    background-color: #374853 !important;
}
.wizard-content .wizard.wizard-circle > .steps > ul > li:before {
    left: 0 !important;
}
.wizard-content .wizard.wizard-circle > .steps > ul > li:after {
    right: 0 !important;
}

/* Nunca sobresalir del primer y último paso */
.wizard-content .wizard.wizard-circle > .steps > ul > li:first-child:before {
    display: none !important;
    content: none !important;
}
.wizard-content .wizard.wizard-circle > .steps > ul > li:last-child:after {
    display: none !important;
    content: none !important;
}

/* Conectores completados en primary oficial sin colorines */
.wizard-content .wizard.wizard-circle > .steps > ul > li.done:after,
.wizard-content .wizard.wizard-circle > .steps > ul > li.done + li:before {
    background-color: var(--bs-primary) !important;
}

/* Contenido del paso */
.wizard-content .wizard > .content {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    min-height: 260px !important;
    overflow: visible !important;
    margin-bottom: 1.5rem !important;
}
.wizard-content .wizard > .content > .body {
    float: none !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
}

/* Botón Dark Universal (Cancelar / Secundario Sobrio) */
.btn-dark {
    background-color: #2a3547 !important;
    border-color: #2a3547 !important;
    color: #ffffff !important;
}
.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active {
    background-color: #1e293b !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .btn-dark {
    background-color: #202936 !important;
    border-color: #374853 !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .btn-dark:hover,
[data-bs-theme="dark"] .btn-dark:focus,
[data-bs-theme="dark"] .btn-dark:active {
    background-color: #2a3547 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

/* Botones centrados con palabras simples y separación estándar global (8px / 0.5rem / gap-2), tamaño uniforme btn-sm */
.wizard-content .wizard > .actions {
    text-align: center !important;
    padding-top: 1rem !important;
}
.wizard-content .wizard > .actions > ul {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important; /* Separación estándar global de 8px (0.5rem / gap-2 / me-2) */
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    flex-wrap: wrap !important;
}
.wizard-content .wizard > .actions > ul > li,
.wizard-content .wizard .actions > ul > li,
.wizard-content .wizard .actions > ul > li + li {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Ocultar li deshabilitado por completo para que no genere espacios dobles o fantasmas */
.wizard-content .wizard > .actions > ul > li.disabled,
.wizard-content .wizard > .actions > ul > li.disabled > a,
.wizard-content .wizard > .actions > ul > li[style*="display: none"],
.wizard-content .wizard > .actions > ul > li[aria-hidden="true"] {
    display: none !important;
}
.wizard-content .wizard > .actions > ul > li > a,
.wizard-content .wizard > .actions > ul > li > button,
.wizard-content .wizard > .actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 0.65rem !important;
    font-size: 0.8125rem !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    border-radius: 7px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease-in-out;
}
.wizard-content .wizard > .actions > ul > li > a[href="#next"],
.wizard-content .wizard > .actions > ul > li > a[href="#finish"] {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border: 1px solid var(--bs-primary) !important;
}
.wizard-content .wizard > .actions > ul > li > a[href="#next"]:hover,
.wizard-content .wizard > .actions > ul > li > a[href="#finish"]:hover {
    filter: brightness(1.1) !important;
}
/* Botón Anterior limpio y estilizado en modo claro y oscuro */
.wizard-content .wizard > .actions > ul > li > a[href="#previous"],
.wizard-content .wizard .actions > ul > li a[href="#previous"] {
    background-color: #ffffff !important;
    color: #2a3547 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
.wizard-content .wizard > .actions > ul > li > a[href="#previous"]:hover,
.wizard-content .wizard .actions > ul > li a[href="#previous"]:hover,
.wizard-content .wizard > .actions > ul > li > a[href="#previous"]:focus,
.wizard-content .wizard .actions > ul > li a[href="#previous"]:focus {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
}
.wizard-content .wizard .btn-wizard-cancel {
    background-color: #2a3547 !important;
    color: #ffffff !important;
    border: 1px solid #2a3547 !important;
}
.wizard-content .wizard .btn-wizard-cancel:hover {
    background-color: #1e293b !important;
    border-color: #1e293b !important;
}
[data-bs-theme="dark"] .wizard-content .wizard .btn-wizard-cancel {
    background-color: #202936 !important;
    color: #ffffff !important;
    border: 1px solid #374853 !important;
}
[data-bs-theme="dark"] .wizard-content .wizard .btn-wizard-cancel:hover {
    background-color: #2a3547 !important;
    border-color: #475569 !important;
}

/* Anterior legible en tema oscuro */
[data-bs-theme="dark"] .wizard-content .wizard > .actions > ul > li > a[href="#previous"],
[data-bs-theme="dark"] .wizard-content .wizard .actions > ul > li a[href="#previous"] {
    background-color: #202936 !important;
    color: #e2e8f0 !important;
    border: 1px solid #374853 !important;
    box-shadow: none !important;
}
[data-bs-theme="dark"] .wizard-content .wizard > .actions > ul > li > a[href="#previous"]:hover,
[data-bs-theme="dark"] .wizard-content .wizard .actions > ul > li a[href="#previous"]:hover,
[data-bs-theme="dark"] .wizard-content .wizard > .actions > ul > li > a[href="#previous"]:focus,
[data-bs-theme="dark"] .wizard-content .wizard .actions > ul > li a[href="#previous"]:focus {
    background-color: #2a3547 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

/* Móvil: acciones principales en una fila a ancho completo; Eliminar aparte, debajo y separado */
@media (max-width: 767.98px) {
    .wizard-content .wizard > .actions > ul > li:not(.delete-step-item) {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }
    .wizard-content .wizard > .actions > ul > li:not(.delete-step-item) > a,
    .wizard-content .wizard > .actions > ul > li:not(.delete-step-item) > button {
        width: 100% !important;
    }
    .wizard-content .wizard > .actions > ul > li.delete-step-item {
        order: 10 !important;
        flex: 0 0 100% !important;
        margin-top: 8px !important;
        padding-top: 12px !important;
        border-top: 1px solid #374853 !important;
    }
    .wizard-content .wizard > .actions > ul > li.delete-step-item > button {
        width: 100% !important;
    }
}

@media (max-width: 767.98px) {
    .wizard-content .wizard.wizard-circle > .steps > ul > li a {
        font-size: 11px !important;
        padding-top: 44px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .wizard-content .wizard.wizard-circle > .steps .step {
        width: 36px !important;
        height: 36px !important;
        line-height: 30px !important;
        margin-left: -18px !important;
        font-size: 0.95rem !important;
        top: 0 !important;
    }
    .wizard-content .wizard.wizard-circle > .steps > ul > li:before,
    .wizard-content .wizard.wizard-circle > .steps > ul > li:after {
        top: 18px !important;
        margin-top: -1px !important;
        height: 2px !important;
    }

    .wizard-content .wizard > .actions > ul > li > a,
    .wizard-content .wizard > .actions > ul > li > button,
    .wizard-content .wizard > .actions .btn {
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
    }

    /* Optimización Móvil: Eliminar contenedor doble card */
    .mobile-card-list-wrapper {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    .mobile-card-list-wrapper > .card-body {
        padding: 0 !important;
    }
    .mobile-card-container {
        padding: 0 !important;
    }

    /* Métricas superiores compactas en móvil */
    .metrics-summary-row .card-body {
        padding: 0.75rem 0.85rem !important;
        gap: 0.65rem !important;
    }
    .metrics-summary-row .round-40 {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }
    .metrics-summary-row h4 {
        font-size: 1.15rem !important;
    }
    .metrics-summary-row span {
        font-size: 0.65rem !important;
    }
}

/* Filas de tabla en PC: Clic en toda la línea para editar */
.proxy-row {
    cursor: pointer !important;
    transition: background-color 0.15s ease-in-out;
}
[data-bs-theme="dark"] .proxy-row:hover td {
    background-color: rgba(255, 255, 255, 0.035) !important;
}
[data-bs-theme="light"] .proxy-row:hover td {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Tarjetas de Lista Móvil (Aprovechamiento de Pantalla) */
.proxy-card-item {
    cursor: pointer !important;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
[data-bs-theme="dark"] .proxy-card-item {
    background-color: #1a222e !important;
    border-color: #2a3547 !important;
}
[data-bs-theme="dark"] .proxy-card-item:hover,
[data-bs-theme="dark"] .proxy-card-item:active {
    background-color: #202b3b !important;
    border-color: #374853 !important;
}
[data-bs-theme="light"] .proxy-card-item {
    background-color: #ffffff !important;
    border-color: #ebf1f6 !important;
}
[data-bs-theme="light"] .proxy-card-item:hover,
[data-bs-theme="light"] .proxy-card-item:active {
    background-color: #f8fafd !important;
    border-color: #dfe5ef !important;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: transparent !important;
    border-color: #374853 !important;
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* ========================================================
   Garantizar Borde Exacto del Color del Texto para Badges
   ======================================================== */
.badge,
.badge.border,
a.badge,
span.badge,
[data-bs-theme="dark"] .badge,
[data-bs-theme="dark"] .badge.border,
[data-bs-theme="dark"] a.badge,
[data-bs-theme="dark"] span.badge,
[data-bs-theme="light"] .badge,
[data-bs-theme="light"] .badge.border,
[data-bs-theme="light"] a.badge,
[data-bs-theme="light"] span.badge {
    border: 1px solid currentColor !important;
}

.badge.text-success,
.badge.bg-success-subtle,
.badge.border-success,
[data-bs-theme="dark"] .badge.text-success,
[data-bs-theme="dark"] .badge.bg-success-subtle,
[data-bs-theme="dark"] .badge.border-success,
[data-bs-theme="dark"] .badge.border-success.border {
    color: #34c759 !important;
    border-color: #34c759 !important;
    background-color: rgba(52, 199, 89, 0.12) !important;
}

.badge.text-warning,
.badge.bg-warning-subtle,
.badge.border-warning,
[data-bs-theme="dark"] .badge.text-warning,
[data-bs-theme="dark"] .badge.bg-warning-subtle,
[data-bs-theme="dark"] .badge.border-warning,
[data-bs-theme="dark"] .badge.border-warning.border {
    color: #F38020 !important;
    border-color: #F38020 !important;
    background-color: rgba(243, 128, 32, 0.12) !important;
}

.badge.text-danger,
.badge.bg-danger-subtle,
.badge.border-danger,
[data-bs-theme="dark"] .badge.text-danger,
[data-bs-theme="dark"] .badge.bg-danger-subtle,
[data-bs-theme="dark"] .badge.border-danger,
[data-bs-theme="dark"] .badge.border-danger.border {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background-color: rgba(220, 38, 38, 0.12) !important;
}

.badge.text-secondary,
.badge.bg-secondary-subtle,
.badge.border-secondary,
[data-bs-theme="dark"] .badge.text-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge.border-secondary,
[data-bs-theme="dark"] .badge.border-secondary.border {
    color: #7c8fac !important;
    border-color: #7c8fac !important;
    background-color: rgba(124, 143, 172, 0.12) !important;
}

.badge.text-primary,
.badge.bg-primary-subtle,
.badge.border-primary,
[data-bs-theme="dark"] .badge.text-primary,
[data-bs-theme="dark"] .badge.bg-primary-subtle,
[data-bs-theme="dark"] .badge.border-primary,
[data-bs-theme="dark"] .badge.border-primary.border {
    color: #F38020 !important;
    border-color: #F38020 !important;
    background-color: rgba(243, 128, 32, 0.12) !important;
}

.ssl-icon-box {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.header-preset-badge {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.header-preset-badge:hover {
    transform: translateY(-1px);
}

/* Norma de Diseño: Botón Cancelar siempre a la izquierda */
.wizard-content .wizard > .actions > ul > li.cancel-step-item {
    order: -1 !important;
}

/* =========================================================================
   Terminal / Consola Base Unificada Nginx (Logs y Editor Vhost)
   ========================================================================= */
.nginx-terminal,
.nginx-log-console,
.nginx-vhost-editor {
    background-color: #f8fafc !important;
    color: #334155 !important;
    border: 1px solid #dfe5ef !important;
    border-radius: 8px !important;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 0.8125rem !important;
    line-height: 1.6 !important;
    white-space: pre-wrap;
    word-break: break-all;
    tab-size: 4;
}

[data-bs-theme="dark"] .nginx-terminal,
[data-bs-theme="dark"] .nginx-log-console,
[data-bs-theme="dark"] .nginx-vhost-editor {
    background-color: #0b1114 !important;
    color: #cbd5e1 !important;
    border-color: #374853 !important;
}

/* Específico: Visor de logs preformateado */
.nginx-log-console {
    display: block;
    padding: 0.875rem 1rem;
    max-height: 440px;
    overflow-y: auto;
    overflow-x: auto;
}

/* Específico: Editor interactivo de Vhost */
.nginx-vhost-editor {
    min-height: 480px !important;
    resize: vertical !important;
    outline: none !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.nginx-vhost-editor:focus,
[data-bs-theme="dark"] .nginx-vhost-editor:focus {
    border-color: var(--bs-primary, #F38020) !important;
    box-shadow: 0 0 0 0.2rem rgba(243, 128, 32, 0.2) !important;
}











.badge-action.badge-keep-case {
    text-transform: none !important;
}

/* Menús de acciones por encima de tablas y tarjetas */
.table .dropdown-menu,
.mobile-card-item .dropdown-menu {
    z-index: 1055;
}

/* Logs Nginx: barras de métricas y líneas coloreadas */
.log-metric-bar { height: 6px; }
.log-bar-0 { width: 0%; }
.log-bar-5 { width: 5%; }
.log-bar-10 { width: 10%; }
.log-bar-15 { width: 15%; }
.log-bar-20 { width: 20%; }
.log-bar-25 { width: 25%; }
.log-bar-30 { width: 30%; }
.log-bar-35 { width: 35%; }
.log-bar-40 { width: 40%; }
.log-bar-45 { width: 45%; }
.log-bar-50 { width: 50%; }
.log-bar-55 { width: 55%; }
.log-bar-60 { width: 60%; }
.log-bar-65 { width: 65%; }
.log-bar-70 { width: 70%; }
.log-bar-75 { width: 75%; }
.log-bar-80 { width: 80%; }
.log-bar-85 { width: 85%; }
.log-bar-90 { width: 90%; }
.log-bar-95 { width: 95%; }
.log-bar-100 { width: 100%; }

.nginx-log-console .log-line {
    display: block;
    padding: 2px 0.5rem;
    border-left: 3px solid transparent;
    border-radius: 2px;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    transition: background-color 0.15s ease;
}
.nginx-log-console .log-line:hover { background-color: rgba(0, 0, 0, 0.04); }

/* Líneas de log en Modo Claro (colores del sistema / Bootstrap contrastados) */
.nginx-log-console .log-line-warn {
    color: #b45309;
    border-left-color: #FAAD14;
    background-color: rgba(250, 173, 20, 0.08);
}
.nginx-log-console .log-line-error {
    color: #b91c1c;
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.08);
}
.nginx-log-console .log-line-info {
    color: #1d4ed8;
    border-left-color: #539bff;
    background-color: rgba(83, 155, 255, 0.08);
}
.nginx-log-console .log-line-success {
    color: #15803d;
    border-left-color: #34c759;
    background-color: rgba(52, 199, 89, 0.08);
}

/* Líneas de log en Modo Oscuro (Dark Theme) */
[data-bs-theme="dark"] .nginx-log-console .log-line {
    color: #cbd5e1;
}
[data-bs-theme="dark"] .nginx-log-console .log-line:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
[data-bs-theme="dark"] .nginx-log-console .log-line-warn {
    color: #fbbf24;
    border-left-color: #FAAD14;
    background-color: rgba(250, 173, 20, 0.12);
}
[data-bs-theme="dark"] .nginx-log-console .log-line-error {
    color: #f87171;
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.14);
}
[data-bs-theme="dark"] .nginx-log-console .log-line-info {
    color: #93c5fd;
    border-left-color: #539bff;
    background-color: rgba(83, 155, 255, 0.12);
}
[data-bs-theme="dark"] .nginx-log-console .log-line-success {
    color: #86efac;
    border-left-color: #34c759;
    background-color: rgba(52, 199, 89, 0.12);
}

/* Administración: espacio inferior para que los menús de acciones no queden cortados al final de la página */
#adminTabsContent {
    padding-bottom: 6rem;
}
#backupsManagerCard,
#proxyHostsCard {
    overflow: visible;
}
@media (min-width: 768px) {
    #tab-backups .table-responsive,
    #tab-audit .table-responsive,
    #proxyHostsCard .table-responsive {
        overflow: visible !important;
    }
}

/* Stacking context dinámico: la fila o tarjeta con el menú abierto se eleva automáticamente */
.table tr:has(.dropdown-menu.show),
.proxy-card-item:has(.dropdown-menu.show),
.cert-card-item:has(.dropdown-menu.show),
.card:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1055 !important;
}
.table .dropdown-menu,
.dropdown-menu {
    z-index: 1060 !important;
}

/* =========================================================================
   CABECERAS DE PÁGINA UNIVERSALES Y HOMOGÉNEAS
   Garantiza fuente, tamaño, peso y separaciones idénticas en todas las páginas.
   ========================================================================= */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.page-header-title {
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
    margin-bottom: 0 !important;
    color: var(--bs-heading-color) !important;
    display: flex;
    align-items: center;
}
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}





[data-bs-theme="dark"] .input-group-text {
    background-color: #17212b !important;
    border-color: #273441 !important;
    color: #94a3b8 !important;
}
