/* ============================================================
    views/assets/css/custom/custom.css
    GLOBAL — Estilos universales del sistema
    Última actualización: 2026-06-02 4:55 pm (VET)
   ============================================================ */

/* ============================================================
   ENLACES
   ============================================================ */

a:link,
a:visited,
a:hover,
a:active {
    text-decoration: none !important;
}

/* ============================================================
   BORDES REDONDEADOS (COMPATIBLE CON SELECT2 Y TAGSINPUT)
   ============================================================ */

.rounded,
.select2-selection,
.bootstrap-tagsinput,
.bootstrap-tagsinput>.badge {
    border-radius: 8px !important;
}

.rounded-start {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.rounded-end {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.rounded-top {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.rounded-bottom {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* ============================================================
   BACKGROUND IMAGE
   ============================================================ */

.backgroundImage {
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    z-index: 1;
}

/* ============================================================
   CHECKBOXES Y BOTONES
   ============================================================ */

.form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
}

.form-check-input:active,
.form-check-input:focus,
.btn {
    outline: 0 !important;
    box-shadow: none !important;
}

/* ============================================================
   LIST GROUP
   ============================================================ */

.list-group-item {
    border: 0px !important;
}

/* ============================================================
   ICONO ADMIN
   ============================================================ */

.icon-admin {
    width: 40px;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

/* ============================================================
   CAMPOS REQUERIDOS — ALERTA VISUAL PREMIUM
   ============================================================ */

.input-requerido {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
    transition: 0.2s ease-in-out;
}

.input-requerido::placeholder {
    color: #dc3545 !important;
    opacity: 1;
}

/* ============================================================
   FIX RESPONSIVE PREMIUM — GLOBAL
   ============================================================ */

/* Select2 ancho completo en móvil */
@media (max-width: 576px) {
    .select2-container {
        width: 100% !important;
    }
}

/* Iconos input-group más pequeños */
@media (max-width: 576px) {
    .input-group-text {
        padding: 4px 6px !important;
        font-size: 0.75rem !important;
    }
}

/* Labels más pequeños */
@media (max-width: 576px) {

    label,
    .form-label {
        font-size: 0.78rem !important;
    }
}

/* Inputs en pantallas muy pequeñas */
@media (max-width: 360px) {

    .form-control,
    .form-select {
        font-size: 0.78rem !important;
        padding: 6px 8px !important;
    }
}

/* Textarea en móvil */
@media (max-width: 576px) {
    textarea.form-control {
        min-height: 70px !important;
    }
}

/* Botones globales en móvil */
@media (max-width: 576px) {
    .btn {
        font-size: 0.85rem !important;
        padding: 0.55rem 0.75rem !important;
    }
}

/* ============================================================
   FIX 6 — UX PREMIUM GLOBAL
   ============================================================ */

/* Enfoque premium */
.form-control:focus,
.form-select:focus,
.select2-selection:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .25) !important;
    outline: none !important;
}

/* Hover suave */
.form-control:hover,
.form-select:hover {
    border-color: #bcbcbc !important;
}

/* Placeholder premium */
.form-control::placeholder,
textarea::placeholder {
    color: #6c757d !important;
    opacity: 0.85 !important;
}

/* Placeholder Select2 */
.select2-selection__placeholder {
    color: #6c757d !important;
    opacity: 0.85 !important;
}

/* Enfoque Select2 */
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .25) !important;
}

/* Input-group accesible */
.input-group-text {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

/* Labels globales */
.form-label,
label {
    font-weight: 600 !important;
    color: #444 !important;
    margin-bottom: 4px !important;
    font-size: 0.85rem !important;
}

/* Textarea premium */
textarea.form-control {
    resize: vertical !important;
    min-height: 80px !important;
}

/* Tabs globales */
.nav-link.active {
    font-weight: 600 !important;
    color: #0d6efd !important;
}

/* Botones premium */
.btn:focus,
.btn:active {
    box-shadow: none !important;
    outline: none !important;
}

/* Campos requeridos (focus) */
.input-requerido:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .25) !important;
}

/* Transiciones suaves */
.form-control,
.form-select,
.select2-selection {
    transition: all 0.2s ease-in-out !important;
}

/* Modales de búsqueda responsivos - fix para centrado en celular */
.modal .table-responsive {
    width: 100% !important;
}

