﻿/* =====================================================
   TREE AUTOCOMPLETE PRO
===================================================== */

/* =====================================================
   INPUT
===================================================== */

.tree-ac-input {
    transition: all .2s ease;
    width: 100% !important;
}

    .tree-ac-input:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 4px rgba(59,130,246,.12) !important;
    }

/* =====================================================
   PANEL
===================================================== */

.tree-ac-panel {
    border: 1px solid #dbe4ee !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    padding: 8px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,.14);
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999999 !important;
}

    /* scrollbar */

    .tree-ac-panel::-webkit-scrollbar {
        width: 8px;
    }

    .tree-ac-panel::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 999px;
    }

/* =====================================================
   ITEM
===================================================== */

.tree-ac-item {
    list-style: none;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: all .15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

    .tree-ac-item:hover {
        background: linear-gradient( 90deg, #eff6ff, #f8fbff );
        border-color: #dbeafe;
    }

/* =====================================================
   ITEM SELECCIONADO
===================================================== */

.tree-ac-panel .ui-state-active {
    background: linear-gradient( 90deg, #dbeafe, #eff6ff ) !important;
    border: 1px solid #bfdbfe !important;
    color: #111827 !important;
}

/* =====================================================
   ROW
===================================================== */

.tree-ac-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* =====================================================
   ICON
===================================================== */

.tree-ac-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient( 135deg, #dbeafe, #eff6ff );
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

/* icono seleccionado */

.tree-ac-panel .ui-state-active .tree-ac-icon {
    background: #bfdbfe !important;
    color: #1d4ed8 !important;
}

/* =====================================================
   BODY
===================================================== */

.tree-ac-body {
    flex: 1;
    min-width: 0;
}

/* =====================================================
   HEADER
===================================================== */

.tree-ac-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* =====================================================
   CODE
===================================================== */

.tree-ac-code {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    min-width: 95px;
}

/* seleccionado */

.tree-ac-panel .ui-state-active .tree-ac-code {
    color: #1d4ed8 !important;
}

/* =====================================================
   TITLE
===================================================== */

.tree-ac-title {
    font-weight: 600;
    color: #111827;
}

/* seleccionado */

.tree-ac-panel .ui-state-active .tree-ac-title {
    color: #111827 !important;
}

/* =====================================================
   BREADCRUMB
===================================================== */

.tree-ac-breadcrumb {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    white-space: normal;
}

/* seleccionado */

.tree-ac-panel .ui-state-active .tree-ac-breadcrumb {
    color: #4b5563 !important;
}

/* =====================================================
   WRAPPER
===================================================== */

.tree-ac-wrapper {
    position: relative;
    width: 100%;
}

/* =====================================================
   CLEAR BUTTON
===================================================== */

.tree-ac-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
    z-index: 10;
}

    .tree-ac-clear:hover {
        background: #d1d5db;
    }

/* =====================================================
   GRUPO ESTRUCTURA
===================================================== */

.estructura-group {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

/* =====================================================
   CODIGO
===================================================== */

.estructura-codigo {
    flex: 0 0 25% !important;
    max-width: 25%;
    width: 25%;
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

/* =====================================================
   WRAPPER AUTOCOMPLETE
===================================================== */

.estructura-group .tree-ac-wrapper {
    flex: 0 0 75% !important;
    max-width: 75%;
    width: 75%;
}

    /* =====================================================
   INPUT AUTOCOMPLETE
===================================================== */

    .estructura-group .tree-ac-wrapper .estructura-texto {
        width: 100% !important;
        max-width: 100% !important;
    }

/* =====================================================
   ALTURA INPUT AUTOCOMPLETE
===================================================== */

.tree-ac-wrapper .tree-ac-input {
    height: calc(1.5em + .5rem + 2px) !important;
    min-height: calc(1.5em + .5rem + 2px) !important;
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .25rem !important;
}

/* espacio para botón clear */

.tree-ac-wrapper .tree-ac-input {
    padding-right: 32px !important;
}

/* botón clear alineado */

.tree-ac-clear {
    width: 18px;
    height: 18px;
    font-size: 12px;
    right: 8px;
}