:root {
  --ink: #0f172a;
  --muted: #475569;
  --soft-ink: #64748b;
  --line: #e2e8f0;
  --primary: #4f46e5;
  --primary-d: #3730a3;
  --primary-soft: #eef2ff;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --accent-d: #b45309;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --ok: #15803d;
  --bg: #ffffff;
  --soft: #f8fafc;
  --soft2: #f1f5f9;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar .in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
  font-size: 16px;
}

.brand span {
  color: var(--primary);
}

.topbar .meta {
  margin-left: auto;
  font-size: 13px;
  color: var(--soft-ink);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 28px 0 40px;
}

.toc summary {
  display: none;
}

.toc .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft-ink);
  margin-bottom: 12px;
}

.toc a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.45;
}

.toc a:hover {
  color: var(--primary);
  background: var(--soft);
}

.toc a.on {
  color: var(--primary-d);
  border-left-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

main {
  padding: 36px 0 110px;
  max-width: 860px;
  min-width: 0;
}

.hero {
  padding-bottom: 12px;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(29px, 4.4vw, 42px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 14px;
}

.lead {
  font-size: 19px;
  color: var(--muted);
}

h2 {
  font-size: clamp(22px, 3.2vw, 29px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.28;
  margin-bottom: 14px;
}

h3 {
  font-size: 18.5px;
  font-weight: 700;
  margin: 30px 0 10px;
  line-height: 1.35;
}

section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

section:first-of-type {
  border-top: none;
}

p {
  margin-bottom: 15px;
  color: var(--muted);
}

p strong,
li strong,
td strong {
  color: var(--ink);
  font-weight: 600;
}

ul,
ol {
  margin: 0 0 16px 22px;
  color: var(--muted);
}

li {
  margin-bottom: 9px;
}

a {
  color: var(--primary-d);
}

.fig {
  margin: 26px 0;
  padding: 20px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.fig figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--soft-ink);
  text-align: center;
}

.docshot {
  margin: 14px 0 20px;
}

.docshot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.docshot figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--soft-ink);
}

.invoice-steps li {
  padding-bottom: 28px;
}

.d-t {
  font: 600 14px "Be Vietnam Pro", sans-serif;
}

.d-s {
  font: 400 12.5px "Be Vietnam Pro", sans-serif;
}

.d-h {
  font: 700 13px "Be Vietnam Pro", sans-serif;
}

.tree {
  margin: 22px 0;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
}

.tree pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre;
}

.tablewrap {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  min-width: 580px;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--soft2);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
  background: var(--soft2);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #ffffff;
}

.card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 7px;
}

.card p {
  font-size: 14.5px;
  margin: 0;
}

.card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 9px;
  background: var(--primary-soft);
  color: var(--primary-d);
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 16px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 22px 0;
}

.callout p {
  color: var(--accent-d);
  margin: 0;
  font-size: 15.5px;
}

.callout p strong {
  color: #7c2d12;
}

.callout.danger {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.callout.danger p,
.callout.danger p strong {
  color: var(--red);
}

.steps {
  counter-reset: s;
  list-style: none;
  margin: 22px 0 0 0;
}

.steps > li {
  counter-increment: s;
  position: relative;
  padding: 0 0 22px 46px;
  border-left: 2px solid var(--line);
  margin: 0;
}

.steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.steps > li::before {
  content: counter(s);
  position: absolute;
  left: -15px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps h4 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 5px;
}

.steps p {
  font-size: 15px;
  margin-bottom: 6px;
}

.steps ul {
  list-style: none;
  margin: 10px 0 10px 0;
  padding: 0;
}

.steps ul li {
  position: relative;
  padding: 0 0 8px 18px;
  border-left: 0;
  margin: 0;
  font-size: 15px;
}

.steps ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.check {
  font-size: 14px;
  color: var(--ok);
  font-weight: 600;
}

.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 20px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: none;
}

.faq summary {
  padding: 15px 18px;
  font-weight: 600;
  cursor: pointer;
  background: #ffffff;
  font-size: 16px;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--primary);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "\2013";
}

.faq details[open] summary {
  background: var(--soft);
}

.faq .body {
  padding: 2px 18px 18px;
  font-size: 15.5px;
  color: var(--muted);
}

.faq .body p:last-child {
  margin-bottom: 0;
}

.checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.checkgrid label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  color: var(--muted);
  font-size: 14.5px;
}

.checkgrid input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--primary);
}

.copybar {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 10px;
}

.copybar button {
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 8px 13px;
  font-size: 14px;
}

.scriptbox {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(16px);
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  padding: 12px 15px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

footer {
  border-top: 1px solid var(--line);
  background: var(--soft);
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--soft-ink);
}

@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 18px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 16px 0 0;
    border-bottom: 1px solid var(--line);
  }

  .toc summary {
    display: block;
    padding: 12px 0;
    font-weight: 700;
    cursor: pointer;
    font-size: 15.5px;
    list-style: none;
  }

  .toc summary::-webkit-details-marker {
    display: none;
  }

  .toc summary::after {
    content: "+";
    float: right;
    color: var(--primary);
  }

  .toc details[open] summary::after {
    content: "\2013";
  }

  .toc .label {
    display: none;
  }

  main {
    padding: 28px 0 80px;
  }

  body {
    font-size: 16px;
  }

  .topbar .meta {
    margin-left: 0;
  }
}

@media print {
  .topbar,
  .toc,
  .toast,
  .copybar {
    display: none;
  }

  .shell {
    display: block;
    padding: 0;
  }

  main {
    max-width: none;
    padding: 0;
  }

  section {
    padding: 26px 0;
  }

  .card,
  .callout,
  .fig,
  .tablewrap,
  .faq,
  .checkgrid label {
    break-inside: avoid;
  }
}

/* Trang 10: o gia tri nhan vien phai tu dien (vang) -> da dien (xanh) */
.var {
  background: #fef3c7;
  border-bottom: 2px dashed #f59e0b;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  color: #92400e;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.94em;
  white-space: nowrap;
}

.var.filled {
  background: #dcfce7;
  border-bottom-color: #22c55e;
  border-bottom-style: solid;
  color: #14532d;
}

code .var {
  font-size: 1em;
  padding: 0 3px;
}

/* Nhan "anh vi du" tren moi anh chup man hinh cua trang 10 */
body[data-page="khoa-trang-hoc"] .fig {
  position: relative;
}

body[data-page="khoa-trang-hoc"] .fig::before {
  content: "ẢNH VÍ DỤ - CHỤP TỪ LỚP WIKI AI, ĐỪNG GÕ THEO CHỮ TRONG ẢNH";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 6px;
  max-width: calc(100% - 20px);
}
