﻿/* ===== Section header kiểu: "I Thông tin ..." ===== */
.section-head {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 0 0 12px;
    position: relative;
}

    .section-head::before {
        content: "";
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 2px;
        height: 11px;
        background: var(--color-brand-primary);
        margin-top: 1px;
    }

.section-head__text {
    font-weight: 600;
    color: var(--color-brand-primary);
    padding-left: 10px;
    white-space: nowrap;
}

.table-responsive-soft {
    overflow-x: auto;
    padding-bottom: 6px;
}

.table-detail-group {
    width: 100%;
    min-width: 1100px; /* tuỳ baby muốn, để tránh bóp cột */
}

/* ===== GLOBAL: combobox trong table luôn bằng nhau, không bể ===== */

/* 1) mọi td có select2/ select sẽ không cho text làm bể layout */
.table .td-select-eq,
.table td:has(.ui-select-eq),
.table td:has(.select2-container) {
    min-width: 200px; /* chỉnh 200/240 tuỳ hệ thống */
    max-width: 200px;
}

/* 2) select thường full width */
.table .ui-select-eq {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
}

/* 3) select2 full width */
.table td .select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.table td .select2-selection {
    width: 100% !important;
}

/* 4) text dài -> ... */
.table td .select2-selection__rendered {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding-right: 28px;
}

.select2-results__option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* actions nằm cùng hàng với title */
.section-head.section-head--with-actions {
    justify-content: space-between;
}

/* cụm bên phải */
.section-head__actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    /* button action title canh chuẩn baseline */
    .section-head__actions .button-action-title {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    /* icon-button không bị tụt */
    .section-head__actions .icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-1px); /* tinh chỉnh nhẹ cho khớp tuyệt đối */
    }

/* wrapper phải là block + relative */
.input-suffix-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

    /* ép input full width để không còn chỗ làm span rớt dòng */
    .input-suffix-wrap > input.form-control {
        width: 100% !important;
        display: block !important;
        padding-right: 34px !important; /* chừa chỗ cho % */
    }

    /* % nằm trong textbox */
    .input-suffix-wrap > .suffix {
        position: absolute !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        line-height: 1 !important;
        color: #6b7280;
        pointer-events: none;
        z-index: 2;
    }

/* Hiển thị tooltip khi rê chuột vào thì hiển thị công thức ở Phiếu Đặt Cọc và Hợp đồng mua bán*/
/* ===== Tooltip riêng: .icon-button-tooltip (không đụng .icon-button cũ) ===== */
/* icon (6) */
/* ===== Icon (6) + CHẤM XANH ===== */
.icon-button-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    user-select: none;
    line-height: 1;
    border-radius: 999px;
    z-index: 2;
    /* ✅ có size để vẽ chấm xanh */
    min-width: 22px;
    height: 18px;
    /* ✅ chừa chỗ cho chấm */
    padding: 0 6px;
    padding-right: 12px;
    /* ✅ chấm xanh (có viền trắng) */
    background-image: radial-gradient(circle, #ffffff 0 60%, transparent 62%), radial-gradient(circle, #3b82f6 0 55%, transparent 58%);
    background-size: 10px 10px, 8px 8px;
    background-repeat: no-repeat, no-repeat;
    background-position: right -1px top 1px, right 0px top 2px;
}

    /* bubble */
    .icon-button-tooltip[data-title]::after {
        content: attr(data-title);
        position: absolute;
        z-index: 999999;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.1;
        letter-spacing: .1px;
        padding: 6px 12px;
        border-radius: 999px;
        background: #f59e0b;
        color: #fff;
        white-space: nowrap;
        box-shadow: 0 10px 28px rgba(0,0,0,.16);
        left: 50%;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(6px) scale(.98);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all .12s ease;
    }

    /* arrow */
    .icon-button-tooltip[data-title]::before {
        content: "";
        position: absolute;
        z-index: 999999;
        left: 50%;
        bottom: calc(100% + 2px);
        transform: translateX(-50%);
        border: 8px solid transparent;
        border-top-color: #f59e0b;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all .12s ease;
    }

    /* show */
    .icon-button-tooltip:hover::after,
    .icon-button-tooltip:hover::before {
        opacity: 1;
        visibility: visible;
    }

    .icon-button-tooltip:hover::after {
        transform: translateX(-50%) translateY(0) scale(1);
    }

/* Hiển thị danh sách dạng chuỗi */
.xntt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.xntt-item {
    cursor: pointer;
    color: var(--theme-color);
    font-weight: 500;
    white-space: nowrap;
}

    .xntt-item:hover {
        text-decoration: underline;
    }