/* Nha bao hiem mau (UAT). Khung, token va thanh phan theo trang DEV (Ci2.Core.Developer), mau nhan xanh mong ket rieng cua nha bao hiem.
   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;

  --env-bg: #fff2cc;
  --env-text: #6b3d00;
  --env-edge: #e9a300;

  --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);
    --env-bg: #3a2a05;
    --env-text: #ffd978;
    --env-edge: #e9a300;
    --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; }

/* ---------- Dai moi truong: luon o tren cung, khong cuon mat ---------- */
.env {
  display: flex; align-items: center; gap: 10px; flex: none;
  min-height: 34px; padding: 6px 20px;
  background: var(--env-bg); color: var(--env-text);
  border-bottom: 1px solid color-mix(in srgb, var(--env-edge) 45%, transparent);
  box-shadow: inset 4px 0 0 var(--env-edge);
  font-size: 13px;
}
.env strong { font-weight: 700; }

/* ---------- 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); }

.env-card { margin: auto 14px 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 12.5px; }
.env-card h2 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
.env-card dl { margin: 0; display: grid; gap: 2px; }
.env-card dt { color: var(--text-3); margin-top: 6px; }
.env-card dt:first-child { margin-top: 0; }
.env-card dd { margin: 0; color: var(--text); font-family: var(--mono); font-size: 12px; word-break: break-all; }

.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; counter-reset: step; }
.bare { min-height: calc(100vh - 34px); }

/* ---------- 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; }

/* Buoc that cua luong UAT (day, mo cua so, nhan goi nguoc): danh so tu dong, Viewer khong co buoc day nen so lien tuc. */
.step { counter-increment: step; }
.step > .card-head h2::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary); font-size: 12.5px; font-weight: 700;
}

/* ---------- 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); }
.verb { display: inline-block; padding: 0 6px; margin-right: 4px; border-radius: 5px; border: 1px solid var(--border-strong); font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-2); }

/* ---------- 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; }

.claims tbody tr[data-href] { cursor: pointer; transition: background .12s; }
.claims tbody tr[data-href]:hover { background: var(--surface-2); }
.claims tbody tr[data-href]:focus-within { background: var(--primary-50); }
.claims td { vertical-align: middle; }
.claims .job { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.claims td:nth-child(3) .truncate { max-width: 220px; }

.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; }

/* ---------- Ho so: dau trang lam viec ---------- */
.claim-head { padding: 22px 24px 0; overflow: hidden; }
.claim-id { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.claim-job { font-size: 13px; color: var(--text-3); }
.claim-job .mono { color: var(--text-2); font-weight: 600; }
.claim-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.claim-ref { margin-top: 8px; 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); }
.claim-ref code { padding: 1px 8px; border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 600; }

.amounts { display: flex; gap: 0; 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)); gap: 0; margin: 0 -24px; border-top: 1px solid var(--border); }
.facts > div { padding: 12px 24px; border-bottom: 1px solid var(--border); min-width: 0; }
.facts > div:not(:nth-child(4n)) { border-right: 1px solid var(--border); }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 2px 0 0; font-weight: 550; overflow-wrap: anywhere; }

.stored { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 -24px; padding: 12px 24px; background: var(--surface-2); }
.stored h2 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.stored ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stored li { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--text-3); }
.stored li.has { border-style: solid; border-color: var(--primary-100); background: var(--surface); color: var(--text); }
.stored li.has .icon { color: var(--ok); }

/* ---------- Ho so: hai thao tac ---------- */
.ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.ops > .card { margin-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.seq { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; }
.seq li { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text); }
.seq li + li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px -6px; border-top: 1.5px solid var(--text-3); border-right: 1.5px solid var(--text-3); transform: rotate(45deg); }
.seq li.off { color: var(--text-3); text-decoration: line-through; }

.push-result { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.push-sum { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.push-result .truncate { max-width: 200px; }

.caps { margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.caps legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cap { display: inline-flex; margin: 0 6px 6px 0; cursor: pointer; }
.cap input { position: absolute; opacity: 0; pointer-events: none; }
.cap span { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); font-size: 13px; color: var(--text-2); transition: background .12s, border-color .12s, color .12s; }
.cap span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border-strong); background: var(--surface); flex: none; }
.cap code { font-size: 11.5px; color: var(--text-3); }
.cap:hover span { border-color: var(--text-3); }
.cap input:checked + span { background: var(--primary-50); border-color: var(--primary); color: var(--text); }
.cap input:checked + span::before { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.cap input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Khung cua so SDK: san khau doi co duoc ---------- */
.stage { overflow: hidden; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.stage-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.stage-bar strong { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; margin-right: auto; }
.stage-hint { font-size: 12px; color: var(--text-3); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius); }
.segmented button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.stage-floor {
  padding: 16px; overflow: auto;
  background-color: var(--surface-3);
  background-image: radial-gradient(color-mix(in srgb, var(--text-3) 35%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
}
.frame {
  width: 100%; height: 760px; min-height: 360px; min-width: 320px; margin: 0 auto;
  resize: both; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.stage[data-width="1280"] .frame { width: 1280px; }
.stage[data-width="1024"] .frame { width: 1024px; }
.stage[data-width="768"] .frame { width: 768px; }
.frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Nhat ky goi nguoc ---------- */
.head-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.stamp { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
/* Bo cuc co dinh: than dai chi cat trong cot cua no, bang khong tran ngang. */
.log { table-layout: fixed; min-width: 900px; }
.log th:nth-child(1) { width: 158px; }
.log th:nth-child(2) { width: 160px; }
.log th:nth-child(3) { width: 140px; }
.log th:nth-child(4) { width: 22%; }
.log td { vertical-align: top; }
.log .truncate { max-width: 100%; }
.log summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.log summary::-webkit-details-marker { display: none; }
.log summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 4px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.log details[open] summary::before { transform: rotate(45deg); }
.log .preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.log details[open] .preview { display: none; }
.log pre { margin: 6px 0 0; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 12px; line-height: 1.55; }
.log pre[data-pretty] { white-space: pre; word-break: normal; }
#callbacks.loading #cb-body { opacity: .55; transition: opacity .2s; }

/* ---------- Dang nhap ---------- */
.auth { min-height: calc(100vh - 34px); 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; }

/* ---------- Co man hinh ---------- */
@media (max-width: 960px) {
  .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); }
}
@media (max-width: 1100px) {
  .sidebar { display: none; }
  .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; }
}
@media (max-width: 860px) {
  .ops { grid-template-columns: minmax(0, 1fr); }
  .amounts > div { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
