/* Phần chủ tiệm */
.qrows { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.qrow { width: 100%; min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--bg); }
.qrow .t { flex: 1; min-width: 0; }
.qrow b { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.qrow small { display: block; font-size: 12px; color: var(--mut); }
.qic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--peach); color: var(--brand); }
.qrow .chev { flex: none; color: #A5682D; }
.qstack { display: flex; flex-direction: column; gap: 10px; }

/* Doanh thu */
.qmoney { padding: 22px; display: flex; flex-direction: column; gap: 4px; border-radius: 26px; background: var(--hero); color: #fff; }
.qmoney small { font-size: 13px; font-weight: 700; color: var(--cream); }
.qmoney b { font-size: 38px; font-weight: 900; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.qmoney b.neg { color: #FFD5CC; }
.qmoney p { font-size: 13px; font-weight: 700; color: var(--cream); }
.qstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qstats > div { padding: 14px 16px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); min-width: 0; }
.qstats small { display: block; font-size: 12px; color: var(--mut); }
.qstats b { display: block; font-size: 17px; font-weight: 900; color: var(--deep); overflow-wrap: anywhere; }
.qstats b.neg { color: var(--red); }
.qbars { display: flex; flex-direction: column; gap: 8px; }
.qbar { display: grid; grid-template-columns: 50px 1fr 96px; align-items: center; gap: 8px; font-size: 12px; }
.qbar i { display: block; height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; }
.qbar u { display: block; height: 100%; border-radius: 7px; background: #A5682D; text-decoration: none; }
.qbar u.neg { background: var(--red); }
.qbar b { text-align: right; font-weight: 800; white-space: nowrap; }
.qbar b.neg { color: var(--red); }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.btn.qsmall { width: auto; min-height: 48px; padding: 8px 18px; font-size: 13px; flex: none; }
.qpay { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qpay:last-child { border-bottom: 0; }
.qpay .t { flex: 1; min-width: 0; }
.qpay .t b { display: block; font-weight: 800; }
.qpay small { display: block; font-size: 12px; color: var(--mut); overflow-wrap: anywhere; }
.qpay > b { flex: none; font-weight: 900; white-space: nowrap; }
.qpay > b.neg { color: var(--red); }
.qpay:hover .t b { text-decoration: underline; text-underline-offset: 3px; }

/* Biểu mẫu */
.qinline { display: flex; gap: 10px; }
.qinline .inp { flex: 1; min-width: 0; }
.qinline .btn { width: auto; flex: none; min-height: 56px; padding: 8px 24px; }
.box .row .field { min-width: 0; }
.box .row .inp { min-width: 0; }
.qitems { display: flex; flex-direction: column; }
.qitem { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.qitem:last-child { border-bottom: 0; }
.qitem .t { flex: 1; min-width: 0; font-weight: 700; line-height: 1.25; }
.qitem .inp { width: 112px; flex: none; min-height: 50px; padding: 8px 10px; text-align: right; font-size: 14px; }
.qdel { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--peach); color: var(--brand); }
.qdel:hover { background: var(--cream); }
.qdel[disabled] { opacity: .4; cursor: not-allowed; }

/* Đại lý, sự cố */
.qagent { display: flex; align-items: center; gap: 14px; }
.qagent-qr { width: 104px; height: 104px; flex: none; }
.qagent-qr svg { display: block; width: 100%; height: 100%; }
.qagent .t { flex: 1; min-width: 0; }
.qagent b { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.qagent small { display: block; font-size: 12px; color: var(--mut); overflow-wrap: anywhere; }
.qissue { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.qissue b { font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.qissue small { flex: none; max-width: 50%; text-align: right; font-size: 12px; font-weight: 800; color: var(--brand); }
.qissue small.qred { color: var(--red); }
.box p { overflow-wrap: anywhere; }
.qlink { font-weight: 800; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 900px) {
  .qstats { grid-template-columns: repeat(4, 1fr); }
  .qmoney b { font-size: 44.5px; }
  .qbar { grid-template-columns: 60px 1fr 110px; }
}

/* Nút bật tắt nhỏ trong danh sách giá */
.msw { position: relative; width: 50px; height: 30px; flex: none; border-radius: 15px; background: #B9A68F; transition: background .15s; }
.msw span { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.msw.on { background: var(--deep); }
.msw.on span { left: 23px; }
.msw:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.qitem .t small { display: block; font-size: 12px; font-weight: 600; color: var(--mut); }
@media (max-width: 420px) { .qitem .inp { width: 96px; } }
.geo-where { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--peach); color: var(--brand); }
.geo-where b { display: block; color: var(--deep); font-weight: 800; }
.geo-where b.late { color: var(--red); }
.geo-where small { display: block; font-size: 12px; color: var(--mut); }
.qrow small.warn { color: #A15C07; font-weight: 800; }

@media (max-width: 420px) { .qitem .inp { width: 84px; padding-inline: 8px; } .qitem .t { font-size: 13.5px; } }

.qic.bad { background: var(--red-soft); color: var(--red); }
.qrow .qic { font-weight: 900; font-size: 14px; }

/* Khung giá theo ký */
.qtier { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--bg); }
.qt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qt-h b { font-size: 14px; font-weight: 900; color: var(--deep); }
.qt-add { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px; border-radius: 14px; background: var(--card); color: var(--brand); font-size: 13px; font-weight: 800; box-shadow: inset 0 0 0 1.5px #E3C9AC; }
.qt-add svg.i { width: 16px; height: 16px; }
.qt-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k x" "m m" "a a"; gap: 8px; padding: 10px; border-radius: 14px; background: var(--card); }
.qt-k { grid-area: k; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--deep); min-height: 46px; }
.qt-kg { width: 76px; min-height: 46px; padding: 6px 10px; text-align: center; font-size: 15px; }
.qt-x { grid-area: x; }
.qt-x.qdel { width: 42px; height: 42px; border-radius: 12px; }
.qt-seg, .qt-mode { grid-area: m; }
.qt-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.qt-seg button { display: grid; place-items: center; min-height: 40px; padding: 0 8px; border-radius: 11px; font-size: 13px; font-weight: 800; color: var(--mut); text-align: center; }
.qt-seg button.on { background: var(--deep); color: #fff; }
.qt-mode { font-size: 12.5px; font-weight: 700; color: var(--mut); }
.qt-amt { grid-area: a; display: flex; align-items: center; gap: 8px; }
.qt-amt .inp { min-height: 50px; text-align: right; }
.qt-amt small { flex: none; width: 64px; font-size: 12.5px; font-weight: 700; color: var(--mut); }
@media (min-width: 700px) {
  .qt-row { grid-template-columns: 170px 190px 1fr 42px; grid-template-areas: "k m a x"; align-items: center; }
}

/* Chọn vai trò nhân viên */
.rolepick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rolepick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 76px; padding: 12px 14px; border-radius: 16px; background: var(--bg); text-align: left; box-shadow: inset 0 0 0 2px var(--line); }
.rolepick button b { font-size: 15px; font-weight: 900; color: var(--deep); }
.rolepick button small { font-size: 12px; font-weight: 700; color: var(--mut); line-height: 1.3; }
.rolepick button.on { background: var(--peach); box-shadow: inset 0 0 0 2px var(--brand); }

/* Doanh thu: 5 nút khoảng thời gian luôn nằm 1 hàng */
.rng { display: flex; gap: 4px; padding: 4px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); overflow-x: auto; scrollbar-width: none; }
.rng::-webkit-scrollbar { display: none; }
.rng .chip { flex: 1 0 auto; display: grid; place-items: center; text-align: center; min-height: 42px; padding: 0 8px; border-radius: 14px; box-shadow: none; background: transparent; font-size: 13px; white-space: nowrap; }
.rng .chip:hover { box-shadow: none; background: var(--bg); }
.rng .chip.on, .rng .chip.on:hover { background: var(--deep); color: #fff; }
@media (max-width: 420px) { .rng .chip { padding: 0 5px; font-size: 12px; } }
@media (max-width: 380px) { .rng { gap: 2px; padding: 3px; } .rng .chip { padding: 0 4px; font-size: 11.5px; } }

/* ---------- Sắp xếp lại Quản lý tiệm (anh 07/11) ---------- */
/* Khung trượt thêm/sửa */
.qsheet { display: flex; flex-direction: column; max-height: 88dvh; padding-bottom: 0; overflow: hidden; }
.qs-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 6px; }
.qs-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 900; color: var(--deep); overflow-wrap: anywhere; }
.qs-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); color: var(--mut); }
.qs-x svg.i { width: 20px; height: 20px; }
.qs-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; margin: 0 -16px; padding: 4px 16px 12px; }
.qs-foot { margin: 0 -16px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -4px 14px rgba(126, 74, 30, .08); }
.qsws { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 700px) { .lsheet.qsheet { bottom: 50%; transform: translateY(50%); border-radius: 26px; max-height: 84vh; width: 480px; } .qsheet .grab { display: none; } .qs-foot { padding-bottom: 16px; } }
/* Khung gập */
.qfold { padding: 0; overflow: hidden; }
.qf-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; color: var(--ink); }
.qf-h > span { flex: 1; min-width: 0; }
.qf-h b { display: block; font-size: 15px; font-weight: 900; color: var(--deep); }
.qf-h small { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--mut); }
.qf-h i { flex: none; color: var(--brand); transition: transform .2s; font-style: normal; }
.qf-h i svg.i { width: 20px; height: 20px; }
.qfold.open .qf-h i { transform: rotate(90deg); }
.qf-b { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.qsub { margin: 4px 0 0; font-size: 15px; font-weight: 900; color: var(--deep); }
.qdiv { height: 1px; background: var(--line); margin: 4px 0; }
.qinfo-btn { margin-top: 10px; width: 100%; }
/* Mã giảm giá */
.qpromo2 { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.qpromo2:last-child { border-bottom: 0; }
.qp-t { flex: 1; min-width: 0; text-align: left; color: var(--ink); }
.qp-t b { display: block; font-size: 15.5px; font-weight: 900; letter-spacing: .03em; color: var(--deep); }
.qp-t small { display: block; font-size: 13px; font-weight: 700; color: var(--mut); line-height: 1.35; }
.qpromo2.off .qp-t b { color: var(--mut); text-decoration: line-through; }
.qconfirm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: #FDECEC; }
.qconfirm b { color: var(--red); font-size: 14.5px; }
.qconfirm small { font-size: 13px; font-weight: 700; color: var(--ink); }
.qdelbtn { width: 100%; }
/* Đại lý */
.qagbox.off { opacity: .72; }
.qoff { font-style: normal; font-size: 12px; font-weight: 800; color: var(--red); }
/* Bảng giá: thẻ dịch vụ gọn */
.qsvc { display: flex; flex-direction: column; gap: 12px; }
.qsvc.off .qsvc-s { opacity: .55; }
.qsvc-h { display: flex; align-items: center; gap: 12px; }
.qsvc-h .t { flex: 1; min-width: 0; }
.qsvc-h b { display: block; font-size: 16px; font-weight: 900; color: var(--deep); }
.qsvc-h small { display: block; font-size: 13px; font-weight: 700; color: var(--mut); }
.qsvc-s { display: grid; gap: 8px; }
.qsvc-s > div { padding: 10px 12px; border-radius: 14px; background: var(--peach); }
.qsvc-s small { display: block; font-size: 12.5px; font-weight: 800; color: var(--brand); }
.qsvc-s b { display: block; font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.qaddrow { display: flex; flex-direction: column; gap: 8px; }
.mini.on { background: var(--brand); color: #fff; box-shadow: none; }
@media (min-width: 700px) {
  .qsvc-s { grid-template-columns: 1fr 1fr; }
  .qt-amt .inp { max-width: 180px; }
  .qt-amt { justify-content: flex-end; }
}

.qp-t .qtags { margin: 2px 0 0; padding: 0; }
.qtagl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qtagl i { font-style: normal; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 800; color: var(--mut); white-space: nowrap; }
