/* Cong doi tac SDK nhung. Chep he thiet ke cua nha bao hiem mau (Ci2.Embed.SampleInsurer): khung, token, thanh phan theo trang DEV, mau nhan xanh mong ket.
   CSP chi cho style-src 'self': khong style noi dong, moi trang thai bang lop hoac thuoc tinh. */

:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Khong dung ui-monospace: Chromium tren Windows doi no ra phong co chan. */
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --surface-3: #eaeff2;
  --border: #dbe2e8;
  --border-strong: #c3ced7;
  --text: #0f1f2c;
  --text-2: #435466;
  --text-3: #5f6e7e;

  --primary: #0f766e;
  --primary-600: #0b5e57;
  --primary-50: #e6f3f1;
  --primary-100: #cce7e3;
  --primary-ring: rgba(15, 118, 110, .3);
  --on-primary: #ffffff;

  --ok: #166534;
  --ok-bg: #dcf5e4;
  --warn: #8a4b00;
  --warn-bg: #fdefcf;
  --danger: #b42318;
  --danger-bg: #fde4e1;
  --info: #0b5c86;
  --info-bg: #def0fa;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 44, .06);
  --shadow-lg: 0 24px 56px -20px rgba(15, 31, 44, .35);

  --sidebar-w: 240px;
  --topbar-h: 56px;
  --row-pad: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1418;
    --surface: #111d22;
    --surface-2: #15232a;
    --surface-3: #1c2d35;
    --border: #253a44;
    --border-strong: #335060;
    --text: #e6eef1;
    --text-2: #b0c0c8;
    --text-3: #8fa3ad;
    --primary: #4fd1c0;
    --primary-600: #79e0d2;
    --primary-50: rgba(79, 209, 192, .12);
    --primary-100: rgba(79, 209, 192, .22);
    --primary-ring: rgba(79, 209, 192, .35);
    --on-primary: #06201d;
    --ok: #5ee08a;
    --ok-bg: rgba(94, 224, 138, .14);
    --warn: #f6c453;
    --warn-bg: rgba(246, 196, 83, .14);
    --danger: #ff8a7a;
    --danger-bg: rgba(255, 138, 122, .14);
    --info: #6cc4f2;
    --info-bg: rgba(108, 196, 242, .14);
          --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 28px 64px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- Nen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: .9em; }
svg { vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-100); }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ---------- Khung ung dung ---------- */
body.is-app { display: flex; flex-direction: column; height: 100vh; }
.app { flex: 1; min-height: 0; display: flex; }

.sidebar {
  flex: none; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid var(--border); color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.brand-mark .icon { width: 19px; height: 19px; stroke-width: 2.1; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-text span { display: block; font-size: 12px; color: var(--text-3); margin-top: -1px; white-space: nowrap; }

.nav { padding: 14px 12px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius); color: var(--text-2); font-weight: 550; }
.nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-50); color: var(--primary); }

.main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; flex: none;
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs strong { color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { display: flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 12px; }
.who-text { line-height: 1.15; }
.who-text strong { display: block; font-size: 13px; font-weight: 600; }
.who-text span { display: block; font-size: 11.5px; color: var(--text-3); }
.topbar form { margin: 0; }
.topbar-brand { display: none; }
.topbar-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }

.content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 40px; }
.bare { min-height: 100vh; }

