@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Nunito+Sans:wght@400;600;700&display=swap&subset=vietnamese');

:root {
  --primary: #BE185D;
  --on-primary: #FFFFFF;
  --secondary: #EC4899;
  --accent: #B45309;
  --bg: #FDF2F8;
  --surface: #FFFFFF;
  --fg: #0F172A;
  --muted-fg: #475569;
  --muted: #FBF1F5;
  --border: #F7E3EB;
  --danger: #DC2626;
  --ok: #047857;
  --warn-bg: #FFFBEB;
  --warn-border: #F59E0B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(190, 24, 93, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

header.top {
  background: linear-gradient(135deg, #831843 0%, var(--primary) 55%, var(--secondary) 100%);
  color: var(--on-primary);
  padding: 48px 20px 40px;
}
header.top .wrap { max-width: 1080px; margin: 0 auto; }
header.top .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; opacity: .9; }
header.top h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 8px 0 12px;
}
header.top p { margin: 0; max-width: 760px; font-size: 1.08rem; opacity: .96; }

nav.tabs { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
nav.tabs .wrap { max-width: 1080px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; }
nav.tabs a {
  white-space: nowrap; padding: 14px 12px; color: var(--muted-fg); text-decoration: none; font-weight: 700; font-size: 14px;
  border-bottom: 3px solid transparent; transition: color .2s, border-color .2s;
}
nav.tabs a:hover { color: var(--primary); }
nav.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }
section { margin: 0 0 40px; }

h2 { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.7rem; margin: 0 0 14px; letter-spacing: -.01em; color: #831843; }
h3 { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.2rem; margin: 22px 0 8px; }
h4 { font-weight: 700; margin: 14px 0 6px; }
a { color: var(--primary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.tldr { border-left: 6px solid var(--primary); }
.tldr strong { color: var(--primary); }

.stat { text-align: left; }
.stat .num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.9rem; color: var(--primary); line-height: 1.1; }
.stat .lbl { color: var(--muted-fg); font-size: 14px; }

.note { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.note.ok { background: #ECFDF5; border-color: #10B981; }
.note.bad { background: #FEF2F2; border-color: var(--danger); }
.note b:first-child { display: block; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; font-size: 15px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--muted); font-weight: 700; color: #831843; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 800; background: #FFF7FB; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }

ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 4px 0 14px 50px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-family: 'Nunito', sans-serif;
}
ol.steps > li > b:first-child { display: block; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--muted); color: var(--primary); border: 1px solid var(--border); }
.tag.gold { color: var(--accent); background: #FFFBEB; border-color: #FDE68A; }
.tag.green { color: var(--ok); background: #ECFDF5; border-color: #A7F3D0; }

.prod img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; display: block; }
.prod h4 { margin: 12px 0 2px; }

pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
pre { background: #1E1B2E; color: #F5E9F0; padding: 14px 16px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; }
code { background: var(--muted); padding: 1px 6px; border-radius: 6px; }
pre code { background: none; padding: 0; }

.calc label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.calc input, .calc select { width: 100%; padding: 10px 12px; border: 1px solid #E9C8D7; border-radius: 10px; font: inherit; background: #fff; min-height: 44px; }
.calc .hint { font-size: 12.5px; color: var(--muted-fg); }

.hub a.card { display: block; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.hub a.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(190, 24, 93, .14); }
.hub a.card h3 { color: var(--primary); margin-top: 0; }

footer { text-align: center; color: var(--muted-fg); font-size: 13px; padding: 24px; border-top: 1px solid var(--border); }

@media print {
  nav.tabs { display: none; }
  header.top { background: #831843 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { box-shadow: none; }
}
