/* ─── Trang tài liệu ────────────────────────────────────────────────────────
   Dùng lại biến màu/typography từ styles.css. Chỉ thêm layout 2 cột và
   kiểu chữ cho nội dung dài.                                               */

body { background: var(--bg); }

.doc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.doc-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc-brand b { color: var(--accent); }
.doc-back {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text2);
  text-decoration: none;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  transition: all var(--t-fast);
}
.doc-back:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.doc-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 36px;
  align-items: start;
}

/* Sidebar dính theo scroll */
.doc-side {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-side-title {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text4);
  margin-bottom: 10px;
}
.doc-nav-link {
  display: block;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--t-fast);
}
.doc-nav-link:hover { color: var(--text); background: var(--surface-3); }
.doc-nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ─── Nội dung ───────────────────────────────────────────────────────────── */
.doc-main {
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text2);
}
.doc-main h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
}
.doc-main h2 {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.02em;
}
.doc-main h2:first-of-type { border-top: none; padding-top: 0; }
.doc-main h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 26px 0 10px;
}
.doc-main p { margin: 0 0 14px; }
.doc-main .lead {
  font-size: 15.5px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 22px;
}
.doc-main a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-border); }
.doc-main a:hover { border-bottom-color: var(--accent); }
.doc-main code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
}
.doc-main pre {
  background: #1a202c;
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.doc-main pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.65;
}
.doc-main .sub { font-size: 12px; color: var(--text3); font-weight: 500; }

/* Công thức nổi bật */
.doc-eq {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  margin: 0 0 18px;
  overflow-x: auto;
}

/* Bảng */
.doc-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.doc-main thead th {
  background: var(--surface-3);
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.doc-main tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-main tbody tr:last-child td { border-bottom: none; }
.doc-main tbody tr:hover { background: var(--surface-2); }
.doc-main td.num { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.doc-main td.hl2, .doc-main .hl2 { color: var(--green); font-weight: 700; }
.doc-main tr.hl { background: var(--green-soft); }
.doc-main tr.hl:hover { background: var(--green-soft); }
.doc-main td.bad, .doc-main .bad { color: var(--red); font-weight: 600; }
.tbl-model td:first-child { min-width: 190px; }
.tbl-model td { font-size: 12.5px; }

/* Ghi chú */
.doc-note {
  background: var(--surface-3);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.65;
}
.doc-note.warn {
  background: rgba(217, 119, 6, 0.07);
  border-left-color: var(--yellow);
}
.doc-note b { color: var(--text); }

/* Thẻ ở trang tổng quan */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
  margin: 0 0 34px;
}
.doc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}
.doc-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.doc-card-icon {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 10px;
  line-height: 1;
}
.doc-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.doc-card-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

.doc-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text3);
  text-align: center;
}
.doc-footer a { color: var(--text2); font-weight: 600; border-bottom: none; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .doc-layout { grid-template-columns: 1fr; gap: 22px; }
  .doc-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }
  .doc-side-title { width: 100%; margin-bottom: 4px; }
  .doc-nav-link { border-left: none; border: 1px solid var(--border); font-size: 12.5px; }
  .doc-nav-link.active { border-color: var(--accent-border); }
}
@media (max-width: 640px) {
  .doc-header-inner, .doc-layout { padding-left: 16px; padding-right: 16px; }
  .doc-main h1 { font-size: 1.6rem; }
  .doc-main table { font-size: 12px; }
  .doc-main thead th, .doc-main tbody td { padding: 7px 9px; }
  .doc-eq { font-size: 12.5px; }
}

/* ─── Bảng giá tương tác — bấm để mở modal dùng chung ────────────────────── */
.tbl-price td { font-size: 12.5px; }
.tbl-price .num { font-family: var(--mono); white-space: nowrap; }
.tbl-price .dim { color: var(--text4); }
.tbl-price .price-cta {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--accent); white-space: nowrap; text-align: right;
}
.price-row { cursor: pointer; transition: background var(--t-fast); }
.price-row:hover { background: var(--accent-soft) !important; }
.price-row:hover .price-cta { text-decoration: underline; }
.price-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
