/* =========================================================
   Cổng Khảo sát Chuyển đổi số
   Ngôn ngữ thiết kế: giấy tờ hành chính — phiếu tiếp nhận, số phiếu, con dấu.
   Chữ có chân (Noto Serif) cho tiêu đề văn bản, Be Vietnam Pro cho giao diện.
   ========================================================= */
:root {
  --page: #f2f4f7;
  --paper: #ffffff;
  --ink: #0f1b30;
  --ink-2: #2d3b55;
  --muted: #55637a;
  --line: #d4dce7;
  --line-2: #b8c3d4;

  /* Bảng màu thương hiệu HHP Paper & Team CĐS */
  --blue: #0166b3;
  --blue-600: #014f8c;
  --blue-700: #013f70;
  --blue-soft: #e5f0fa;
  --sky: #00a1dd;
  --navy: #014f8c;
  --orange: #f16a33;
  --orange-600: #d6511c;
  --orange-soft: #feeae1;
  --orange-light: #ffa47f;
  --orange-border: #f9c3ad;
  --seal: #b42318;
  --green: #0e7a5f;
  --amber: #d6511c;

  --serif: 'Noto Serif', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px;
  --r-sm: 7px;
  --shadow-1: 0 1px 2px rgba(19, 32, 59, .06);
  --shadow-2: 0 1px 2px rgba(19, 32, 59, .05), 0 6px 20px -6px rgba(19, 32, 59, .12);
  --shadow-paper: 0 1px 1px rgba(19, 32, 59, .04), 0 2px 4px rgba(19, 32, 59, .04), 0 18px 40px -18px rgba(19, 32, 59, .30);

  --st-moi: #0166b3;        --st-moi-bg: #e5f0fa;
  --st-dang: #d6511c;       --st-dang-bg: #feeae1;
  --st-phanhoi: #0e7a5f;    --st-phanhoi-bg: #e3f4ee;
  --st-dong: #5f6b80;       --st-dong-bg: #eef0f4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; overflow-x: clip; scrollbar-width: none; -ms-overflow-style: none; }
body { overflow-x: clip; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 0; }
.container { width: min(1160px, 100% - 48px); margin-inline: auto; }
.container.narrow { width: min(760px, 100% - 48px); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.with-ic { display: inline-flex; align-items: center; gap: 6px; }
.link { font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo svg { width: 34px; height: 34px; color: var(--blue); flex: none; }
.logo span { display: grid; font-size: 12px; line-height: 1.2; color: var(--ink-2); }
.logo span b { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.logo.light span { color: rgba(255,255,255,.65); }
.logo.light span b { color: #fff; }
.logo.light svg { color: var(--sky); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 16px;
  background: var(--paper); color: var(--ink); transition: background .15s, border-color .15s, color .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.ghost { border-color: var(--line-2); background: var(--paper); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.white { background: #fff; color: var(--navy); }
.btn.white:hover { background: var(--blue-soft); }
.btn.outline-white { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.btn.outline-white:hover { background: rgba(255,255,255,.08); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 12px 22px; font-size: 15.5px; }
.btn.block { width: 100%; }

/* ---------- Form ---------- */
.form { display: grid; gap: 16px; }
label { font-weight: 500; font-size: 14px; }
.form label, .fs-body > label, .row-2 > label, .side-action label { display: grid; gap: 6px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: #758299; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 102, 179, .15); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { color: var(--seal); margin: 0; font-size: 13.5px; font-weight: 500; }
.form-error:empty { display: none; }

/* =========================================================
   TRANG CHỦ
   ========================================================= */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a { color: var(--ink-2); font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 6px; }
.site-nav a:hover { color: var(--blue); background: var(--blue-soft); }
.header-actions { display: flex; gap: 8px; }
.mobile-only-btn { display: none; }
@media (max-width: 768px) { .mobile-only-btn { display: inline-flex; } }

.hero { position: relative; overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; padding: 72px 0 82px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--green); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #fde2d6; }
.hero h1 { font-family: var(--serif); font-size: clamp(32px, 3.5vw, 46px); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; margin: 18px 0 20px; }
.hero-accent { color: var(--blue); }
.lead { font-size: 17px; color: var(--ink-2); max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 24px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: ''; width: 16px; height: 16px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e7a5f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat;
}


.stats-band { background: linear-gradient(120deg, var(--blue) 0%, var(--blue-600) 100%); color: #fff; }
.stats-band-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-band-inner div { padding: 28px 24px; display: grid; gap: 2px; border-left: 1px solid rgba(255,255,255,.16); }
.stats-band-inner div:first-child { border-left: 0; padding-left: 0; }
.stats-band-inner b { font-family: var(--serif); font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-band-inner span { color: rgba(255,255,255,.92); font-size: 14px; font-weight: 500; }

.section { padding: 76px 0; }
.section.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section.dark { background: linear-gradient(120deg, var(--blue) 0%, var(--blue-600) 100%); color: #fff; }
.section h2 { font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -.01em; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-lead { font-size: 16.5px; color: var(--ink-2); }
.section.dark .section-lead { color: rgba(255,255,255,.92); }
.kicker { display: inline-block; font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.kicker.light { color: #8cc8ee; }
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.feature { padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature:nth-child(2n) { border-right: 0; }
.feature:nth-last-child(-n+2) { border-bottom: 0; }
.feature h3 { font-size: 16.5px; margin: 14px 0 6px; }
.feature p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.ficon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--blue-soft); }
.ficon svg, .domain svg { width: 21px; height: 21px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.domain-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.domain { padding: 26px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); transition: background .2s; }
.domain:hover { background: #f8f9fc; }
.domain svg { width: 26px; height: 26px; }
.domain h3 { font-size: 15.5px; margin: 14px 0 6px; }
.domain p { font-size: 14px; color: var(--ink-2); margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.timeline::before { content: ''; position: absolute; top: 21px; left: 22px; width: calc(75% + 21px); height: 1px; background: var(--line-2); }
.timeline li { position: relative; }
.tl-num { position: relative; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line-2); font-family: var(--serif); font-weight: 700; color: var(--blue); font-size: 16px; margin-bottom: 18px; }
.timeline h3 { font-size: 16.5px; }
.timeline p { color: var(--ink-2); font-size: 14.5px; }

.levels { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; position: relative; }
.levels::before { content: ''; position: absolute; top: 21px; left: 22px; width: calc(80% + 19.2px); height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .42) 0 6px, transparent 6px 14px); background-size: 28px 2px; animation: flow 1.6s linear infinite; }
.levels::after { content: ''; position: absolute; z-index: 1; top: 17px; left: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 0 16px rgba(241, 106, 51, .9); animation: packet-x-5 10s linear infinite; }
.levels li { position: relative; }
.levels h3 { font-size: 16.5px; color: #fff; margin: 0 0 .45em; }
.levels p { margin: 0; color: rgba(255,255,255,.92); font-size: 14px; }
.lv { position: relative; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-family: var(--serif); font-weight: 700; font-size: 16px; color: #fff; background: #01599e; border: 1.5px solid rgba(255,255,255,.65); margin-bottom: 18px; }

.faq { display: grid; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 0 4px; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--blue); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 20px; margin: 0; max-width: 60ch; }

.cta-band { margin: 0 0 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 42px 50px; border-radius: var(--r); color: #fff; background: linear-gradient(120deg, var(--blue) 0%, var(--blue-600) 100%); box-shadow: 0 18px 40px -20px rgba(1, 79, 140, .45); }
.cta-band h2 { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
.cta-band p { color: rgba(255,255,255,.92); margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.site-footer { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-600) 100%); color: rgba(255,255,255,.92); font-size: 14px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, auto); gap: 36px 56px; align-items: start; padding: 44px 0 30px; }
.footer-brand p { margin: 14px 0 0; max-width: 38ch; color: rgba(255,255,255,.88); line-height: 1.65; }
.footer-inner h4 { color: rgba(255,255,255,.78); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 12px; }
.footer-inner a:not(.logo) { display: block; color: #fff; font-weight: 500; padding: 4px 0; opacity: .9; white-space: nowrap; transition: opacity .15s, transform .15s; }
.footer-inner a:not(.logo):hover { opacity: 1; transform: translateX(2px); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,.18); padding: 16px 0 24px; font-size: 13px; color: rgba(255,255,255,.85); }
.footer-bottom p { margin: 0; }

/* =========================================================
   ĐĂNG NHẬP / ĐĂNG KÝ
   ========================================================= */

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #eef3f9; border: 1px solid #dbe4f0; border-radius: 12px; padding: 4px; margin: 18px 0 22px; }
.tab { font-weight: 600; font-size: 14px; text-align: center; padding: 9px 14px; color: var(--ink-2); border-radius: 9px; transition: background .18s, color .18s, box-shadow .18s; }
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(1, 63, 112, .10); }

/* =========================================================
   KHUNG ỨNG DỤNG
   ========================================================= */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; padding: 0 clamp(16px, 4vw, 40px); height: 64px; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav { display: flex; gap: 4px; flex: 1; align-self: stretch; }
.nav a { display: flex; align-items: center; padding: 0 12px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.nav a.nav-cta { margin: auto 0 auto auto; height: 38px; border-radius: var(--r-sm); color: #fff; background: var(--blue); font-weight: 600; padding: 0 14px; border: 0; }
.nav a.nav-cta:hover { background: var(--blue-600); }
.me { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 12.5px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.me-text { display: grid; font-size: 13px; line-height: 1.3; }
.role-badge, .role-tag { font-size: 12px; font-weight: 600; color: var(--green); }

.main { max-width: 1160px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 80px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-title h1 { font-family: var(--serif); font-size: clamp(26px, 3vw, 32px); font-weight: 700; margin: 0; }
.page-date { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.page-sub { margin: 6px 0 0; color: var(--ink-2); max-width: 60ch; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.panel-title { font-size: 16px; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.panel-title .count { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--page); border-radius: 999px; padding: 1px 9px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty.sm { padding: 16px; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state h3 { font-family: var(--serif); font-size: 19px; }
.empty-state p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 20px; }

/* Tổng quan: một dải số liệu liền, không chia thẻ rời */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; overflow: hidden; }
.figure { padding: 20px 22px; border-left: 1px solid var(--line); display: grid; gap: 4px; }
.figure:first-child { border-left: 0; }
.figure-label { font-size: 13px; color: var(--ink-2); }
.figure-value { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure-value small { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.bar-row b { font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 7px; background: #e6ecf5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 3px; }
.bar-fill.alt { background: var(--sky); }
.recent { margin-top: 32px; }
.section-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-row .panel-title { margin: 0; }

/* Danh sách: mỗi dòng là một phiếu, cuống số phiếu bên trái */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1 1 260px; width: auto; }
.filters select { width: auto; flex: 0 1 220px; }
.result-count { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.slip-list { display: grid; gap: 10px; perspective: 1600px; }
.slip-row {
  position: relative; display: grid; grid-template-columns: 148px 1fr auto; color: inherit;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .2s;
}
.slip-row:hover { border-color: var(--line-2); box-shadow: var(--shadow-paper); }
.slip-row-no { position: relative; padding: 16px 18px; border-right: 1px dashed var(--line-2); display: grid; align-content: center; gap: 1px; }
.slip-row-no::before, .slip-row-no::after { content: ''; position: absolute; right: -8px; width: 15px; height: 15px; border-radius: 50%; background: var(--page); border: 1px solid var(--line); }
.slip-row-no::before { top: -8px; clip-path: inset(50% 0 0 0); }
.slip-row-no::after { bottom: -8px; clip-path: inset(0 0 50% 0); }
.no-label { font-size: 11.5px; color: var(--muted); }
.no-value { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--blue); font-variant-numeric: tabular-nums; }
.no-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.slip-row-body { padding: 15px 20px; min-width: 0; align-self: center; }
.slip-row-title { font-weight: 700; font-size: 15.5px; color: var(--ink); margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-row-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }
.slip-row-meta .ic { width: 14px; height: 14px; color: var(--muted); }
.slip-row-side { padding: 14px 20px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }
.st-moi { color: var(--st-moi); background: var(--st-moi-bg); }
.st-dang_xu_ly { color: var(--st-dang); background: var(--st-dang-bg); }
.st-da_phan_hoi { color: var(--st-phanhoi); background: var(--st-phanhoi-bg); }
.st-da_dong { color: var(--st-dong); background: var(--st-dong-bg); }
.pri { font-size: 12.5px; font-weight: 600; }
.pri-thap { color: var(--muted); }
.pri-trung_binh { color: var(--ink-2); }
.pri-cao { color: var(--amber); }
.pri-khan_cap { color: var(--seal); }
.level { display: inline-flex; gap: 2px; }
.level i { width: 12px; height: 5px; border-radius: 2px; background: var(--line); }
.level i.on { background: var(--blue); }

/* Form khảo sát */
.survey { display: grid; gap: 16px; max-width: 880px; }
.fs { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 0; margin: 0; }
.fs-head { display: flex; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.fs-head legend { float: left; padding: 0; font-weight: 700; font-size: 16px; }
.fs-head p { clear: both; margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.fs-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--blue); }
.fs-body { padding: 22px 24px 24px; display: grid; gap: 18px; }
.field-label { font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale label, .checks label, .chips label { cursor: pointer; }
.scale input, .checks input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: grid; gap: 2px; text-align: center; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 12.5px; font-weight: 400; color: var(--ink-2); height: 100%; transition: border-color .15s, background .15s; }
.scale span b { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.scale label:hover span { border-color: var(--ink-2); }
.scale input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.scale input:checked + span b { color: var(--blue); }
.scale input:focus-visible + span, .checks input:focus-visible + span, .chips input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.checks label { display: block; }
.checks span { height: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-weight: 400; transition: border-color .15s, background .15s; }
.checks span::before { content: ''; width: 17px; height: 17px; border: 1.5px solid #aeb7c7; border-radius: 4px; flex: none; }
.checks label:hover span { border-color: var(--ink-2); }
.checks input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.checks input:checked + span::before {
  border-color: var(--blue);
  background: var(--blue) 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='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { display: inline-block; padding: 7px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 500; font-size: 14px; }
.chips label:hover span { border-color: var(--ink-2); }
.chips input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }

/* =========================================================
   PHIẾU TIẾP NHẬN 3D (trang chi tiết)
   ========================================================= */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.back:hover { text-decoration: underline; }
.slip-stage { position: relative; perspective: 1100px; perspective-origin: 50% 0%; margin: 0 0 24px; padding: 34px 0 40px; }
.slip-tilt {
  --bx: 36deg; --by: -22deg; --bz: -3deg;
  position: relative; cursor: grab; transform-style: preserve-3d; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transform: translateZ(-170px)
    rotateX(calc(var(--bx) * (1 - var(--lift, 0)) + 8deg * var(--lift, 0) + var(--rx, 0deg)))
    rotateY(calc(var(--by) * (1 - var(--lift, 0)) + var(--ry, 0deg)))
    rotateZ(calc(var(--bz) * (1 - var(--lift, 0))));
  animation: slip-enter 1.3s cubic-bezier(.16,.84,.24,1) both;
}
.slip-tilt.tilting { will-change: transform; }
.slip-stage.grabbing .slip-tilt { cursor: grabbing; }
.slip-tilt:focus-visible { outline: none; }
.slip-tilt:focus-visible .slip-face { box-shadow: 0 0 0 3px rgba(1,102,179,.35), var(--shadow-paper); }
@keyframes slip-enter {
  from { opacity: 0; transform: translateY(-50px) rotateX(55deg) rotateY(-38deg) rotateZ(-6deg) scale(.92); }
  40% { opacity: 1; }
}
.slip-flip { position: relative; display: grid; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.25,.45,1); }
.slip-flip.dragging { transition: none; }
.sheet {
  position: absolute; inset: 0; border-radius: var(--r); border: 1px solid #cfd6e2;
  background: hsl(220 30% calc(99% - var(--i) * 1.4%));
  transform: translate3d(calc(var(--i) * .6px), calc(var(--i) * 1.2px), calc(var(--i) * -3.2px)) rotateZ(calc(var(--i) * .08deg));
}
.sheet:first-child { box-shadow: 0 40px 60px -24px rgba(1,63,112,.4); }
.slip-desk { position: absolute; left: 6%; right: 2%; bottom: 0; height: 60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(1,63,112,.25), transparent); filter: blur(10px); transform: skewX(-18deg); pointer-events: none; }
.slip-face {
  grid-area: 1 / 1; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-paper); backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.slip-back { transform: rotateY(180deg); display: flex; flex-direction: column; }
.slip-face::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 4px; border-radius: var(--r) var(--r) 0 0; background: var(--blue); }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 30px 18px; border-bottom: 1px solid var(--line); }
.slip-org { display: grid; line-height: 1.35; }
.slip-org b { font-size: 14.5px; font-weight: 700; }
.slip-org span { font-size: 13px; color: var(--muted); }
.slip-no { display: grid; text-align: right; line-height: 1.2; }
.slip-no span { font-size: 12px; color: var(--muted); }
.slip-no b { white-space: nowrap; font-family: var(--serif); font-size: 26px; color: var(--blue); font-variant-numeric: tabular-nums; }
.slip-body { padding: 24px 30px 26px; padding-right: 220px; }
.slip-kind { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.slip-title { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; line-height: 1.3; margin: 0 0 22px; max-width: 30em; }
.slip-fields { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 12px 40px; margin: 0; }
.slip-fields.wide { grid-template-columns: repeat(4, 1fr); padding: 24px 30px; gap: 18px 28px; }
.sf { display: grid; gap: 3px; min-width: 0; }
.sf dt { font-size: 12.5px; color: var(--muted); }
.sf dd { margin: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.slip-perf { position: relative; height: 0; border-top: 1.5px dashed var(--line-2); margin: 0 18px; }
.slip-perf::before, .slip-perf::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--page); border: 1px solid var(--line); }
.slip-perf::before { left: -29px; clip-path: inset(0 0 0 50%); }
.slip-perf::after { right: -29px; clip-path: inset(0 50% 0 0); }
.slip-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 30px 18px; }
.slip-sender { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 14px; font-weight: 500; }
.slip-sender .ic { color: var(--muted); }
.barcode { display: flex; align-items: stretch; gap: 2px; height: 30px; color: var(--ink); opacity: .85; }
.barcode i { display: block; background: currentColor; }
.slip-back-code { margin-top: auto; display: grid; justify-items: center; gap: 4px; padding: 6px 30px 22px; }
.slip-back-code .barcode { height: 38px; }
.slip-back-code span { font-family: var(--serif); font-size: 13px; letter-spacing: .3em; color: var(--ink-2); }
.slip-controls { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.flip-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--blue); background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; padding: 6px 12px; }
.flip-btn:hover { border-color: var(--blue); }

/* Con dấu trạng thái */
.stamp {
  --c: var(--st-moi);
  position: absolute; right: 40px; top: 80px; width: 146px; height: 146px; border-radius: 50%;
  display: grid; place-items: center; color: var(--c); pointer-events: none;
  border: 3px solid var(--c); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6.5px var(--c);
  transform: rotate(-12deg); opacity: .82; mix-blend-mode: multiply;
}
.stamp span { font-family: var(--serif); font-weight: 700; font-size: 13.5px; letter-spacing: .05em; text-transform: uppercase; text-align: center; line-height: 1.15; max-width: 120px; white-space: nowrap; border-block: 1.5px solid var(--c); padding: 4px 0; }
.stamp-dang_xu_ly { --c: var(--orange-600); }
.stamp-da_phan_hoi { --c: var(--seal); }
.stamp-da_dong { --c: var(--st-dong); }

.slip-stage.print-in .slip-tilt { animation-duration: 1.5s; }
.slip-stage.print-in .stamp { animation: stamp-in .4s cubic-bezier(.3,1.6,.5,1) 1.3s both; }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-12deg) scale(1.9); } }

/* Nội dung chi tiết */
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; margin-top: 16px; }
.detail-main { display: grid; gap: 20px; min-width: 0; }
.doc h2 { font-size: 15px; font-weight: 700; margin: 24px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.prose { white-space: pre-wrap; word-break: break-word; margin: 0; max-width: 72ch; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13.5px; padding: 4px 11px; background: var(--page); border: 1px solid var(--line); border-radius: 6px; }
.side { position: sticky; top: 88px; }
.side-action { display: grid; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.side-action p { margin: 0; font-size: 14px; }
.progress { list-style: none; padding: 0; margin: 0; display: grid; }
.progress li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--ink-2); font-size: 14.5px; }
.progress li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 30px; bottom: -6px; width: 1.5px; background: var(--line); }
.progress li.done::after { background: var(--blue); }
.pg-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--paper); flex: none; }
.pg-dot .ic { width: 13px; height: 13px; stroke-width: 3; color: #fff; }
.progress li.done { color: var(--ink); }
.progress li.done .pg-dot { background: var(--blue); border-color: var(--blue); }
.progress li.current { color: var(--ink); font-weight: 700; }
.progress li.current .pg-dot { border: 6px solid var(--orange); }

.thread { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 18px; }
.msg { display: flex; gap: 12px; }
.msg-body { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.msg.admin .msg-body { background: var(--blue-soft); border-color: #c5dff5; }
.msg.admin .avatar { background: var(--blue); color: #fff; }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; margin-bottom: 4px; }
.msg-head time { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.reply { display: grid; gap: 10px; margin-top: 18px; }

/* Thông báo */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-sm); box-shadow: var(--shadow-2); z-index: 50; font-size: 14px; }
.toast.error { background: var(--seal); }

/* =========================================================
   MÀN HÌNH NHỎ
   ========================================================= */
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .header-actions { margin-left: auto; }
  .domain-grid { grid-template-columns: repeat(2, 1fr); }
  .slip-body { padding-right: 30px; }
  .stamp { top: auto; bottom: 70px; right: 28px; width: 128px; height: 128px; }
  .stamp span { font-size: 12px; }
  .slip-fields { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 900px) {
  .hero-inner, .split { grid-template-columns: 1fr; gap: 44px; }
  .hero-inner { padding: 56px 0 72px; }
  .stats-band-inner { grid-template-columns: repeat(2, 1fr); }
  .stats-band-inner div { padding: 22px 0; border-left: 0; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline::before { display: none; }
  .section { padding: 72px 0; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
  .auth { grid-template-columns: 1fr; }
  .grid-2, .detail { grid-template-columns: 1fr; }
  .side { position: static; }
  .topbar { flex-wrap: wrap; gap: 10px; height: auto; padding-top: 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; height: 44px; }
  .me { margin-left: auto; }
  .slip-fields.wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .container, .container.narrow { width: calc(100% - 32px); }
  .header-inner { height: 62px; gap: 12px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 7px 11px; font-size: 13.5px; }
  .logo svg { width: 30px; height: 30px; }
  .logo span { font-size: 11px; }
  .logo span b { font-size: 14px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 16px; }
  .hero-cta .btn { flex: 1; }
  .feature-grid, .domain-grid, .timeline { grid-template-columns: 1fr; }
  .feature { border-right: 0; }
  .feature:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .stats-band-inner b { font-size: 28px; }
  .cta-band { padding: 30px 22px; margin-bottom: 64px; }
  .cta-actions .btn { flex: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .scale span small { display: none; }
  .fs-head, .fs-body { padding-inline: 18px; }
  .main { padding-top: 24px; }
  .figure { border-left: 0; border-top: 1px solid var(--line); }
  .figures { grid-template-columns: 1fr 1fr; }
  .figure:nth-child(-n+2) { border-top: 0; }
  .figure:nth-child(2n) { border-left: 1px solid var(--line); }
  .slip-row { grid-template-columns: 1fr; }
  .slip-row-no { border-right: 0; border-bottom: 1px dashed var(--line-2); grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; padding: 12px 16px; }
  .slip-row-no::before, .slip-row-no::after { display: none; }
  .slip-row-body { padding: 12px 16px 4px; }
  .slip-row-title { white-space: normal; }
  .slip-row-side { flex-direction: row; justify-content: flex-start; padding: 8px 16px 14px; }
  .me-text { display: none; }
  .nav a { white-space: nowrap; padding: 0 10px; font-size: 14px; }
  .slip-head { padding: 18px 18px 14px; }
  .slip-tilt { --bx: 30deg; --by: -16deg; --bz: -2deg; }
  .slip-tip { display: none; }
  .slip-no b { font-size: 21px; }
  .slip-body { padding: 18px 18px 22px; }
  .slip-fields, .slip-fields.wide { grid-template-columns: 1fr 1fr; gap: 12px 18px; }
  .slip-fields.wide { padding: 18px; }
  .slip-perf { margin: 0 8px; }
  .slip-perf::before { left: -19px; }
  .slip-perf::after { right: -19px; }
  .slip-foot { padding: 14px 124px 18px 18px; flex-direction: column; align-items: flex-start; min-height: 124px; justify-content: center; }
  .slip-sender { flex-direction: column; }
  .filters select { flex: 1 1 40%; }
  .slip-foot .barcode { display: none; }
  .stamp { bottom: 16px; right: 14px; width: 104px; height: 104px; border-width: 2.5px; }
  .stamp span { font-size: 10px; letter-spacing: .02em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* =========================================================
   HỆ HIỆU ỨNG 3D DÙNG CHUNG (mọi trang)
   ========================================================= */
.reveal:not(.in) { opacity: 0; }
.reveal.in { animation: rise-clean .62s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms) backwards; }
@keyframes rise-clean { from { opacity: 0; transform: translateY(16px) scale(.99); } }

.t3d {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0px));
  transition: transform .55s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.t3d.tilting { --tz: 22px; transition: transform .12s linear, box-shadow .35s; box-shadow: 0 30px 50px -24px rgba(1,63,112,.35), 0 2px 6px rgba(1,63,112,.06); z-index: 2; position: relative; }

.btn { transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease, background .18s ease, border-color .18s ease; }
.btn.primary, .nav a.nav-cta { box-shadow: 0 2px 6px rgba(1, 79, 140, .22), 0 8px 18px -6px rgba(1, 102, 179, .38); }
.btn.ghost, .btn.white, .flip-btn { box-shadow: 0 1px 2px rgba(15, 27, 48, .06), 0 4px 10px -6px rgba(1, 63, 112, .16); }
.btn.outline-white { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.btn:hover:not(:disabled), .nav a.nav-cta:hover, .flip-btn:hover { transform: translateY(-1.5px); }
.btn.primary:hover:not(:disabled), .nav a.nav-cta:hover { box-shadow: 0 4px 12px rgba(1, 79, 140, .28), 0 14px 24px -8px rgba(1, 102, 179, .45); }
.btn:active:not(:disabled), .nav a.nav-cta:active, .flip-btn:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(1, 63, 112, .25); }

.main.page-in { animation: page-swing .7s cubic-bezier(.2,.8,.2,1) backwards; transform-origin: 0% 50%; }
@keyframes page-swing { from { opacity: 0; transform: perspective(1600px) rotateY(18deg) translateX(40px); } }

.panel.in .bar-fill { animation: bar-grow 1.1s cubic-bezier(.2,.8,.2,1) calc(var(--d, 0ms) + 300ms) backwards; transform-origin: 0 50%; }
@keyframes bar-grow { from { transform: scaleX(0); } }

.figures { background: none; border: 0; overflow: visible; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.figure { background: var(--paper); border: 1px solid var(--line) !important; border-radius: var(--r); }

.domain-grid { border: 0; gap: 16px; }
.domain { height: 196px; padding: 0; border: 0; background: none; perspective: 1000px; cursor: pointer; outline: none; }
.domain:hover { background: none; }
.fc-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.22,.8,.3,1); }
.domain:hover .fc-inner, .domain:focus .fc-inner { transform: rotateY(180deg); }
.fc-front, .fc-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r); padding: 24px 22px; display: flex; flex-direction: column; }
.fc-front { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line), 0 14px 24px -16px rgba(1,63,112,.25); }
.fc-front h3 { margin: auto 0 4px; font-size: 16.5px; }
.fc-hint { font-size: 13px; color: var(--blue); font-weight: 600; }
.fc-back { background: var(--blue); color: #fff; transform: rotateY(180deg); box-shadow: 0 3px 0 var(--blue-700), 0 18px 30px -16px rgba(1,102,179,.6); }
.fc-back h3 { font-size: 16px; margin-bottom: 8px; }
.fc-back p { color: rgba(255,255,255,.92); font-size: 14.5px; margin: 0; }
.domain:focus-visible .fc-front, .domain:focus-visible .fc-back { outline: 2px solid var(--blue); outline-offset: 3px; }
.domain svg { width: 30px; height: 30px; }

@media (max-width: 600px) {
  .domain { height: 170px; }
  .t3d.tilting { --tz: 0px; }
}
@media (prefers-reduced-motion: reduce) { .reveal:not(.in) { opacity: 1; } }

/* =========================================================
   TRANG ĐĂNG NHẬP / ĐĂNG KÝ / XÁC THỰC TỐI GIẢN, HIỆN ĐẠI
   ========================================================= */
.auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f5f7fb;
}
.auth-top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
}
.auth-top-inner { display: flex; justify-content: flex-start; align-items: center; height: 100%; }
.auth-card-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 8px;
  width: fit-content;
}
.auth-card-logo img { width: 44px; height: 44px; object-fit: contain; display: block; }
.auth-top .back-home {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #dde4ee;
  background: #fff;
  transition: color .15s, border-color .15s, background .15s;
}
.auth-top .back-home:hover { color: var(--blue); border-color: #b7d2ed; background: var(--blue-soft); }

.auth-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 32px;
}
.auth-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: auto;
  width: min(430px, 100%);
  min-height: 430px;
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 16px;
  padding: 32px 32px 28px;
  box-shadow: 0 2px 6px rgba(15, 27, 48, .03), 0 18px 42px -18px rgba(1, 63, 112, .14);
}
.auth-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--blue) 0 72%, var(--orange) 72%);
}
#auth-main-head { margin-bottom: 20px; }
#auth-tabs[hidden] { display: none !important; }
.unit-row { grid-template-columns: 152px 1fr; }
.auth-card select { width: 100%; }

.auth-card h2 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
  text-align: center;
  margin: 0 0 6px;
}
.auth-sub {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 auto;
  max-width: 34ch;
  line-height: 1.5;
  text-wrap: balance;
}
.auth-card .tabs { margin: 16px 0 0; padding: 3px; border-radius: 10px; }
.auth-card .tab { padding: 7px 12px; font-size: 13.5px; border-radius: 8px; }
.auth-card .form { gap: 14px; }
.auth-card .row-2 { gap: 11px; }
.auth-card label { font-weight: 600; font-size: 13px; color: #24324a; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.4; }

.field-group { display: grid; gap: 5px; text-align: left; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.forgot-link { font-size: 12px; font-weight: 600; color: var(--blue); }
.forgot-link:hover { text-decoration: underline; }

.input-wrap { position: relative; display: flex; align-items: center; }
.auth-card input, .auth-card select {
  height: 39px;
  background: #fff;
  border: 1px solid #d5dee9;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.auth-card .input-wrap input { padding-right: 36px; }
.auth-card input:focus, .auth-card select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(1, 102, 179, .12);
}

.pw-toggle {
  position: absolute;
  right: 4px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6b7a93;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.pw-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.is-shown .eye-open { display: none; }
.pw-toggle.is-shown .eye-off { display: block; }
.pw-toggle:hover { color: var(--blue); background: rgba(1, 102, 179, .08); }

.auth-submit { height: 40px; font-size: 14px; border-radius: 8px; margin-top: 2px; padding: 0 16px; }

.auth-oauth { margin-top: 12px; display: grid; gap: 10px; }
.auth-oauth[hidden] { display: none !important; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: #e3e9f2; }
.btn-google {
  height: 40px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  border: 1px solid #d5dee9;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 27, 48, .04);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn-google svg { width: 17px; height: 17px; flex: none; }
.btn-google:hover { background: #f8fafd; border-color: #b7c6d8; box-shadow: 0 3px 10px -4px rgba(15, 27, 48, .12); transform: translateY(-1px); }
.btn-google:active { transform: translateY(0); }
.auth-step-foot {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
  text-align: center;
}
.step-back-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); }
.step-back-link:hover { color: var(--blue); text-decoration: underline; }

.auth-card .form-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--seal);
  font-size: 13px;
  line-height: 1.45;
}
.auth-card .form-error:empty { display: none; }

.auth-mini-note {
  margin: -2px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.auth-mini-note.warn { color: #9a4515; }
.auth-mini-note:empty { display: none; }
.auth-mini-note b { font-weight: 600; color: var(--ink-2); }

.auth-step { text-align: left; }
.auth-step .email-pill, .auth-step .sender-note, .auth-step .otp-resend-row, .auth-step .step-back-link, .auth-step .step-icon, .auth-step .step-sub { text-align: center; }
.auth-step .email-pill { display: table; margin: -4px auto 4px; }
.auth-step .step-back-link { display: table; margin: 2px auto 0; }
.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin: 0 auto 6px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #cce0f5;
  display: grid;
  place-items: center;
}
.step-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.step-icon.ok { background: #e3f4ee; color: var(--green); border-color: #b7e2d2; }
.step-sub { font-size: 13px; color: var(--muted); margin: 0 auto 4px; line-height: 1.45; max-width: 34ch; }
.email-pill {
  display: inline-block;
  margin: 2px auto 0;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}
.email-pill:empty { display: none; }
.sender-note { margin: 2px auto 4px; font-size: 12px; color: var(--muted); }
.sender-note:empty { display: none; }
.sender-note b { color: var(--ink-2); }

.left-label { text-align: left; }
.center { text-align: center; }

.otp-digits { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; max-width: 306px; margin: 4px auto 2px; }
.auth-card .otp-digits input {
  height: 44px;
  padding: 0;
  text-align: center;
  font-size: 18.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #f8fafd;
  border: 1.5px solid #cfdbe9;
  border-radius: 9px;
}
.auth-card .otp-digits input:not(:placeholder-shown) {
  border-color: #7eb3e0;
  background: #f0f7fe;
  color: var(--blue-700);
}
.auth-card .otp-digits input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(1, 102, 179, .14);
}
.otp-resend-row { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; }
.otp-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.otp-status:empty { display: none; }
.otp-status.ok { color: var(--green); font-weight: 500; }
.otp-status.err { color: var(--seal); font-weight: 500; }
.step-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 2px; }

.welcome-view { gap: 14px; padding: 6px 0; }
.welcome-timer { display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin: 2px 0; }
.welcome-timer b { color: var(--blue); }
.welcome-bar { height: 5px; border-radius: 99px; background: var(--blue-soft); overflow: hidden; }
.welcome-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--blue), var(--orange)); transform-origin: 0 50%; transition: transform 5s linear; }
.welcome-bar i.go { transform: scaleX(0); }

@media (max-width: 600px) {
  .auth-top { height: 54px; }
  .auth-side { padding: 14px 14px 36px; align-items: start; }
  .auth-card, .auth-card.wide { padding: 24px 20px 22px; }
  .unit-row { grid-template-columns: 1fr; }
  .auth-card-logo img { width: 46px; height: 46px; }
  .auth-card .otp-digits input { height: 44px; font-size: 18px; }
  .step-actions { grid-template-columns: 1fr; }
}

/* =========================================================
   Thành phần cho khảo sát nội bộ HHP – HHPY
   ========================================================= */
.title-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-note { margin: -10px 0 16px; font-size: 13.5px; color: var(--ink-2); }
.factory-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: var(--blue); background: var(--blue-soft); border-radius: 4px; padding: 1px 7px; }
.assignee-tag { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
textarea.short { min-height: 76px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; margin: 0 0 16px; padding: 14px 16px; background: #f4f7fb; border: 1px solid var(--line); border-radius: var(--r-sm); }
.facts div { display: grid; gap: 2px; min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.doc h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 16px 0 6px; }
.side-kv { display: grid; gap: 10px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.side-kv div { display: grid; gap: 2px; }
.side-kv dt { font-size: 12.5px; color: var(--muted); }
.side-kv dd { margin: 0; font-weight: 600; font-size: 14px; }
.side-action select { margin-top: 2px; }
.filters select { flex: 0 1 190px; }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.roadmap li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.roadmap .rm-time { font-size: 13px; font-weight: 700; color: var(--blue); }
.roadmap h3 { font-family: var(--serif); font-size: 20px; margin: 6px 0 10px; }
.roadmap p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
@media (max-width: 900px) { .roadmap { grid-template-columns: 1fr; } }
.nav a { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 601px) { .me-text { display: none; } .topbar { gap: 18px; } }

/* Cảnh 3D chuyển đổi số phía sau phần đầu trang chủ */
.hero-scene {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.12) 42%, #000 68%);
          mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.12) 42%, #000 68%);
}
.hero-inner { z-index: 1; }
@media (max-width: 900px) {
  .hero-scene { -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 40%, #000 72%); mask-image: linear-gradient(180deg, transparent 0%, transparent 40%, #000 72%); }
}

.t3d, .t3d.tilting {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(calc(var(--lift, 0) * -6px));
  transition: none;
  box-shadow: calc(var(--lift, 0) * 0px) calc(var(--lift, 0) * 22px) calc(var(--lift, 0) * 42px) calc(var(--lift, 0) * -18px) rgba(1, 63, 112, .28);
  backface-visibility: hidden;
}
.t3d.tilting { z-index: 2; will-change: transform; }
.feature.t3d::after, .figure.t3d::after, .roadmap li.t3d::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 50%), rgba(0, 161, 221, .10), transparent 60%);
  opacity: var(--lift, 0);
}
.timeline li.t3d { box-shadow: none; }
.timeline li.t3d .tl-num { transform: translateY(calc(var(--lift, 0) * -4px)); }

.feature-grid { gap: 14px; border: 0; background: none; overflow: visible; border-radius: 0; }
.feature, .feature:nth-child(2n), .feature:nth-last-child(-n+2) { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }

.stats-band-inner > div { position: relative; transition: background-color .45s ease; }
.stats-band-inner > div::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 2px; background: var(--orange-light);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.stats-band-inner > div:first-child::before { left: 0; }
.stats-band-inner > div b { display: inline-block; transition: transform .45s cubic-bezier(.2,.8,.2,1), color .45s; }
.stats-band-inner > div:hover { background-color: rgba(255, 255, 255, .045); }
.stats-band-inner > div:hover::before { transform: scaleX(1); }
.stats-band-inner > div:hover b { transform: translateY(-3px); color: #ffd8c8; }

.levels li:hover .lv { border-color: #fff; }

.slip-row { transform: none; transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease, border-color .3s ease; }
.slip-row::after {
  content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--blue); transform: scaleY(0); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.slip-row:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 18px 32px -20px rgba(1, 63, 112, .32); }
.slip-row:hover::after { transform: scaleY(1); }

.bar-row .bar-fill { transition: filter .3s ease; }
.bar-row:hover .bar-fill { filter: brightness(1.25) saturate(1.2); }
.bar-row:hover > span { color: var(--blue); }
.bar-row > span { transition: color .3s ease; }

.panel, .fs, .auth-card, .cta-band { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .t3d, .t3d.tilting, .slip-row:hover { transform: none !important; }
}

/* =========================================================
   BỘ HIỆU ỨNG "SỐ HÓA": giấy tờ được quét và chuyển thành dữ liệu
   ========================================================= */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

body { background-color: var(--page); background-image: radial-gradient(rgba(1, 102, 179, .05) 1px, transparent 1.2px); background-size: 22px 22px; }
#landing-view, #app-view, #auth-view { position: relative; z-index: 1; }
.fx-spot {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background-image: radial-gradient(rgba(1, 102, 179, .18) 1.1px, transparent 1.4px), radial-gradient(360px circle at var(--cx, -999px) var(--cy, -999px), rgba(241, 106, 51, .045), transparent 70%);
  background-size: 22px 22px, 100% 100%;
  -webkit-mask-image: radial-gradient(240px circle at var(--cx, -999px) var(--cy, -999px), #000 0%, rgba(0,0,0,.5) 45%, transparent 75%);
          mask-image: radial-gradient(240px circle at var(--cx, -999px) var(--cy, -999px), #000 0%, rgba(0,0,0,.5) 45%, transparent 75%);
}
.fx-spot.on { opacity: 1; }
.hero, .site-header, .topbar { position: relative; }
.site-header, .topbar { position: sticky; }
.section { background-color: transparent; }


/* 5. Các bước thực hiện: đường nối thành luồng dữ liệu, chạm vào mới sáng */
.timeline::before {
  height: 2px; top: 21px; left: 22px; width: calc(75% + 21px);
  background: repeating-linear-gradient(90deg, rgba(1, 102, 179, .35) 0 6px, transparent 6px 14px);
  background-size: 28px 2px; animation: flow 1.6s linear infinite;
}
@keyframes flow { to { background-position: 28px 0; } }
.timeline::after {
  content: ''; position: absolute; z-index: 1; top: 17px; left: 17px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px rgba(241, 106, 51, .2), 0 0 16px rgba(241, 106, 51, .8);
  animation: packet-x 8s linear infinite;
}
@keyframes packet-x {
  0%   { left: 17px; opacity: 0; }
  2%   { left: 17px; opacity: 1; }
  29%  { left: calc(25% + 24px); opacity: 1; }
  56%  { left: calc(50% + 31px); opacity: 1; }
  83%  { left: calc(75% + 38px); opacity: 1; }
  91%  { left: calc(75% + 38px); opacity: 0; }
  100% { left: calc(75% + 38px); opacity: 0; }
}
.tl-num { animation: node-pass 8s linear infinite; }
.timeline li:nth-child(1) .tl-num { animation-delay: 0s; }
.timeline li:nth-child(2) .tl-num { animation-delay: 2.08s; }
.timeline li:nth-child(3) .tl-num { animation-delay: 4.24s; }
.timeline li:nth-child(4) .tl-num { animation-delay: 6.40s; }
@keyframes node-pass {
  0%, 1.5%  { background: var(--paper); color: var(--blue); border-color: var(--line-2); box-shadow: 0 0 0 0 rgba(241, 106, 51, 0); }
  3.5%, 10% { background: var(--orange); color: #fff; border-color: var(--orange); box-shadow: 0 0 0 9px rgba(241, 106, 51, .22); }
  18%, 100% { background: var(--paper); color: var(--blue); border-color: var(--line-2); box-shadow: 0 0 0 0 rgba(241, 106, 51, 0); }
}

/* 6. Lộ trình: thanh tiến độ nạp lần lượt qua 3 giai đoạn */
.roadmap li { overflow: hidden; }
.roadmap li::before {
  content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--orange)); transform: scaleX(0); transform-origin: 0 50%;
}
.roadmap li.in::before { animation: load-bar 1.2s cubic-bezier(.2, .8, .2, 1) calc(var(--d, 0ms) + 400ms) forwards; }
@keyframes load-bar { to { transform: scaleX(1); } }

/* 7. Năm mức số hóa: timeline ngang 5 bước, chạm vào mới sáng */
@keyframes packet-x-5 {
  0%   { left: 17px; opacity: 0; }
  2%   { left: 17px; opacity: 1; }
  22%  { left: calc(20% + 21.8px); opacity: 1; }
  42%  { left: calc(40% + 26.6px); opacity: 1; }
  62%  { left: calc(60% + 31.4px); opacity: 1; }
  82%  { left: calc(80% + 36.2px); opacity: 1; }
  91%  { left: calc(80% + 36.2px); opacity: 0; }
  100% { left: calc(80% + 36.2px); opacity: 0; }
}
.lv { animation: level-pass 10s linear infinite; }
.levels li:nth-child(1) .lv { animation-delay: 0s; }
.levels li:nth-child(2) .lv { animation-delay: 1.88s; }
.levels li:nth-child(3) .lv { animation-delay: 3.88s; }
.levels li:nth-child(4) .lv { animation-delay: 5.88s; }
.levels li:nth-child(5) .lv { animation-delay: 7.88s; }
@keyframes level-pass {
  0%, 1.5%  { background: #01599e; color: #fff; border-color: rgba(255,255,255,.65); box-shadow: 0 0 0 0 rgba(255, 164, 127, 0); }
  3.5%, 10% { background: var(--orange); color: #fff; border-color: var(--orange); box-shadow: 0 0 0 9px rgba(255, 164, 127, .28); }
  17%, 100% { background: #01599e; color: #fff; border-color: rgba(255,255,255,.65); box-shadow: 0 0 0 0 rgba(255, 164, 127, 0); }
}

/* 8. Thẻ lĩnh vực: mặt sau có viền sáng chạy quanh như mạch điện */
.fc-back { overflow: hidden; }
.fc-back::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 70%, var(--orange-light) 85%, #fff 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-ang 2.6s linear infinite paused;
}
.domain:hover .fc-back::before, .domain:focus .fc-back::before { animation-play-state: running; }
@keyframes spin-ang { to { --ang: 360deg; } }
.fc-back::after {
  content: ''; position: absolute; right: -30px; bottom: -30px; width: 140px; height: 140px; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.4px); background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(circle, #000, transparent 70%); mask-image: radial-gradient(circle, #000, transparent 70%);
}

/* 9. Nút chính: vệt sáng quét qua khi rê chuột */
.btn.primary, .nav a.nav-cta { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::after, .nav a.nav-cta::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); transition: left .6s cubic-bezier(.2, .8, .2, 1);
}
.btn.primary:hover::after, .nav a.nav-cta:hover::after { left: 120%; }

/* 10. Thanh số liệu dưới đầu trang: tia quét ngang chạy chậm */
.stats-band { position: relative; overflow: hidden; }
.stats-band::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -20%; width: 18%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 164, 127, .08), transparent);
  animation: band-scan 7s linear infinite;
}
@keyframes band-scan { to { left: 110%; } }

/* 11. Ô số liệu trong ứng dụng: góc mạch số khi rê chuột */
.figure::before {
  content: ''; position: absolute; right: 10px; top: 10px; width: 18px; height: 18px; pointer-events: none;
  border-top: 2px solid var(--orange); border-right: 2px solid var(--orange); border-radius: 0 6px 0 0;
  opacity: 0; transform: translate(-4px, 4px); transition: opacity .35s ease, transform .35s ease;
}
.figure:hover::before { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .timeline::after, .levels::before, .levels::after { display: none; }
  .levels { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (max-width: 600px) {
  .levels { grid-template-columns: 1fr; gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.in, .tl-num, .timeline::before, .timeline::after, .lv, .levels::before, .levels::after, .stats-band::after { animation: none !important; }
  .roadmap li::before { transform: none; }
  .fx-spot { display: none; }
}
.roadmap li { position: relative; }
/* Đầu trang: không còn xấp phiếu, cột phải để trống cho mạng lưới 3D */
.hero-orb { min-height: 500px; }
@media (max-width: 900px) { .hero-orb { min-height: 380px; } }
@media (max-width: 600px) { .hero-orb { min-height: 330px; } }

/* ===== Điểm nhấn thương hiệu & Logo ===== */
.eyebrow { color: var(--orange-600); }
.pulse { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.kicker { color: var(--orange-600); }
.hero-points li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f16a33' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }
.role-badge, .role-tag { color: var(--orange-600); }
.btn.white { color: var(--blue); }
.fs-num { color: var(--orange-600); border-color: var(--orange-border); }
.slip-face::before { background: linear-gradient(90deg, var(--blue) 0 70%, var(--orange) 70%); }
.nav a.active { color: var(--blue); border-bottom-color: var(--orange); }
.factory-tag { color: var(--blue); background: var(--blue-soft); }
.stats-band-inner b { color: #fff; }
.stats-band-inner > div:hover b { color: #ffd8c8; }

.logo img { width: 46px; height: 46px; flex: none; display: block; object-fit: contain; }
.logo.light img {
  width: 50px;
  height: 50px;
  background: none;
  border-radius: 0;
  padding: 2px;
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff);
}
.logo span { line-height: 1.15; }
.logo-slogan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.1;
  color: var(--orange);
  white-space: nowrap;
}
.logo-slogan::before,
.logo-slogan::after {
  content: '';
  width: 24px;
  height: 2px;
  border-radius: 1px;
  flex: none;
}
.logo-slogan::before { background: linear-gradient(90deg, transparent, var(--orange)); }
.logo-slogan::after { background: linear-gradient(90deg, var(--orange), transparent); }
.logo.light .logo-slogan { color: #ffe4d6; }
.logo.light .logo-slogan::before { background: linear-gradient(90deg, transparent, var(--orange-light)); }
.logo.light .logo-slogan::after { background: linear-gradient(90deg, var(--orange-light), transparent); }
@media (max-width: 600px) {
  .logo img { width: 38px; height: 38px; }
  .logo-slogan { font-size: 10.5px; gap: 5px; letter-spacing: .05em; }
  .logo-slogan::before, .logo-slogan::after { width: 12px; }
}

/* ===== Ẩn slogan ở thanh trên & chuẩn hóa độ tương phản/bố cục ===== */
.eyebrow {
  background: var(--orange-soft);
  border: 1px solid var(--orange-border);
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 700;
}
.kicker {
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.kicker.light {
  display: inline-block;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 4px 12px;
  border-radius: 999px;
}
.figure {
  border-top: 3px solid var(--blue) !important;
  box-shadow: var(--shadow-1);
}
.figure-label { font-weight: 500; color: var(--ink-2); }
.figure-value { color: var(--ink); }
.panel { box-shadow: var(--shadow-1); }
.field-label { font-weight: 600; color: var(--ink); }
.scale span, .checks span, .chips span { color: var(--ink); }
.fs-head p { color: var(--ink-2); }
.fc-back p { color: rgba(255, 255, 255, .95); }
.slip-kind { color: var(--ink-2); }
.prose { color: var(--ink); }

/* =========================================================
   CHAT HỖ TRỢ KHẢO SÁT CĐS
   ========================================================= */
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.chat-fab {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  background: #fff;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(1, 79, 140, .38), 0 2px 6px rgba(15, 27, 48, .10);
  transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.chat-fab::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  border: 1.5px solid #fff;
}
.chat-fab.open {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-600) 100%);
  border-color: rgba(255, 255, 255, .24);
}
.chat-fab.open::after { display: none; }
.chat-fab img.ic-open {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  transition: transform .2s ease, opacity .15s ease;
}
.chat-fab svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease, opacity .15s ease;
}
.chat-fab .ic-close { position: absolute; opacity: 0; transform: rotate(-45deg) scale(.75); }
.chat-fab.open .ic-open { opacity: 0; transform: rotate(45deg) scale(.75); }
.chat-fab.open .ic-close { opacity: 1; transform: rotate(0) scale(1); }
.chat-fab:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: 0 12px 26px -6px rgba(241, 106, 51, .42);
}
.chat-fab.open:hover {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-600) 100%);
  border-color: rgba(255, 255, 255, .24);
}
.chat-fab:active { transform: translateY(1px); }

.chat-panel {
  width: min(396px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 96px));
  background: var(--paper);
  border: 1px solid rgba(15, 27, 48, .08);
  border-radius: 16px;
  box-shadow: 0 24px 64px -16px rgba(1, 63, 112, .34), 0 4px 16px -4px rgba(15, 27, 48, .08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chat-pop .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes chat-pop {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: linear-gradient(125deg, var(--blue) 0%, var(--blue-600) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff;
  flex: none;
}
.chat-agent { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}
.chat-avatar img {
  width: 36px;
  height: 36px;
  padding: 2px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff);
}
.chat-agent div { display: grid; gap: 2px; line-height: 1.2; min-width: 0; }
.chat-agent b { font-size: 13.5px; font-weight: 700; color: #fff; }
.chat-agent span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: rgba(255, 255, 255, .9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, .28); flex: none; }
.chat-head-actions { display: flex; gap: 4px; flex: none; }
.chat-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .9);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chat-icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-icon-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 14px;
  background: linear-gradient(180deg, #f4f7fc 0%, #f8fafd 100%);
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }

.chat-day {
  align-self: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(1, 102, 179, .07);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 1px;
}

.chat-msg {
  display: flex;
  gap: 7px;
  max-width: 92%;
  animation: msg-in .18s ease-out;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.bot { align-self: flex-start; }

.chat-badge {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 27, 48, .06);
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.chat-badge img { width: 17px; height: 17px; object-fit: contain; display: block; }
.chat-bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-msg.user .chat-bubble-wrap { align-items: flex-end; }

.chat-bubble {
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-msg.bot .chat-bubble {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(212, 220, 231, .85);
  border-top-left-radius: 4px;
  box-shadow: 0 2px 6px -2px rgba(15, 27, 48, .05);
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-600) 100%);
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 3px 10px -3px rgba(1, 102, 179, .38);
}
.chat-bubble p { margin: 0 0 4px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul { margin: 3px 0 0; padding-left: 15px; display: grid; gap: 2px; }
.chat-bubble b { font-weight: 600; }

.chat-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #c6def4;
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.chat-action-btn:hover { background: #d6e9f9; border-color: var(--blue); transform: translateY(-1px); text-decoration: none; }

.chat-time { font-size: 10px; color: var(--muted); padding-inline: 2px; }

.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid rgba(212, 220, 231, .85);
  border-radius: 13px;
  border-top-left-radius: 4px;
  box-shadow: 0 2px 6px -2px rgba(15, 27, 48, .05);
}
.chat-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-dot 1.1s infinite ease-in-out;
}
.chat-typing i:nth-child(2) { animation-delay: .15s; }
.chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-quick {
  margin-top: auto;
  padding-top: 4px;
  padding-left: 31px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: msg-in .22s ease-out;
}
.chat-quick-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chat-chip {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  background: #fff;
  border: 1px solid #cdddf0;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 27, 48, .04);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.chat-chip:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.chat-form {
  padding: 8px 10px 7px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  flex: none;
}
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.chat-input-wrap:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(1, 102, 179, .10);
}
.chat-input-wrap textarea {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 4px 0;
  min-height: 22px;
  max-height: 68px;
  resize: none;
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: none;
}
.chat-input-wrap textarea:focus { outline: none; box-shadow: none; }
.chat-send {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .15s;
}
.chat-send svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-send:hover:not(:disabled) { background: var(--orange); transform: translateY(-1px); }
.chat-send:disabled { opacity: .35; cursor: default; }
.chat-hint { margin-top: 4px; font-size: 10px; color: var(--muted); text-align: right; padding-right: 3px; }

@media (max-width: 600px) {
  .chat-widget { right: 16px; bottom: 16px; }
  .chat-fab { width: 42px; height: 42px; }
  .chat-fab img.ic-open { width: 27px; height: 27px; }
  .chat-panel { width: calc(100vw - 32px); height: min(520px, calc(100vh - 94px)); }
}

/* =========================================================
   QUẢN TRỊ CAO CẤP (SUPER ADMIN): CMS, PHÂN QUYỀN, WEB & API
   ========================================================= */
.sa-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #e9eff7;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 22px;
}
.sa-tab {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.sa-tab:hover { color: var(--ink); }
.sa-tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(15, 27, 48, .08); }

.sa-cms-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
.sa-sec-nav {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
}
.sa-sec-btn {
  text-align: left;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sa-sec-btn:hover { background: #f2f6fb; color: var(--ink); }
.sa-sec-btn.active { background: var(--blue-soft); color: var(--blue); }

.sa-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
.sa-card + .sa-card { margin-top: 16px; }
.sa-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sa-card-head h2, .sa-card-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.sa-sub-item {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  background: #fafcff;
  display: grid;
  gap: 10px;
}
.sa-sub-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sa-sub-head b { font-size: 13.5px; color: var(--blue); }
.sa-bar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sa-switches { display: grid; gap: 12px; }
.sa-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fafcff;
}
.sa-switch b { display: block; font-size: 14px; }
.sa-switch small { display: block; font-size: 12.5px; color: var(--muted); }
.sa-switch input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--blue); cursor: pointer; }

