/* ===== Design tokens (sáng, sạch, kiểu Airbnb: một màu nhấn san hô) ===== */
:root {
  --primary: #d63a52; --primary-d: #bd2c43; --primary-ink: #ffffff;  /* nền san hô + chữ trắng trên nền đó (tương phản 4.6:1) */
  --primary-soft: #fdeef0; --primary-line: #f6c6ce;                  /* nền/viền nhạt của màu nhấn */
  --accent-ink: #b3243b;                                              /* chữ nhấn/link trên nền sáng (tương phản ~6:1) */
  --bg: #f7f6f4; --surface: #fff; --card: var(--surface);
  --text: #222222; --muted: #6a6963; --line: #ebe9e5; --line-strong: #d3d0c9;
  --ok: #1f7a3e; --err: #c8321f; --green: #1f7a3e; --green-soft: #e4f3e8;
  --cream: #fdf0c8; --cream-ink: #7a4f00;
  --radius: 16px; --radius-sm: 10px; --radius-pill: 999px;
  --shadow: 0 2px 12px rgba(34,34,34,.06); --shadow-lg: 0 12px 36px rgba(34,34,34,.14);
  --focus: 0 0 0 3px rgba(214,58,82,.35);
  --font: "Inter", "Lexend Deca", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Lexend Deca", "Inter", system-ui, sans-serif;
  --header-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.6 var(--font); background: #fff; color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; }
.muted { color: var(--muted); } .small { font-size: 13px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; font-weight: 700; font-family: var(--font-head); letter-spacing: -.01em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--primary); color: var(--primary-ink); }

/* ===== Header (chi tiết xem shell.css) ===== */
.top { background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.bar { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); white-space: nowrap; }
.logo:hover { color: var(--text); }
.nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.icon-link { padding: 4px 8px; }
.dot { background: var(--err); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 1100; }
.dropdown-menu.open { display: block; }
.dropdown-menu a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); }
.dropdown-menu a:hover { background: var(--bg); color: var(--text); }
.foot { background: var(--bg); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* ===== Buttons & forms ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-align: center; background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, box-shadow .15s; line-height: 1.3; }
.btn:hover { background: var(--bg); border-color: var(--text); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: var(--primary-ink); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; } .btn-danger:hover { background: #b92f23; border-color: #b92f23; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-sm); }
.form .field { margin-bottom: 14px; }
.form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: #8d8c85; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1; min-width: 140px; }
.err-msg { color: var(--err); font-size: 14px; margin: 6px 0; }

/* ===== Blocks ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.empty { text-align: center; padding: 40px 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; background: #ebeae4; color: var(--text); }
.badge.ok { background: var(--green-soft); color: var(--green); } .badge.warn { background: var(--cream); color: var(--cream-ink); } .badge.err { background: #fbe3df; color: #9a2519; }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface); font-size: 13px; margin: 2px; cursor: pointer; }
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tab { padding: 9px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-size: 15px; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.table th { background: #faf9f5; font-weight: 600; }
.table tbody tr:hover td { background: #fbfaf6; }
.table-wrap { overflow-x: auto; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.pager button, .pager a { min-width: 38px; padding: 7px 11px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.pager .active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 700; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }

/* ===== Listing card (cơ sở; cards.css có thể ghi đè) ===== */
.lcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.lcard:hover { box-shadow: var(--shadow-lg); }
.lcard-img { display: block; position: relative; aspect-ratio: 4/3; background: #eceae3; }
.lcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 42px; }
.ph span { font-size: 13px; color: #374151; }
.vip-tag { position: absolute; left: 8px; top: 8px; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 4px; }
.fav { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.94); font-size: 19px; cursor: pointer; color: #6b6a64; }
.fav.on { color: #e11d48; }
.lcard-body { padding: 10px 12px 12px; }
.lcard-title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; }
.lcard-price { color: var(--text); font-weight: 700; margin: 4px 0; }

/* ===== Toast ===== */
#toast { position: fixed; right: 16px; bottom: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #222; color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-width: 340px; border-left: 4px solid var(--primary); }
.toast.err { background: #b92f23; border-left-color: #ffb4ab; } .toast.ok { background: var(--green); border-left-color: #9be0b1; }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(29,29,27,.55); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }

@media (max-width: 760px) {
  #toast { left: 16px; right: 16px; bottom: 12px; }
  .toast { max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
}
/* ===== Mobile (Chrome Android / Safari iOS) ===== */
html { -webkit-tap-highlight-color: transparent; }
a, button, .btn, .lcard, .chip, .tab { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, #6a6963 50%), linear-gradient(135deg, #6a6963 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=checkbox], input[type=radio] { -webkit-appearance: auto; appearance: auto; }
.top { -webkit-backdrop-filter: saturate(1.4) blur(10px); padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.modal-bg, .modal { overscroll-behavior: contain; }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .modal-bg { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .modal { max-height: 90vh; max-height: 90dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
