@import url('../assets/fonts/fonts.css');
:root { --green: #0b3d2e; --green2: #145842; --deep: #062a1f; --gold: #c9a96b; --gold2: #e6cf98; --cream: #f7f2e8; --ink: #1f2a24; --muted: #5b6b62; --line: #e2d9c6; --red: #e0262b;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; color: var(--ink); background: var(--cream); }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
.btn { border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 600; font-size: 14px; background: #fff; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.15); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--green); color: #fff; }
.btn.gold { background: var(--gold); color: var(--deep); }
.btn.ghost { background: transparent; box-shadow: none; color: inherit; border: 1px solid currentColor; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--green); }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.muted { color: var(--muted); }
.toast { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); background: rgba(6,42,31,.94); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 100; max-width: 92vw; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- thẻ căn ---------- */
.card { background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18); padding: 10px 16px calc(14px + var(--safe-b)); }
.card .grab { width: 44px; height: 5px; background: #d5d5d5; border-radius: 3px; margin: 0 auto 8px; }
.card h2 { margin: 0; font-size: 22px; color: var(--green); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card h2 small { font-size: 13px; color: var(--muted); font-weight: 600; }
.card .x { position: absolute; right: 12px; top: 10px; border: 0; background: #f0ece3; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; color: var(--muted); }
.card .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 10px 0; font-size: 14px; }
.card .grid div span { display: block; color: var(--muted); font-size: 12px; }
.card .grid div b { font-weight: 700; }
.card .price { display: flex; align-items: center; justify-content: space-between; background: var(--cream); border-radius: 12px; padding: 8px 12px; margin: 6px 0 10px; }
.card .price b { font-size: 18px; color: var(--green); }
.card .bm { position: relative; }
.card .bm .tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.card .bm .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: 12px; scrollbar-width: none; }
.card .bm .strip::-webkit-scrollbar { display: none; }
.card .bm img { flex: 0 0 100%; width: 100%; height: 190px; object-fit: contain; background: #faf8f3; border-radius: 12px; scroll-snap-align: center; }
.card .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.card .acts .btn { justify-content: center; padding: 12px 8px; }
.need { font-size: 11px; color: #a06a00; background: #fff4d6; border-radius: 6px; padding: 1px 6px; margin-left: 4px; font-weight: 600; }

/* ---------- hộp thoại ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: none; align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
.modal .box { background: var(--cream); width: 100%; max-width: 980px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); }
.modal .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -14px; background: var(--cream); padding: 6px 0 8px; z-index: 2; }
.modal .head h3 { margin: 0; font-size: 18px; color: var(--green); }
.modal .body { display: grid; gap: 14px; }
.modal canvas, .modal .preview img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.2); background: #ddd; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select { font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
.form .row { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 10px; overflow: hidden; }
table.t th { background: var(--green); color: #fff; text-align: left; padding: 8px; font-weight: 600; }
table.t td { padding: 7px 8px; border-bottom: 1px solid #efe8da; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.on td { background: #fde8e8; }
@media (min-width: 900px) {
  .modal { align-items: center; }
  .modal .box { border-radius: 18px; }
  .modal .body.two { grid-template-columns: 360px 1fr; align-items: start; }
  .modal .body.two .preview { position: sticky; top: 50px; }
}