/* ============================================================
   ESTILOS DE COTIZACIONES Y MODO OSCURO (TOTALE SUPERIORES)
   ============================================================ */

body.dark-mode #wrap_totales_cotizacion_top {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode #wrap_totales_cotizacion_top .text-muted,
body.dark-mode #wrap_totales_cotizacion_top .text-dark,
body.dark-mode #wrap_totales_cotizacion_top .text-secondary {
    color: #cbd5e1 !important;
}

body.dark-mode #qd_subtotal_bs,
body.dark-mode #qd_tax_bs,
body.dark-mode #qd_total_bs {
    color: #60a5fa !important;
}

/* ============================================================
   ESTANDARIZACIÓN DE BOTONES DE ACCIÓN (TABLAS Y MODALES)
   ============================================================ */
.btn-action-ver {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #ffffff !important;
}

.btn-action-ver:hover {
    background-color: #0bacce !important;
    border-color: #0bacce !important;
    color: #ffffff !important;
}

.btn-action-editar {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-action-editar:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}

.btn-action-whatsapp {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-action-whatsapp:hover {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

.btn-action-anular {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-action-anular:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

.btn-action-pdf {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-action-pdf:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

/* ============================================================
   RESPONSIVE EN CELULAR — TRANSFORMACIÓN DE TABLA A CARDS
   ============================================================ */
@media (max-width: 768px) {

    /* Ocultar cabeceras tradicionales de tabla en móvil */
    #cardTable table thead,
    .table-responsive table thead,
    table.table thead {
        display: none !important;
    }

    #cardTable .table-responsive,
    .table-responsive {
        overflow: visible !important;
        border: none !important;
    }

    #cardTable table,
    .table-responsive table,
    table.table {
        display: block !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
    }

    #cardTable table tbody,
    .table-responsive table tbody,
    table.table tbody {
        display: block !important;
        width: 100% !important;
    }

    /* Cada fila (tr) se transforma en una Card idéntica a Image 1 */
    #cardTable table tbody tr,
    .table-responsive table tbody tr,
    table.table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 14px !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    }

    #cardTable table tbody tr:active,
    #cardTable table tbody tr:hover,
    .table-responsive table tbody tr:active,
    .table-responsive table tbody tr:hover,
    table.table tbody tr:active,
    table.table tbody tr:hover {
        border-color: #cbd5e1 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    }

    /* Anular anchos fijos de escritorio en celdas */
    #cardTable table tbody tr td,
    .table-responsive table tbody tr td,
    table.table tbody tr td {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 🟢 CABECERA DE LA CARD (# Número de registro) */
    #cardTable table tbody tr td[data-label="#"],
    .table-responsive table tbody tr td[data-label="#"],
    table.table tbody tr td[data-label="#"] {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background-color: #f8fafc !important;
        border: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 10px 14px !important;
        font-weight: 700 !important;
        font-size: 0.92rem !important;
        color: #0d6efd !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #cardTable table tbody tr td[data-label="#"]::before,
    .table-responsive table tbody tr td[data-label="#"]::before,
    table.table tbody tr td[data-label="#"]::before {
        content: "REGISTRO" !important;
        font-weight: 700 !important;
        font-size: 0.72rem !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        text-align: left !important;
    }

    /* ⚪ CAMPOS GENERALES DE LA TARJETA (Idéntico a Image 1: label izquierda, valor derecha) */
    #cardTable table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child),
    .table-responsive table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child),
    table.table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child) {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 9px 14px !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        text-align: right !important;
        font-size: 0.86rem !important;
        white-space: normal !important;
        gap: 12px !important;
        background: transparent !important;
    }

    /* Etiqueta automática a la izquierda obtenida de data-label */
    #cardTable table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child)::before,
    .table-responsive table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child)::before,
    table.table tbody tr td:not([data-label="#"]):not([data-label="Acciones"]):not(:last-child)::before {
        content: attr(data-label) !important;
        display: inline-block !important;
        font-weight: 600 !important;
        font-size: 0.72rem !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        text-align: left !important;
        margin-right: 8px !important;
        flex-shrink: 0 !important;
        max-width: 48% !important;
    }

    /* Contenido/valor dentro de la celda auto-ajustado y alineado a la derecha */
    #cardTable table tbody tr td:not([data-label="#"]):not([data-label="Acciones"])>*,
    .table-responsive table tbody tr td:not([data-label="#"]):not([data-label="Acciones"])>* {
        max-width: 60% !important;
        text-align: right !important;
        white-space: normal !important;
        word-break: break-word !important;
        margin-left: auto !important;
    }

    /* Fila de Selección (Sel.) */
    #cardTable table tbody tr td[data-label="Sel."],
    .table-responsive table tbody tr td[data-label="Sel."],
    table.table tbody tr td[data-label="Sel."] {
        padding: 8px 14px !important;
    }

    #cardTable table tbody tr td[data-label="Sel."] .form-check,
    .table-responsive table tbody tr td[data-label="Sel."] .form-check,
    table.table tbody tr td[data-label="Sel."] .form-check {
        margin: 0 !important;
        margin-left: auto !important;
    }

    /* 🟣 PIE DE TARJETA: BARRA DE ACCIONES (Idéntico a Image 1) */
    #cardTable table tbody tr td[data-label="Acciones"],
    #cardTable table tbody tr td:last-child,
    .table-responsive table tbody tr td[data-label="Acciones"],
    .table-responsive table tbody tr td:last-child,
    table.table tbody tr td[data-label="Acciones"],
    table.table tbody tr td:last-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        background-color: #f8fafc !important;
        border: none !important;
        border-top: 1px solid #e2e8f0 !important;
        border-bottom: none !important;
        padding: 10px 14px !important;
        box-sizing: border-box !important;
        margin-top: 0 !important;
    }

    #cardTable table tbody tr td[data-label="Acciones"]::before,
    #cardTable table tbody tr td:last-child::before,
    .table-responsive table tbody tr td[data-label="Acciones"]::before,
    .table-responsive table tbody tr td:last-child::before,
    table.table tbody tr td[data-label="Acciones"]::before,
    table.table tbody tr td:last-child::before {
        content: "ACCIONES" !important;
        font-weight: 700 !important;
        font-size: 0.72rem !important;
        color: #475569 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        text-align: left !important;
        margin-right: 8px !important;
    }

    #cardTable table tbody tr td[data-label="Acciones"] .d-inline-flex,
    #cardTable table tbody tr td:last-child .d-inline-flex,
    .table-responsive table tbody tr td[data-label="Acciones"] .d-inline-flex,
    .table-responsive table tbody tr td:last-child .d-inline-flex,
    table.table tbody tr td[data-label="Acciones"] .d-inline-flex,
    table.table tbody tr td:last-child .d-inline-flex {
        gap: 8px !important;
        margin-left: auto !important;
        justify-content: flex-end !important;
    }

    /* Fila vacía / Sin registros disponibles */
    #cardTable table tbody tr td[colspan],
    .table-responsive table tbody tr td[colspan],
    table.table tbody tr td[colspan] {
        display: block !important;
        text-align: center !important;
        justify-content: center !important;
        border: none !important;
        padding: 20px 14px !important;
    }

    #cardTable table tbody tr td[colspan]::before,
    .table-responsive table tbody tr td[colspan]::before,
    table.table tbody tr td[colspan]::before {
        content: none !important;
    }

    /* Adaptación de controles superiores en móvil */
    #cardTable .d-lg-flex {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #daterange-btn {
        width: 100% !important;
        justify-content: space-between !important;
        display: flex !important;
        align-items: center !important;
        font-size: 0.85rem !important;
    }
}

/* ============================================================
   TOOLTIPS Y GLOBOS DE VALIDACIÓN CON FLECHA
============================================================ */
.field-validation-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e63946 0%, #d90429 100%);
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(217, 4, 41, 0.35);
    position: relative;
    z-index: 1060;
    animation: fieldBubbleAnim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.2px;
}

.field-validation-bubble .field-validation-arrow {
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #e63946;
}

@keyframes fieldBubbleAnim {
    0% {
        opacity: 0;
        transform: translateY(-6px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.field-shake {
    animation: fieldShakeAnim 0.4s ease-in-out;
}

@keyframes fieldShakeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

.field-validation-bubble.fade-out {
    opacity: 0 !important;
    transform: translateY(-6px) scale(0.96) !important;
    transition: opacity 0.5s ease, transform 0.5s ease !important;
}