/* Thanh cong cu cua api.apiz.vn chep sang tai lieu /docs (18/09/2026).
   Anh Chien: bam "Tai lieu" van hien thanh cong cu nhu cu, khong phai thanh rieng.
   So do va mau lay tu bang dieu khien that (public-header.tsx, app-header.tsx, search.tsx):
   chu #0a0a0a, chu phu #606060, vien #e8e8e8, nen nhat #f5f5f5, accent #e4eeed, chu dao #0f766e,
   cao 64px, rong toi da 1280px, chu menu 14px/500, nut Dang nhap 32px/12px.
   Sinh boi audit/docs_mirror.py tu audit/docs_header/ - dung sua trong .mirror. */

.apzh {
  position: sticky; top: 0; z-index: 50; height: 64px; isolation: isolate;
  border-bottom: 1px solid #e8e8e8;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0a0a0a;
}
/* Nen mo nam o lop gia: backdrop-filter dat thang tren .apzh bien no thanh khung chua cho moi con
   position:fixed -> menu dien thoai bi giam trong 64px cua thanh (da dinh 18/09/2026). */
.apzh::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
html:has(.apzh-menu[open]) { overflow: hidden; }
html:has(.apzh-menu[open]) .tg-fab { display: none; }
.apzh *, .apzh-dlg * { box-sizing: border-box; }
.apzh-wrap {
  max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
/* bang dieu khien: khung px-4 md:px-6 + thanh px-2 -> mep trong 24px / 32px */
@media (min-width: 768px) { .apzh-wrap { padding: 0 32px; } }

.apzh-brand { display: flex; flex-shrink: 0; align-items: center; gap: 10px; color: #0a0a0a; text-decoration: none; }
.apzh-brand img { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; transition: transform .3s; }
.apzh-brand:hover img { transform: scale(1.05); }
.apzh-brand span { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }

.apzh-nav { display: none; align-items: center; gap: 2px; }
.apzh-nav > a:not(.apzh-signin) {
  padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 20px;
  color: #606060; text-decoration: none; white-space: nowrap; transition: color .2s;
}
.apzh-nav > a:not(.apzh-signin):hover, .apzh-nav > a.is-active { color: #0a0a0a; }
.apzh-sep { display: block; width: 1px; height: 16px; margin: 0 8px; background: #e8e8e8; opacity: .4; }
.apzh-sep.is-narrow { margin: 0 4px; }

.apzh-search {
  position: relative; display: inline-flex; align-items: center; height: 32px; width: 208px;
  padding: 0 48px 0 26px; border: 1px solid #e8e8e8; border-radius: 6px;
  background: rgba(245, 245, 245, .25); color: #606060; cursor: pointer;
  font: 400 14px/1 "Be Vietnam Pro", system-ui, sans-serif; text-align: left; transition: background .15s;
}
.apzh-search:hover { background: #e4eeed; }
.apzh-search svg { position: absolute; left: 6px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); }
.apzh-search kbd {
  position: absolute; right: 5px; top: 5px; display: flex; align-items: center; gap: 3px; height: 20px;
  padding: 0 6px; border: 1px solid #e8e8e8; border-radius: 4px; background: #f5f5f5; color: #606060;
  font: 500 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.apzh-search kbd span { font-size: 12px; }
.apzh-search:hover kbd { background: #e4eeed; }
@media (min-width: 1280px) { .apzh-search { width: 256px; } }

.apzh-signin {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px;
  background: #0f766e; color: #fff; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.apzh-signin:hover { background: #115e59; color: #fff; }

.apzh a:focus-visible, .apzh button:focus-visible, .apzh summary:focus-visible, .apzh-dlg a:focus-visible {
  outline: 2px solid rgba(15, 118, 110, .45); outline-offset: 2px;
}
.apzh-field input:focus, .apzh-field input:focus-visible { outline: none; }
html.apzh-lock .tg-fab { display: none; }

/* ---- dien thoai ---- */
.apzh-mobile { display: flex; align-items: center; gap: 4px; }
.apzh-icon {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: #0a0a0a; cursor: pointer;
}
.apzh-icon:hover { background: #e4eeed; }
.apzh-icon svg { width: 18px; height: 18px; }
.apzh-menu > summary { list-style: none; }
.apzh-menu > summary::-webkit-details-marker { display: none; }
.apzh-burger { position: relative; display: block; width: 16px; height: 16px; }
.apzh-burger span {
  position: absolute; left: 0; right: 0; display: block; height: 1.5px; border-radius: 9px;
  background: currentColor; transition: all .3s;
}
.apzh-burger span:nth-child(1) { top: 3px; }
.apzh-burger span:nth-child(2) { top: 7px; }
.apzh-burger span:nth-child(3) { top: 11px; }
.apzh-menu[open] .apzh-burger span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.apzh-menu[open] .apzh-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.apzh-menu[open] .apzh-burger span:nth-child(3) { top: 7px; transform: rotate(-45deg); }
.apzh-menu-panel {
  position: fixed; top: 64px; right: 0; bottom: 0; left: 0; z-index: 40; overflow-y: auto;
  padding: 12px 32px 40px; background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.apzh-menu-panel a {
  display: flex; padding: 12px 0; color: #606060; text-decoration: none; font-size: 16px; font-weight: 500;
  letter-spacing: -.01em;
}
.apzh-menu-panel a.is-active, .apzh-menu-panel a[aria-current="page"] { color: #0a0a0a; }
.apzh-menu-docs { margin: 8px 0 20px; padding: 4px 0 0 14px; border-left: 1px solid #e8e8e8; }
.apzh-menu-docs a { padding: 8px 0; font-size: 15px; }
.apzh-menu-group {
  margin: 14px 0 2px; color: #606060; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.apzh-menu-cta {
  display: flex !important; align-items: center; justify-content: center; height: 40px; margin-top: 12px;
  border-radius: 8px; background: #0a0a0a; color: #fff !important; font-size: 14px !important;
}
@media (min-width: 1100px) {
  .apzh-nav { display: flex; }
  .apzh-mobile, .apzh-menu-panel { display: none; }
}

/* ---- hop tim kiem (giong bang lenh ⌘K cua bang dieu khien) ---- */
html.apzh-lock { overflow: hidden; }
.apzh-dlg {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; background: rgba(10, 10, 10, .4);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.apzh-dlg[hidden] { display: none; }
.apzh-box {
  width: 100%; max-width: 560px; overflow: hidden; border: 1px solid #e8e8e8; border-radius: 12px;
  background: #fff; box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
}
.apzh-field { position: relative; border-bottom: 1px solid #e8e8e8; }
.apzh-field svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; color: #606060; transform: translateY(-50%); }
.apzh-field input {
  width: 100%; height: 50px; padding: 0 16px 0 46px; border: 0; background: transparent; color: #0a0a0a;
  font: 400 15px "Be Vietnam Pro", system-ui, sans-serif; outline: none;
}
.apzh-list { max-height: min(60vh, 440px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.apzh-list a { display: block; padding: 9px 12px; border-radius: 8px; color: #0a0a0a; text-decoration: none; }
.apzh-list a[aria-selected="true"] { background: #e4eeed; }
.apzh-list .t { display: block; font-size: 14px; font-weight: 500; }
.apzh-list .p { display: block; margin-top: 2px; color: #606060; font-size: 12px; }
.apzh-empty { padding: 22px 16px; color: #606060; font-size: 14px; text-align: center; }
.apzh-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid #e8e8e8; color: #606060; font-size: 11px; }
.apzh-foot kbd { padding: 1px 5px; border: 1px solid #e8e8e8; border-radius: 4px; background: #f5f5f5; font: 500 10px ui-monospace, monospace; }

/* nhay toi muc: khong de thanh dinh che mat tieu de; muc luc trai dung duoi thanh */
main [id] { scroll-margin-top: 84px; }
.docs-nav { top: 88px; }
@media (prefers-reduced-motion: reduce) { .apzh *, .apzh-menu-panel * { transition: none !important; } }
