:root {
  --accent: #b5652f; --accent-dark: #924f22; --accent-soft: #f4e7da;
  --ink: #231b16; --text: #4a3f37; --muted: #8a7d72;
  --bg: #fffdf9; --sand: #f6efe4; --espresso: #2b221d; --cream: #f3e6cc;
  --line: #e9dfd2; --ok: #2f7a3f; --bad: #b3261e;
  --radius: 16px; --pill: 999px;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Playfair Display", Georgia, "Times New Roman", serif;
  --hand: "Great Vibes", "Playfair Display", cursive;
  --header-h: 88px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 10px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
input, select, textarea, button { font: inherit; }
a { color: var(--accent); }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.container { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.section { padding-block: 72px; }
.section-title { text-align: center; font-size: clamp(30px, 4vw, 48px); font-weight: 500; margin-bottom: 40px; }
.band { background: var(--sand); }
.band.dark { background: var(--espresso); }
.band.dark .section-title { color: #fff; }

/* ---------- Header ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; color: #fff; transition: background .3s, color .3s, box-shadow .3s; }
.topbar-inner { max-width: 1440px; margin: 0 auto; height: var(--header-h); padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar.scrolled { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.topbar.scrolled .brand-mark { filter: none; }
.brand-text { font-family: var(--hand); font-size: 34px; line-height: 1; font-weight: 400; letter-spacing: 0; padding-top: 4px; }
.tabs { display: flex; align-items: center; gap: 36px; }
.tabs a { color: inherit; text-decoration: none; font-weight: 500; font-size: 16px; padding: 6px 0; position: relative; }
.tabs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s; }
.tabs a:hover::after, .tabs a.active::after { transform: scaleX(1); }
.account-link { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }
.account-link svg { width: 22px; height: 22px; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: inherit; }
.menu-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: currentColor; transition: transform .25s, opacity .25s; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--espresso) var(--hero) center/cover no-repeat; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(30,20,14,.6) 0%, rgba(30,20,14,.15) 30%, rgba(30,20,14,.2) 60%, rgba(30,20,14,.65) 100%); }
.hero-full { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--header-h) + 18vh) 24px 12vh; gap: 48px; }
.hero-full:not(:has(.searchbar)) { justify-content: flex-end; }
.hero-short { height: 42vh; min-height: 300px; }
.hero-copy { max-width: 980px; text-align: center; }
.hero-copy p { font-size: 18px; line-height: 1.65; max-width: 720px; margin: 18px auto 32px; color: rgba(255,255,255,.92); }
.hero-copy .kicker { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; font-size: 17px; margin-bottom: 0; }
.script { font-family: var(--script); font-style: italic; font-weight: 400; color: #fff8ec; font-size: clamp(34px, 5vw, 72px); line-height: 1.1; letter-spacing: -0.01em; text-shadow: 0 2px 24px rgba(0,0,0,.25); }

/* Thanh tìm kiếm dạng viên thuốc */
.searchbar { width: min(1140px, 100%); background: #fff; border-radius: var(--pill); padding: 12px 12px 12px 40px;
  display: flex; align-items: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sb-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 22px; border-left: 1px solid var(--line); }
.sb-field:first-child { padding-left: 0; border-left: 0; }
.sb-wide { flex-grow: 1.8; }
.sb-narrow { flex-grow: .7; }
.sb-field span { color: var(--accent); font-size: 14px; font-weight: 500; }
.sb-field input, .sb-field select { border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 17px; outline: none; width: 100%; appearance: none; cursor: pointer; }
.sb-field input { cursor: text; }
.sb-field input::placeholder { color: #9a9a9a; }
.searchbar .btn { margin-left: 12px; padding: 16px 44px; font-size: 17px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 0;
  padding: 13px 28px; border-radius: var(--pill); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .2s, transform .2s; white-space: nowrap; }
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn.pill-dark { background: var(--espresso); text-transform: uppercase; letter-spacing: .03em; padding: 16px 40px; font-size: 17px; }
.btn.pill-dark:hover { background: #45372e; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--sand); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Room cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 40px 28px; }
.room { display: flex; flex-direction: column; }
.room .img { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); background: var(--sand); overflow: hidden; transition: transform .4s; }
.room .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room .chip { position: absolute; top: 14px; left: 14px; }
.room:hover .img { transform: scale(1.015); }
.room .body { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.room h3 { font-size: 22px; font-weight: 500; margin: 0; }
.room .meta { color: var(--muted); font-size: 14px; }
.room .desc { font-size: 15px; line-height: 1.6; flex: 1; margin: 0; }
.room .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.room .price { font-weight: 700; font-size: 18px; color: var(--accent); }
.room .price small { color: var(--muted); font-weight: 400; font-size: 14px; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: var(--pill); background: rgba(255,255,255,.95); color: var(--ink); font-weight: 600; letter-spacing: .02em; }

/* ---------- Features / Pricing / Steps ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px 40px; }
.features.four { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { text-align: center; padding: 0 12px; }
.feature .icon { width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 30px; border-radius: 50%; background: var(--accent-soft); }
.feature h3 { font-size: 20px; font-weight: 600; }
.feature p { color: var(--muted); margin: 0; line-height: 1.65; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: stretch; }
.plan { position: relative; background: #fff; border-radius: 24px; padding: 36px 32px; }
.plan h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.plan.featured { background: var(--espresso); color: rgba(255,255,255,.85); }
.plan.featured h3 { color: rgba(255,255,255,.7); }
.plan .price { font-family: var(--script); font-style: italic; font-size: 56px; color: var(--accent); margin: 6px 0 20px; line-height: 1; }
.plan .price small { font-family: var(--sans); font-style: normal; font-size: 15px; color: var(--muted); }
.plan ul { list-style: none; padding: 20px 0 0; margin: 0; border-top: 1px solid var(--line); line-height: 2.1; }
.plan.featured ul { border-color: rgba(255,255,255,.15); }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 10px; }
.badge { position: absolute; top: 28px; right: 28px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--pill); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; color: rgba(255,255,255,.8); font-size: 17px; line-height: 1.6; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.2); }
.steps li::before { content: "0" counter(s); display: block; font-family: var(--script); font-style: italic; font-size: 48px; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.steps b { color: #fff; font-weight: 600; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.panel { max-width: 820px; margin: 0 auto; background: #fff; border-radius: 24px; padding: 40px; box-shadow: 0 10px 50px rgba(0,0,0,.08); }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent); }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form .check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); }
.form .check input { width: auto; accent-color: var(--accent); }
.form > .btn, .form .actions { align-self: flex-start; }
input, select, textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Account / Admin ---------- */
.account-wrap { position: relative; margin-top: -120px; padding-bottom: 80px; }
.account-wrap #accountView > * { position: relative; }
.login-split { display: grid; grid-template-columns: 1fr 1fr; max-width: 1040px; margin: 0 auto; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 10px 50px rgba(43,34,29,.12); }
.login-media { background: var(--espresso) url('/img/signboard.jpg') center/cover no-repeat; min-height: 480px; }
.login { padding: 48px; align-self: center; }
.login h2 { font-size: 32px; font-weight: 500; }
.dash { background: #fff; border-radius: 24px; padding: 36px; box-shadow: 0 10px 50px rgba(0,0,0,.08); }
.header-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.header-row h1 { font-size: 32px; font-weight: 500; }
.header-row h2 { font-size: 22px; font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 24px 0; }
.stat { background: var(--sand); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: 30px; color: var(--ink); font-weight: 600; }
.stat span { color: var(--muted); font-size: 13px; }
.card { background: var(--sand); border-radius: var(--radius); padding: 24px; }

.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.subtabs button { border: 0; background: var(--sand); color: var(--ink); padding: 10px 18px; border-radius: var(--pill); cursor: pointer; font-weight: 500; }
.subtabs button.active { background: var(--espresso); color: var(--cream); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand); color: var(--ink); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td select, td input { padding: 6px 10px; min-width: 120px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions input { flex: 1 1 260px; }
.muted { color: var(--muted); }
.empty { padding: 48px; text-align: center; color: var(--muted); }

.status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--pill); background: #eee; white-space: nowrap; }
.status.new, .status.pending { background: var(--accent-soft); color: var(--accent-dark); }
.status.contacting, .status.negotiating, .status.confirmed { background: #e6f0fb; color: #1d5ea8; }
.status.signed, .status.approved, .status.done { background: #e8f4ea; color: var(--ok); }
.status.lost, .status.rejected, .status.cancelled { background: #fbeaea; color: var(--bad); }

.token-box { font-family: ui-monospace, Menlo, monospace; background: var(--espresso); color: var(--cream); padding: 14px; border-radius: 12px; word-break: break-all; }

/* ---------- Intro & Footer ---------- */
.intro { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.intro h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 500; }
.intro p { color: var(--muted); line-height: 1.7; margin: 0; }

.footer { background: var(--espresso); color: rgba(255,255,255,.72); padding-top: 64px; font-size: 15px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer h3 { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer p { line-height: 1.7; margin: 0 0 8px; }
.footer-brand { font-family: var(--hand); font-size: 30px; color: var(--cream); margin: 10px 0 6px; }
.footer nav { display: flex; flex-direction: column; gap: 10px; }
.footer a { color: rgba(255,255,255,.72); text-decoration: none; }
.footer a:hover { color: var(--cream); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 24px; font-size: 13px; }

/* ---------- Misc ---------- */
.fab { position: fixed; right: 28px; bottom: 28px; z-index: 40; width: 64px; height: 64px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(181,101,47,.2), 0 10px 30px rgba(0,0,0,.2); transition: transform .2s; }
.fab:hover { transform: scale(1.06); }
.fab svg { width: 30px; height: 30px; }

dialog { border: 0; border-radius: 24px; padding: 36px; width: min(680px, calc(100vw - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(30,20,14,.6); backdrop-filter: blur(3px); }
dialog h2 { font-size: 26px; font-weight: 500; }
#toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 24px; border-radius: var(--pill); z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#toast.error { background: var(--bad); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tabs { gap: 24px; }
  .searchbar { flex-wrap: wrap; border-radius: 28px; padding: 20px; gap: 12px 0; }
  .sb-field { flex: 1 1 45%; padding: 6px 16px; }
  .sb-field:nth-child(odd) { padding-left: 0; border-left: 0; }
  .searchbar .btn { flex: 1 1 100%; margin: 6px 0 0; }
}
@media (max-width: 860px) {
  :root { --header-h: 68px; }
  .topbar-inner { padding: 0 20px; }
  .menu-toggle { display: block; }
  .tabs { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 20px;
    background: #fff; color: var(--ink); box-shadow: 0 20px 40px rgba(0,0,0,.12); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .25s; }
  .tabs a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tabs a::after { display: none; }
  .tabs a.active { color: var(--accent); }
  .account-link { margin-left: 0; }
  .topbar.open { background: #fff; color: var(--ink); }
  .topbar.open .tabs { transform: none; opacity: 1; pointer-events: auto; }
  .topbar.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .topbar.open .menu-toggle span:nth-child(2) { opacity: 0; }
  .topbar.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .section { padding-block: 56px; }
  .hero-full { padding-top: calc(var(--header-h) + 10vh); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
  .login-split { grid-template-columns: 1fr; }
  .login-media { min-height: 0; aspect-ratio: 4/3; }
  .brand-text { font-size: 28px; }
}
@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .sb-field { flex-basis: 100%; padding-left: 0; border-left: 0; }
  .panel, .dash, dialog { padding: 24px 20px; }
  .login { padding: 28px 20px; }
  .fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy p { font-size: 16px; }
}
