﻿/*-------------- LOADER -------------- */

/* Ajustar tamaño y estilo del popup */
.swal2-popup.loader-popup {
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0px 8px 25px rgba(0,0,0,0.15);
}

/* Título más elegante */
.swal2-title.loader-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #0d6efd; /* azul tipo bootstrap */
}

/* Texto de ayuda */
.swal2-html-container.loader-html {
    font-size: 0.95rem;
    color: #6c757d;
    margin-top: 10px;
}

/* Animación del loader */
.swal2-loader {
    border: 0.25em solid #e9ecef !important;
    border-top: 0.25em solid #0d6efd !important;
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 15px;
}

/* Efecto de giro */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.navbar .navbar-brand {
    margin-left: 0 !important;
}


.ck.ck-editor__main > .ck-editor__editable {
    height: 300px !important;
    overflow-y: auto !important;
}

/* ===== LOADER POPUP ===== */
.loader-popup {
    border-radius: 16px !important;
    padding: 2rem 2.5rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
}

.loader-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-bottom: 0 !important;
}

/* ===== RING ANIMADO ===== */
.custom-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.loader-ring {
    display: inline-block;
    position: relative;
    width: 56px;
    height: 56px;
}

    .loader-ring div {
        box-sizing: border-box;
        display: block;
        position: absolute;
        width: 46px;
        height: 46px;
        margin: 5px;
        border: 4px solid transparent;
        border-radius: 50%;
        animation: loader-ring-spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    }

        .loader-ring div:nth-child(1) {
            border-top-color: #4f46e5;
            animation-delay: -0.3s;
        }

        .loader-ring div:nth-child(2) {
            border-top-color: #818cf8;
            animation-delay: -0.2s;
        }

        .loader-ring div:nth-child(3) {
            border-top-color: #c7d2fe;
            animation-delay: -0.1s;
        }

        .loader-ring div:nth-child(4) {
            border-top-color: #e0e7ff;
        }

.loader-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    margin: 0;
}

@keyframes loader-ring-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== BOTONES PRIMARY - HOME (BOOTSTRAP BLUE) ===== */

.home-page .btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

    .home-page .btn-primary:hover {
        background-color: #0b5ed7 !important;
        border-color: #0b5ed7 !important;
    }

    .home-page .btn-primary:active,
    .home-page .btn-primary.active {
        background-color: #0a58ca !important;
        border-color: #0a58ca !important;
    }

    .home-page .btn-primary:focus,
    .home-page .btn-primary:focus-visible {
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.35) !important;
    }

