:root {
  --brand: #e8590c;
  --brand-dark: #c2410c;
  --brand-soft: #fff1e6;
  --blue: #1d4ed8;
  --ink: #1f2328;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --warn: #b54708;
  --warn-soft: #fef0c7;
  --bad: #b42318;
  --bad-soft: #fee4e2;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0 0 10px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 9px 16px; background: var(--brand); color: #fff; font-weight: 600; }
button:hover { background: var(--brand-dark); }
button:disabled { background: #d0d5dd; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover { background: #fff; border-color: #cfd4dc; }
button.small { padding: 5px 10px; font-size: 13px; }
input, select, textarea { font: inherit; border: 1px solid #d0d5dd; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
table { border-collapse: collapse; width: 100%; margin: 8px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; }
a { color: var(--blue); }
.muted { color: var(--muted); } .tiny { font-size: 12px; } .pad { padding: 24px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.logo { height: 44px; width: auto; }
.brand-name { font-weight: 700; } .brand-sub { font-size: 12px; color: var(--muted); }
.account { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account label { font-size: 13px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; max-width: 1180px; margin: 20px auto; padding: 0 16px; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }
.side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-self: start; position: sticky; top: 80px; }
@media (max-width: 820px) { .side { position: static; } }
.side .who { padding: 6px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li button { width: 100%; text-align: left; background: transparent; color: var(--ink); font-weight: 500; display: flex; gap: 10px; align-items: center; padding: 8px; }
.steps li button:hover:not(:disabled) { background: var(--bg); }
.steps li button.active { background: var(--brand-soft); color: var(--brand-dark); }
.steps li button:disabled { background: transparent; color: #98a2b3; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d0d5dd; display: grid; place-items: center; font-size: 12px; flex: none; }
.dot.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.dot.now { border-color: var(--brand); color: var(--brand); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.bar > i { display: block; height: 100%; background: var(--brand); }

.content { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.wide { max-width: 1180px; margin: 20px auto; }
.remember { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 6px; padding: 10px 14px; margin-top: 12px; }
.remember b { color: var(--brand-dark); }
.remember ul { margin: 4px 0 0; padding-left: 18px; }
.q { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.q:last-child { border-bottom: 0; }
.q label { display: flex; gap: 8px; padding: 4px 0; cursor: pointer; }
.q.right { background: var(--ok-soft); } .q.wrong { background: var(--bad-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: #e0eaff; color: var(--blue); }
.notice { padding: 10px 14px; border-radius: 8px; background: #e0eaff; color: #1e3a8a; margin: 10px 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.feedback { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 10px; background: #fcfcfd; }
.feedback ul { margin: 4px 0; padding-left: 18px; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.slide-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; margin: 6px 0; }
.rubric-row { display: grid; grid-template-columns: 1fr 90px 60px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.qa-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; margin: 6px 0; }
@media (max-width: 600px) { .qa-row, .slide-row { grid-template-columns: 1fr; } }
.viewer { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: var(--brand-soft); }
tr.selected { background: var(--brand-soft); }
.total { font-size: 20px; font-weight: 700; }

.chat-toggle { position: fixed; right: 20px; bottom: 20px; z-index: 20; border-radius: 999px; padding: 12px 20px; box-shadow: 0 6px 20px rgba(232, 89, 12, .35); }
.chat { position: fixed; right: 20px; bottom: 76px; z-index: 20; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 24, 40, .18); display: flex; flex-direction: column; }
.chat[hidden], .toast[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 9px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: var(--bg); align-self: flex-start; }
.msg.me { background: var(--brand); color: #fff; align-self: flex-end; }
.msg .src { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: normal; }
.msg .src details { margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-weight: 500; font-size: 13px; }
.chip:hover { background: var(--brand-soft); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 90vw; }
.toast.bad { background: var(--bad); }

/* Trình xem slide */
.sv-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #e9e4dd; border-radius: 10px; outline: none; }
.sv-stage:focus-visible { box-shadow: 0 0 0 3px var(--brand); }
.sv-stage:fullscreen { background: #111; border-radius: 0; aspect-ratio: auto; }
.sv-canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.sv-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sv-pdf { font-size: 14px; font-weight: 600; }
.sv-notes { margin-top: 12px; padding: 12px 14px; background: var(--warn-soft); border-radius: 8px; }
.sv-notes p { margin: 4px 0 0; }

/* Phiếu đánh giá nội dung báo cáo */
.rb-wrap { overflow-x: auto; }
table.rubric { font-size: 14px; min-width: 760px; }
table.rubric td { vertical-align: middle; padding: 6px 8px; }
table.rubric tr.rb-group td { background: var(--brand-soft); font-weight: 700; }
table.rubric select, table.rubric input { width: 100%; min-width: 90px; padding: 5px 6px; }

/* Họ tên nhân viên mới */
.name-card { border-left: 4px solid var(--brand); }
.name-form { display: flex; flex-direction: column; gap: 6px; }
.name-form input { width: 100%; }

/* Thêm nhân viên mới & thông tin cá nhân */
.profile-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-top: 8px; }
.profile-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.profile-grid input, .profile-grid select { width: 100%; }
@media (max-width: 820px) { .profile-grid { grid-template-columns: 1fr; } }
.add-learner { margin: 12px 0; }

/* Đăng nhập & tài khoản */
.account .who { text-align: right; line-height: 1.25; }
body.guest .account, body.guest .chat-toggle, body.guest #chat { display: none; }
.login { max-width: 420px; margin: 48px auto; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.login input { width: 100%; }
.login button { margin-top: 16px; }
.cred { margin: 12px 0; }
.cred b { letter-spacing: .3px; }

/* Quản trị hệ thống */
.row-off td { opacity: .55; }
.row-off td b { text-decoration: line-through; }
.mat-list { margin: 8px 0 0; padding-left: 18px; }
.mat-list li { margin-bottom: 6px; }

/* Ô ngày kiểu Việt Nam: ô chữ dd/mm/yyyy + nút lịch nhỏ bên cạnh */
.date-vn { display: inline-flex; align-items: center; gap: 4px; }
.date-vn input[name="date"] { width: 130px; }
.date-pick { width: 34px; padding: 8px 4px; color: transparent; }
.date-pick::-webkit-datetime-edit, .date-pick::-webkit-inner-spin-button, .date-pick::-webkit-clear-button { display: none; }
.date-pick::-webkit-calendar-picker-indicator { margin: 0; opacity: .7; cursor: pointer; }