/* ---------- Dau trang ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 72ch; }

/* ---------- Nut ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px;
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: var(--on-primary); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- The ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.card-head p { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.card-body { padding: 16px 20px 20px; }
.hint { color: var(--text-2); font-size: 13px; }

/* ---------- O nhap ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }

/* ---------- Nhan ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); vertical-align: middle; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); font-family: var(--mono); font-weight: 500; font-size: 11.5px; }
.code { display: inline-block; min-width: 40px; padding: 1px 7px; border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.code.ok { background: var(--ok-bg); color: var(--ok); }
.code.warn { background: var(--warn-bg); color: var(--warn); }
.code.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Form mot cot (doi mat khau) ---------- */
.form-card { max-width: 480px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form .btn { align-self: flex-start; }
.field-error { font-size: 12.5px; color: var(--danger); }
.field-error:empty { display: none; }
.form .alert { margin: 0; }

/* ---------- Bao ---------- */
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; margin-top: 12px; border-radius: var(--radius); font-size: 13px; }
.alert .icon { margin-top: 2px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert:empty { display: none; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Thanh cong cu, bang, phan trang ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0; }
.toolbar .search { flex: 1 1 280px; max-width: 560px; }
.toolbar .count { margin-left: auto; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { padding: 9px 14px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--row-pad) 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap, .nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.table .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .sub.wrap { white-space: normal; max-width: 420px; }
.table .strong { font-weight: 600; }
.truncate { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--text-3); }
.table.compact td, .table.compact th { padding: 7px 10px; }

/* Dong bang co data-href: bam ca dong mo chi tiet (site.js); lien ket trong dong van la duong cho ban phim. */
.table tbody tr[data-href] { cursor: pointer; transition: background .12s; }
.table tbody tr[data-href]:hover { background: var(--surface-2); }
.table tbody tr[data-href]:focus-within { background: var(--primary-50); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pager-pages { display: flex; align-items: center; gap: 10px; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty.small { padding: 32px 20px; }
.empty-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-art .icon { width: 30px; height: 30px; stroke-width: 1.6; }
.empty h3 { font-size: 15.5px; color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 56ch; margin: 0 auto 14px; }
.empty p:last-child { margin-bottom: 0; }

/* ---------- Nhom nut (khoang ngay, nhom trang thai), o loc ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius); }
.segmented a { padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range-form { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-3); }
.range-form .input, .toolbar .input.date { width: auto; height: 34px; }
.toolbar .select { width: auto; height: 38px; }
.search-form { display: flex; align-items: center; gap: 10px; flex: 1 1 360px; margin: 0; }
.search-form .search { flex: 1; }
.alert.flush { margin: 0; border-radius: 0; }
.alert.banner { margin: 0 0 18px; }
code.raw { font-size: 11px; color: var(--text-3); }
.table .raw.sub { display: block; }
.wrap-text { display: block; max-width: 420px; white-space: normal; overflow-wrap: anywhere; }
.back { margin: -6px 0 12px; font-size: 13px; }
.back a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Bang dieu khien ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0 0 18px; }
.kpi { margin: 0; padding: 14px 18px; }
.kpi dt { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.kpi dd { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi dd.kpi-sub { margin-top: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.kpi.ok dd:not(.kpi-sub) { color: var(--ok); }
.kpi.danger dd:not(.kpi-sub) { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-2 > .card { margin: 0; min-width: 0; }
.stack { display: grid; gap: 18px; }
.kind-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.kind-head .muted { margin-left: auto; font-size: 12.5px; }

/* Bieu do SVG dung o may chu: mau theo lop t-*, khong style noi dong. */
.chart { display: block; width: 100%; height: auto; }
.chart.ratio { height: 14px; border-radius: 7px; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .tick { font-family: var(--font); font-size: 11px; fill: var(--text-3); }
.chart .chart-empty { font-family: var(--font); font-size: 13px; fill: var(--text-3); }
.chart .track { fill: var(--surface-3); }
.chart .t-ok { fill: var(--ok); }
.chart .t-warn { fill: var(--warn); }
.chart .t-danger { fill: var(--danger); }
.chart .t-info { fill: var(--info); }
.chart .t-primary { fill: var(--primary); }
.chart .t-muted { fill: var(--border-strong); }
.chart rect[class^="t-"]:hover { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--border-strong); }
.swatch.t-ok { background: var(--ok); }
.swatch.t-warn { background: var(--warn); }
.swatch.t-danger { background: var(--danger); }
.swatch.t-info { background: var(--info); }
.swatch.t-primary { background: var(--primary); }

/* ---------- Ho so: dau trang chi tiet (chep tu nha bao hiem mau) ---------- */
.case-head { padding: 22px 24px 0; overflow: hidden; }
.case-id { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.case-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.case-ref { display: inline-flex; align-items: center; gap: 8px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; color: var(--text-3); }
.case-ref code { padding: 1px 8px; border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 600; }
.amounts { display: flex; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.amounts > div { padding: 12px 20px; min-width: 180px; }
.amounts > div + div { border-left: 1px solid var(--border); }
.amounts dt { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.amounts dd { margin: 2px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.amounts dd small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.amounts .payout { background: var(--primary-50); }
.amounts .payout dd { color: var(--primary); }
.states { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--border); }
.states dt { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.states dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.states dd code { font-size: 11.5px; color: var(--text-3); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.case-head .facts { margin: 0 -24px; border-top: 1px solid var(--border); }
.facts > div { padding: 12px 20px; border-bottom: 1px solid var(--border); min-width: 0; }
.case-head .facts > div { padding: 12px 24px; }
.facts > div:not(:nth-child(4n)) { border-right: 1px solid var(--border); }
.facts > div.wide { grid-column: 1 / -1; border-right: 0; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 2px 0 0; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Tien trinh ---------- */
.timeline { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 0; padding: 20px 12px 18px; list-style: none; }
.step { position: relative; padding: 0 6px; text-align: center; min-width: 0; }
.step::before { content: ""; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before, .step.failed::before { background: var(--primary); }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 8px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: 12.5px; font-weight: 700; }
.step.done .step-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.step.current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.step.failed .step-dot { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.step-label { display: block; font-size: 13px; font-weight: 600; }
.step.pending .step-label { color: var(--text-3); }
.step.failed .step-label { color: var(--danger); }
.step-at { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.step.pending .step-at { color: var(--text-3); }
.step-note { display: block; margin-top: 3px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.step.failed .step-note { color: var(--danger); font-weight: 550; }

/* ---------- Dang nhap ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 44px 52px; color: #f1fbf9;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(560px 380px at 12% 18%, rgba(45, 212, 191, .35), transparent 62%),
    radial-gradient(520px 420px at 88% 82%, rgba(14, 116, 144, .55), transparent 60%),
    #0b3b38;
}
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%); }
.auth-art > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.auth-brand small { display: block; font-size: 12.5px; font-weight: 500; opacity: .8; }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff; }
.auth-copy h1 { font-size: 36px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; max-width: 21ch; }
.auth-copy > p { margin-top: 14px; font-size: 15.5px; opacity: .85; max-width: 52ch; }
.auth-steps { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; max-width: 520px; counter-reset: auth; }
.auth-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); }
.auth-steps .icon { margin-top: 2px; color: #7ee7d8; }
.auth-steps strong { display: block; font-size: 14px; }
.auth-steps span { font-size: 13px; opacity: .8; }
.auth-foot { font-size: 13px; opacity: .75; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.auth-card > p { color: var(--text-2); margin: 6px 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .alert { margin-top: 0; }
.auth-card .input { height: 44px; font-size: 14.5px; border-radius: 12px; }
.auth-mini { display: none; align-items: center; gap: 12px; margin-bottom: 28px; }

/* ---------- Loi ---------- */
.notice { max-width: 520px; margin: 48px auto; padding: 32px; text-align: center; }
.notice .empty-art { background: var(--danger-bg); color: var(--danger); }
.notice h1 { font-size: 22px; margin-bottom: 8px; }
.notice p { color: var(--text-2); margin-bottom: 12px; }
.notice code { word-break: break-all; }

/* ---------- Lien ket tai lieu tu man du lieu ---------- */
.doc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.doc-link:hover { border-color: var(--primary); text-decoration: none; }

/* ---------- Tai lieu: thanh tren rieng (chua dang nhap), muc luc, o tim ---------- */
.docs-topbar { gap: 20px; }
.docs-brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.docs-brand:hover { text-decoration: none; }
.docs-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.docs-nav { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; }
.docs-nav a { padding: 7px 12px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.docs-nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--primary-50); color: var(--primary); }

.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; max-width: 1240px; margin: 0 auto; }
.docs-side { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; padding: 2px 4px 2px 0; }
.docs-toc > summary { display: none; }
.toc-title { margin: 18px 0 6px; padding: 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.docs-toc nav > .toc-title:first-child { margin-top: 0; }
.toc, .toc-sections { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.35; }
.toc a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.toc a[aria-current="page"] { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.toc-sections { margin: 4px 0 8px 12px; border-left: 1px solid var(--border); }
.toc .toc-sections a { margin-left: -1px; padding: 4px 10px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; font-size: 12.5px; overflow-wrap: anywhere; }
.toc .toc-sections a.active { border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.toc-chapter > a.active { color: var(--primary); font-weight: 600; }
/* Co JavaScript: chi chuong dang doc mo cac muc ###; tat JavaScript thi mo het. */
.docs-toc.collapsible .toc-sections { display: none; }
.docs-toc.collapsible .toc-chapter.open > .toc-sections { display: block; }

.docs-main { min-width: 0; }
.docs-bar { display: flex; align-items: flex-start; gap: 10px; max-width: 920px; margin-bottom: 22px; }
.docs-search { position: relative; flex: 1; min-width: 0; }
.docs-search .input { height: 42px; border-radius: 12px; font-size: 14px; }
.search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a:focus { background: var(--primary-50); text-decoration: none; outline: none; }
.r-where { display: block; font-size: 12px; color: var(--text-3); }
.r-title { display: block; font-weight: 600; }
.r-snip { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.search-results mark { padding: 0 1px; border-radius: 3px; background: var(--warn-bg); color: inherit; }
.search-note { padding: 6px 12px; font-size: 12.5px; color: var(--text-3); }
.dl-menu { position: relative; flex: none; margin-left: auto; }
.yaml-link { flex: none; height: 42px; margin-left: auto; border-radius: 12px; }
.yaml-link + .dl-menu { margin-left: 0; }
.dl-menu > summary { height: 42px; border-radius: 12px; list-style: none; }
.dl-menu > summary::-webkit-details-marker { display: none; }
.dl-menu[open] > summary { border-color: var(--primary); color: var(--primary); }
.dl-list { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.dl-title { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.dl-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.dl-list a:hover { background: var(--primary-50); text-decoration: none; }
.dl-list a span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dl-list .dl-all { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; font-size: 13px; color: var(--primary); }

/* ---------- Tai lieu: noi dung Markdown ---------- */
.doc { max-width: 920px; font-size: 14.5px; line-height: 1.65; overflow-wrap: break-word; }
.doc h1 { margin: 0 0 8px; font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.doc h1 + p { margin-bottom: 18px; font-size: 12.5px; color: var(--text-3); }
.doc h2 { margin: 36px 0 12px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 20px; }
.doc h3 { margin: 26px 0 10px; font-size: 16px; }
.doc h4 { margin: 20px 0 8px; font-size: 14.5px; }
.doc .doc-yaml { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--text-2); }
/* Muc luc trong trang: hai cot tren man rong, moi chuong khong bi chia doi giua hai cot. */
.doc #muc-luc + ul { columns: 2; column-gap: 32px; }
.doc #muc-luc + ul > li { break-inside: avoid; }
.doc [id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.doc p, .doc ul, .doc ol, .doc pre, .doc .table-wrap { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li + li { margin-top: 4px; }
.doc strong { font-weight: 650; }
.doc code { padding: 1px 5px; border-radius: 5px; background: var(--surface-3); font-size: .86em; overflow-wrap: break-word; }
.doc pre { padding: 14px 16px; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; line-height: 1.55; }
.doc pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; }
.doc th, .doc td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.doc .contains-task-list { list-style: none; padding-left: 4px; }
.doc .task-list-item input { margin: 0 8px 0 0; vertical-align: -1px; }
.anchor { position: relative; margin-left: 8px; color: var(--text-3); font-weight: 500; opacity: 0; transition: opacity .15s; }
.anchor:hover { text-decoration: none; color: var(--primary); }
.doc :is(h2, h3, h4):hover .anchor, .anchor:focus-visible, .anchor.copied { opacity: 1; }
.anchor.copied::after { content: "Đã chép liên kết"; position: absolute; top: 50%; left: 100%; transform: translateY(-50%); margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (hover: none) { .anchor { opacity: .45; } }

.code-block { position: relative; margin: 0 0 14px; }
.code-block > pre { margin: 0; padding-right: 76px; }
.copy { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; }
.copy:hover { color: var(--text); border-color: var(--text-3); }

.lang-tabs { margin: 0 0 16px; }
.lang-tabs.tabbed { padding: 0 16px 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.lang-bar { display: flex; gap: 2px; margin: 0 -16px 14px; padding: 0 10px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.lang-bar button { margin-bottom: -1px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lang-bar button:hover { color: var(--text); }
.lang-bar button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); }
.lang-tabs.tabbed .lang-panel > h4:first-child { margin-top: 0; }

/* So do luong 4 buoc o trang Bat dau nhanh: 4 o mot hang, khung hep thi 2 roi 1 (container query theo be rong noi dung). */
.flow-card { container-type: inline-size; }
.doc .flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; padding: 0; list-style: none; }
.doc .flow li { position: relative; margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.doc .flow li + li::before { content: ""; position: absolute; top: 26px; left: -15px; width: 16px; height: 2px; background: var(--primary); }
.flow-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 700; }
.flow strong { font-size: 15px; }
.flow-who { font-size: 12px; font-weight: 600; color: var(--primary); }
.flow-what { flex: 1; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.flow a { font-size: 12.5px; font-weight: 600; }
@container (max-width: 700px) {
  .doc .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc .flow li + li::before { display: none; }
}
@container (max-width: 440px) {
  .doc .flow { grid-template-columns: minmax(0, 1fr); }
  .doc .flow li + li::before { display: block; top: -15px; left: 26px; width: 2px; height: 16px; }
}

/* ---------- Tai lieu: bang ma loi, tai ve ---------- */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .input-icon { flex: 1 1 320px; max-width: 560px; }
.filter-bar .count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Hai bang (may chu, cua so) cung be rong cot de doc thang hang; ma loi khong bi ngat giua chu. */
.table.errors { table-layout: fixed; min-width: 640px; }
.table.errors th:nth-child(1) { width: 104px; }
.table.errors th:nth-child(2) { width: 240px; }
.table.errors td { font-size: 13px; }
.table.errors td:nth-child(2) { white-space: nowrap; }
.table.errors tr { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.table.errors tr:target td { background: var(--warn-bg); }
.table.errors td:nth-child(n+3) code { overflow-wrap: anywhere; }
.bundle .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.bundle h2 { margin-bottom: 4px; font-size: 16px; }
.bundle .hint { max-width: 62ch; }
.table.downloads .muted { margin-left: 6px; font-size: 12px; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* ---------- Co man hinh ---------- */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:not(:nth-child(4n)) { border-right: 0; }
  .facts > div:nth-child(odd) { border-right: 1px solid var(--border); }
  .timeline { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 20px; }
  .step { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; text-align: left; padding: 0; }
  .step::before { display: none; }
  .step-dot { grid-row: span 3; margin: 0; }
}
@media (max-width: 1100px) {
  /* Cong co 7 trang: man hep thi thanh ben thanh dai dieu huong ngang tren cung (nha bao hiem mau chi an thanh ben). */
  .app { flex-direction: column; }
  .sidebar { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .sidebar .brand { display: none; }
  .nav { display: flex; gap: 4px; padding: 6px 12px; }
  .nav-link { white-space: nowrap; padding: 7px 10px; }
  .topbar-brand { display: flex; }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .content { padding: 20px 20px 32px; }
  .topbar { padding: 0 20px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mini { display: flex; }
}
/* Tai lieu tren man hep va khi in: dat sau cac khoi tren de de len quy tac chung cung do uu tien. */
@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs-side { position: static; max-height: none; overflow: visible; padding: 0; }
  .docs-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
  .docs-toc > summary { display: list-item; padding: 10px 14px; font-weight: 600; cursor: pointer; }
  .docs-toc[open] > summary { border-bottom: 1px solid var(--border); }
  .docs-toc nav { max-height: 60vh; overflow-y: auto; padding: 12px 6px; }
  .doc { font-size: 14px; }
  .doc h1 { font-size: 23px; }
  .doc h2 { font-size: 18px; }
}
@media (max-width: 720px) {
  .docs-topbar { flex-wrap: wrap; height: auto; gap: 6px 12px; padding: 8px 16px 6px; }
  .docs-topbar .brand-text { display: none; }
  .docs-topbar .btn { margin-left: auto; }
  .docs-nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  /* O tim mot dong rieng, du rong cho chu goi y; hai nut tai xuong dong duoi. */
  .docs-bar { flex-wrap: wrap; }
  .docs-search { flex-basis: 100%; }
  /* Thanh tren hai dong (cao hon --topbar-h): neo dung duoi thanh, khong bi che. */
  .doc [id], .table.errors tr { scroll-margin-top: calc(var(--topbar-h) + 48px); }
  .content { padding: 16px 16px 28px; }
  .code-block > pre { padding: 40px 14px 14px; }
  /* Bang nhieu cot: giu cot du rong, cuon ngang trong khung thay vi ep moi o con mot chu mot dong. */
  .doc th, .doc td { min-width: 9em; }
  .doc #muc-luc + ul { columns: 1; }
  .page-head .doc-links { width: 100%; }
}
@media (max-width: 640px) {
  /* Bang ma loi thanh tung khoi: ma va HTTP tren mot dong, nguyen nhan va cach sua co nhan. */
  .table.errors thead { display: none; }
  .table.errors, .table.errors tbody, .table.errors tr, .table.errors td { display: block; width: auto; min-width: 0; }
  .table.errors tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table.errors tbody tr:last-child { border-bottom: 0; }
  .table.errors td { min-width: 0; padding: 2px 0; border: 0; }
  .table.errors td:nth-child(-n+2) { display: inline-block; margin-right: 8px; }
  .table.errors td:nth-child(n+3)::before { content: attr(data-label); display: block; margin-top: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
  /* Bang tai ve: ten tai lieu mot dong, ba dinh dang xep ngang ben duoi. */
  .table.downloads thead { display: none; }
  .table.downloads, .table.downloads tbody, .table.downloads tr, .table.downloads td { display: block; width: auto; }
  .table.downloads tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.downloads tbody tr:last-child { border-bottom: 0; }
  .table.downloads td { padding: 2px 0; border: 0; }
  .table.downloads td:nth-child(n+2) { display: inline-block; margin: 4px 14px 0 0; }
}
@media print {
  /* In tai lieu: bo khung, muc luc, o tim; in moi ngon ngu cua ma mau. */
  body.is-app { display: block; height: auto; background: #fff; }
  .app, .main { display: block; overflow: visible; }
  .sidebar, .topbar, .docs-side, .docs-bar, .copy, .anchor, .lang-bar, .filter-bar, .doc-links { display: none !important; }
  .docs { display: block; max-width: none; }
  .lang-panel[hidden] { display: block !important; }
  .lang-tabs.tabbed { padding: 0; border: 0; }
  .doc pre { overflow: visible; white-space: pre-wrap; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