/* =====================================================
   TABULATOR - CONTENEDOR
===================================================== */
.tabulator-wrapper .tabulator {
    border: 1px solid #d9d9e3;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

/* =====================================================
   TABULATOR - HEADER
===================================================== */
.tabulator-wrapper .tabulator-header {
    background: linear-gradient(90deg, #0a0a8f, #6f1d7a);
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    height: auto !important;
}

.tabulator-wrapper .tabulator-col {
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    height: auto !important;
}

.tabulator-wrapper .tabulator-col-title {
    white-space: normal !important;
    font-size: 14px;
    line-height: 1.2;
}

.tabulator-wrapper .tabulator-col-sorter {
    color: #ffffff !important;
}

/* =====================================================
   TABULATOR - FILAS Y CELDAS
===================================================== */
.tabulator-wrapper .tabulator-row {
    border-bottom: 1px solid #ececf3;
}

    .tabulator-wrapper .tabulator-row:hover {
        background-color: #f4f2fb;
    }

.tabulator-wrapper .tabulator-cell {
    white-space: normal !important;
    word-break: break-word;
    padding: 8px 10px;
    font-size: 12px;
    border-right: 1px solid #f0f0f5;
}

    .tabulator-wrapper .tabulator-cell:last-child {
        border-right: none;
    }

/* =====================================================
   TABULATOR - FOOTER (bottomCalc / fila TOTAL)
===================================================== */
.tabulator-wrapper .tabulator-footer {
    background: #ffffff;
    border-top: 2px solid #d9d9e3;
}

.tabulator-wrapper .tabulator-calcs-holder {
    overflow: hidden !important;
}

.tabulator-wrapper .tabulator-calcs-bottom .tabulator-cell {
    font-size: 12px;
    font-weight: 700;
    color: var(--on-surface);
    border-right: 1px solid #ececf3;
    background-color: #f4f2fb !important;
    border-top: 2px solid #c5c0e8;
}

    /* Resaltar celda "TOTAL" (primera columna) */
    .tabulator-wrapper .tabulator-calcs-bottom .tabulator-cell:first-child {
        color: #000091;
        font-size: 13px;
        letter-spacing: 0.5px;
    }

    .tabulator-wrapper .tabulator-calcs-bottom .tabulator-cell:last-child {
        border-right: none;
    }

/* ========================================================================
   Variables de gradiente (reutilizable)
   ======================================================================== */
:root {
    --gradient-primary: linear-gradient(45deg, #000091, #6f166f);
    --gradient-primary-hover: linear-gradient(45deg, #00006e, #5a1259);
    --gradient-success: linear-gradient(45deg, #1a7a4a, #28a745);
    --gradient-success-hover: linear-gradient(45deg, #155f39, #1e7e34);
}

/* ========================================================================
   Filtro Card - Contenedor
   ======================================================================== */
.filtro-card {
    background: #ffffff;
    border: 1px solid var(--outline-variant);
    border-radius: var(--md-shape-corner-medium);
    box-shadow: var(--md-elevation-1);
    overflow: visible; /* 👈 importante */
}

.filtro-card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top-left-radius: var(--md-shape-corner-medium);
    border-top-right-radius: var(--md-shape-corner-medium);
}

    .filtro-card-header .material-symbols-rounded {
        font-size: 18px;
    }

.filtro-busqueda {
    padding: 16px 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ========================================================================
   Filtro Item - Label + Control
   ======================================================================== */
.filtro-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filtro-btns {
    display: flex;
    flex-direction: column; /* cambia a column */
    gap: 4px;
}

    .filtro-btns .btn-new {
        height: 38px; /* misma altura que tus .search-input */
        margin-top: auto;
        width:320px;
    }

.combo-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--md-neutral-50);
    white-space: nowrap;
}

.filtro-divider {
    width: 1px;
    height: 36px;
    background-color: var(--outline-variant);
    align-self: flex-end;
    margin-bottom: 1px;
}

/* ========================================================================
   Combo Filtro
   ======================================================================== */
.combo-filtro {
    height: 38px;
    padding: 0 32px 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface);
    background-color: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-radius: var(--md-shape-corner-small);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 320px;
    appearance: auto;
}

    .combo-filtro:hover {
        border-color: #6f166f;
        background-color: #fff;
        box-shadow: 0 0 0 3px rgba(111, 22, 111, 0.08);
    }

    .combo-filtro:focus {
        border-color: #000091;
        background-color: #fff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 0, 145, 0.12);
    }

/* ========================================================================
   Search Box
   ======================================================================== */
.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-radius: var(--md-shape-corner-small);
    overflow: visible !important;
    transition: all 0.2s ease;
    min-width: 320px;
}

    .search-box:focus-within {
        border-color: #000091;
        box-shadow: 0 0 0 3px rgba(0, 0, 145, 0.12);
        background: #fff;
    }

.search-input {
    flex: 1;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--on-surface);
    outline: none;
    padding: 0 8px 0 12px;
}

    .search-input::placeholder {
        color: var(--md-neutral-60);
        font-size: 13px;
    }

.search-btn {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .search-btn:hover {
        background: var(--gradient-primary-hover);
    }

.search-btn-standalone {
    border-radius: var(--md-shape-corner-small);
}
/* ========================================================================
   Botón Exportar Excel
   ======================================================================== */
.btn-export {
    height: 38px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--gradient-success);
    border: none;
    border-radius: var(--md-shape-corner-small);
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    min-width: 130px;
}

    .btn-export:hover {
        background: var(--gradient-success-hover);
        box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
        transform: translateY(-1px);
    }

    .btn-export:active {
        transform: translateY(0);
    }

.btn-new {
    height: 38px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--md-shape-corner-small);
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(91, 110, 245, 0.3);
    min-width: 130px;
}

    .btn-new:hover {
        background: var(--gradient-primary-hover);
        box-shadow: 0 4px 10px rgba(91, 110, 245, 0.4);
        transform: translateY(-1px);
    }

    .btn-new:active {
        transform: translateY(0);
    }


/* ========================================================================
   Info Card - Datos del Cliente
   ======================================================================== */
.info-card {
    background: #ffffff;
    border: 1px solid var(--outline-variant);
    border-radius: var(--md-shape-corner-medium);
    box-shadow: var(--md-elevation-1);
    overflow: visible;
}

.info-card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top-left-radius: var(--md-shape-corner-medium);
    border-top-right-radius: var(--md-shape-corner-medium);
}

    .info-card-header .material-symbols-rounded {
        font-size: 18px;
    }

.info-card-body {
    padding: 4px 0;
}

