/* Tông hồng sang trọng: hồng mận, hồng phấn, vàng hồng. Bố cục theo 25 ảnh thiết kế. */
:root {
  --plum: #38102a; --plum2: #571a40; --brand: #a8245f; --brand-d: #8b1a4d; --gold: #c9975f; --gold-l: #f3d9b8;
  --bg: #fbf3f6; --card: #fff; --line: #f0dce5; --field: #fef9fb; --head: #fcf3f7; --text: #34162a; --muted: #84606f; --tint: #fdeef4;
  --green: #17694a; --green-bg: #e2f5ec; --amber: #885012; --amber-bg: #fdeed6; --red: #a8232f; --red-bg: #ffe5e7; --blue: #4b3f8f; --blue-bg: #ecebfa;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 'Noto Sans', 'Segoe UI', system-ui, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 34px; line-height: 1.25; letter-spacing: -1px; margin: 0; font-weight: 800; }
h2 { font-size: 16.5px; margin: 0 0 16px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.boot { padding: 40px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; } .pre { white-space: pre-line; }

/* Khung */
.shell { display: flex; min-height: 100vh; }
.side { width: 224px; flex: 0 0 224px; background: linear-gradient(175deg, var(--plum) 0%, #4a1537 60%, var(--plum2) 100%); color: #f6dfe9; display: flex; flex-direction: column; padding: 22px 14px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; gap: 10px; align-items: center; margin: 0 4px 24px; color: inherit; }
.logo b.m { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: linear-gradient(140deg, #fbe7d3, #dca06f 60%, #e9bfa0); color: var(--plum); display: grid; place-items: center; font-size: 21px; box-shadow: 0 6px 18px #dca06f55; }
.logo strong { display: block; color: #fff; font-size: 14px; } .logo span { font-size: 12px; color: var(--gold-l); }
.side nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; margin-bottom: 3px; border-radius: 9px; color: #efd3e0; font-weight: 600; border: 1px solid transparent; }
.side nav a i { font-style: normal; width: 18px; text-align: center; color: var(--gold-l); }
.side nav a:hover { background: #ffffff12; }
.side nav a.on { background: linear-gradient(100deg, #8d2a60, #6d2150); color: #fff; border-color: #c9975f66; }
.who { margin-top: auto; border: 0; border-top: 1px solid #ffffff22; background: none; color: #efd3e0; text-align: left; font: inherit; font-size: 12px; padding: 16px 6px 4px; cursor: pointer; }
.who strong { display: block; color: #fff; font-size: 14px; }
.main { flex: 1; min-width: 0; }
.top { height: 64px; background: #fffdfe; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.top .crumb b { color: #8a5a2b; } .top .crumb span { color: var(--muted); margin: 0 10px; }
.top .grow { flex: 1; }
.content { padding: 26px 28px 48px; max-width: 1240px; }
.pagehead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead p { margin: 3px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mtop, .tabbar { display: none; }

/* Thành phần */
button, .btn { font: inherit; font-weight: 700; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 9px 14px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { border-color: #dfa9c1; }
button.primary, .btn.primary { background: linear-gradient(135deg, #bd3070, #911c52); border-color: #911c52; color: #fff; box-shadow: 0 5px 14px #a8245f33; }
button.sm, .btn.sm { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #e386ae; outline-offset: 1px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { color: var(--muted); font-weight: 700; padding: 4px 0 11px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand-d); border-color: var(--brand); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pills a { padding: 8px 18px; border-radius: 99px; color: var(--muted); font-weight: 700; }
.pills a.on { background: linear-gradient(135deg, #8d2a60, #5a1a42); color: #fff; }
.pills.soft a.on { background: var(--tint); color: var(--brand-d); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 10px #8b1a4d08; min-width: 0; }
.grid { display: grid; gap: 14px; align-items: start; }
.g2 { grid-template-columns: minmax(0, 590fr) minmax(0, 476fr); }
.g2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
.grid { margin-bottom: 14px; }
.kpi { min-height: 121px; }
.kpi small { color: var(--muted); font-size: 12px; } .kpi strong { display: block; font-size: 29px; line-height: 1.35; letter-spacing: -.8px; margin-top: 4px; } .kpi p { margin: 0; color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.green { background: var(--green-bg); color: var(--green); } .amber { background: var(--amber-bg); color: var(--amber); } .red { background: var(--red-bg); color: var(--red); } .blue { background: var(--blue-bg); color: var(--blue); } .pink { background: var(--tint); color: var(--brand-d); }
.tablewrap { border: 1px solid var(--line); border-radius: 9px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: var(--head); text-align: left; font-size: 11px; color: var(--muted); padding: 9px; }
td { padding: 10px 9px; border-top: 1px solid var(--line); height: 44px; vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover, tr.sel { background: var(--tint); }
.list > .li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; min-height: 39px; border-bottom: 1px solid var(--line); color: var(--text); }
.list > .li:last-child { border-bottom: 0; }
.list > .li > b { font-size: 12px; text-align: right; }
.list > a.li:hover, .li.click:hover { color: var(--brand); cursor: pointer; }
.li.sel { color: var(--brand); font-weight: 700; }
.field { margin-bottom: 11px; min-width: 0; }
.field > label, .field > span.l { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 1px; }
.field > div.v { background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; font-weight: 700; font-size: 13px; min-height: 36px; white-space: pre-line; }
input, select, textarea { font: inherit; font-weight: 600; font-size: 13px; width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: var(--text); }
input[type=checkbox] { width: auto; margin-right: 8px; }
textarea { resize: vertical; min-height: 62px; }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; } .filters .field { margin: 0; min-width: 140px; }
.note { padding: 11px 12px; border-radius: 8px; font-weight: 700; font-size: 12px; margin: 10px 0; }
.quote { background: var(--tint); border-left: 3px solid #dd8cae; border-radius: 6px; padding: 16px; font-size: 15px; line-height: 1.6; white-space: pre-line; }
.quote.big { font-size: 24px; font-weight: 700; line-height: 1.55; }
.bar { height: 7px; border-radius: 9px; background: #f3e5ec; overflow: hidden; margin: 10px 0; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, #b0246b, #d6a066); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.session-row { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border: 0; }
.session-row time { font-weight: 800; color: var(--brand); font-size: 17px; line-height: 1.25; } .session-row time small { display: block; color: var(--text); font-size: 12px; }
.session-row h4 { margin: 0; font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 6px; overflow-x: auto; }
.day { border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 96px; background: #fff; }
.day.today { border-color: var(--brand); background: var(--tint); } .day.dim { opacity: .45; }
.day a { display: block; font-size: 11px; background: var(--tint); border-radius: 5px; padding: 3px 5px; margin-top: 4px; color: var(--text); }
.day a.red { background: var(--red-bg); } .day a.amber { background: var(--amber-bg); }
.chart { display: flex; gap: 8px; height: 190px; margin-top: 6px; }
.chart .axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); padding-bottom: 22px; }
.chart .cols { flex: 1; display: flex; align-items: stretch; background: repeating-linear-gradient(to top, transparent 0, transparent calc(33.33% - 1px), var(--line) calc(33.33% - 1px), var(--line) 33.33%) top / 100% calc(100% - 22px) no-repeat; overflow-x: auto; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 30px; }
.chart .col i { width: 42px; max-width: 70%; border-radius: 7px 7px 0 0; background: linear-gradient(#b8336f, #eaa9c2); }
.chart .col span { height: 22px; font-size: 11px; color: var(--muted); padding-top: 5px; }
.led { height: 82px; border-radius: 9px; background: radial-gradient(ellipse at center, #4a2140, #25101f 75%); display: flex; justify-content: center; align-items: center; gap: 24px; }
.led i { width: 58px; height: 22px; border-radius: 50%; background: repeating-linear-gradient(105deg, #ff7aa8 0 3px, #8c2050 3px 5px); box-shadow: 0 0 22px 5px #ff5a9444; }
.livebar { background: linear-gradient(100deg, var(--plum), var(--plum2)); color: #fff; border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.livebar .clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; } .livebar .grow { flex: 1; }
.video { height: 153px; border-radius: 9px; background: radial-gradient(ellipse at 50% 20%, #8a4a72, #2e1226 80%); display: grid; place-items: center; position: relative; color: #fff; }
.video .play { width: 54px; height: 43px; border-radius: 13px; background: #ffffff26; display: grid; place-items: center; } .video small { position: absolute; left: 12px; bottom: 7px; }
.hero { background: linear-gradient(130deg, var(--plum) 20%, #6a1f4e); color: #fff; border-radius: 18px; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; box-shadow: 0 12px 30px #38102a33; }
.hero div { padding: 20px 24px; border-left: 1px solid #ffffff18; } .hero small { text-transform: uppercase; color: #e8c3d5; font-size: 12px; letter-spacing: .04em; } .hero strong { display: block; font-size: 32px; color: var(--gold-l); } .hero p { margin: 0; font-size: 12px; color: #e8c3d5; }
.highlight { background: #fdf1e0; border: 1px solid #eed5ac; border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; }
.goldbar::before { content: ''; display: inline-block; width: 4px; height: 17px; border-radius: 3px; background: var(--gold); margin-right: 10px; vertical-align: -3px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; } .metrics small { color: var(--muted); display: block; } .metrics b { font-size: 16px; } .metrics em { display: block; font-style: normal; font-weight: 700; color: #94671f; font-size: 12px; }
.alertcard { border-color: #c9374a; background: #fffaf7; }
details > summary { cursor: pointer; font-weight: 700; }
.thumb { width: 74px; height: 104px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.thumb.wide { width: 120px; height: 84px; }
.noimg { display: grid; place-items: center; background: var(--head); color: var(--muted); font-size: 11px; text-align: center; }

/* Hộp thoại & thông báo nổi */
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(580px, calc(100vw - 24px)); color: var(--text); box-shadow: 0 24px 70px #38102a55; max-height: 90vh; }
dialog::backdrop { background: #38102a77; }
dialog .err { background: var(--red-bg); color: var(--red); padding: 10px; border-radius: 8px; font-weight: 700; margin-bottom: 10px; }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 36px)); }
#toast div { background: var(--plum); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px #38102a44; font-weight: 600; }
#toast div.bad { background: #a8232f; }
.net { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: #a8232f; color: #fff; text-align: center; padding: 8px; font-weight: 700; }

/* Đăng nhập */
.login { display: grid; grid-template-columns: 712fr 648fr; min-height: 100vh; }
.login .art { background: radial-gradient(circle at 20% 65%, #a23b72, var(--plum) 72%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.login .art h1 { font-size: 55px; line-height: 1; margin: 6px 0 18px; max-width: 420px; } .login .art p { color: #efcadc; font-size: 17px; } .login .art .led { margin-top: 16px; }
.login .form { display: flex; flex-direction: column; justify-content: center; width: min(350px, 86%); margin: auto; } .login .form button.primary { padding: 11px; margin-top: 12px; }
.demo-users { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; } .demo-users button { text-align: left; font-size: 12px; } .demo-users small { display: block; color: var(--muted); font-weight: 400; }
.mobile-only { display: none; }

@media (max-width: 1000px) { .g2, .g2e { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .shell { display: block; }
  .mtop { display: flex; align-items: center; justify-content: space-between; background: var(--plum); color: #fff; padding: 12px 15px; position: sticky; top: 0; z-index: 20; }
  .mtop .logo { margin: 0; } .mtop button { background: none; border: 0; color: #fff; font-size: 20px; }
  .side { display: none; position: fixed; top: 66px; left: 0; right: 0; width: auto; height: calc(100dvh - 66px - 62px - env(safe-area-inset-bottom)); z-index: 19; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; margin: 0; padding: 6px 2px; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; }
  .tabbar i { font-style: normal; font-size: 20px; line-height: 1; }
  .tabbar a.on, .menu-open .tabbar button { color: #8d2a60; background: var(--tint); }
  [data-scan] > * { width: 100%; max-width: none; } [data-scan] input, [data-scan] select { width: 100%; font-size: 16px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .side > .logo { display: none; } .menu-open .side { display: flex; }
  .top { display: none; } .content { padding: 14px 15px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 25px; } .g3, .g4, .formrow, .hero { grid-template-columns: 1fr; }
  .session-row { grid-template-columns: 64px 1fr; } .quote.big { font-size: 19px; }
  .login { grid-template-columns: 1fr; } .login .art { padding: 28px; } .login .art h1 { font-size: 34px; } .login .form { padding: 28px 0; }
  .mobile-only { display: block; } .desktop-only { display: none !important; }
  .mobile-first { order: -1; }
}

/* Bảng quyết toán theo ngày */
.sheetbox { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
table.sheet th, table.sheet td { padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; background: #fff; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
table.sheet th { position: sticky; top: 0; z-index: 2; background: #fbeef3; text-transform: uppercase; font-size: 11px; }
table.sheet th:first-child, table.sheet td:first-child { position: sticky; left: 0; z-index: 1; background: #fbeef3; }
table.sheet th:first-child { z-index: 3; }
table.sheet tr.fee td { background: #f2a9a9; color: #5a0f14; }
table.sheet tr.fee.big td { background: #c0262d; color: #fff; font-weight: 700; }
.feebadge { display: inline-block; background: #c0262d; color: #fff; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 700; }

/* Nút hiển thị như chữ liên kết */
button.linklike{background:none;border:0;padding:0;min-height:0;box-shadow:none;font:inherit;color:#a3205c;cursor:pointer;text-align:left}
button.linklike:hover{text-decoration:underline}

/* Ô số liệu bấm được */
button.cardbtn{margin:0;padding:12px;text-align:left;font:inherit;display:block;cursor:pointer;color:inherit;font-weight:400}
button.cardbtn:hover{border-color:#a3205c}

/* Bảng chốt lương theo kỳ: mỗi kỳ một hàng, màu giống bảng Lương TH */
dialog.wide{width:min(1100px,96vw);max-width:96vw}
.paysheet{overflow-x:auto;border:1px solid #333;border-radius:6px}
.paysheet table{border-collapse:collapse;width:100%;color:#111;background:#fff}
.paysheet th,.paysheet td{border:1px solid #bbb;padding:5px 6px;text-align:right;white-space:nowrap;font-size:13px}
.paysheet th{text-align:center;background:#fdf2f7;white-space:normal;font-size:12.5px}
.paysheet td:first-child{text-align:left;position:sticky;left:0;background:#fff}
.paysheet td .m{color:#d31616;font-weight:700;font-size:14px}
.paysheet td .r{color:#1527c9;font-weight:700;font-size:12px}
.paysheet .note-cut{white-space:normal;max-width:110px;margin-left:auto;font-size:11px;line-height:1.25}
.paysheet tr.live td{background:#fdf2f7}
.paysheet td.tot,.paysheet th.tot,.paysheet tr.live td.tot{background:#ffff00;font-weight:700;font-size:14px}
.paysheet th .hint{font-weight:400;font-size:10.5px;color:#7a5a6a;line-height:1.2}

/* Ô số liệu bấm được trong bảng tổng hợp */
button.metricbtn{background:none;border:0;padding:0;margin:0;min-height:0;box-shadow:none;font:inherit;color:inherit;font-weight:400;text-align:left;cursor:pointer}
button.metricbtn small{color:#a3205c;text-decoration:underline}

/* Cảnh báo đơn hoàn phí cao */
.refundalert{border:2px solid #c3263a;background:#fff5f6}
.alertrow{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;border-top:1px solid #f0c9d0;padding:10px 0;flex-wrap:wrap}
.alertrow .warn{color:#c3263a;font-weight:700}

/* Đoạn ghi âm nằm trong câu hỏi đáp */
.clipbox{border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin-top:10px;background:#fdf6f9}

/* Tổng số phút không nói, vắng hình: làm nổi bật */
.totalmin{display:inline-block;background:#fde4e8;color:#a81f33;font-size:14px;font-weight:700;border-radius:7px;padding:1px 7px;margin:0 3px;white-space:nowrap}
.rangebox>summary{margin:4px 0}

/* Ô tổng không nói, vắng hình: bấm để xem từng đoạn */
button.segtile{display:grid;grid-template-columns:1fr auto;align-items:center;gap:0 10px;width:100%;max-width:300px;margin:6px 0;padding:8px 12px;text-align:left;font:inherit;font-weight:400;background:#fff;border:1px solid #efc7cf;border-left:4px solid #c3263a;border-radius:10px;box-shadow:none;cursor:pointer;color:inherit}
button.segtile:hover{background:#fdf1f3}
.segtile .t{font-weight:700}
.segtile b{grid-row:span 2;grid-column:2;color:#a81f33;font-size:15px;text-align:right;white-space:nowrap}
.segtile .n{grid-column:1;font-size:12px;color:#85606f}
div.segtile{display:grid;grid-template-columns:1fr auto;align-items:center;gap:0 10px;width:100%;max-width:300px;margin:6px 0;padding:8px 12px;border-radius:10px}
.daycard>summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px;cursor:pointer;list-style:none}
.daycard>summary::before{content:'▸';font-size:18px;color:#8b1a4d}
.daycard[open]>summary{margin-bottom:10px}
.daycard[open]>summary::before{content:'▾'}
.daycard>summary>div:last-child{margin-left:auto!important}
div.segtotal{background:#a81f33;color:#fff}
div.segtotal b{color:#fff;grid-row:1;grid-column:2}
div.segtotal .n{grid-column:1 / -1;color:#f6d5da}

/* Nhận hàng hoàn: hộp camera, ảnh phiếu và video */
dialog.camdlg{width:min(560px,96vw);max-width:96vw}
.camview{position:relative;background:#000;border-radius:10px;overflow:hidden}
.camview video{display:block;width:100%;height:100%;object-fit:cover}.camview.wide video{object-fit:contain}
.camview{height:44dvh;aspect-ratio:9/16;max-width:100%;margin:0 auto}.camview .idle:not([hidden])~.aim{display:none}
.camview .idle{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:#fff;font-size:15px}
.camview .rec{position:absolute;top:8px;left:10px;color:#fff;background:#0009;border-radius:99px;padding:2px 10px;font-weight:700;font-size:13px}
.camview .rec b{margin-left:4px}.camview .rec::first-letter{color:#ff4d4d}
.camview .aim{position:absolute;left:10%;right:10%;top:38%;bottom:38%;border:2px dashed #ffd66b;border-radius:8px;pointer-events:none}
.camshot{display:flex;gap:10px;align-items:center;margin:6px 0}.camshot img{height:74px;border-radius:6px;border:1px solid var(--line)}
.retthumb{display:block;height:46px;border-radius:6px;border:1px solid var(--line)}
.retmedia{display:block;max-width:100%;max-height:70dvh;margin:8px auto;border-radius:8px}
.decide{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.decide button{min-height:56px;font-size:16px;font-weight:800;color:#fff;border:0}
.decide button.ok{background:#1d7a46}.decide button.claim{background:#b4232f}
.camdlg [data-step][hidden]{display:none}
.camdlg .recbtn{min-height:52px;font-size:16px;font-weight:800;flex:1}
.camdlg [hidden]{display:none}

/* Mỗi ngày chấm công gọn một dòng */
details.card.daycard{padding:6px 14px;margin-bottom:6px}
.daycard>summary{min-height:30px;gap:8px}
.daycard>summary .dayhead{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 10px}
.daycard>summary .dayhead b{font-size:14px;min-width:150px}
.daycard>summary .pill{padding:1px 8px}
.dayrow{justify-content:flex-end;margin:0 0 6px}

/* Trạng thái đơn gửi đi: ô bấm và hộp chọn */
button.statusbtn{background:none;border:1px dashed var(--line);border-radius:99px;padding:3px 8px;min-height:30px;box-shadow:none;cursor:pointer;font:inherit}
button.statusbtn:hover{border-color:#a3205c}
.statuslist{display:grid;gap:8px;margin:10px 0}
.statuslist button{min-height:46px;font-size:15px;font-weight:700}
.statuslist button.on{background:var(--tint);border-color:#a3205c;color:#a3205c}
.statuslist button.clear{font-weight:400;color:var(--muted)}

/* Ô bấm vào để viết trên bảng đơn gửi đi */
button.editcell{display:block;width:100%;min-width:60px;min-height:30px;background:none;border:1px dashed transparent;border-radius:6px;box-shadow:none;padding:2px 4px;font:inherit;font-weight:400;color:inherit;text-align:left;white-space:normal;cursor:text}
button.editcell:hover,button.editcell:focus-visible{border-color:#a3205c;background:#fff}
button.editcell.changed{color:#8d2a60;font-weight:700;text-decoration:underline dotted}
.statuslist{grid-template-columns:1fr 1fr}
.statuslist button{margin:0}
.statuslist button.clear{grid-column:1 / -1}
.statushead{margin:12px 0 0;font-size:14px}
.statuslist.write{grid-template-columns:1fr}
.statuslist.write button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:8px 14px;border-color:#a3205c}
.statuslist.write small{font-weight:400;color:var(--muted);white-space:normal}
dialog button.savebtn{min-width:140px;min-height:46px;font-size:15px}
.steps{display:flex;flex-wrap:wrap;align-items:center;gap:3px 5px;margin-top:5px;font-size:12px}
.steps small{width:100%;color:var(--muted);font-weight:700}
.steps span{background:#e8f1ff;color:#1c4f9c;border-radius:6px;padding:2px 7px;font-weight:600}
.steps i{font-style:normal;color:#1c4f9c;font-weight:800}

/* Giờ hẹn giao và hộp nhắc */
button.appoint{display:block;margin-top:5px;background:#fff4d6;border:1px solid #e6b94d;color:#7a5200;border-radius:7px;padding:3px 8px;min-height:28px;box-shadow:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer;text-align:left}
.remind{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;border-top:1px solid var(--line);padding:10px 0}
.remind>b{font-size:17px;color:#a81f33}
.remind button{grid-column:1 / -1;justify-self:start}
.appoint.still{display:inline-block;margin-top:5px;background:#fff4d6;border:1px solid #e6b94d;color:#7a5200;border-radius:7px;padding:3px 8px;font-size:12px;font-weight:700}
.contact{display:inline-block;border:1px solid #a3205c;border-radius:7px;padding:4px 9px;font-size:12.5px;font-weight:700;color:#a3205c;background:#fff}
.contact.zalo{border-color:#0068ff;color:#0068ff}
.contact.off{opacity:.45}
.contacts{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:6px}
.remind>b small{display:block;font-size:11px;color:var(--muted)}
button.appoint.pickup{background:#e8f7ee;border-color:#7cc79a;color:#14603a;line-height:1.6}
.pickup .nodeposit{color:#a81f33}.pickup .dnote{font-weight:400;white-space:normal}
button.deposit{background:#fff1d6;border:1px solid #d98e04;color:#8a5300;border-radius:7px;min-height:30px;padding:3px 9px;box-shadow:none;font:inherit;font-size:12.5px;font-weight:800;cursor:pointer}
.depositask{background:#fff1d6;border:1px solid #d98e04;border-radius:8px;padding:8px 12px;color:#8a5300;margin:6px 0}
.contact.ship{border-color:#1d7a46;color:#14603a;background:#e8f7ee}
i.then{font-style:normal;font-weight:800;color:#14603a;align-self:center}

/* Lịch sử chuyển trạng thái */
td.statuscol{min-width:170px;vertical-align:top}
.hist{margin-top:5px;font-size:11.5px;line-height:1.35;color:var(--muted)}
.hist ul{list-style:none;margin:0;padding:0}
.hist li{border-left:2px solid var(--line);padding:1px 0 2px 7px}
.hist li:first-child{border-left-color:#a3205c}
.hist time{display:block;font-size:10.5px}
.hist b{color:var(--ink,#38102a);font-weight:600}
.hist summary{cursor:pointer;color:#a3205c;font-weight:700}
.contact.check{border-color:#d98e04;color:#8a5300;background:#fff1d6}
button.contact{min-height:30px;box-shadow:none;font-family:inherit;cursor:pointer}
.yesno{grid-column:1 / -1;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.yesno button{min-height:52px;font-size:15px;font-weight:800;color:#fff;border:0;margin:0}
.remind .yesno button{justify-self:stretch}
.yesno .yes{background:#1d7a46}.yesno .no{background:#b4232f}
button.appoint.arrived{background:#e8f7ee;border-color:#7cc79a;color:#14603a}
.remind b.ask{font-size:16px;color:var(--ink,#38102a)}
.camdlg [data-step=quay]{flex-wrap:wrap}
.camdlg .pickbtn{min-height:52px;font-weight:700;border-color:#a3205c;color:#a3205c}
.camdlg [data-step=quay] .recbtn{flex:1 1 100%}
.camdlg [data-step=quay] .pickbtn{flex:1}
.reasonlist{display:grid;gap:10px;margin:8px 0}
.reasonlist button{min-height:52px;font-size:16px;font-weight:700;border-color:#a3205c;margin:0}
.reasonlist button.on{background:var(--tint);color:#a3205c}
button.appoint.codreason{background:#fdeef5;border-color:#d47aa3;color:#8d2a60}
.remind .reason{font-weight:700;color:#8d2a60;font-size:12.5px}
.yesno .wait{background:#b9770e}
button.appoint.askcod{background:#fff;border:1px solid #a3205c;color:#a3205c}

/* Ghim đơn lên đầu */
button.pinbtn{display:block;margin:0 0 5px;min-height:28px;padding:2px 9px;border-radius:8px;border:1px solid var(--line);background:#fff;box-shadow:none;font:inherit;font-size:12px;font-weight:700;color:var(--muted);cursor:pointer;filter:grayscale(1)}
button.pinbtn:hover{border-color:#a3205c;color:#a3205c}
button.pinbtn.on{filter:none;background:#a3205c;border-color:#a3205c;color:#fff}
tr.pinned td{background:#fff7e0}

/* Bảng đơn gửi đi: dùng hết bề ngang, cột chia tỷ lệ, chữ tự xuống dòng để thấy đủ thông tin */
.content:has(.caretable){max-width:none;padding-left:16px;padding-right:16px}
.caretable{padding-left:8px;padding-right:8px}
.caretable table{table-layout:fixed;width:100%;min-width:940px;font-size:12.5px}
.caretable th,.caretable td{padding:7px 5px;vertical-align:top;white-space:normal !important;overflow-wrap:anywhere;min-width:0 !important}
.caretable th{font-size:11px}
.caretable th:nth-child(1){width:14%}.caretable th:nth-child(2){width:17%}.caretable th:nth-child(3){width:10.5%}.caretable th:nth-child(4){width:9%}.caretable th:nth-child(5){width:9%}
.caretable th:nth-child(6){width:18%}.caretable th:nth-child(7){width:4.5%}.caretable th:nth-child(8){width:7%}.caretable th:nth-child(9){width:8%}.caretable th:nth-child(10){width:6%}
.caretable .pill{white-space:normal}
.caretable .steps span,.caretable .contact{overflow-wrap:normal}
.caretable td:nth-child(5) .editcell{overflow-wrap:normal;font-size:12px}
.caretable td.track b{display:block;overflow-wrap:normal;font-size:12px}
button.copybtn{margin:4px 0 0;min-height:26px;padding:2px 8px;border-radius:7px;border:1px solid #a3205c;background:#fff;color:#a3205c;box-shadow:none;font:inherit;font-size:11.5px;font-weight:700;cursor:pointer;white-space:nowrap}
button.copybtn.done{background:#1d7a46;border-color:#1d7a46;color:#fff}
@media (max-width:760px){.content:has(.caretable){padding-left:8px;padding-right:8px}}
.steps.office{flex-direction:column;align-items:stretch}
button.appoint.officeinfo{background:#e8f1ff;border-color:#8db4e8;color:#17407a;line-height:1.6;margin:0}
.steps.office .copybtn{white-space:normal}

/* Chọn địa chỉ kho đã lưu */
.offices{margin:8px 0}
.officelist{display:grid;gap:6px;max-height:210px;overflow-y:auto;margin:6px 0}
.officelist>div{display:flex;gap:6px}
.officelist .pickoffice{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;white-space:normal;min-height:44px;margin:0;font-weight:600}
.officelist .pickoffice small{font-weight:400;color:var(--muted)}
.officelist .pickoffice.on{background:var(--tint);border-color:#a3205c;color:#a3205c}
.officelist .dropoffice{min-width:38px;margin:0;color:var(--muted)}
button.newoffice{margin-top:4px;border-color:#a3205c;color:#a3205c;font-weight:700}
.officefind{width:100%;margin:6px 0}
.officelist>div[hidden]{display:none}
.officeactions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.officeactions button{min-height:44px;margin:0}
.wardother{margin-top:6px}.wardother[hidden]{display:none}
tr.justsaved td{animation:justsaved 3.5s ease-out}
@keyframes justsaved{0%,40%{background:#ffe08a}100%{background:transparent}}

/* Vận đơn Sapo: bảng giống Sapo */
.content:has(.sapoview){max-width:none;padding-left:16px;padding-right:16px}
.sapoview{padding:0 0 12px}
.sp-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid #e3e6ea;padding:0 10px}
.sp-tabs a{padding:12px 12px 10px;color:#5b6573;font-weight:600;border-bottom:3px solid transparent}
.sp-tabs a.on{color:#0d6efd;border-bottom-color:#0d6efd}
.sp-tabs small{margin-left:6px;font-weight:400;opacity:.8}
.sp-filters{display:flex;flex-wrap:wrap;gap:8px;padding:12px 14px}
.sp-filters input{flex:1;min-width:240px}.sp-filters select{width:auto;max-width:240px}
.sp-scroll{overflow-x:auto}
.sapoview table{width:100%;border-collapse:collapse;font-size:13px;min-width:1250px}
.sapoview th{background:#f4f6f8;text-align:left;padding:10px;white-space:nowrap;color:#212b35;text-transform:none;font-size:12.5px}
.sapoview td{padding:9px 10px;border-bottom:1px solid #eef0f2;vertical-align:top}
.sapoview td.blue{color:#0d6efd;font-weight:600}.sapoview td.num{text-align:right;white-space:nowrap}.sapoview td.sp-name{min-width:180px;max-width:320px}
.sapoview th:first-child,.sapoview td:first-child{position:sticky;left:0;z-index:1}.sapoview td:first-child{background:#fff}
.sp-status{display:inline-block;border-radius:99px;border:1px solid;padding:2px 10px;font-size:12px;white-space:nowrap}
.sp-status.wait{color:#b76e00;background:#fff7e6;border-color:#ffd591}.sp-status.go{color:#0f8a5f;background:#e9fbf3;border-color:#a7e9cd}.sp-status.idle{color:#5b6573;background:#f1f2f4;border-color:#d7dbe0}.sp-status.ok{color:#0b6e2e;background:#e6f6ea;border-color:#9fd8ae}.sp-status.bad{color:#c92a2a;background:#fff0f0;border-color:#ffc2c2}
.sp-tel{white-space:nowrap}
button.sp-copy{min-height:22px;padding:0 6px;margin:0;border:1px solid #cfd6dd;background:#fff;box-shadow:none;border-radius:6px;color:#0d6efd;cursor:pointer;font-size:12px}
.sapoview .row{padding:0 14px}
.sp-info{padding:0 14px 10px;font-size:13px;color:#5b6573}.sp-info a{color:#0d6efd;font-weight:600}
.sapoview .sp-addr{color:#5b6573;font-size:12px;line-height:1.4}
.sp-from,.sp-hidden{display:inline-block;margin-top:3px;font-size:11px;font-weight:700;border-radius:6px;padding:1px 6px}
.sp-from{background:#e6f6ea;color:#0b6e2e}.sp-hidden{background:#fff7e6;color:#b76e00}
.sapoview .sp-method{margin-top:3px;font-size:11.5px;font-weight:400;color:#5b6573}
.sapoview table{min-width:1100px}
.sapoview .sp-method.carrier{color:#212b35;font-weight:700}
.sapoview table{min-width:1560px}
.sapoview td.statuscol{width:170px;min-width:170px}.sapoview td.sp-note{width:250px;min-width:250px}
.sapoview th:first-child,.sapoview td:first-child{position:static}
.sapoview tr.pinned td{background:#fff7e0}
.sapoview td.sp-ship{min-width:190px}
.shipwatch{margin-top:6px;display:grid;gap:4px;justify-items:start;font-size:12px}
.sw-phone{font-size:14px;font-weight:700;white-space:nowrap}.sw-phone a{color:#0b6e2e}
.sw-links{display:flex;flex-wrap:wrap;gap:4px}.sw-links .contact{font-size:11px;padding:2px 6px}
.sw-shop{border:0;background:none;color:#8a93a0;font-size:11px;text-decoration:underline;padding:0;cursor:pointer}
.sw-none{color:#b76e00;font-weight:700}.sw-day,.sw-at,.sw-closed{color:#5b6573}
.sw-warn{background:#fde8e8;color:#b42318;border:1px solid #f3b4ae;border-radius:8px;padding:4px 8px;font-weight:800}.sw-warn small{display:block;font-weight:600}
.sw-ask{border:1px solid #b42318;background:#fff;color:#b42318;border-radius:8px;padding:3px 8px;font-size:11px;font-weight:700;cursor:pointer}
.sw-done{color:#0b6e2e;font-weight:700}
.sw-history{list-style:none;margin:2px 0 0;padding:0 0 0 8px;border-left:2px solid #d9dee5;display:grid;gap:3px;font-size:11.5px;max-width:230px}
.sw-history time{color:#8a93a0;margin-right:3px}.sw-history li.fail{color:#b42318;font-weight:700}
.sw-urge{background:#fff1d6;color:#9a5b00;border:1px solid #f0c36d;border-radius:8px;padding:4px 8px;font-weight:800}.sw-urge small{display:block;font-weight:600}
.sp-track{color:inherit;text-decoration:underline}
.sp-track{color:inherit;text-decoration:underline}
.sp-video{margin-top:6px;font-size:12px;font-weight:700;white-space:nowrap}.sp-video.yes{color:#0b6e2e}.sp-video.yes a{display:block;font-weight:600;color:#0d6efd}
.sp-video.no{color:#b42318}.sp-video.old{color:#8a93a0;font-weight:600}
dialog button.clear{min-width:140px;min-height:46px;font-size:15px;font-weight:600;color:var(--muted);margin:0 0 0 10px}
.sapoview td.sp-note{width:270px;min-width:270px}
.sapoview .sp-mynote{margin-top:8px;border-top:1px dashed #d9dee5;padding-top:6px}
.sapoview table{min-width:1440px}
.sw-journey{border:1px solid #cfd6dd;background:#fff;color:#0d6efd;border-radius:8px;padding:3px 8px;font-size:11.5px;font-weight:700;cursor:pointer;box-shadow:none;min-height:26px}
.sw-history.full{max-width:none;font-size:14px;gap:8px;margin:10px 0}
.sapoview tr.overdue td{background:#fff5f4}
.sapoview tr.overdue td:first-child{box-shadow:inset 4px 0 0 #d92d20}
.sw-receive{font-size:11.5px;font-weight:700;color:#0d6efd}
.sw-check{font-size:11.5px;display:flex;flex-wrap:wrap;gap:3px 8px;align-items:center;max-width:250px}.sw-check small{width:100%;color:#5b6573}
.sw-check .has{color:#0b6e2e;font-weight:700}.sw-check .none{color:#b42318}.sw-check a{font-weight:700;color:#0d6efd}
.cod-cut{display:flex;flex-direction:column;align-items:flex-end;gap:1px}.cod-cut s{color:#7a8290}.cod-cut b{font-size:14px}
.cod-cut span{color:#b42318;font-weight:700;white-space:nowrap}.cod-cut small{font-size:10.5px;color:#5b6573;white-space:nowrap}
.sp-tabs .sp-staffmenu{width:auto;max-width:230px;align-self:center;font-weight:700;margin-left:6px}.sp-tabs .sp-staffmenu.on{color:#0d6efd;border-color:#0d6efd}
.credit{display:flex;flex-direction:column;gap:4px;align-items:flex-start;margin-top:4px;max-width:210px}.credit small.wait{color:#8a6100}.credit small.done{color:#0b6e2e}.credit .credit-btn{font-size:11px;padding:2px 8px}
.ds{display:flex;flex-direction:column;gap:2px;min-width:150px}.ds .ok{color:#0b6e2e;white-space:nowrap}.ds small,.ds-none{color:#5b6573;font-size:11px}.ds .bad{color:#b42318;font-weight:700;font-size:12px}
/* Đổi bảo hành, đổi kích thước, trả hàng TikTok */
dialog.exdlg{width:min(620px,96vw);max-width:96vw}
.exdlg [data-edit][hidden],.exdlg [data-check][hidden],.exdlg [data-order][hidden],.exdlg [data-goods][hidden],.exdlg .field[hidden],.exdlg [data-orders][hidden],.exdlg [data-review][hidden]{display:none}
.exkinds{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 10px}
.exkinds label{display:flex;gap:8px;align-items:flex-start;border:1px solid #d9c2ce;border-radius:10px;padding:10px;cursor:pointer}
.exkinds label:has(input:checked){border-color:#a3205c;background:#fdf0f6}
.exkinds input{width:auto;min-height:0;margin:3px 0 0}.exkinds span{display:flex;flex-direction:column}.exkinds small{color:#6b5b64}
.exlist{display:flex;flex-direction:column;gap:6px;max-height:34dvh;overflow:auto;margin:0 0 8px}
.exdlg button.expick{display:block;width:100%;text-align:left;background:#fff;color:inherit;border:1px solid #d7dbe0;box-shadow:none;font-weight:400;height:auto;white-space:normal;flex:none}
.exdlg button.expick:hover{border-color:#a3205c}
.expicked,.exitem{border:1px solid #a3205c;border-radius:10px;padding:10px;margin:0 0 8px;background:#fdf0f6}
.exitem label{display:flex;align-items:center;gap:6px;margin:0}.exitem input{width:90px}
.exwarn{color:#a35200;font-weight:700}
a.casetag{display:inline-block;margin:3px 0 0;border-radius:99px;padding:1px 9px;font-size:11.5px;font-weight:700;text-decoration:none;white-space:nowrap;background:#e7f0ff;color:#0b4fb3;border:1px solid #bcd4ff}
a.casetag.doisize{background:#fff3e0;color:#8a4b00;border-color:#ffd8a0}a.casetag.tiktok{background:#ececf0;color:#16161c;border-color:#cfcfd8}
@media (max-width:640px){.exkinds{grid-template-columns:1fr}}
.tabs.caretabs{flex-wrap:wrap;overflow:visible;row-gap:0}
.exalarm{display:inline-block;min-width:20px;border-radius:99px;background:#c92a2a;color:#fff;font-size:11.5px;padding:0 6px;text-align:center}
.ttnews{margin:0 14px 10px;border:1px solid #e3e6ea;border-radius:12px;padding:10px 12px;background:#fff}
.ttnews.on{border:2px solid #e8590c;background:#fff9f2}
.ttnews h3{margin:0 0 2px;font-size:15px}.ttnews p{margin:2px 0}
.ttnews ul{list-style:none;margin:8px 0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:340px;overflow:auto}
.ttnews li{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;border-radius:8px;padding:8px 10px;background:#fff3bf;border-left:5px solid #f59f00}
.ttnews li.urgent{background:#ffe3e3;border-left-color:#c92a2a}.ttnews li.late{background:#f1f3f5;border-left-color:#868e96}
.ttleft{display:inline-block;background:#c92a2a;color:#fff;border-radius:99px;padding:0 8px;font-size:12px;font-weight:700;white-space:nowrap}
.ttnews li.late .ttleft{background:#868e96}.ttacts{display:flex;gap:6px;align-items:center}
a.casetag.ttnew{background:#ffe066;color:#7a2e00;border-color:#f08c00;white-space:normal;border-radius:8px}
tr:has(a.casetag.ttnew)>td{background:#fff9db!important}
.ttnews li.money{background:#fff0e6;border-left-color:#d9480f}.ttnews li.money b{color:#a61e4d}
.sp-order{font-weight:600;color:#0d6efd;font-size:12.5px;margin:2px 0;white-space:nowrap}
.wh-neg{color:#c92a2a;font-weight:700}td.wh-real{background:#fdf0f6}
/* Đuổi target: bảng gọn đầu trang Chấm công */
.tg-head{margin:0 0 8px;align-items:center}.tg-head h2{margin:0}
.tg td{padding-top:7px;padding-bottom:7px;vertical-align:middle}
.tg .tg-done{min-width:150px}.tg .bar{margin:4px 0 2px;height:6px}
