/* Nâng cấp website (CRM): yêu cầu, chi tiết, bảng giá, mã khuyến mãi */
.ox-badge--violet { background: #f3eeff; color: #7c3aed; }
.ox-badge--brand { background: var(--ox-primary-soft); color: var(--ox-primary); }
.mc--violet { --c: #7c3aed; --cs: #f3eeff; }

.upg-filter { padding: 12px 16px; border-bottom: 1px solid var(--ox-border); }
.ox-segs-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ox-segs-tabs::-webkit-scrollbar { display: none; }
.ox-segs-tabs a { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; color: var(--ox-muted) !important; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ox-segs-tabs a:hover { background: var(--ox-surface-2); color: var(--ox-text) !important; }
.ox-segs-tabs a em { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--ox-surface-2); color: var(--ox-muted); font-size: 11.5px; font-style: normal; line-height: 20px; text-align: center; }
.ox-segs-tabs a.is-active { background: linear-gradient(135deg, #ff7a2e, var(--ox-primary)); color: #fff !important; }
.ox-segs-tabs a.is-active em { background: rgba(255, 255, 255, .25); color: #fff; }
.upg-table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--ox-primary); }
.upg-code { display: inline-flex; padding: 3px 10px; border: 1.5px dashed var(--ox-primary); border-radius: 8px; background: #fffaf6; color: var(--ox-primary) !important; font-weight: 800; letter-spacing: .04em; }
.upg-code--sm { padding: 1px 7px; font-size: 12px; }

/* Chi tiết */
.upg-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.upg-detail__side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 96px; }
.upg-detail .ox-card { padding: 18px; }
.upg-detail .ox-card__title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.upg-lines { margin: 0 0 12px; padding: 0; list-style: none; }
.upg-lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #ece4dd; }
.upg-lines li span { display: flex; flex-direction: column; min-width: 0; }
.upg-lines li b { font-size: 14px; }
.upg-lines li small { color: var(--ox-muted); font-size: 12px; }
.upg-lines li em { flex: none; color: var(--ox-primary); font-size: 13.5px; font-style: normal; font-weight: 700; }
.upg-lines li em.is-quote { color: #7c3aed; }
.upg-sum { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--ox-surface-2); }
.upg-sum div { display: flex; justify-content: space-between; gap: 10px; }
.upg-sum dt { color: var(--ox-muted); font-size: 13px; }
.upg-sum dd { margin: 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.upg-sum dd small { color: var(--ox-muted); font-weight: 500; }
.upg-sum .is-discount dd { color: var(--ox-green); }
.upg-sum .is-total { padding-top: 6px; border-top: 1px dashed #e2d8cf; }
.upg-sum .is-final dd { color: var(--ox-primary); font-size: 17px; }
.upg-note { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; background: #fffaf6; border: 1px solid #f6dfd2; font-size: 13.5px; }
.upg-hist__title { margin: 4px 0 8px; font-size: 13px; color: var(--ox-muted); text-transform: uppercase; letter-spacing: .04em; }
.upg-hist { margin: 0; padding: 0 0 0 4px; list-style: none; }
.upg-hist li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 0 0 12px 18px; font-size: 13px; }
.upg-hist li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ox-slate); }
.upg-hist li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: #ece4dd; }
.upg-hist li:last-child::after { display: none; }
.upg-hist li.is-blue::before { background: var(--ox-blue); } .upg-hist li.is-amber::before { background: var(--ox-amber); } .upg-hist li.is-green::before { background: var(--ox-green); } .upg-hist li.is-violet::before { background: #7c3aed; } .upg-hist li.is-brand::before { background: var(--ox-primary); }
.upg-hist li span { color: var(--ox-muted); }
.upg-hist li small { margin-left: auto; color: var(--ox-slate); font-size: 11.5px; }
.upg-proc { display: flex; flex-direction: column; gap: 10px; }
.upg-proc select, .upg-proc input { height: 38px; font-size: 13px; }
.upg-proc textarea { font-size: 13px; }
.upg-proc__hint { font-size: 11.5px; line-height: 1.45; }

/* Bảng giá */
.upg-cat { display: flex; flex-direction: column; gap: 14px; }
.upg-cat__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ox-border); }
.upg-cat__name { flex: 1; min-width: 200px; height: 38px; font-size: 15px; font-weight: 700; }
.upg-cat__head select { width: 140px; height: 38px; }
.upg-cat__del { color: var(--ox-red); font-size: 12.5px; }
.upg-cat__group.is-new { border-style: dashed; background: #fffaf6; }
.upg-cat__table th { white-space: nowrap; }
.upg-cat__table td { padding: 6px 8px !important; vertical-align: middle; }
.upg-cat__table input[type=text], .upg-cat__table select { width: 100%; height: 36px; font-size: 13px; }
.upg-cat__table td.upg-c-name { min-width: 200px; } .upg-cat__table td.upg-c-desc { min-width: 240px; } .upg-cat__table td.upg-c-type { width: 130px; } .upg-cat__table td.upg-c-price { width: 120px; } .upg-cat__table td.upg-c-unit { width: 90px; }
.upg-cat__table .upg-c-sum, .upg-act-lbl { display: none; }
.upg-cat__iconbtn { flex: none; border: 0; cursor: default; }
.upg-cat__foot { padding: 10px 16px; border-top: 1px solid var(--ox-border); }
.upg-cat__save { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; }
.upg-cat__save .ox-btn { box-shadow: 0 12px 26px -12px rgba(232, 64, 28, .7); }

/* Mã khuyến mãi */
.upg-promo-modal { width: min(720px, 96vw); }
.upg-codefield { display: flex; gap: 6px; }
.upg-codefield input { flex: 1; min-width: 0; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.upg-chk { display: flex; flex-wrap: wrap; gap: 6px; }
.upg-chk label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--ox-border); border-radius: 99px; font-size: 12.5px; cursor: pointer; }
.upg-chk label:has(input:checked) { border-color: var(--ox-primary); background: var(--ox-primary-soft); color: var(--ox-primary); }
.upg-del { margin-right: auto; }
[data-upg-for][hidden] { display: none !important; }

@media (max-width: 1100px) {
    .upg-detail { grid-template-columns: minmax(0, 1fr); }
    .upg-detail__side { position: static; }
}
@media (max-width: 760px) {
    .upg-filter { padding: 10px 12px; }
    .upg-cat__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; padding: 12px; }
    .upg-cat__head .ox-ic { width: 38px; height: 38px; cursor: pointer; }
    .upg-cat__name { min-width: 0; width: 100%; }
    .upg-cat__head > select { grid-column: 1 / -1; display: none; }
    .upg-cat__head > small, .upg-cat__head > .upg-cat__del { grid-row: 2; }
    .upg-cat__head > small { grid-column: 1 / 2; align-self: center; white-space: nowrap; font-size: 12px; }
    .upg-cat__head > .upg-cat__del { grid-column: 2; justify-self: end; font-size: 12.5px; }
    .upg-cat__group.is-icon .upg-cat__head > select { display: block; width: 100%; height: 38px; }
    .upg-cat__group.is-new .upg-cat__head > select { display: block; width: 100%; height: 38px; }
    /* Bảng giá trên điện thoại: mỗi tính năng là 1 dòng tóm tắt (tên + mô tả | giá + nhãn), bấm để mở ô sửa */
    .ox-app .upg-cat__table thead { display: none; }
    .ox-app .upg-cat__table tbody tr { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 8px; padding: 0 !important; border-bottom: 1px solid var(--ox-border); }
    .ox-app .upg-cat__table tbody tr:last-child { border-bottom: 0; }
    .ox-app .upg-cat__table tbody td { min-width: 0 !important; width: auto !important; padding: 0 !important; border: 0 !important; }
    .ox-app .upg-cat__table tbody tr:not(.is-open) > td:not(.upg-c-sum) { display: none !important; }
    .ox-app .upg-cat__table tbody td.upg-c-sum { display: block !important; grid-column: 1 / -1; }
    .ox-app .upg-cat__table tbody td.upg-c-sum::before { content: none !important; }
    .ox-app .upg-cat__table .upg-sum { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; gap: 10px; width: 100%; height: auto !important; min-height: 0; padding: 12px 12px 12px 14px !important; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ox-text); font: inherit; text-align: left !important; cursor: pointer; }
    .upg-sum:active { background: var(--ox-surface-2); }
    .upg-sum__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
    .upg-sum__main b { font-size: 14px; font-weight: 700; line-height: 1.35; }
    .upg-sum__main small { overflow: hidden; color: var(--ox-muted); font-size: 12px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
    .upg-sum__main small:empty { display: none; }
    .upg-sum__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; max-width: 46%; text-align: right; }
    .upg-sum__side strong { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .upg-sum__tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
    .upg-sum__tags em { padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-style: normal; font-weight: 600; line-height: 1.6; }
    .upg-sum__tags em[hidden] { display: none; }
    .upg-sum__tags .is-hot { background: #fff1e6; color: #d4520f; }
    .upg-sum__tags .is-off { background: var(--ox-surface-2); color: var(--ox-muted); }
    .upg-sum > svg { flex: none; color: var(--ox-muted); transform: rotate(90deg); transition: transform .15s; }
    .upg-row.is-open { background: #fffaf6; }
    .upg-row.is-open .upg-sum > svg { transform: rotate(-90deg); }
    .upg-row:not(.is-open) .upg-sum__main small, .upg-row:not(.is-open) .upg-sum__main b { opacity: 1; }
    .upg-row:has(td.upg-c-on input:not(:checked)) .upg-sum__main b { color: var(--ox-muted); }
    /* Ô sửa khi mở */
    .ox-app .upg-cat__table tbody tr.is-open { padding: 0 12px 14px !important; }
    .ox-app .upg-cat__table tbody tr.is-open > td.upg-c-sum { margin: 0 -12px !important; }
    .ox-app .upg-cat__table td::before { margin-bottom: 4px; font-size: 10.5px; }
    .ox-app .upg-cat__table input, .ox-app .upg-cat__table select { min-width: 0 !important; width: 100%; height: 40px; font-size: 14px; }
    .ox-app .upg-cat__table td.upg-c-name, .ox-app .upg-cat__table td.upg-c-desc { grid-column: 1 / -1; }
    .ox-app .upg-cat__table td.upg-c-name input { font-weight: 700; }
    .ox-app .upg-cat__table td.upg-c-type { grid-column: span 3; }
    .ox-app .upg-cat__table td.upg-c-price { grid-column: span 3; }
    .ox-app .upg-cat__table td.upg-c-unit { grid-column: span 2; }
    .ox-app .upg-cat__table td.upg-c-hot, .ox-app .upg-cat__table td.upg-c-on { grid-column: span 2; display: flex !important; flex-direction: column; align-items: flex-start; text-align: left; }
    .ox-app .upg-cat__table td.upg-c-on::before { content: "Hiện" !important; }
    .ox-app .upg-cat__table td.upg-c-act { grid-column: 1 / -1 !important; display: flex !important; justify-content: flex-end; padding: 2px 0 0 !important; border-top: 0 !important; }
    .ox-app .upg-cat__table td.upg-c-act .ox-icon-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 32px; padding: 0 10px; border-radius: 9px; color: var(--ox-red); font-size: 12.5px; font-weight: 600; }
    .upg-act-lbl { display: inline; }
    .upg-cat__foot { padding: 10px 12px; }
    .upg-cat__foot .ox-btn { width: 100%; justify-content: center; }
    .upg-cat__save .ox-btn { width: 100%; justify-content: center; }
}
/* Báo giá chi tiết: sửa giá từng dòng */
.upg-edit-wrap { margin-bottom: 12px; }
.upg-edit-wrap > .ox-btn { margin-top: 8px; }
.upg-edit th { white-space: nowrap; }
.upg-edit td { padding: 6px 8px !important; vertical-align: middle; }
.upg-edit td:first-child input { width: 100%; height: 36px; font-weight: 600; }
.upg-edit td:first-child small { display: block; margin-top: 2px; color: var(--ox-muted); font-size: 11.5px; }
.upg-edit .upg-edit__orig { width: 120px; color: var(--ox-muted); font-size: 13px; white-space: nowrap; }
.upg-edit td:nth-child(3) { width: 170px; }
.upg-edit td:nth-child(3) input { height: 36px; font-weight: 700; text-align: right; }
.upg-sum .ox-input-suffix.upg-disc { width: 150px; }
.upg-sum .upg-disc input { height: 34px; text-align: right; font-weight: 700; color: var(--ox-green); }
.upg-sum .is-final dd { color: var(--ox-primary); font-size: 18px; }
.upg-sum .is-ref dt, .upg-sum .is-ref dd { color: var(--ox-slate); font-size: 12px; font-weight: 500; }
.upg-proc__step { margin: -2px 0 2px; padding: 10px 12px; border-radius: 10px; background: #fffaf6; border: 1px solid #f6dfd2; color: var(--ox-text); font-size: 12.5px; line-height: 1.5; }
.upg-sum dd { white-space: nowrap; }

/* Đối chiếu hạn tên miền */
.dc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ox-border); }
.dc-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 200px; color: var(--ox-muted); font-size: 12.5px; }
.dc-progress[hidden] { display: none; }
.dc-progress i { display: block; flex: 1; height: 6px; border-radius: 99px; background: linear-gradient(90deg, #ff7a2e, var(--ox-primary)); transition: width .3s; }
.dc-table td { vertical-align: middle; }
.dc-table tr[hidden] { display: none !important; }
.dc-table tr.is-fresh td { background: #fffaf6; }
.dc-date { width: 150px; height: 34px; font-size: 13px; }
.dc-tag { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 18px; }
.dc-tag--oxo { background: var(--ox-green-soft); color: var(--ox-green); }
.dc-tag--own { background: #f2f3f6; color: #6b7486; }
.dc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--ox-border); position: sticky; bottom: 0; background: #fff; border-radius: 0 0 var(--ox-radius) var(--ox-radius); }
.dc-check-btn { margin-left: 6px; padding: 1px 8px; border: 1px dashed var(--ox-primary); border-radius: 99px; background: #fffaf6; color: var(--ox-primary); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.dc-check-btn:hover { background: var(--ox-primary); color: #fff; }
.dc-one { width: min(460px, 94vw); }
.dc-one__dom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 16px; }
.dc-one__warn { display: flex; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff6e5; color: #8a5a0b; font-size: 12.5px; line-height: 1.5; }
.dc-one__warn svg { flex: none; margin-top: 2px; }
.dc-one__state { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--ox-surface-2); font-size: 13px; }
.dc-one__state[hidden], .dc-one__res[hidden] { display: none; }
.dc-spin { width: 16px; height: 16px; border: 2px solid #f1d9cd; border-top-color: var(--ox-primary); border-radius: 50%; animation: dcSpin .8s linear infinite; }
@keyframes dcSpin { to { transform: rotate(360deg); } }
.dc-one__res { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--ox-surface-2); }
.dc-one__res div { display: flex; justify-content: space-between; gap: 10px; }
.dc-one__res dt { color: var(--ox-muted); font-size: 13px; }
.dc-one__res dd { margin: 0; font-weight: 700; }
.dc-one__res .is-sug { padding-top: 6px; border-top: 1px dashed #e2d8cf; }
.dc-one__res .is-sug dd { color: var(--ox-primary); font-size: 17px; }
#dbh_datebaohanh.is-filled { border-color: var(--ox-primary); box-shadow: 0 0 0 3px rgba(232, 64, 28, .12); }
.dc-table td.ox-row-actions { width: 1%; white-space: nowrap; }
.dc-table td.ox-row-actions > * { display: inline-flex; vertical-align: middle; }
.dc-table td { padding-top: 10px !important; padding-bottom: 10px !important; }
