/* PMS CONFIG — Light Warm, 1.2x fonts */

/* ── Selector Bar ── */
.cfg-selector-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 20px; min-height: 50px; flex-wrap: wrap;
    background: #fffefa !important; color: #2d2d42 !important;
    border-bottom: 1px solid #e0ddd6 !important;
    font-family: 'Be Vietnam Pro', sans-serif; font-size: 15px;
}
.cfg-sel-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9e9eb0 !important; }
.cfg-sel-wrap select {
    padding: 7px 30px 7px 12px; border-radius: 6px;
    border: 1px solid #e0ddd6; background: #fff !important; color: #2d2d42 !important;
    font-size: 15px; font-family: inherit; font-weight: 500;
    cursor: pointer; outline: none; appearance: none; -webkit-appearance: none; min-width: 240px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239e9eb0'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 10px center !important;
}
.cfg-sel-wrap select:focus { border-color: #b8892e; box-shadow: 0 0 0 3px rgba(184,137,46,.1); }
.cfg-sel-wrap select option { background: #fff !important; color: #2d2d42 !important; }
.cfg-sel-wrap select:disabled { opacity: .45; }
.cfg-sel-arrow { color: #c5c5d0 !important; font-size: 16px; }
.cfg-sel-info { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #6b6b80 !important; }
.cfg-sel-info strong { color: #b8892e !important; font-weight: 700; }
.cfg-sel-info code { font-size: 12.5px; font-family: 'Inter', system-ui, -apple-system, sans-serif; background: rgba(184,137,46,.08); color: #b8892e !important; padding: 2px 7px; border-radius: 3px; }
.cfg-sel-dot { width: 8px; height: 8px; border-radius: 50%; background: #0d9668; }

/* ── No Site ── */
.cfg-no-site {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: calc(100vh - 110px); gap: 16px; text-align: center;
    background: #f4f1ec !important; color: #9e9eb0 !important; font-size: 17px;
}
.cfg-no-site strong { color: #b8892e !important; }

/* ── Layout ── */
.pms-cfg {
    display: flex; height: calc(100vh - 104px);
    background: #f4f1ec !important; color: #2d2d42 !important;
    font-family: 'Be Vietnam Pro', sans-serif; font-size: 15px;
}

/* ── Sidebar ── */
.cfg-side {
    width: 240px; min-width: 240px;
    background: #fffefa !important; color: #2d2d42 !important;
    border-right: 1px solid #ebe8e2; overflow-y: auto; padding-bottom: 20px;
}
.cfg-side::-webkit-scrollbar { width: 0; }
.cfg-side-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid #ebe8e2; }
.cfg-side-icon { font-size: 22px; }
.cfg-side-title { font-size: 16px; font-weight: 700; color: #1a1a2e !important; }
.cfg-side-sub { font-size: 12.5px; color: #9e9eb0 !important; }
.cfg-side-group { padding: 16px 16px 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #c5c5d0 !important; }
.cfg-side-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; margin: 1px 6px; cursor: pointer;
    border-radius: 8px; border-left: 3px solid transparent;
    color: #6b6b80 !important; font-size: 15px; font-weight: 500;
    background: transparent !important; transition: all .15s;
}
.cfg-side-item:hover { background: rgba(0,0,0,.03) !important; color: #2d2d42 !important; }
.cfg-si-active { background: rgba(184,137,46,.08) !important; color: #b8892e !important; border-left-color: #b8892e; font-weight: 600; }
.cfg-si-icon { font-size: 17px; width: 24px; text-align: center; }
.cfg-si-badge {
    margin-left: auto; font-size: 12px; font-weight: 600;
    background: #f0ede6 !important; color: #6b6b80 !important;
    padding: 2px 8px; border-radius: 10px; min-width: 24px; text-align: center;
}
.cfg-si-active .cfg-si-badge { background: #b8892e !important; color: #fff !important; }

/* ── List Panel ── */
.cfg-list {
    width: 360px; min-width: 360px;
    background: #f4f1ec !important; color: #2d2d42 !important;
    border-right: 1px solid #ebe8e2; display: flex; flex-direction: column;
}
.cfg-list-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; background: #fffefa !important; border-bottom: 1px solid #ebe8e2;
}
.cfg-list-head h2 { font-size: 17px; font-weight: 700; margin: 0; color: #1a1a2e !important; }
.cfg-btn-add {
    padding: 6px 13px; border-radius: 6px;
    border: 1px dashed #b8892e; background: rgba(184,137,46,.05) !important;
    color: #b8892e !important; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.cfg-btn-add:hover { background: #b8892e !important; color: #fff !important; border-style: solid; }
.cfg-list-search { padding: 7px 16px; background: #fffefa !important; border-bottom: 1px solid #ebe8e2; }
.cfg-list-search input {
    width: 100%; padding: 8px 12px; border-radius: 6px;
    border: 1px solid #e0ddd6; background: #f4f1ec !important; color: #2d2d42 !important;
    font-size: 14px; font-family: inherit; outline: none;
}
.cfg-list-search input:focus { border-color: #b8892e; }
.cfg-list-body { flex: 1; overflow-y: auto; padding: 5px 6px; }
.cfg-list-body::-webkit-scrollbar { width: 4px; }
.cfg-list-body::-webkit-scrollbar-thumb { background: #e0ddd6; border-radius: 4px; }

/* ── List Items ── */
.cfg-li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 2px; border-radius: 7px;
    cursor: pointer; border: 1px solid transparent;
    background: transparent !important; color: #2d2d42 !important;
}
.cfg-li:hover { background: #fff !important; border-color: #ebe8e2; }
.cfg-li-active { background: #fff !important; border-color: rgba(184,137,46,.2) !important; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.cfg-li-code {
    font-size: 12.5px; font-weight: 600; color: #b8892e !important;
    background: rgba(184,137,46,.08) !important; padding: 3px 8px;
    border-radius: 4px; min-width: 44px; text-align: center;
}
.cfg-li-name { flex: 1; font-weight: 500; font-size: 15px; color: #2d2d42 !important; }
.cfg-li-meta { font-size: 13px; color: #9e9eb0 !important; }
.cfg-li-price { color: #b8892e !important; font-weight: 600; }
.cfg-loading { text-align: center; padding: 40px; color: #9e9eb0 !important; font-size: 14px; }

/* ── Detail Panel ── */
.cfg-detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.cfg-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 20px; background: #fffefa !important; border-bottom: 1px solid #ebe8e2;
}
.cfg-detail-title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: #1a1a2e !important; }
.cfg-dt-dot { width: 9px; height: 9px; border-radius: 3px; transform: rotate(45deg); background: #b8892e; }
.cfg-detail-actions { display: flex; gap: 7px; }
.cfg-detail-body { flex: 1; overflow-y: auto; padding: 16px 20px; background: #f4f1ec !important; }
.cfg-detail-body::-webkit-scrollbar { width: 4px; }
.cfg-detail-body::-webkit-scrollbar-thumb { background: #e0ddd6; border-radius: 4px; }

/* ── Buttons ── */
.cfg-btn { padding: 8px 16px; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; }
.cfg-btn-del { background: rgba(225,29,72,.07) !important; color: #e11d48 !important; }
.cfg-btn-del:hover { background: #e11d48 !important; color: #fff !important; }
.cfg-btn-reset { background: transparent !important; color: #6b6b80 !important; border: 1px solid #e0ddd6 !important; }
.cfg-btn-reset:hover { background: #f0ede6 !important; }
.cfg-btn-save { background: #b8892e !important; color: #fff !important; }
.cfg-btn-save:hover { background: #a07828 !important; }
.cfg-btn-save:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form Sections ── */
.cfg-section {
    background: #fff !important; border-radius: 10px;
    border: 1px solid #ebe8e2; padding: 16px 18px;
    margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cfg-sec-title {
    font-size: 12.5px; font-weight: 700; color: #b8892e !important;
    text-transform: uppercase; letter-spacing: .7px;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.cfg-sec-title::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: #b8892e; }
.cfg-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cfg-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 16px; }
.cfg-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px 16px; }

/* Ô chứa ImageUploadField. CỐ Ý KHÔNG dùng .cfg-field: rule ".cfg-field label" ngay dưới đây có
   color !important + text-transform:uppercase, nó sẽ ăn vào nhãn BÊN TRONG component (scoped CSS
   không thắng nổi !important) ⇒ nhãn của component đổi màu và viết hoa lệch hẳn phần còn lại.
   Chiếm trọn hàng vì khung cắt rộng hơn một ô nhập thường. */
.cfg-media { margin-bottom: 8px; }
.cfg-grid-2 > .cfg-media, .cfg-grid-3 > .cfg-media, .cfg-grid-4 > .cfg-media { grid-column: 1 / -1; }

/* ── Fields ── */
.cfg-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 5px; }
.cfg-field label { font-size: 12px; font-weight: 600; color: #9e9eb0 !important; text-transform: uppercase; letter-spacing: .3px; }
.cfg-field input, .cfg-field select, .cfg-field textarea {
    padding: 8px 12px; border-radius: 7px;
    border: 1px solid #e0ddd6; background: #f9f7f3 !important; color: #2d2d42 !important;
    font-size: 15px; font-family: inherit; outline: none;
}
.cfg-field input:focus, .cfg-field select:focus, .cfg-field textarea:focus { border-color: #b8892e; background: #fff !important; }
.cfg-field select option { background: #fff !important; color: #2d2d42 !important; }
.cfg-field textarea { resize: vertical; min-height: 60px; }
.cfg-field select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239e9eb0'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 12px center !important;
    padding-right: 30px;
}

/* ── F03 · Hạn mức bán vượt theo loại phòng (mục "Tồn phòng & bán vượt") ── */
.cfg-ob-table { max-width: 520px; width: 100%; border-collapse: collapse; font-size: 14px; }
.cfg-ob-table th { text-align: left; font-size: 12px; font-weight: 600; color: #9e9eb0; padding: 6px 8px; border-bottom: 1px solid #e0ddd6; }
.cfg-ob-table td { padding: 6px 8px; border-bottom: 1px solid #f0ede6; color: #2d2d42; }
.cfg-ob-input {
    width: 90px; padding: 6px 10px; border-radius: 7px;
    border: 1px solid #e0ddd6; background: #f9f7f3; color: #2d2d42; font-size: 14px; font-family: inherit; outline: none;
}
.cfg-ob-input:focus { border-color: #b8892e; background: #fff; }

/* ── Tax Rows ── */
.cfg-tax-row { display: flex; gap: 7px; align-items: center; margin-bottom: 6px; }
.cfg-tax-row input {
    flex: 1; padding: 7px 12px; border-radius: 7px;
    border: 1px solid #e0ddd6; background: #f9f7f3 !important; color: #2d2d42 !important;
    font-size: 15px; font-family: inherit; outline: none;
}
.cfg-tax-row input:focus { border-color: #b8892e; background: #fff !important; }
.cfg-btn-rm { width: 28px; height: 28px; border-radius: 6px; border: none; background: rgba(225,29,72,.07) !important; color: #e11d48 !important; cursor: pointer; font-size: 14px; }
.cfg-btn-rm:hover { background: #e11d48 !important; color: #fff !important; }
.cfg-btn-add-row {
    padding: 6px 12px; margin-top: 5px; border-radius: 6px;
    border: 1px dashed #e0ddd6; background: transparent !important;
    color: #9e9eb0 !important; font-size: 13px; font-family: inherit; cursor: pointer;
}
.cfg-btn-add-row:hover { border-color: #b8892e; color: #b8892e !important; background: rgba(184,137,46,.05) !important; }

/* ── Messages ── */
.cfg-msg { padding: 11px 16px; border-radius: 7px; font-size: 15px; font-weight: 500; margin-top: 12px; }
.cfg-msg-ok { background: rgba(13,150,104,.06) !important; color: #0d9668 !important; border: 1px solid rgba(13,150,104,.12); }
.cfg-msg-err { background: rgba(225,29,72,.06) !important; color: #e11d48 !important; border: 1px solid rgba(225,29,72,.1); }

/* ── Empty ── */
.cfg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #9e9eb0 !important; gap: 12px; }
.cfg-empty-icon { font-size: 42px; opacity: .3; }

/* ── Nhóm thuế: hàng tiêu đề, cảnh báo, bảng xem trước ─────────────────────── */
.cfg-tax-head { font-size: 11px; font-weight: 600; color: #7c6a4d; text-transform: uppercase; letter-spacing: .04em; }
.cfg-tax-head span:nth-child(1) { flex: 1; }
.cfg-tax-head span:nth-child(2) { width: 80px; flex: none; }
.cfg-tax-head span:nth-child(3) { width: 60px; flex: none; }
.cfg-tax-head span:nth-child(4) { width: 28px; flex: none; }

.cfg-alert { margin-top: 8px; padding: 7px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.45; }
.cfg-alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.cfg-alert-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #92400e; }

.cfg-tax-preview { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cfg-tax-preview th { text-align: left; font-size: 11px; font-weight: 600; color: #7c6a4d;
    text-transform: uppercase; letter-spacing: .04em; padding: 5px 8px; border-bottom: 1px solid #e7ddc9; }
.cfg-tax-preview td { padding: 5px 8px; border-bottom: 1px solid #f2ece0; }
.cfg-tax-preview td.num, .cfg-tax-preview th:nth-child(3), .cfg-tax-preview th:nth-child(4) { text-align: right; }
.cfg-tax-preview tfoot td { border-top: 1px solid #e7ddc9; border-bottom: 0; }

/* ══ VẬN HÀNH · Điểm bán tại buồng phòng ═══════════════════════════════════════════════════════ */
.cfg-rs-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #ebe6df;
    border-radius: 10px;
    background: #fbfaf8;
    font-size: 13px;
    color: #5b5348;
}

    .cfg-rs-bar .cfg-btn-save {
        margin-left: auto;
    }

.cfg-rs-grid {
    display: grid;
    /* 320 chu khong con 260: moi o nay mang them 3 nut vai (~102px), de 260 thi ten diem ban
       chi con ~140px va bi cat ellipsis ngay o nhung ten dai nhu 'Nha hang Golden Lotus'. */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 8px;
}

.cfg-rs-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #ebe6df;
    border-radius: 10px;
    background: #fff;
    transition: .15s;
}

/* Chỉ nửa TRÁI (ô tick + tên) mới là vùng bấm-để-tick; nửa phải là nút vai — xem chú thích ở markup. */
.cfg-rs-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

    .cfg-rs-item:hover {
        border-color: #d9d2c8;
        background: #fbfaf8;
    }

    .cfg-rs-item.on {
        border-color: #0d9668;
        background: #f4fbf7;
    }

    .cfg-rs-item input[type="checkbox"] {
        width: 15px;
        height: 15px;
        margin: 0;
        accent-color: #0d9668;
        cursor: pointer;
        flex: none;
    }

.cfg-rs-code {
    flex: none;
    padding: 1px 7px;
    border-radius: 6px;
    background: #f1efea;
    font-size: 11px;
    font-weight: 600;
    color: #5b5348;
    font-family: 'JetBrains Mono', monospace;
}

.cfg-rs-name {
    font-size: 13px;
    color: #3c352c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Vai: MB Minibar · GL Giặt là · ĐB Đền bù ─────────────────────────────────────────────── */
.cfg-rs-roles {
    display: flex;
    gap: 4px;
    flex: none;
}

.cfg-rs-role {
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    min-width: 30px;
    padding: 3px 6px;
    border: 1px solid #e2ddd4;
    border-radius: 7px;
    background: #fff;
    color: #a49a8c;
    cursor: pointer;
    transition: .13s;
}

    .cfg-rs-role:hover {
        border-color: #c9c0b2;
        color: #5b5348;
    }

    /* Ba vai ba màu — cùng bảng với chip tab ở màn Buồng phòng, để mắt nối được hai màn. */
    .cfg-rs-role.on {
        color: #fff;
        border-color: transparent;
    }

    .cfg-rs-role.on.r1 { background: #b8742a; }   /* Minibar */
    .cfg-rs-role.on.r2 { background: #3b82f6; }   /* Giặt là */
    .cfg-rs-role.on.r3 { background: #7a4ed6; }   /* Đền bù  */

.cfg-rs-roles-sum {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.cfg-rs-sum-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #ebe6df;
    border-radius: 9px;
    background: #fff;
    font-size: 12.5px;
    color: #5b5348;
}

    .cfg-rs-sum-item.off {
        background: #fdf7f7;
        border-color: #f0d9d9;
    }

    .cfg-rs-sum-item .cfg-rs-role {
        cursor: default;
    }

.cfg-rs-sum-name {
    font-weight: 600;
    color: #3c352c;
}

/* ── SALE-G05 G05-06 — Công ty: bộ lọc Đang dùng / Đã xoá + khôi phục ── */
.cfg-co-filter { display: flex; gap: 6px; margin: 2px 0 8px; }
.cfg-co-tab {
    flex: 1; padding: 6px 10px; border-radius: 7px; font: inherit; font-size: 13px; cursor: pointer;
    border: 1px solid var(--ez-sel-bg, #ebe8e2); background: transparent; color: var(--ink-mute, #6b6b80);
}
.cfg-co-tab-on { background: var(--surface, #fff); color: var(--ink, #2d2d42); font-weight: 600; border-color: rgba(184,137,46,.35); }
.cfg-co-hint { margin: 4px 2px 8px; }
.cfg-co-deleted { cursor: default; opacity: .9; }
.cfg-co-deleted .cfg-li-name { text-decoration: none; color: var(--ink-mute, #6b6b80) !important; }
.cfg-co-restore { width: auto; padding: 4px 10px; font-size: 12.5px; background: var(--surface, #fff); border: 1px solid var(--brand, #b8892e); color: var(--brand-deep, #8a6620); }
.cfg-co-restore:disabled { opacity: .5; cursor: default; }