.info-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

    .info-row.border-0 {
        border-bottom: none;
    }

.info-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 20px;
}

    .info-item:first-child {
        border-right: 1px solid #f0f0f0;
    }

.info-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--md-neutral-50);
    min-width: 90px;
    flex-shrink: 0;
}

.info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface);
}

.info-label-pay {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--md-neutral-50);
    min-width: 165px;
    flex-shrink: 0;
}

/* ========================================================================
   Botón Atrás
   ======================================================================== */
.btn-back {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-back .icon-circle {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        border-radius: 50%;
        background: var(--gradient-primary);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex-shrink: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        transition: opacity 0.2s ease;
    }

    .btn-back:hover .icon-circle {
        opacity: 0.85;
    }

.btn-back-text {
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 0.3px;
}

.filtro-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.space {
    visibility: hidden;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e3a5f;
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
    margin: 0;
}

.form-card {
    background: var(--md-sys-color-surface, #fff);
    border-radius: var(--md-shape-corner-medium, 12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-width: 600px; /* ancho contenido, no ocupa toda la pantalla */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    width: 100%;
    margin: 0;
}

.form-card-header {
    background: var(--gradient-primary, linear-gradient(135deg, #5b6ef5, #7c3aed));
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

    .form-card-header .material-symbols-rounded {
        font-size: 22px;
    }

.form-card-body {
    padding: 28px 24px;
}

.btn-submit {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary, linear-gradient(135deg, #5b6ef5, #7c3aed));
    border: none;
    border-radius: var(--md-shape-corner-small);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(91, 110, 245, 0.3);
}

    .btn-submit:hover {
        opacity: 0.88;
        box-shadow: 0 4px 10px rgba(91, 110, 245, 0.4);
        transform: translateY(-1px);
    }

    .btn-submit:active {
        transform: translateY(0);
    }

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

    .btn-action:active {
        transform: translateY(0);
    }

.btn-action-edit {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.25);
}

    .btn-action-edit:hover {
        background: rgba(59, 130, 246, 0.25);
        color: #2563eb;
        transform: translateY(-1px);
    }

.btn-action-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

    .btn-action-delete:hover {
        background: rgba(239, 68, 68, 0.25);
        color: #dc2626;
        transform: translateY(-1px);
    }

.btn-action-user {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

    .btn-action-user:hover {
        background: rgba(16, 185, 129, 0.25);
        color: #059669;
        transform: translateY(-1px);
    }

.btn-action-download {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

    .btn-action-download:hover {
        background: rgba(16, 185, 129, 0.25);
        color: #059669;
        transform: translateY(-1px);
    }

.swal-popup-custom {
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(91, 110, 245, 0.15) !important;
}

.swal-title-custom {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--on-surface, #1a1c1e) !important;
    padding-bottom: 4px !important;
}

.swal-text-custom {
    font-size: 14px !important;
    color: var(--md-neutral-50, #76777a) !important;
    margin-bottom: 0 !important;
}

.swal-icon-custom {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 16px !important;
    border-color: rgba(91, 110, 245, 0.3) !important;
    color: #5b6ef5 !important;
}

    .swal-icon-custom .swal2-icon-content {
        font-size: 28px !important;
    }

/* Contenedor de botones — gap en lugar de margen */
.swal-actions-custom {
    display: flex !important;
    gap: 12px !important; /* ← separación entre botones */
    justify-content: center !important;
    margin-top: 24px !important;
    padding: 0 !important;
}

.swal-btn-confirm {
    background: linear-gradient(90deg, #0a0a8f, #6f1d7a);
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(91, 110, 245, 0.3) !important;
    transition: all 0.2s ease !important;
    min-width: 110px !important;
}

    .swal-btn-confirm:hover {
        opacity: 0.88 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 10px rgba(91, 110, 245, 0.4) !important;
    }

.swal-btn-cancel {
    background: rgba(107, 114, 128, 0.1) !important;
    border: 1px solid rgba(107, 114, 128, 0.25) !important;
    border-radius: 8px !important;
    padding: 10px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    transition: all 0.2s ease !important;
    min-width: 110px !important;
}

    .swal-btn-cancel:hover {
        background: rgba(107, 114, 128, 0.2) !important;
        transform: translateY(-1px) !important;
    }

    .swal-btn-confirm:active,
    .swal-btn-cancel:active {
        transform: translateY(0) !important;
    }

.swal-icon-success-custom {
    margin: 0 auto 16px !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

    .swal-icon-success-custom .swal2-success-ring {
        border-color: rgba(16, 185, 129, 0.25) !important;
    }

    .swal-icon-success-custom [class^="swal2-success-line"] {
        background-color: #10b981 !important;
    }

/* Error */
.swal-icon-error-custom {
    margin: 0 auto 16px !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

    .swal-icon-error-custom .swal2-x-mark-line-left,
    .swal-icon-error-custom .swal2-x-mark-line-right {
        background-color: #ef4444 !important;
    }

/* Question — para el showConfirmation */
.swal-icon-custom {
    margin: 0 auto 16px !important;
    border-color: rgba(91, 110, 245, 0.3) !important;
    color: #5b6ef5 !important;
}

.swal-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3) !important;
    transition: all 0.2s ease !important;
    min-width: 110px !important;
}

    .swal-btn-danger:hover {
        opacity: 0.88 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4) !important;
    }

    .swal-btn-danger:active {
        transform: translateY(0) !important;
    }


.swal-icon-warning-custom {
    margin: 0 auto 16px !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

    .swal-icon-warning-custom .swal2-icon-content {
        color: #f59e0b !important;
    }

.swal-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3) !important;
    transition: all 0.2s ease !important;
    min-width: 110px !important;
}

    .swal-btn-warning:hover {
        opacity: 0.88 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4) !important;
    }

    .swal-btn-warning:active {
        transform: translateY(0) !important;
    }

.area-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 1rem;
    letter-spacing: -0.2px;
}

.filtro-card-body {
    padding: 16px 18px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

    .filtro-card-body .form-control {
        height: 40px;
        background: #f5f5f8;
        border: 0.5px solid rgba(0, 0, 0, 0.12);
        border-radius: 8px 0px 0px 8px;
        font-size: 14px;
        color: #1a1a2e;
    }

        .filtro-card-body .form-control:focus {
            border-color: #4f46e5;
            background: #fff;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
        }

    /* Botón Agregar (si usas btn-primary ya lo tienes, pero por si acaso) */
    .filtro-card-body .btn-add {
        height: 40px;
        background: var(--gradient-primary);
        border-color: var(--gradient-primary);
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        padding: 0 18px;
        gap: 8px;
    }

        .filtro-card-body .btn-add:hover {
            background: var(--gradient-primary-hover);
        }

        .filtro-card-body .btn-add span {
            color: white;
        }

        /* El icon-circle dentro del botón Agregar */
        .filtro-card-body .btn-add .icon-circle {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            font-size: 12px;
        }

/* Autocomplete list */
.autocomplete-list {
    position: relative;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

    .autocomplete-list li {
        padding: 9px 14px;
        font-size: 13px;
        cursor: pointer;
        transition: background 0.1s;
    }

        .autocomplete-list li:hover {
            background: #f5f5f8;
        }

    .autocomplete-list:empty {
        display: none;
    }

/* Spinner dentro del input */
.input-with-spinner {
    position: relative;
}

.input-spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    display: none;
    animation: spin 1s linear infinite;
}

    .input-spinner.active {
        display: block;
    }


.mp-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.mp-card-header {
    background: linear-gradient(135deg, #3b1f8c, #6b3fc4);
    color: #fff;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-card-body {
    padding: 18px 20px;
}

.mp-info-box {
    background: #eef6fd;
    border: 1px solid #b6d9f5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1a4a7a;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mp-files-table {
    width: 100%;
    border-collapse: collapse;
}

    .mp-files-table tr {
        border-bottom: 1px solid #eee;
    }

        .mp-files-table tr:last-child {
            border-bottom: none;
        }

    .mp-files-table td {
        padding: 8px 0;
        vertical-align: middle;
    }

        .mp-files-table td:first-child {
            width: 90px;
            font-size: 13px;
            color: #555;
            font-weight: 500;
        }

        .mp-files-table td:last-child {
            width: 44px;
            text-align: right;
        }

.mp-file-input {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 13px;
}

.mp-btn-remove {
    background: #c0392b;
    border: none;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    color: #fff;
    cursor: pointer;
}

    .mp-btn-remove:hover {
        background: #a93226;
    }

.mp-add-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.mp-link-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.mp-link-label {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.mp-link-input {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 13px;
    background: #fafaff;
}

    .mp-link-input:focus {
        outline: none;
        border-color: #6b3fc4;
        box-shadow: 0 0 0 3px rgba(107,63,196,0.1);
    }

.mp-footer {
    background: #f8f8fb;
    border-top: 1px solid #e0dff5;
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
}

.mp-btn-enviar {
    background: var(--gradient-primary, linear-gradient(135deg, #5b6ef5, #7c3aed));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}



/* Alerta empresa no encontrada */
.alert-entity-not-found {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background-color: #fef9ec;
    border: 1px solid #f5c842;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: #5a4a00;
    margin-bottom: 1rem;
}

    .alert-entity-not-found span {
        flex: 1;
        min-width: 200px;
    }

/* Botón Registrar Empresa */
.btn-register-entity {
    background-color: #f5c842;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

    .btn-register-entity:hover {
        background-color: #e0b030;
        color: #1a1a1a;
    }

/* ✅ Botón principal - Guardar */
#modalRegisterEntity .btn-primary {
    background: var(--gradient-primary, linear-gradient(135deg, #5b6ef5, #7c3aed));
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
/*    font-weight: 600;*/
    color: #fff;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

    #modalRegisterEntity .btn-primary:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        color: #fff;
    }

    #modalRegisterEntity .btn-primary:active {
        transform: translateY(0);
        opacity: 1;
    }

/* ✅ Botón secundario - Cancelar */
#modalRegisterEntity .btn-light {
    background: transparent;
    border: 1.5px solid #d0d0d0;
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 500;
    color: #555;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    #modalRegisterEntity .btn-light:hover {
        background: #f4f4f4;
        border-color: #aaa;
        color: #333;
    }

.btn-search-ruc {
    background: transparent;
    border: none;
    border-left: 1px solid #6c757d !important; /* #ced4da !important */
    border-radius: 0px 5px 5px 0px !important;
    color: #6c757d;
    width: 48px;
    height: 100% !important;
    position: absolute;
    top: 0;
    right: 0;
    transform: none !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

    .btn-search-ruc:hover {
        background: rgba(91, 110, 245, 0.08);
        color: #5b6ef5;
        border-radius: 0 8px 8px 0;
    }

    .btn-search-ruc:active {
        background: rgba(91, 110, 245, 0.15);
    }

/* ✅ Clave: el contenedor necesita overflow hidden para que el hover respete el border-radius */
#formViewMyProfileRuc ~ .btn-search-ruc,
.form-floating.position-relative {
    overflow: hidden;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

    .autocomplete-dropdown .list-group-item {
        display: block;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
    }

        .autocomplete-dropdown .list-group-item:hover {
            background-color: #f5f5f5;
        }

.filtro-card,
.filtro-busqueda,
.filtro-container {
    overflow: visible !important;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@media (max-width: 768px) {
    .info-row {
        flex-direction: column; /* pasa a 1 columna */
        gap: 12px;
    }

    /* El contenedor general se vuelve vertical */
    .filtro-busqueda .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px;
    }

    /* Exportar ocupa todo el ancho */
    .btn-export {
        width: 100%;
        height: 48px;
    }

    .btn-new {
        width: 100%;
        height: 48px;
    }

    /* Buscador vuelve a horizontal */
    .search-box {
        display: flex;
        flex-direction: row; /* 👈 importante */
        width: 100%;
        gap: 0; /* sin separación */
    }

    .search-input {
        flex: 1; /* ocupa todo el espacio */
        height: 38px;
        border-radius: 12px 0 0 12px;
    }

    .search-btn {
        width: 120px;
        height: 38px;
        border-radius: 0 12px 12px 0;
    }

    .tabulator-cell {
        white-space: normal !important;
    }

    .tabulator-wrapper .tabulator-footer-contents {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        gap: 8px;
        padding: 8px 4px;
    }

    /* Contador */
    .tabulator-wrapper .tabulator-page-counter {
        text-align: center;
        width: 100%;
        font-size: 13px;
        white-space: normal !important;
        word-break: break-word;
    }

    /* Paginador */
    .tabulator-wrapper .tabulator-paginator {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 4px;
        white-space: normal !important;
    }

    /* Select page size */
    .tabulator-wrapper .tabulator-page-size {
        height: 30px;
        font-size: 13px;
    }

    /* Botones */
    .tabulator-wrapper .tabulator-page {
        padding: 4px 8px;
        font-size: 12px;
        min-width: auto;
    }

        /* Opcional: ocultar First / Last en mobile */
        .tabulator-wrapper .tabulator-page[data-page="first"],
        .tabulator-wrapper .tabulator-page[data-page="last"] {
            display: none;
        }

    .wrap-servicio {
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.2;
    }

    .space {
        display: none;
    }

    .form-card {
        max-width: 100%;
        margin: 0;
    }

    .form-card-header {
        padding: 12px 16px;
        font-size: 14px;
    }

    .form-card-body {
        padding: 16px 12px;
    }

    .btn-submit {
        height: 48px;
        font-size: 15px;
    }
}
