:root {
  --yellow: #ffc32b;
  --yellow-light: #ffdb4d;
  --yellow-soft: #fff6d6;
  --black: #1c1c1c;
  --gray-dark: #3d3d3d;
  --gray: #6b6b6b;
  --gray-light: #e6e6e6;
  --bg: #f8f9fc;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--black);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
}
.brand { padding: 28px 24px 24px; border-bottom: 1px solid #2e2e2e; }
.logo { display: flex; align-items: center; gap: 6px; }
.logo-block {
  width: 34px; height: 34px;
  background: var(--yellow);
  transform: skewX(-12deg);
}
.logo-text {
  background: var(--gray-dark);
  color: var(--white);
  font-weight: 800;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 6px;
  padding: 0 10px 0 12px;
  height: 34px;
  line-height: 34px;
  transform: skewX(-12deg);
  border: 1px solid #555;
}
.tagline {
  margin-top: 8px;
  font-size: 9.5px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1.5px;
  color: var(--yellow);
}
.nav { display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; flex: 1; }
.nav a {
  color: #cfcfcf;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: #2a2a2a; color: var(--white); }
.nav a.active { background: var(--yellow); color: var(--black); font-weight: 700; }
.nav .ico { width: 18px; text-align: center; font-size: 16px; }
.sidebar-foot { padding: 16px 24px; border-top: 1px solid #2e2e2e; }
.btn-link { background: none; border: none; color: #9a9a9a; cursor: pointer; font: inherit; font-size: 12px; }
.btn-link:hover { color: var(--yellow); }

/* ---------- Main ---------- */
.main {
  margin-left: 240px;
  flex: 1;
  padding: 0 32px 200px;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}
.topbar h1 { font-size: 24px; font-weight: 700; }
.topbar h1::after {
  content: "";
  display: block;
  width: 48px; height: 4px;
  background: var(--yellow);
  margin-top: 6px;
  border-radius: 2px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--gray); }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--black);
  color: var(--yellow);
  display: grid; place-items: center;
  font-weight: 700;
}

.waves {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 180px;
  pointer-events: none;
  z-index: 0;
}
.waves svg { width: 100%; height: 100%; display: block; }

.view { display: none; position: relative; z-index: 1; }
.view.active { display: block; animation: fade 0.2s ease; }

/* ---------- Bots ---------- */
.bot-bar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.bot-bar label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; }
.bot-bar .muted { flex: 1; }
.bot-bar .btn { text-decoration: none; }