.sa-role-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.sa-legend-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  display: grid;
  gap: 5px;
}
.sa-legend-box small { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

.sa-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.role-superadmin { background: #feeae1; color: #b93c0c; border: 1px solid #f9c3ad; }
.role-admin { background: #e5f0fa; color: var(--blue-700); border: 1px solid #c3dcf4; }
.role-user { background: #eef1f6; color: var(--ink-2); border: 1px solid var(--line); }

.sa-user-list { display: grid; gap: 10px; }
.sa-user-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 12px 16px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px;
}
.sa-user-main b { font-size: 14.5px; }
.sa-user-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.sa-user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sa-user-actions select { width: auto; min-width: 175px; padding: 7px 10px; font-size: 13px; }
.btn.danger { color: var(--seal); border-color: #f3c4c0; background: #fff7f6; }
.btn.danger:hover { background: #feeae8; border-color: var(--seal); }

.sa-api-list { display: grid; gap: 8px; }
.sa-api-item {
  display: grid;
  grid-template-columns: 76px 210px 1fr;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fafcff;
  font-size: 13px;
}
.sa-method {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}
.sa-api-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--ink); }

@media (max-width: 900px) {
  .sa-cms-grid { grid-template-columns: 1fr; }
  .sa-sec-nav { position: static; display: flex; flex-wrap: wrap; }
  .sa-role-legend { grid-template-columns: 1fr; }
  .sa-user-row { grid-template-columns: 1fr; }
  .sa-api-item { grid-template-columns: 1fr; }
}
