:root {
  --brand: #0e5a4f; --brand-2: #127566; --accent: #f2a03d; --ink: #1d2a2b; --muted: #627173;
  --line: #e2e8e7; --bg: #f4f7f6; --card: #fff; --ok: #1f8a4c; --warn: #b7791f; --bad: #c0392b; --info: #2563eb;
  --r: 12px; --sh: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(15,50,45,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* layout: menu trái */
.side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 236px; background: #0b4a41; color: #cfe5e0;
  display: flex; flex-direction: column; padding: 14px 10px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; }
.brand { font-weight: 700; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand b { background: var(--accent); color: #2b1c05; border-radius: 6px; padding: 1px 6px; font-size: .75rem; }
.side .brand { padding: 6px 10px 18px; font-size: 1.05rem; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .side-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfe5e0;
  text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.side-nav a:hover, .side-foot button:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a span { flex: 1; }
.side-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; margin-top: 10px; }
.side-foot .me { display: flex; align-items: center; gap: 12px; padding: 6px 12px 10px; color: #fff; font-weight: 600; font-size: .92rem; }
.side-foot .me small { display: block; font-weight: 400; color: #9fc4bc; font-size: .78rem; }
.side-foot button { font-size: .88rem; padding: 8px 12px; }
.ic { width: 20px; height: 20px; flex: none; }
.cnt { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #2b1c05;
  font-size: .72rem; line-height: 20px; text-align: center; font-weight: 800; }
.cnt[hidden] { display: none; }
.side-bg { display: none; }
.top { display: none; position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  align-items: center; gap: 8px; }
.menu-btn { background: none; border: 0; color: #fff; padding: 6px; margin-left: -4px; border-radius: 8px; cursor: pointer; display: flex; }
.menu-btn .ic { width: 24px; height: 24px; }
body.has-side { padding-left: 236px; }
@media print { .side, .top, .side-bg { display: none !important; } body.has-side { padding-left: 0; } }
main { max-width: 1200px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { margin: 0; flex: 1 1 auto; }
.crumb { font-size: .85rem; margin-bottom: 4px; } .crumb a { text-decoration: none; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 40px; }
.btn:hover { border-color: #c5d2cf; }
.btn.pri { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.acc { background: var(--accent); border-color: var(--accent); color: #2b1c05; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { font: inherit; color: inherit; width: 100%; border: 1px solid #cfd9d7; border-radius: 10px; padding: 9px 11px;
  background: #fff; min-height: 42px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(18,117,102,.25); border-color: var(--brand-2); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; color: #334; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem;
  white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; margin-bottom: 14px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .card-h h2 { margin: 0; flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--sh); }
.stat .l { font-size: .8rem; color: var(--muted); } .stat .v { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }
.stat a { text-decoration: none; color: inherit; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list a.row { text-decoration: none; color: inherit; display: flex; gap: 10px; align-items: center; width: 100%; }

.tours { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-decoration: none;
  color: inherit; box-shadow: var(--sh); }
.tcard:hover { border-color: #b7cbc7; }
.tcard .t1 { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.tcard h3 { margin: 6px 0; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); }

.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .75rem; font-weight: 700; background: #eef2f1; color: #445;
  white-space: nowrap; }
.s-draft { background: #eef0f3; color: #556; } .s-confirmed { background: #e6efff; color: #1d4ed8; }
.s-running { background: #fff3dc; color: #9a5b00; } .s-completed { background: #e9f7ef; color: #1f7a45; }
.s-settled { background: #0e5a4f; color: #fff; } .s-cancelled { background: #fde8e6; color: #b42318; }
.s-pending { background: #fff3dc; color: #9a5b00; } .s-approved { background: #e9f7ef; color: #1f7a45; }
.s-rejected, .s-hidden { background: #fde8e6; color: #b42318; }
.badge.n { background: var(--accent); color: #2b1c05; }

/* tables */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8fbfa; }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; font-weight: 600; }
.settle { width: 100%; } .settle td { padding: 8px 4px; } .settle tr.total td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--ink); }

.day { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin-bottom: 14px; }
.day h3 { margin-bottom: 4px; } .day p { margin: 4px 0; white-space: pre-line; }
.day .meta { font-size: .82rem; color: var(--muted); }
.dayedit { border: 1px dashed #c9d6d3; border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fbfdfc; }
.dayedit .dh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; } .dayedit .dh span { flex: 1; }

.exp { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.exp:first-child { border-top: 0; }
.exp .thumb { width: 64px; height: 64px; border-radius: 8px; background: #eef2f1 center/cover no-repeat; flex: none; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); text-decoration: none; cursor: pointer; }
.exp .body { flex: 1; min-width: 0; }
.exp .amt { font-weight: 800; white-space: nowrap; }
.exp .note { font-size: .82rem; color: var(--bad); }

.stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.review { padding: 12px 0; border-top: 1px solid var(--line); } .review:first-child { border-top: 0; }
.review blockquote { margin: 6px 0; white-space: pre-line; }
.reply { background: #f3f8f7; border-radius: 8px; padding: 8px 10px; font-size: .9rem; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 8px 0; overflow-x: auto; }
.bar { flex: 1 0 22px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 22px; }
.bar i { display: block; width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: var(--brand-2); }
.bar i.p { background: var(--accent); margin-top: 2px; }
.bar small { font-size: .65rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.empty { text-align: center; color: var(--muted); padding: 24px 10px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0e5a4f, #0a3b34); }
.login form { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 26px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login h1 { text-align: center; } .login p { text-align: center; color: var(--muted); margin-top: -4px; }
.login .btn { width: 100%; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 0 0 8px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10,25,22,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet .sh { display: flex; align-items: center; margin-bottom: 12px; } .sheet .sh h2 { flex: 1; margin: 0; }
.sheet .x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.sheet .foot { display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 12px 0 0; }
.preview-img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.viewer img { width: 100%; border-radius: 8px; } .viewer iframe { width: 100%; height: 70vh; border: 0; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: #1d2a2b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }

@media (min-width: 720px) {
  .modal { align-items: center; } .sheet { border-radius: 16px; }
}
@media (max-width: 900px) {
  body.has-side { padding-left: 0; }
  .top { display: flex; }
  .side { transform: translateX(-100%); transition: transform .22s ease; width: 264px; }
  body.side-open .side { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  body.side-open .side-bg { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10,25,22,.45); }
  body.side-open { overflow: hidden; }
}
@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .tours { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 1.05rem; }
  .head .btn { flex: 1 1 auto; }
  .hide-sm { display: none !important; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
}

.med { color: #b42318; }
.bd-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
b.click { cursor: pointer; } b.click:hover { color: var(--brand-2); text-decoration: underline; }

.phone { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.phone a { white-space: nowrap; }
.zalo { display: inline-block; background: #0068ff; color: #fff !important; border-radius: 999px; padding: 1px 9px; font-size: .75rem;
  font-weight: 700; text-decoration: none; line-height: 1.6; }
.zalo:hover { background: #0052cc; }
.cust-cell { min-width: 200px; }