/* ---------- PCV ---------- */
.pcv-empty { text-align: center; padding: 48px 24px; }
#view-pcv [hidden], #view-prodcontrol [hidden], #view-coo [hidden] { display: none; }
.bot-frame-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
#botFrame, #pcvFrame, #prodcontrolFrame, #kpiFrame, #cooFrame { display: block; width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 0; }
.bot-hint { margin-top: 10px; }
/* ---------- Guide ---------- */
.guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--yellow); padding-bottom: 14px; margin-bottom: 18px; }
.guide-head h2 { font-size: 22px; margin-top: 8px; }
.guide-head .btn { text-decoration: none; }
.guide-sec { margin-bottom: 20px; }
.guide-sec h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); margin-bottom: 8px; border-left: 4px solid var(--yellow); padding-left: 8px; }
.guide-text { white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; }
.guide-text + .guide-code, .guide-code + .guide-text { margin-top: 12px; }
.guide-text a { color: #8a6200; }
.guide-code { position: relative; background: var(--black); border-radius: 8px; }
.guide-code pre { color: #f2f2f2; font: 12.5px/1.6 Consolas, "Courier New", monospace; padding: 16px; overflow: auto; max-height: 420px; }
.guide-code .btn { position: absolute; top: 8px; right: 12px; background: transparent; color: var(--yellow); border-color: var(--yellow); }
.guide-code .btn:hover { background: var(--yellow); color: var(--black); }
.guide-note { background: var(--yellow-soft); border-radius: 8px; padding: 14px 16px; }

/* ---------- Effort QA ---------- */
.effort-bar { display: flex; align-items: center; gap: 14px; padding: 14px 20px; flex-wrap: wrap; }
.effort-bar label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.effort-bar input, .effort-bar select { padding: 7px 10px; }
.effort-bar .spacer { flex: 1; }
.eff-legend { display: flex; align-items: center; gap: 6px; }
.eff-legend .sw { width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.sw.proj { background: #3fbf5f; }
.sw.task { background: var(--yellow); }
/* Khung thấp, cuộn dọc riêng: thanh cuộn ngang nằm gần phía trên, xem phần còn lại bằng cuộn dọc.
   Kéo góc dưới bên phải để tăng/giảm chiều cao khung. */
.eff-board {
  display: flex; gap: 12px; align-items: stretch;
  overflow: auto; height: 400px; min-height: 200px; resize: vertical;
  overscroll-behavior: contain;
  scrollbar-color: #9a9a9a #eeeeee;
}
.eff-board::-webkit-scrollbar { width: 12px; height: 12px; }
.eff-board::-webkit-scrollbar-track { background: #eeeeee; border-radius: 6px; }
.eff-board::-webkit-scrollbar-thumb { background: #9a9a9a; border-radius: 6px; border: 2px solid #eeeeee; }
.eff-board::-webkit-scrollbar-thumb:hover { background: var(--gray-dark); }
.eff-col { flex: 0 0 230px; background: #f6f7f9; border-radius: 8px; padding: 0 8px 8px; }
/* Tên member + tổng % đứng yên khi cuộn dọc */
.eff-head {
  position: sticky; top: 0; z-index: 2;
  text-align: center; padding: 8px; border-radius: 0 0 6px 6px; margin-bottom: 8px; background: var(--white);
  border-top: 4px solid #3fbf5f; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.eff-head.under { border-top-color: var(--yellow); }
.eff-head.over { border-top-color: #d93025; }
.eff-head.over .eff-total { color: #d93025; }
.eff-total { font-size: 20px; font-weight: 800; }
.eff-name { font-weight: 600; font-size: 13px; }
.eff-items { display: flex; flex-direction: column; gap: 6px; }
.eff-item {
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  font: inherit; font-size: 12px; cursor: pointer;
  background: var(--white); border: 1px solid var(--gray-light); border-left: 5px solid #3fbf5f;
  border-radius: 6px; padding: 7px 8px;
}
.eff-item.task { border-left-color: var(--yellow); background: #fffbea; }
.eff-item:hover { border-color: var(--black); }
.eff-label { flex: 1; overflow-wrap: anywhere; }
.eff-label .muted { display: block; font-size: 11px; margin-top: 2px; }
.eff-val { font-weight: 800; }
.eff-empty { padding: 8px; text-align: center; }
.eff-add { display: block; width: 100%; padding: 8px 0 2px; color: var(--gray); }
.eff-form { margin: 0; max-width: 560px; margin-inline: auto; }
.eff-form [hidden] { display: none; }
.eff-form { max-width: 680px; }
.pick-head { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.proj-pick { max-height: 260px; overflow: auto; border: 1px solid #d6d6d6; border-radius: 8px; padding: 4px; margin-bottom: 14px; }
.form .pick { flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; border-radius: 6px; font-weight: 500; cursor: pointer; }
.form .pick:hover { background: var(--yellow-soft); }
.pick-code { flex: 1; overflow-wrap: anywhere; }
#opmsForm { max-width: 820px; }
.opms-paste { margin-bottom: 14px; }
#syncForm { max-width: 820px; }
#syncForm .guide-code { margin-bottom: 14px; }
.sync-steps { padding-left: 20px; margin-bottom: 14px; line-height: 1.8; }
.sync-steps a { color: #8a6200; }
#effSyncSetup { font-size: 18px; }
#effSync:disabled { opacity: 0.6; cursor: wait; }
.opms-paste summary { cursor: pointer; margin-bottom: 10px; font-size: 13px; }
.opms-preview { overflow: auto; max-height: 240px; margin: 6px 0 10px; }
.opms-preview .table td, .opms-preview .table th { white-space: nowrap; padding: 6px 10px; }
.tag.ok { background: #e6f6ea; color: #1e7b34; border-color: #a8dcb5; }
.tag.warn { background: #fdecea; color: #b3261e; border-color: #f3b8b3; }
.tag.dim { background: #f1f1f1; color: var(--gray); border-color: #ddd; }
#effProjects .nowrap { white-space: nowrap; }
.overdue { color: #b3261e; font-weight: 700; }

.bot-guide p { line-height: 1.6; }
.guide-list, .guide-steps { margin: 10px 0 10px 20px; line-height: 1.7; }
.guide-steps li { margin-bottom: 6px; }
.bot-guide code, #kpiMissing code, #cooMissing code { background: var(--yellow-soft); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.guide-props { margin: 12px 0 8px; }
.guide-props td:first-child { white-space: nowrap; }
.bot-guide .req { color: #b3261e; font-weight: 700; }
/* Tin nhắc mẫu (mô phỏng Google Chat card) */
.chat-card { border: 1px solid var(--gray-light); border-radius: 10px; padding: 14px 16px; font-size: 13px; background: #fff; }
.chat-card-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-light); margin-bottom: 8px; }
.chat-card-head span, .chat-period, .chat-none { color: var(--gray); font-size: 12px; }
.chat-group { color: #d93025; font-weight: 700; margin: 12px 0 6px; font-size: 12px; }
.chat-group span { color: var(--black); font-weight: 400; }
.chat-pic { padding: 6px 0; border-bottom: 1px dashed var(--gray-light); }
.chat-pic span { display: block; margin-top: 2px; color: #1a73e8; font-size: 12px; font-weight: 600; }
.chat-issue { padding: 6px 0 6px 14px; }
.chat-issue u { color: #1a73e8; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--gray); font-size: 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.kpi {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border-left: 5px solid var(--yellow);
}
.kpi.dark { background: var(--black); color: var(--white); border-left-color: var(--yellow); }
.kpi .label { font-size: 12px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi.dark .label { color: #bdbdbd; }
.kpi .value { font-size: 32px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.kpi .sub { font-size: 12px; color: var(--gray); margin-top: 4px; }
.kpi.dark .sub { color: var(--yellow); }

.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }
.grid-form { display: grid; grid-template-columns: minmax(340px, 2fr) 3fr; gap: 20px; align-items: start; }

/* ---------- Dashboard: lưới điều hướng tính năng ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--yellow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.12); }
.feature-card .ico-big { font-size: 26px; }
.feature-card h3 { font-size: 16px; font-weight: 700; }
.feature-card p { font-size: 13px; color: var(--gray); line-height: 1.55; flex: 1; margin: 0; }
.feature-card .go { font-size: 13px; font-weight: 700; }

/* ---------- Gen tài liệu (chọn loại bằng tab trước khi hiện form) ---------- */
.plan-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.plan-tab {
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; border: 2px solid var(--black);
  background: var(--white); color: var(--black); display: flex; align-items: center; gap: 8px;
}
.plan-tab:hover { background: var(--yellow-soft); }
.plan-tab.active { background: var(--black); color: var(--white); }
.kind-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kind-dot.run { background: var(--yellow); animation: dot-pulse 1s ease-in-out infinite alternate; }
.kind-dot.wait { background: #b3261e; }
@keyframes dot-pulse { from { opacity: 0.35; } to { opacity: 1; } }
#planGenEmpty { margin-bottom: 16px; }
.plan-gen { margin-bottom: 20px; }
.form .req { color: #b3261e; }
.form input[type="file"] { padding: 8px; background: var(--yellow-soft); border-style: dashed; cursor: pointer; }
.plan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.plan-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.plan-steps li { border-top: 4px solid var(--gray-light); padding-top: 6px; font-size: 12px; display: flex; flex-direction: column; color: var(--gray); }
.plan-steps li b { color: var(--black); }
.plan-steps li.ok { border-top-color: var(--black); }
.plan-steps li.cur { border-top-color: var(--yellow); }
.plan-steps li.cur span { color: #7a5a00; font-weight: 600; }
.plan-outputs, .plan-file-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.plan-file-bar .btn { text-decoration: none; }
.plan-running { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--yellow-soft); border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.spinner { width: 14px; height: 14px; flex: none; border: 2px solid var(--yellow); border-top-color: var(--black); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plan-error { color: #b3261e; background: #fdecea; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; white-space: pre-wrap; }
.plan-msg { border-left: 4px solid var(--yellow); padding: 4px 0 4px 14px; font-size: 13px; line-height: 1.65; max-height: 460px; overflow: auto; margin-bottom: 14px; }
.plan-msg h4, .plan-turn h4 { margin: 10px 0 4px; font-size: 14px; }
.plan-msg p, .plan-turn p { margin: 4px 0; }
.plan-msg .table, .plan-turn .table { margin: 8px 0; font-size: 12px; }
.plan-msg .table td, .plan-msg .table th { padding: 6px 8px; }
.md-li { padding-left: 12px; margin: 2px 0; }
.md-quote { border-left: 3px solid var(--gray-light); padding-left: 10px; color: var(--gray-dark); margin: 4px 0; }
.plan-msg code, .plan-offline code { background: var(--yellow-soft); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.plan-reply textarea { width: 100%; }
.plan-log { margin-top: 10px; font-size: 12px; }
.plan-log summary { cursor: pointer; color: var(--gray); font-weight: 600; }
.plan-log pre { max-height: 240px; overflow: auto; background: #f3f4f7; padding: 10px; border-radius: 8px; white-space: pre-wrap; margin-top: 6px; }
.plan-turn { border-bottom: 1px solid var(--gray-light); padding: 8px 0; font-size: 13px; }
.plan-turn.pm { background: #fffcf0; padding: 8px; }
.plan-frame { width: 100%; height: 75vh; border: none; background: #fff; display: block; }

/* ---------- Charts ---------- */
.chart { width: 100%; min-height: 240px; position: relative; }
.chart svg { width: 100%; display: block; overflow: visible; }
.chart .axis text { fill: var(--gray); font-size: 11px; }
.chart .grid line { stroke: #eeeeee; }
.chart .baseline { stroke: #bdbdbd; }
.chart .val { fill: var(--black); font-size: 11px; font-weight: 600; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar { transition: opacity 0.15s; }
.chart .dimmed { opacity: 0.35; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-wrap svg { width: 200px; flex-shrink: 0; }
.legend { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend .n { margin-left: auto; font-weight: 700; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--black);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
  white-space: nowrap;
}
.tooltip b { color: var(--yellow); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  background: var(--yellow-soft);
  border-bottom: 2px solid var(--yellow);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.table tr:hover td { background: #fffcf0; }
.table .empty { text-align: center; color: var(--gray); padding: 32px; }
.table td b { white-space: nowrap; }
.tag {
  display: inline-block;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--yellow-soft);
  color: #7a5a00;
  border: 1px solid #f3dc8a;
}
.tag.dark { background: var(--black); color: var(--yellow); border-color: var(--black); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Forms ---------- */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.form label.check { flex-direction: row; align-items: center; font-weight: 500; gap: 8px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input, select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 195, 43, 0.25); }
input[type="checkbox"] { accent-color: var(--black); width: 16px; height: 16px; }
textarea { resize: vertical; }
.search { width: 220px; padding: 8px 12px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid var(--black);
  transition: transform 0.05s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.btn-primary:hover { background: #f5b500; border-color: #f5b500; }
.btn-outline { background: var(--white); color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-width: 1px; }
.btn-danger:hover { background: #b3261e; border-color: #b3261e; color: #fff; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: 12px;
  width: min(1000px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: var(--black); color: var(--white);
}
.modal-head > div { display: flex; gap: 10px; align-items: center; }
.modal-head .btn-outline { background: transparent; color: var(--yellow); border-color: var(--yellow); }
.modal-head .btn-outline:hover { background: var(--yellow); color: var(--black); }
.btn-close { background: none; border: none; color: var(--white); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-body { overflow: auto; padding: 24px; background: #eef0f4; }

/* ---------- Document cover (giống slide mẫu) ---------- */
.doc-page {
  background: var(--white);
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", serif;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.doc-page + .doc-page { margin-top: 24px; }
.doc-customer { position: absolute; top: 6%; left: 4.5%; font-size: clamp(14px, 2.6vw, 28px); }
.doc-logo { position: absolute; top: 5%; right: 6%; transform: scale(0.9); transform-origin: top right; font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif; }
.doc-logo .logo-text { color: #fff; }
.doc-logo .tagline { color: #f5b800; }
.doc-center { position: absolute; top: 37%; left: 0; right: 0; text-align: center; }
.doc-center h1 { font-size: clamp(28px, 6vw, 68px); font-weight: 400; line-height: 1; }
.doc-center h2 { font-size: clamp(16px, 3vw, 34px); font-weight: 700; color: #2a2730; margin-top: 8px; }
.doc-center .date { font-size: clamp(12px, 1.8vw, 20px); margin-top: 6%; }
.doc-waves { position: absolute; left: 0; right: 0; bottom: 0; height: 32%; }
.doc-waves svg { width: 100%; height: 100%; display: block; }
.doc-meta {
  position: absolute; right: 1.5%; bottom: 3%;
  border-collapse: collapse;
  font-size: clamp(9px, 1.15vw, 13px);
  font-weight: 700;
}
.doc-meta td { border: 1px solid #9c9c9c; padding: 0.9em 0.4em; min-width: 10em; }
.doc-content { padding: 6% 7%; font-family: "Be Vietnam Pro", sans-serif; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.doc-content h3 { font-size: 20px; margin-bottom: 12px; border-left: 5px solid var(--yellow); padding-left: 10px; white-space: normal; }

/* Report preview */
.report-page {
  background: var(--white);
  padding: 40px 48px 120px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.report-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--yellow); padding-bottom: 16px; margin-bottom: 24px; }
.report-head h1 { font-size: 26px; }
.report-head .meta { color: var(--gray); margin-top: 6px; font-size: 13px; }
.report-page h3 { margin: 24px 0 12px; font-size: 16px; }
.report-page .kpis { grid-template-columns: repeat(3, 1fr); }
.report-page p { line-height: 1.7; white-space: pre-wrap; }
.report-page .doc-waves { height: 90px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--black); color: var(--white);
  padding: 12px 20px; border-radius: 8px;
  border-left: 5px solid var(--yellow);
  font-weight: 500;
  transform: translateY(120px);
  transition: transform 0.25s ease;
  z-index: 200;
}
.toast.show { transform: none; }

/* Responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-form { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { width: 72px; }
  .brand .tagline, .nav a span:not(.ico), .sidebar-foot { display: none; }
  .logo-text { display: none; }
  .nav a { font-size: 0; justify-content: center; }
  .nav .ico { font-size: 18px; }
  .main { margin-left: 72px; padding: 0 16px 200px; }
  .kpis { grid-template-columns: 1fr; }
}

/* Print: chỉ in nội dung modal */
@media print {
  body * { visibility: hidden; }
  #modalBody, #modalBody * { visibility: visible; }
  #modalBody { position: absolute; inset: 0; padding: 0; background: #fff; overflow: visible; }
  .modal-box { max-height: none; }
  .doc-page, .report-page { box-shadow: none; page-break-after: always; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.chat-card { max-width: 560px; }
.guide-warn { border-left: 5px solid #b3261e; }
.guide-warn h3, .guide-warn li { color: #b3261e; }
.guide-warn li { font-weight: 600; }
.chat-pic.open { border-bottom: none; }
.chat-less { color: #1a73e8; font-size: 12px; font-weight: 600; padding: 2px 0 6px; border-bottom: 1px dashed var(--gray-light); }
