[hidden] { display: none !important; }
:root {
  --bg: #f7f3ec;
  --card: #ffffff;
  --ink: #2a2118;
  --muted: #7a6d5f;
  --line: #e6dccd;
  --gold: #7a4f12;
  --gold-2: #a8741f;
  --gold-soft: #f6ecd9;
  --red: #b3261e;
  --green: #2f7a4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 4px 14px rgba(60, 40, 10, .06);
  font-size: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--gold); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 2rem 1rem; }
.small { font-size: .88rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 1rem 16px 6rem; }

/* ---------- thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) .6rem max(16px, env(safe-area-inset-left));
  background: linear-gradient(90deg, #5f3c0c, #7a4f12 60%, #8d5d18);
  color: #f6e7c1;
}
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: #f6e7c1; color: #7a4f12; font-size: 1.4rem; font-family: serif;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 1.05rem; }
.brand-text small { opacity: .8; font-size: .78rem; }
.nav { display: flex; gap: .25rem; margin-left: 1rem; }
.nav a {
  color: #f6e7c1; text-decoration: none; padding: .55rem .9rem; border-radius: 10px; font-weight: 600;
}
.nav a.active, .nav a:hover { background: rgba(255, 255, 255, .14); }
.me { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.me button { background: rgba(255,255,255,.14); color: #f6e7c1; border: 0; min-height: 40px; padding: 0 .8rem; border-radius: 10px; font: inherit; cursor: pointer; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: none; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; text-align: center; padding: .5rem 0 .55rem; text-decoration: none; color: var(--muted);
  font-size: .8rem; font-weight: 600;
}
.bottomnav a .ico { display: block; font-size: 1.35rem; line-height: 1.2; }
.bottomnav a.active { color: var(--gold); }

@media (max-width: 760px) {
  .nav { display: none; }
  .bottomnav:not([hidden]) { display: flex; }
  .me .who { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 1.15rem; }
  h1 { font-size: 1.35rem; }
}

/* ---------- thẻ, lưới ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-tiers { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: .6rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1rem; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: 0 1.1rem; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-2); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-primary:hover { background: #64400e; }
.btn-zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.btn-call { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { color: var(--red); border-color: #efc7c4; }
.btn-sm { min-height: 40px; padding: 0 .8rem; font-size: .9rem; }
.btn-icon { min-width: 48px; padding: 0; }
.btn-block { width: 100%; }

/* ---------- form ---------- */
label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: .6rem .8rem; border: 1px solid #d7cab6; border-radius: 12px;
  font: inherit; color: var(--ink); background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(168, 116, 31, .25); border-color: var(--gold-2); }
.form-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-weight: 700; color: var(--gold); margin: 1.2rem 0 .3rem; grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { padding-left: 2.6rem; }
.search::before { content: "🔍"; position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .6; }

