/* Shop Hub – giao diện quản trị. Phong cách: nhẹ nhàng, bo tròn, bóng mềm, không viền dày. */
:root {
  --ink: #2E2A26;
  --text: #4A4540;
  --muted: #8A817A;
  --line: #EFE6DC;
  --bg: #FBF8F4;
  --card: #fff;
  --accent: #D4691F;
  --accent-soft: #FDEBDD;
  --ok: #2E8B57;
  --warn: #B7791F;
  --bad: #C0392B;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 4px 18px rgba(46, 42, 38, .07);
  --shadow-hover: 0 8px 26px rgba(46, 42, 38, .12);
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font-family: Quicksand, Nunito, "Segoe UI", system-ui, sans-serif; font-weight: 500; color: var(--text); background: var(--bg); font-size: 14.5px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, strong { color: var(--ink); font-weight: 700; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- nút, ô nhập */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; transition: filter .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(212, 105, 31, .25); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: #F4EEE7; color: var(--ink); }
.btn.ghost:hover { box-shadow: none; filter: brightness(.97); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: #FBE4E1; color: var(--bad); }
.in, select.in, textarea.in { width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.in { height: auto; min-height: 76px; padding: 10px 14px; border-radius: 14px; resize: vertical; }
select.in { padding-right: 30px; }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 105, 31, .12); }
label.f { display: block; margin: 0 0 10px; }
label.f > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 4px 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: #F4EEE7; color: var(--ink); font-size: 12.5px; font-weight: 600; border: 0; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #F4EEE7; color: var(--ink); white-space: nowrap; }
.pill.processing { background: #E3F1FB; color: #1F6FA8; }
.pill.completed { background: #E2F4EA; color: var(--ok); }
.pill.on-hold { background: #FFF2DC; color: var(--warn); }
.pill.pending { background: #F4EEE7; color: var(--muted); }
.pill.cancelled, .pill.failed, .pill.refunded { background: #FBE4E1; color: var(--bad); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #E0245E; color: #fff; font-size: 11.5px; font-weight: 700; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 34px; margin-bottom: 6px; }

/* ---------- đăng nhập */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 360px; padding: 28px; }
.login h1 { font-size: 22px; margin: 10px 0 4px; }
.login .logo { width: 52px; height: 52px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 4px 4px 8px; }

/* ---------- khung chính: menu trái */
.shell { display: flex; height: 100%; }
.side { flex: none; width: 210px; display: flex; flex-direction: column; padding: 18px 12px; background: #fff; box-shadow: 1px 0 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-size: 17px; font-weight: 700; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; margin-bottom: 4px; border-radius: 12px; color: var(--text); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a .badge { margin-left: auto; }
.nav svg { width: 20px; height: 20px; flex: none; }
.side .grow { flex: 1; }
.side .me { padding: 10px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.side .me button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 700; }
.side .me > div { margin-bottom: 3px; }
.side .me .me-name { color: var(--ink); font-weight: 700; font-size: 13px; }
.side .me .pill { height: 18px; padding: 0 7px; font-size: 10.5px; vertical-align: 1px; }
/* Nhân viên */
.staff-card { flex-wrap: wrap; }
.staff-card.off { opacity: .6; }
.staff-card .av { position: relative; flex: none; }
.staff-sites { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.staff-sites .chip { cursor: default; height: 24px; }
.f .flabel { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px 4px; }
.checks { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #FBF8F4; }
.checks .check { margin: 0; }
.danger-text { color: var(--bad) !important; }
.perf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.perf-bar .grow { flex: 1; }
.perf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.perf .pf { display: flex; flex-direction: column; min-width: 92px; padding: 6px 12px; border-radius: 12px; background: #FBF8F4; }
.perf .pf b { font-size: 15px; color: var(--ink); }
.perf .pf span { font-size: 11.5px; color: var(--muted); }
.perf .pf.warn { background: #FFF2DC; }
.perf .pf.warn b { color: var(--warn); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.top .grow { flex: 1; }
.conn-bar { padding: 6px 12px; text-align: center; font-size: 12.5px; background: #FFF2DC; color: var(--warn); }
.upd-bar { background: #E3F1FB; color: #1F6FA8; }
.upd-bar button { margin-left: 6px; border: 0; border-radius: 99px; padding: 3px 12px; background: #1F6FA8; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- tin nhắn: 3 cột */
.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px 1fr 300px; gap: 14px; padding: 0 16px 16px; }
.col { min-height: 0; display: flex; flex-direction: column; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.col-head { padding: 12px 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; box-shadow: 0 1px 0 var(--line); }
.scroll { flex: 1; overflow-y: auto; }
.cl-item { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #F6F0EA; }
.cl-item:hover { background: #FCFAF7; }
.cl-item.on { background: var(--accent-soft); }
.av { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.av .on-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #2ECC71; box-shadow: 0 0 0 2px #fff; }
.cl-body { flex: 1; min-width: 0; }
.cl-top { display: flex; align-items: center; gap: 6px; }
.cl-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cl-time { font-size: 11.5px; color: var(--muted); flex: none; }
.cl-prev { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cl-item.unread .cl-prev { color: var(--ink); font-weight: 700; }
.cl-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.th-head { padding: 12px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 0 var(--line); }
.th-head .grow { flex: 1; min-width: 0; }
.th-head .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; background: var(--bg); }
.mrow { display: flex; margin-bottom: 4px; }
.mrow.out { justify-content: flex-end; }
.bub { max-width: 72%; padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mrow.inc .bub { background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(46, 42, 38, .07); color: var(--ink); }
.mrow.out .bub { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.mrow.out.ai .bub { background: #6B5BD2; }
.mtime { font-size: 11px; color: var(--muted); margin: 0 6px 10px; }
.mtime.r { text-align: right; }
.mpage { font-size: 11px; color: var(--muted); margin: -6px 6px 10px; }
.day { text-align: center; margin: 10px 0; font-size: 12px; color: var(--muted); }
.typing-ind { font-size: 12.5px; color: var(--muted); padding: 0 18px 6px; background: var(--bg); min-height: 20px; font-style: italic; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; box-shadow: 0 -1px 0 var(--line); }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 22px; resize: none; outline: none; line-height: 1.4; }
.composer textarea:focus { border-color: var(--accent); }
.composer .btn { height: 44px; }

.info { padding: 14px 16px; }
.info section { margin-bottom: 18px; }
.info h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.kv > span { overflow-wrap: anywhere; }
.prod { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg); }
.prod img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #fff; }
.prod a { font-weight: 700; color: var(--ink); }
.pages li { font-size: 12.5px; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages { list-style: none; padding: 0; margin: 0; }
.mini-order { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--bg); margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.mini-order:hover { background: var(--accent-soft); }

/* ---------- đơn hàng */
.orders { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px 1fr; gap: 14px; padding: 0 16px 16px; }
.ol-item { display: flex; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #F6F0EA; align-items: center; }
.ol-item:hover { background: #FCFAF7; }
.ol-item.on { background: var(--accent-soft); }
.ol-item.new { box-shadow: inset 3px 0 0 var(--accent); }
.ol-item .thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--bg); flex: none; }
.ol-body { flex: 1; min-width: 0; }
.ol-top { display: flex; align-items: center; gap: 6px; }
.ol-top strong { font-size: 14px; }
.ol-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-right { text-align: right; flex: none; font-size: 12px; color: var(--muted); }
.ol-right b { display: block; color: var(--ink); font-size: 14px; }

.od { padding: 18px 20px; }
.od-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.od-head h2 { margin-right: 4px; }
.od-head .grow { flex: 1; }
.od-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.countdown { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: #FFF2DC; color: var(--warn); font-weight: 700; margin-bottom: 14px; font-size: 13.5px; }
.countdown.done { background: #E2F4EA; color: var(--ok); }
.item { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid #F6F0EA; }
.item:last-child { border-bottom: 0; }
.item-top { display: flex; gap: 12px; align-items: flex-start; }
.item-top img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--bg); flex: none; }
.item-top .grow { flex: 1; min-width: 0; }
.item-top .price { font-weight: 700; color: var(--ink); flex: none; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.ph { width: 128px; }
.ph a { display: block; }
.ph img { width: 128px; height: 128px; border-radius: 12px; object-fit: cover; background: var(--bg); box-shadow: 0 1px 4px rgba(46, 42, 38, .1); }
.ph small { display: block; text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ph.ai img { box-shadow: 0 0 0 3px #E6E0FA; }
.pers { display: grid; grid-template-columns: 150px 1fr; gap: 5px 10px; font-size: 13.5px; background: var(--bg); padding: 10px 12px; border-radius: 12px; }
.pers > span:nth-child(odd) { color: var(--muted); }
.pers > span:nth-child(even) { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pers .hl { background: #FFF6C9; padding: 0 4px; border-radius: 4px; }
.addr { white-space: pre-line; font-size: 13.5px; color: var(--ink); }
.copy { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 0; }
.stages { display: flex; gap: 4px; flex-wrap: wrap; }
.stages button { flex: 1; min-width: 70px; height: 32px; border: 0; border-radius: 99px; background: #F4EEE7; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.stages button.done { background: var(--accent-soft); color: var(--accent); }
.stages button.cur { background: var(--accent); color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.timeline li.cust::before { background: var(--accent); }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 10px; }

/* ---------- các web */
.sites { padding: 0 20px 20px; overflow-y: auto; }
.site-card { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.site-card .sw { width: 14px; height: 44px; border-radius: 8px; flex: none; }
.site-card .grow { flex: 1; min-width: 0; }
.secret-box { font-family: Consolas, monospace; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--bg); overflow-wrap: anywhere; user-select: all; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin-bottom: 6px; }

/* ---------- thông báo nổi */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 340px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-hover); font-size: 13.5px; cursor: pointer; animation: tin .2s ease-out; }
.toast.err { background: var(--bad); }
.toast strong { color: #fff; display: block; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- hộp thoại */
.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(46, 42, 38, .35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 520px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 1250px) { .chat { grid-template-columns: 290px 1fr; } .chat .info-col { display: none; } .od-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .side { width: 64px; padding: 14px 8px; } .brand span, .nav a span, .side .me { display: none; } .orders { grid-template-columns: 300px 1fr; } }

/* ô tích theo màu chủ đạo */
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.check { cursor: pointer; }

/* ---------- đơn hàng: thanh chọn ngày, thống kê, nhóm theo ngày */
.o-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 14px 16px 10px; }
.o-bar .grow { flex: 1; }
.o-dates { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 4px 2px 10px; border-radius: 99px; background: #F4EEE7; font-size: 13px; }
.o-dates.on { background: var(--ink); color: #fff; }
.o-dates .in.date { width: 138px; height: 28px; padding: 0 8px; font-size: 13px; border: 0; }
.o-stats { padding: 0 16px 12px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(240px, 2fr); gap: 10px; }
.stat { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px; min-width: 0; }
.stat > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.stat > b { display: block; font-size: 22px; color: var(--ink); line-height: 1.25; }
.stat > small { font-size: 11.5px; color: var(--muted); }
.stat.sites { display: flex; flex-direction: column; gap: 2px; }
.site-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.site-line .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-line .muted { min-width: 64px; text-align: right; }
.stat-row2 { display: flex; gap: 10px; margin-top: 10px; align-items: stretch; }
.chart { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 3px; height: 74px; padding: 8px 10px 4px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; border: 0; background: none; padding: 0; cursor: pointer; min-width: 4px; }
.bar i { display: block; width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: var(--accent); opacity: .8; transition: opacity .15s; }
.bar:hover i { opacity: 1; }
.bar em { font-style: normal; font-size: 10px; color: var(--muted); line-height: 1; }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; max-width: 360px; padding: 8px 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.day-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #F7F2EC; font-size: 12.5px; }
.day-head strong { font-size: 13px; }
.day-head span { flex: 1; color: var(--muted); }
.orders { min-height: 260px; }
@media (max-width: 1250px) { .stat-row { grid-template-columns: repeat(4, 1fr); } .stat.sites { grid-column: 1 / -1; } }

/* ---------- dịch tự động + trợ lý AI */
.bub .orig { margin-top: 6px; padding-top: 5px; border-top: 1px dashed rgba(46, 42, 38, .15); font-size: 12px; opacity: .75; }
.mrow.out .bub .orig { border-top-color: rgba(255, 255, 255, .35); }
.handoff { padding: 8px 16px; background: #FBE4E1; color: var(--bad); font-size: 13px; font-weight: 700; }
.tr-opt { margin: -6px 18px 10px; font-size: 12.5px; color: var(--muted); }
.btn.ai-on { background: #ECE8FB; color: #5B4BC4; }
.ai-page .card { margin-bottom: 14px; }
.ai-page h3 { font-size: 15px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.mode { text-align: left; padding: 12px 14px; border: 0; border-radius: 14px; background: #F7F2EC; cursor: pointer; }
.mode b { display: block; margin-bottom: 3px; }
.mode small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.mode.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ai-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ai-sites .card { margin: 0; }
pre.kb { max-height: 60vh; overflow: auto; white-space: pre-wrap; font-size: 12px; background: var(--bg); padding: 12px; border-radius: 12px; }
.modal:has(pre.kb) { width: 900px; }
.th-head { flex-wrap: wrap; row-gap: 6px; }
.th-head .grow { min-width: 200px; }
.th-head .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- ảnh + emoji trong chat */
.bub .pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 2px 0 4px; }
.bub .pics.one { grid-template-columns: 1fr; }
.bub .pics a { display: block; }
.bub .pics img { display: block; width: 100%; max-width: 260px; max-height: 240px; object-fit: cover; border-radius: 12px; background: #F4EEE7; height: auto; }
.compose-wrap { position: relative; }
.composer .ib { flex: none; width: 38px; height: 44px; border: 0; background: none; font-size: 20px; cursor: pointer; border-radius: 50%; padding: 0; }
.composer .ib:hover { background: var(--bg); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; }
.thumbs:empty { display: none; }
.th { position: relative; width: 60px; height: 60px; border-radius: 12px; overflow: hidden; background: #F4EEE7; }
.th img { width: 100%; height: 100%; object-fit: cover; }
.th.up img { opacity: .4; }
.th button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; line-height: 20px; padding: 0; cursor: pointer; }
.emo { display: none; position: absolute; left: 14px; bottom: 100%; margin-bottom: 6px; padding: 8px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-hover); grid-template-columns: repeat(8, 36px); gap: 2px; z-index: 5; }
.emo.on { display: grid; }
.emo button { border: 0; background: none; font-size: 21px; padding: 4px 0; border-radius: 10px; cursor: pointer; }
.emo button:hover { background: var(--bg); }

/* ---------- Đơn hàng v2: thanh lọc 1 hàng + bảng toàn chiều rộng + popup chi tiết */
.o-bar { gap: 8px; padding: 14px 16px 8px; }
.o-bar { flex-wrap: nowrap; }
.o-bar .in { height: 34px; font-size: 13.5px; width: auto; min-width: 0; }
.o-bar .sel { padding-right: 28px; }
.o-dates { background: #fff; box-shadow: inset 0 0 0 1px var(--line); padding: 0 6px; height: 34px; margin: 0; color: var(--muted); }
.o-dates.on { background: #fff; color: var(--muted); }
.o-dates .in.date { width: 128px; height: 30px; box-shadow: none; }
.o-stats { padding: 0 16px 8px; }
.kpis { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); font-size: 13px; color: var(--muted); }
.kpis .grow { flex: 1; }
.kpi b { color: var(--ink); font-size: 15px; }
.o-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 16px 16px; padding: 0; }
.or { display: grid; grid-template-columns: 52px 170px minmax(120px, 1fr) minmax(160px, 2fr) 90px 120px 110px 56px; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid #F6F0EA; cursor: pointer; font-size: 13.5px; }
.or:hover { background: #FCFAF7; }
.or.on { background: var(--accent-soft); }
.or.new { box-shadow: inset 3px 0 0 var(--accent); }
.or .r { text-align: right; }
.or-head { position: sticky; top: 0; z-index: 2; background: #fff; cursor: default; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 10px; padding-bottom: 10px; box-shadow: 0 1px 0 var(--line); }
.or-head:hover { background: #fff; }
.or-day { position: sticky; top: 37px; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 7px 16px; background: #F7F2EC; font-size: 12.5px; }
.or-day strong { font-size: 13px; }
.or-day span { flex: 1; color: var(--muted); }
.or-img { position: relative; width: 44px; height: 44px; }
.or-img .thumb, .or-img img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--bg); display: block; }
.or-img i { position: absolute; right: -6px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; text-align: center; line-height: 18px; }
.or-num b { display: block; color: var(--ink); }
.or-num small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.or-cust, .or-prod { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-prod { color: var(--text); }
.omodal-bg { align-items: flex-start; padding: 28px 20px; z-index: 30; }
.omodal { position: relative; width: 1180px; max-width: 100%; max-height: calc(100vh - 56px); display: flex; flex-direction: column; background: var(--bg); border-radius: 20px; box-shadow: 0 24px 70px rgba(46, 42, 38, .3); overflow: hidden; }
.omodal > .scroll { flex: 1; overflow-y: auto; }
.omodal .od { padding: 22px 26px; }
.omodal-x { position: absolute; top: 14px; right: 16px; z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 16px; cursor: pointer; }
.omodal-x:hover { background: var(--accent-soft); }
.omodal .od-head { padding-right: 44px; }
@media (max-width: 1250px) { .or { grid-template-columns: 52px 150px minmax(100px, 1fr) minmax(120px, 1.5fr) 80px 110px 56px; } .or > :nth-child(7) { display: none; } }

/* ---------- Tin nhắn gọn: cột "Thông tin khách" ẩn mặc định, nút 👤 Khách để mở */
.chat { grid-template-columns: 300px 1fr; }
.chat .info-col { display: none; }
.chat.info-open { grid-template-columns: 300px 1fr 290px; }
.chat.info-open .info-col { display: flex; }
.info-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; box-shadow: 0 1px 0 var(--line); }
.btn.on-info { background: var(--accent-soft); color: var(--accent); }
.col-head { flex-wrap: nowrap; }
@media (max-width: 1250px) {
  .chat, .chat.info-open { grid-template-columns: 280px 1fr; position: relative; }
  .chat.info-open .info-col { display: flex; position: absolute; top: 0; right: 16px; bottom: 16px; width: 300px; z-index: 6; box-shadow: var(--shadow-hover); }
  .chat.info-open #thread .th-head { padding-right: 330px; } /* nút ở đầu khung chat không bị cột thông tin che */
}

.models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 0; }
@media (max-width: 1250px) { .models { grid-template-columns: repeat(2, 1fr); } }
