:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #1b1f24;
  --muted: #5b636e;
  --dim: #8a929d;
  --line: #e4e7ec;
  --line-soft: #eef0f3;
  --brand: #e11d48;
  --brand-ink: #be123c;
  --pink: #ec4899;
  --maxw: 1120px;
  --read: 760px;
  --side: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #161a20;
    --ink: #e7eaee;
    --muted: #9aa3af;
    --dim: #7b828d;
    --line: #262c34;
    --line-soft: #1e232a;
    --brand: #fb7185;
    --brand-ink: #fda4af;
    --pink: #f472b6;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #161a20; --ink: #e7eaee; --muted: #9aa3af;
  --dim: #7b828d; --line: #262c34; --line-soft: #1e232a;
  --brand: #fb7185; --brand-ink: #fda4af; --pink: #f472b6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
a { color: var(--brand-ink); }

/* ---------- Header: logo + 2 tab ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { display: block; height: 26px; width: auto; }
.tabs { display: flex; gap: 8px; margin-left: auto; }
.tabs a {
  position: relative;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
}
.tabs a:hover { color: var(--ink); background: var(--surface); }
.tabs a[aria-current="page"] { color: var(--brand-ink); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px;
  height: 2px; background: var(--brand);
}

/* ---------- Layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px 16px 56px; }
.page.home { max-width: var(--read); }
.page.with-side { display: flex; gap: 40px; align-items: flex-start; }

.side { flex: 0 0 var(--side); width: var(--side); position: sticky; top: 72px; }
.side-title {
  margin: 0 0 8px; padding: 0 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--dim);
}
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35;
  border-left: 2px solid transparent;
}
.side a:hover { background: var(--surface); color: var(--ink); }
.side a[aria-current="page"] {
  background: var(--surface); color: var(--brand-ink); font-weight: 600;
  border-left-color: var(--brand);
}

.doc { flex: 1 1 auto; min-width: 0; max-width: var(--read); }
.with-side .doc { margin: 0; }
.doc h1 { font-size: 30px; line-height: 1.25; letter-spacing: -0.02em; margin: 2px 0 22px; }
.doc h2 { font-size: 22px; margin: 38px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 22px 0 8px; }
.doc h4 { font-size: 16px; margin: 18px 0 6px; color: var(--muted); }
.doc p { margin: 12px 0; }
.doc ul, .doc ol { margin: 12px 0; padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc strong { font-weight: 700; }

/* landing cards */
.doc .cards { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 12px; }
.cards li { margin: 0; }
.cards a {
  display: block; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink);
}
.cards a:hover { border-color: var(--brand); }
.cards .t { font-weight: 700; display: block; }
.cards .d { color: var(--muted); font-size: 15px; }

/* ---------- Footer (mẫu F7 của web) ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.f-grad { position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, #ff3f94, #c46bff, #8b5cf6); }
.f-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.f-top { display: flex; flex-direction: column; gap: 28px; padding: 32px 0 12px; }
.f-brand img { display: block; height: 30px; width: auto; }
.f-tag { margin: 10px 0 0; max-width: 44ch; }
.f-org { margin-top: 12px; font-size: 12px; line-height: 1.6; color: var(--dim); }
.f-org p { margin: 0; }
.f-org-name { font-weight: 600; color: var(--muted); }
.f-cols { display: grid; grid-template-columns: 1fr; gap: 20px 24px; }
.f-col h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.f-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.f-col a { color: var(--muted); text-decoration: none; }
.f-col a:hover { color: var(--ink); }
.f-hot { margin: 0; color: var(--ink); }
.f-hot span { font-weight: 700; }
.f-icons { display: flex; gap: 10px; margin-top: 10px; }
.f-icons a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; text-decoration: none; font-size: 13px; font-weight: 700; }
.f-icons a.f-call { background: var(--pink); color: #fff; }
.f-icons a.f-zalo { background: #0068ff; color: #fff; }
.f-icons a:hover { opacity: .85; color: #fff; }
.f-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  border-top: 1px solid var(--line); padding: 16px 0; font-size: 12px; color: var(--dim);
}
.f-bottom a { color: var(--dim); text-decoration: none; }
.f-bottom a:hover { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .f-cols { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
@media (min-width: 900px) {
  .f-top { flex-direction: row; justify-content: space-between; gap: 40px; }
  .f-brand { max-width: 22rem; }
  .f-cols { flex: 0 0 auto; }
}
@media (max-width: 860px) {
  .page.with-side { display: block; }
  .side {
    position: static; width: auto; flex: none;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
  }
  .side ul { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; padding: 6px 10px; }
  .side a[aria-current="page"] { border-left: 0; border-bottom-color: var(--brand); }
  .doc { max-width: none; }
}