/* ---------- hạng, sao ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.stars { color: #d39b1c; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #ddd2c0; }
.stars-input button {
  background: none; border: 0; font-size: 1.9rem; line-height: 1; padding: .1rem .15rem; cursor: pointer; color: #ddd2c0;
  min-width: 44px; min-height: 44px;
}
.stars-input button.on { color: #d39b1c; }
.tier-card { border-left: 6px solid var(--c); padding: .8rem 1rem; }
.tier-card .n { font-size: 1.6rem; font-weight: 800; }
.stat { font-size: 1.6rem; font-weight: 800; }

/* ---------- danh sách khách ---------- */
.cust-list { display: grid; gap: .7rem; }
.cust {
  display: grid; grid-template-columns: 52px 1fr auto; gap: .8rem; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.cust:hover { border-color: var(--gold-2); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: 1.15rem;
}
.cust .name { font-weight: 700; font-size: 1.05rem; }
.cust .sub { color: var(--muted); font-size: .88rem; }
.cust .right { text-align: right; }
.cust .money { font-weight: 700; }
@media (max-width: 560px) {
  .cust { grid-template-columns: 46px 1fr; }
  .avatar { width: 46px; height: 46px; }
  .cust .right { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-align: left; border-top: 1px dashed var(--line); padding-top: .5rem; }
}

/* ---------- chi tiết khách ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.profile-head .avatar { width: 72px; height: 72px; font-size: 1.6rem; }
.profile-head .actions { grid-column: 1 / -1; display: flex; gap: .6rem; flex-wrap: wrap; }
.profile-head .actions .btn { flex: 1 1 140px; }
@media (min-width: 900px) {
  .profile-head { grid-template-columns: auto 1fr auto; }
  .profile-head .actions { grid-column: auto; flex-wrap: nowrap; }
  .profile-head .actions .btn { flex: 0 0 auto; }
}
.kpis { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .4rem; }
.kpis div { font-size: .88rem; color: var(--muted); }
.kpis b { display: block; font-size: 1.1rem; color: var(--ink); }

.tabs {
  display: flex; gap: .3rem; overflow-x: auto; margin: 1rem 0; padding-bottom: 2px;
  position: sticky; top: 62px; z-index: 5; background: var(--bg);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; min-height: 46px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.tabs button.private { border-style: dashed; }
.tabs button.private.active { background: #3b2a16; border-color: #3b2a16; }

dl.info { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: .45rem 1rem; margin: 0; }
dl.info dt { color: var(--muted); font-size: .92rem; }
dl.info dd { margin: 0; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 480px) { dl.info { grid-template-columns: 1fr; gap: 0; } dl.info dd { margin-bottom: .55rem; } }

.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start;
  padding: .8rem 0; border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--gold-soft); display: grid; place-items: center; font-size: 1.6rem; }
.item .title { font-weight: 700; }
.item .meta { color: var(--muted); font-size: .88rem; }
.item .tools { display: flex; gap: .3rem; }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--gold-soft); color: var(--gold); }
.pill.grey { background: #eee8df; color: #6b6156; }
.pill.red { background: #fbe4e2; color: var(--red); }
.pill.green { background: #e2f3e8; color: var(--green); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--gold-2); }
.timeline .when { font-size: .85rem; color: var(--muted); }

.task { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task input[type=checkbox] { width: 28px; height: 28px; min-height: 0; flex: 0 0 auto; accent-color: var(--gold); }
.task .t { flex: 1; }
.task.done .t { text-decoration: line-through; color: var(--muted); }

.private-box { background: #2f2316; color: #f6e7c1; border-color: #2f2316; }
.private-box textarea { background: #3b2c1b; color: #fff6df; border-color: #5b4529; min-height: 260px; }
.private-box .hint { color: #cdb894; }

.event { display: flex; gap: .8rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.event .ico { font-size: 1.5rem; width: 2.2rem; text-align: center; }
.event .info { flex: 1; min-width: 0; }
.event .days { font-weight: 800; color: var(--gold); white-space: nowrap; }
.event .days.today { color: var(--red); }
.empty { color: var(--muted); padding: .6rem 0; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 8, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 760px; max-height: 92vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 1.1rem 16px calc(1.1rem + env(safe-area-inset-bottom));
}
@media (min-width: 760px) { .modal-back { align-items: center; } .modal { border-radius: 18px; padding: 1.4rem; } }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.1rem; position: sticky; bottom: -1.2rem; background: #fff; padding: .6rem 0; }
.modal-actions .btn { flex: 1 1 auto; max-width: 240px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #2a2118; color: #fff; padding: .75rem 1.2rem; border-radius: 12px; z-index: 60; transition: .2s; pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- đăng nhập ---------- */
.auth-wrap { min-height: 90vh; display: grid; place-items: center; }
.auth { width: 100%; max-width: 420px; }
.auth .brand-mark { width: 72px; height: 72px; font-size: 2.2rem; margin: 0 auto 1rem; background: var(--gold); color: #f6e7c1; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .4rem; border-top: 1px solid var(--line); }
.table th { color: var(--muted); font-size: .85rem; font-weight: 600; }

@media (max-width: 760px) {
  .page-head .btn-primary:not(#print):not(#new-order) { display: none; }
  .grid-tiers { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .tier-card { padding: .55rem .6rem; border-left-width: 5px; }
  .tier-card .n { font-size: 1.3rem; }
  .tier-card .small { font-size: .78rem; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .profile-head .avatar { width: 56px; height: 56px; font-size: 1.25rem; align-self: start; }
}

/* ---------- chăm đệ tử ---------- */
.red { color: var(--red); }
.home-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
.fast-card { border-left: 6px solid #6a9a3a; }
.fast-card.is-soon { background: #f4f9ec; border-color: #cfe3b5; border-left-color: #4f8a1f; }
.fast-ico { font-size: 2rem; }
.fast-title { font-weight: 800; font-size: 1.15rem; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .6rem; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; min-height: 44px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-size: .92rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--gold-soft); border-color: var(--gold-2); color: var(--gold); }
.seg .count { display: inline-block; min-width: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold); color: #fff; font-size: .78rem; text-align: center; margin-left: .2rem; }
.care-list { display: grid; }
.care-row { display: grid; grid-template-columns: 46px 1fr auto; gap: .7rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.care-row:first-child { border-top: 0; }
.care-row .avatar { width: 46px; height: 46px; font-size: 1rem; text-decoration: none; }
.care-row .who { color: inherit; text-decoration: none; min-width: 0; }
.care-row .sub { color: var(--muted); font-size: .86rem; }
.care-row .acts { display: flex; gap: .4rem; }
.btn-done { border-color: var(--gold-2); color: var(--gold); }
.btn-done.is-done { background: #e2f3e8; border-color: #bfe0ca; color: var(--green); }
.row-done .who { opacity: .55; }
@media (max-width: 560px) {
  .care-row { grid-template-columns: 42px 1fr; }
  .care-row .avatar { width: 42px; height: 42px; }
  .care-row .acts { grid-column: 2; }
  .care-row .acts .btn { flex: 1; }
}
.cycle { display: flex; gap: .7rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); }
.cycle:first-of-type { border-top: 0; }
.cycle .ico { font-size: 1.4rem; width: 2rem; text-align: center; }
.cycle .info { flex: 1; }
.cycle.due .info b { color: var(--red); }
.num-head { display: flex; gap: .9rem; align-items: center; margin-bottom: .5rem; }
.num-big { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, #7a4f12, #b9852c); color: #fff6df; }
.num-card p { margin: .4rem 0; }
.num-care { background: var(--gold-soft); border-radius: 10px; padding: .55rem .7rem; }
.table-wrap { overflow-x: auto; }
.le-table td { vertical-align: top; }

@media print {
  .topbar, .bottomnav, .no-print, #toast { display: none !important; }
  body { background: #fff; font-size: 13pt; }
  .container { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .le-table a { color: inherit; text-decoration: none; }
}
@media (max-width: 600px) {
  .le-table tr:first-child { display: none; }
  .le-table tr { display: grid; grid-template-columns: 2rem 1fr; border-top: 1px solid var(--line); padding: .5rem 0; }
  .le-table td { border: 0; padding: .1rem .2rem; }
  .le-table td:nth-child(n+3) { grid-column: 2; }
  .le-table td:nth-child(3), .le-table td:nth-child(4) { color: var(--muted); }
}

/* ---------- lễ ---------- */
.le-row { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.le-row:first-of-type { border-top: 0; }
.le-row.is-main { background: var(--gold-soft); border-radius: 12px; padding: .6rem; margin: .2rem 0; border-top: 0; }
.le-date { flex: 0 0 64px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .3rem 0; line-height: 1.2; }
.le-date b { display: block; font-size: 1.05rem; color: var(--gold); }
.le-date span { font-size: .75rem; color: var(--muted); }
.le-info { flex: 1; min-width: 0; }
.le-count { text-align: center; line-height: 1.1; }
.le-count b { display: block; font-size: 1.2rem; }
.le-count span { font-size: .72rem; color: var(--muted); }
.le-month { margin-top: 1rem; }
.le-month h3 { color: var(--gold); }
.le-card { border-left: 6px solid #c0841a; }
.le-mota { background: #fffaf0; }
.chk { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; white-space: nowrap; }
.chk input { width: 24px; height: 24px; min-height: 0; accent-color: var(--green); }
.print-only { display: none; }
@media print { .print-only { display: block; } }
@media (max-width: 560px) { .le-row .btn { display: none; } }

/* ---------- tử vi ---------- */
.warn-box { background: #fbe9e7; border: 1px solid #f1c3bd; border-radius: 12px; padding: .7rem .9rem; margin-top: .8rem; }
.warn-box ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.ok-box { background: #e2f3e8; border-radius: 12px; padding: .7rem .9rem; margin-top: .8rem; }
.advice { display: flex; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.advice:first-of-type { border-top: 0; }
.advice .ai { font-size: 1.6rem; }
.advice p { margin: .15rem 0 0; }
.seg button { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: left; padding: .4rem .85rem; }

/* ---------- vận hạn tháng ---------- */
.van-card { border-left: 6px solid #8a5bd6; }
.van-row .sub { margin-top: .15rem; }
.van-ask { color: #4b3a8a; }
.van-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.van-month { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; background: #fff; border-left: 5px solid #c9a227; }
.van-month.van-green { border-left-color: var(--green); }
.van-month.van-grey { border-left-color: #b7ab9b; }
.van-month.van-red { border-left-color: var(--red); background: #fff8f7; }
.van-month.is-now { box-shadow: 0 0 0 2px var(--gold-2); }
.van-line { font-size: .9rem; margin-top: .35rem; }

/* ===== Doanh thu ===== */
.pill.blue { background: #e3ecfb; color: #2c5aa0; }
.red { color: var(--red); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.month-nav { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; flex-wrap: wrap; }
.month-pick { position: relative; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.month-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; min-height: 0; cursor: pointer; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi .n { font-size: 1.6rem; font-weight: 800; }
.kpi .big { font-size: 2rem; font-weight: 800; color: var(--gold); line-height: 1.2; }
.kpi.main { grid-column: span 2; }
@media (max-width: 640px) { .kpi.main { grid-column: 1 / -1; } .kpi-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } .kpi:last-child { grid-column: 1 / -1; } .kpi { padding: .7rem .9rem; } .kpi .n { font-size: 1.3rem; } .mcol .mval { font-size: .6rem; } }
.mchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 220px; align-items: end; margin-top: .5rem; }
.mcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.mcol .mbar { width: 100%; max-width: 44px; background: #d9bf8c; border-radius: 4px 4px 0 0; }
.mcol:hover .mbar { background: var(--gold-2); }
.mcol.cur .mbar { background: var(--gold); }
.mcol .mval { font-size: .72rem; font-weight: 700; white-space: nowrap; min-height: 1.1em; }
.mcol .mlab { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 2px; }
.mcol.cur .mlab { color: var(--gold); font-weight: 800; }
.bars { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: .15rem .7rem; align-items: center; }
.bar-label { grid-column: 1 / -1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label a { color: inherit; }
.bar-track { height: 12px; background: #f1ebe0; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold-2); border-radius: 0 4px 4px 0; }
.bar-val { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.rev-grid { align-items: start; }
.order { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .7rem; padding: .75rem 0; border-top: 1px solid var(--line); align-items: start; }
.order:first-child { border-top: 0; }
.order .o-date { color: var(--muted); font-weight: 700; font-size: .9rem; padding-top: .1rem; }
.order .o-main a { color: inherit; text-decoration: none; }
.order .o-item { margin: .1rem 0 .25rem; }
.order .o-right { text-align: right; }
.order .o-amt { font-weight: 800; font-size: 1.05rem; margin-bottom: .3rem; white-space: nowrap; }
.order.is-void .o-amt { text-decoration: line-through; color: var(--muted); }
@media (max-width: 640px) {
  .order { grid-template-columns: 1fr auto; }
  .order .o-date { grid-column: 1 / -1; padding: 0; }
  .order .o-right { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-align: left; }
  .order .o-amt { margin: 0; }
}
.pick-cust { margin-bottom: .8rem; }
.cust-res { display: grid; gap: .3rem; margin-top: .4rem; }
.cust-opt { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; font: inherit; cursor: pointer; min-height: 48px; }
.cust-opt:hover { border-color: var(--gold-2); }
.cust-opt.new { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.picked { display: flex; align-items: center; gap: .7rem; background: var(--gold-soft); border-radius: 12px; padding: .6rem .8rem; }
.picked > div:nth-child(2) { flex: 1; }
.pick-item { margin-bottom: .8rem; padding-bottom: .8rem; border-bottom: 1px dashed var(--line); }
.item-opt { display: flex; align-items: center; gap: .6rem; }
.item-opt img, .item-opt .ph, .thumb-sm { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 44px; display: grid; place-items: center; background: var(--gold-soft); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }

/* Doanh thu: xem theo tháng / quý / năm, đọc từ Google Sheet */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; margin-top: .4rem; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; padding: .5rem 1.1rem; min-height: 40px; cursor: pointer; color: inherit; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--gold); color: #fff; }
.sheet-note { margin: .2rem 0 .8rem; padding: .55rem .8rem; border-radius: 10px; background: #f3efe6; font-size: .95rem; color: #5b4a2f; }
.sheet-note.warn { background: #fdecea; color: #8a2a1d; }
.sheet-note .linkbtn { margin-left: .4rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sale-table th, .sale-table td { white-space: nowrap; text-align: right; }
.sale-table th:first-child, .sale-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.sale-table tr.sum td { border-top: 2px solid var(--line); }
.qchart .mlab small { display: block; font-size: .72rem; opacity: .75; }
.qchart { grid-template-columns: repeat(8, 1fr); gap: 6px; } .qchart .mbar { max-width: 56px; }
.seg button { border-radius: 0; box-shadow: none; min-width: 0; }

/* ---------- kho có món khách đang tìm ---------- */
.wish-card { border-left: 5px solid #d9a21b; }
.wish-card h2 .count { font-size: .85rem; background: #d9a21b; color: #fff; border-radius: 999px; padding: .05rem .55rem; vertical-align: middle; }
.wish-card.inner { border: 1px solid #f0d48a; background: #fffaf0; border-radius: 12px; padding: .7rem .8rem; margin: .3rem 0 .8rem; }
.wm { padding: .5rem 0; border-top: 1px solid var(--line); }
.wm:first-of-type { border-top: 0; }
.wish-card.inner .wm { border-top: 0; padding-bottom: 0; }
.wm-head { margin-bottom: .3rem; }
.wm-item { display: grid; grid-template-columns: 44px 1fr auto; gap: .6rem; align-items: center; padding: .35rem 0; }
.wm-item .sub { color: var(--muted); font-size: .86rem; }
.wm-item .acts { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wm-item.row-done { opacity: .5; }
@media (max-width: 760px) {
  .wm-item { grid-template-columns: 44px 1fr; }
  .wm-item .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .wm-item .acts .btn { flex: 1 1 auto; }
}

/* ---------- cài app ---------- */
.install-card { display: flex; align-items: center; gap: .9rem; background: linear-gradient(90deg, #fffaf0, #fff); }
.install-card img { border-radius: 12px; flex: 0 0 56px; }
.install-card > div:nth-child(2) { flex: 1; }
@media (max-width: 560px) { .install-card { flex-wrap: wrap; } .install-card > .row { width: 100%; justify-content: flex-end; } }

/* ---------- ảnh lễ ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.ph-card { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.ph-img { border: 0; padding: 0; background: var(--gold-soft); cursor: zoom-in; aspect-ratio: 4 / 3; display: block; width: 100%; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-card figcaption { padding: .55rem .7rem .7rem; }
.photo-pick { position: relative; align-self: flex-start; }
.ph-prev { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.ph-prev img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; }
.ph-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .3rem .8rem; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.photo-view { display: grid; place-items: center; background: rgba(0, 0, 0, .88); padding: 12px; }
.photo-view img { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.photo-view .btn { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
@media (max-width: 560px) { .ph-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } .ph-card figcaption { padding: .45rem .5rem .55rem; font-size: .9rem; } .ph-card .btn { width: 100%; } }

/* ---------- thưởng ---------- */
.bonus-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; }
.bonus-row .row { gap: .4rem; flex-wrap: nowrap; align-items: center; flex: 1 1 200px; min-width: 0; }
.bonus-row input { min-width: 0; flex: 1 1 100px; width: 100%; }
.bonus-row .row:first-child { flex-basis: 100%; }
.bonus-row input.pct { flex: 0 0 64px; }
.bonus-row .muted { white-space: nowrap; }
.bonus-table td:nth-child(n+2), .bonus-table th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.green { color: var(--green); }

/* ---------- kho pháp phẩm ---------- */
.kho-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.kho-item { display: grid; grid-template-columns: 96px 1fr; gap: .7rem; border: 1px solid var(--line); border-radius: 12px; padding: .6rem; background: #fff; }
.kho-item img, .kho-ph { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--gold-soft); display: grid; place-items: center; font-size: 2rem; }
.kho-info { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.kho-info .btn { align-self: flex-start; margin-top: .3rem; }
.kho-price { font-weight: 700; color: var(--gold); }
.kho-want { font-size: .86rem; background: #fff6dc; border-radius: 8px; padding: .2rem .45rem; }
.gear-top { display: none; text-decoration: none; font-size: 1.3rem; padding: 0 .3rem; }
@media (max-width: 760px) { .gear-top { display: inline-block; } .me .who { display: none; } }
