/* Application-specific styles. Keep custom changes here, not inside Tabler vendor CSS. */
:root {
    --qevano-navy: #102a43;
    --qevano-teal: #12b8a6;
}

.login-brand-logo {
    display: block;
    width: 230px;
    height: auto;
    margin-inline: auto;
}

.qevano-sidebar-logo {
    display: block;
    width: 172px;
    height: auto;
    max-height: 44px;
}

.navbar-vertical .navbar-brand a {
    display: flex;
    align-items: center;
}

.navbar-vertical .navbar-brand a.sidebar-company-brand {
    position: relative;
    display: block;
    width: 205px;
    height: 48px;
    overflow: hidden;
}

.sidebar-company-logo {
    position: absolute;
    top: -22px;
    left: 0;
    display: block;
    width: 205px;
    max-width: none;
    height: 205px;
    object-fit: contain;
    object-position: left top;
}

.quick-menu-dropdown {
    width: 280px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.quick-menu-dropdown .dropdown-item {
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.page-wrapper {
    min-height: 100vh;
}

/* Keep searchable form selects above the fields in following grid rows. */
.page-body .ts-wrapper.dropdown-active {
    position: relative;
    z-index: 1200;
}

.page-body .ts-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1210 !important;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 36, 51, .18);
}

.page-body .ts-dropdown .option {
    background: #fff;
}

.page-body .ts-dropdown .option.active {
    background: #f1f5f9;
}

.page-body .ts-wrapper.dropdown-active .ts-control input::placeholder,
.page-body .ts-wrapper.has-items .ts-control input::placeholder {
    color: transparent !important;
}

/* Search-first selectors: behave like autocomplete inputs, not open lists. */
.search-only-select + .ts-wrapper,
.search-only-select + .ts-wrapper.single {
    --ts-pr-caret: 0px;
    background-image: none !important;
}

.search-only-select + .ts-wrapper.single .ts-control {
    background-image: none !important;
}

/* Quotation Item Master selector */
#items-table th:nth-child(2),
#items-table td:nth-child(2) {
    min-width: 245px;
    width: 245px;
    position: relative;
}

#items-table th:first-child,
#items-table td.master-item-toggle-cell {
    min-width: 52px;
    width: 52px;
    white-space: nowrap;
    text-align: center;
}

#items-table th,
#items-table td {
    padding: .4rem .45rem;
}

#items-table th:nth-child(3),
#items-table td:nth-child(3) { min-width: 150px; }
#items-table th:nth-child(4),
#items-table td:nth-child(4) { min-width: 90px; }
#items-table th:nth-child(5),
#items-table td:nth-child(5) { min-width: 120px; }
#items-table th:nth-child(6),
#items-table td:nth-child(6) { min-width: 105px; }
#items-table th:nth-child(7),
#items-table td:nth-child(7) { min-width: 120px; }
#items-table th:nth-child(8),
#items-table td:nth-child(8) { min-width: 130px; }
#items-table th:nth-child(9),
#items-table td:nth-child(9) { min-width: 100px; }

#items-table .form-control,
#items-table .form-select,
#items-table .ts-control {
    padding-left: .55rem;
    padding-right: .55rem;
}

#items-table .ts-wrapper.focus,
#items-table .ts-wrapper.dropdown-active {
    z-index: 1060;
}

#items-table .ts-dropdown {
    width: 380px;
    min-width: 100%;
    z-index: 1070;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 36, 51, .18);
}

#items-table .ts-dropdown .option {
    background: #fff;
    white-space: normal;
    line-height: 1.35;
    padding: .65rem .75rem;
}

#items-table .ts-dropdown .option.active {
    background: #f1f5f9;
}

.rounding-sign {
    min-width: 78px !important;
    max-width: 78px !important;
    padding-left: 1rem !important;
    padding-right: 2rem !important;
    font-weight: 700;
    text-align: center;
}

/* Quotation customer AJAX search */
#client_id-ts-control + .ts-dropdown,
#client_id + .ts-wrapper .ts-dropdown,
.ts-wrapper:has(#client_id-ts-control) .ts-dropdown {
    z-index: 2101 !important;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 36, 51, .18);
    max-height: 280px;
    overflow-y: auto;
}

.ts-wrapper:has(#client_id-ts-control) {
    position: relative;
    z-index: 2100;
}

.ts-wrapper:has(#client_id-ts-control) .ts-dropdown .option {
    background: #fff;
    padding: .65rem .75rem;
    line-height: 1.35;
}

.ts-wrapper:has(#client_id-ts-control) .ts-dropdown .option.active {
    background: #f1f5f9;
}

.quotation-items-responsive {
    overflow: visible !important;
}

#items-table .ts-wrapper.dropdown-active {
    position: relative;
    z-index: 2000;
}

#items-table .ts-dropdown {
    position: absolute;
    z-index: 2001 !important;
    max-height: 280px;
    overflow-y: auto;
}

/* Keep list action dropdowns inside short/empty table cards. DataTables adds
   the dataTable class after initialization, so this applies to all list pages. */
.page-body .card-body:has(> .table-responsive > table.dataTable),
.page-body .card-body:has(> .table-responsive table tbody .dropdown) {
    min-height: 430px;
}

.page-body .card-body > .table-responsive:has(table.dataTable),
.page-body .card-body > .table-responsive:has(table tbody .dropdown) {
    min-height: 300px;
}

@media (max-width: 767.98px) {
    .page-body .card-body:has(> .table-responsive > table.dataTable),
    .page-body .card-body:has(> .table-responsive table tbody .dropdown) {
        min-height: 360px;
    }
}

/* Stock Adjustment product search must remain above the Add Product control. */
.page-body .card-body:has(#sa-items) {
    min-height: 390px;
}

.page-body .table-responsive:has(#sa-items) {
    min-height: 245px;
    overflow: visible;
}

.page-body #sa-items .ts-wrapper {
    position: relative;
}

.page-body #sa-items .ts-wrapper.focus {
    z-index: 1055;
}

.page-body #sa-items .ts-dropdown {
    z-index: 1060;
    min-width: 420px;
}

/* Journal ledger suggestions must overlay following rows and totals. */
.page-body .table-responsive:has(#lines) {
    overflow: visible;
}

.page-body #lines .ts-wrapper {
    position: relative;
}

.page-body #lines .ts-wrapper.focus {
    z-index: 1065;
}

.page-body #lines tr:has(.ts-wrapper.focus) {
    position: relative;
    z-index: 1065;
}

.page-body #lines .ts-dropdown {
    z-index: 1070;
    background: #fff;
}
