:root {
  --hhr-blue: #1d8fcf;
  --hhr-blue-600: #0f6fa8;
  --hhr-blue-700: #0b5a8a;
  --hhr-blue-50: #eaf5fc;
  --hhr-green: #2e9e4f;
  --hhr-green-700: #20793b;
  --hhr-green-50: #eaf6ed;
  --hhr-amber: #c97a0a;
  --hhr-amber-700: #94590a;
  --hhr-amber-50: #fdf3e1;
  --hhr-red: #cf3f3f;
  --hhr-red-700: #a92e2e;
  --hhr-red-50: #fdeded;
  --hhr-ink: #0f2233;
  --hhr-ink-2: #34495c;
  --hhr-muted: #5f7082;
  --hhr-line: #e2e8ef;
  --hhr-line-2: #eef2f6;
  --hhr-surface: #ffffff;
  --hhr-canvas: #f4f7fa;
  --hhr-radius: 16px;
  --hhr-radius-sm: 10px;
  --hhr-shadow: 0 1px 2px rgba(15, 34, 51, .05), 0 8px 24px rgba(15, 34, 51, .06);

  --bs-body-font-family: 'Kanit', system-ui, sans-serif;
  --bs-body-color: var(--hhr-ink);
  --bs-primary: var(--hhr-blue-600);
  --bs-primary-rgb: 15, 111, 168;
  --bs-link-color: var(--hhr-blue-600);
  --bs-link-color-rgb: 15, 111, 168;
  --bs-link-hover-color: var(--hhr-blue-700);
  --bs-border-color: var(--hhr-line);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Kanit', system-ui, sans-serif;
  font-weight: 300;
  color: var(--hhr-ink);
  background: var(--hhr-canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.hhr-white { background: #fff; }

b, strong, .fw-bold { font-weight: 500 !important; }
h1, h2, h3, h4, h5, h6 { font-weight: 500; color: var(--hhr-ink); }

/* One spacing unit for page edges, gaps between blocks and panel padding, so all sides match. */
:root { --gutter: 16px; }
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1400px) { :root { --gutter: 28px; } }
.hhr-main { flex: 1 0 auto; padding: var(--gutter) 0; }
.hhr-wide { width: 100%; padding-left: var(--gutter); padding-right: var(--gutter); }

:focus-visible { outline: 3px solid rgba(29, 143, 207, .45); outline-offset: 2px; }

/* ---------- Navbar (dark, like the original) ---------- */
.hhr-nav {
  background: #17212b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  padding: 8px 0;
}
.hhr-nav > .hhr-wide { display: flex; flex-wrap: inherit; align-items: center; justify-content: space-between; }
.hhr-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-right: 24px; }
.hhr-brand:hover { color: #fff; }
.hhr-brand img { width: 44px; height: auto; }
.hhr-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.hhr-brand strong { font-size: 1.05rem; font-weight: 600 !important; letter-spacing: .1px; }
.hhr-brand small { font-size: .72rem; color: rgba(255, 255, 255, .6); font-weight: 300; }
.hhr-nav .navbar-toggler { border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; padding: 6px 10px; font-size: 1.35rem; color: #fff; }
.hhr-nav .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(41, 169, 224, .35); }
.hhr-nav .nav-link {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  color: rgba(255, 255, 255, .78); font-weight: 400;
  padding: 8px 14px !important; border-radius: 10px;
}
.hhr-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hhr-nav .nav-link.active { background: rgba(41, 169, 224, .2); color: #fff; font-weight: 500; }
.hhr-user {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px;
  padding: 4px 12px 4px 4px; color: #fff; font-weight: 400;
}
.hhr-user:hover { background: rgba(255, 255, 255, .08); }
.hhr-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--hhr-blue), var(--hhr-green));
  color: #fff; font-weight: 500;
}
.hhr-user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1199.98px) {
  .hhr-nav .navbar-collapse { padding-top: 12px; }
  .hhr-nav .navbar-nav { margin-bottom: 12px; }
  .hhr-user { width: 100%; justify-content: flex-start; border-radius: 12px; }
  .hhr-user .bi-chevron-down { margin-left: auto; }
}

/* ---------- Generic building blocks ---------- */
.hhr-card {
  background: var(--hhr-surface);
  border: 1px solid var(--hhr-line);
  border-radius: var(--hhr-radius);
  box-shadow: var(--hhr-shadow);
}
.hhr-card-pad { padding: 20px; }
@media (min-width: 768px) { .hhr-card-pad { padding: 24px; } }
.hhr-card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--hhr-line);
}
.hhr-card-head h2 { font-size: 1.1rem; margin: 0; }

.hhr-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 500; letter-spacing: .3px;
  color: var(--hhr-green-700); text-transform: uppercase;
}
.hhr-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.hhr-page-head h1 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 4px 0; font-weight: 600; line-height: 1.3; }
.hhr-page-head p { color: var(--hhr-muted); margin: 0; }

.btn { font-weight: 400; border-radius: var(--hhr-radius-sm); }
.btn-brand { background: var(--hhr-blue-600); border-color: var(--hhr-blue-600); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--hhr-blue-700); border-color: var(--hhr-blue-700); color: #fff; }
.btn-green { background: var(--hhr-green-700); border-color: var(--hhr-green-700); color: #fff; }
.btn-green:hover, .btn-green:focus { background: #19632f; border-color: #19632f; color: #fff; }
.btn-soft { background: #fff; border: 1px solid var(--hhr-line); color: var(--hhr-ink-2); }
.btn-soft:hover { background: var(--hhr-line-2); color: var(--hhr-ink); }
.btn-pdf { background: var(--hhr-red-700); border-color: var(--hhr-red-700); color: #fff; }
.btn-pdf:hover, .btn-pdf:focus { background: #8c2525; border-color: #8c2525; color: #fff; }

.hhr-icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--hhr-line); background: #fff; color: var(--hhr-ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.hhr-icon-btn { --ib: var(--hhr-ink-2); color: var(--ib); border-color: color-mix(in srgb, var(--ib) 35%, #fff); }
.hhr-icon-btn:hover, .hhr-icon-btn:focus-visible { color: #fff; background: var(--ib); border-color: var(--ib); }
.hhr-icon-btn.i-blue { --ib: var(--hhr-blue-600); }
.hhr-icon-btn.i-sky { --ib: #0b87b8; }
.hhr-icon-btn.i-green { --ib: var(--hhr-green-700); }
.hhr-icon-btn.i-amber { --ib: var(--hhr-amber-700); }
.hhr-icon-btn.i-red { --ib: var(--hhr-red-700); }
.hhr-icon-btn.i-ink { --ib: #5c6b7a; }
.hhr-icon-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.hhr-tip-wrap { display: inline-block; cursor: not-allowed; border-radius: 10px; }
.c-actions .hhr-tip-wrap { margin-left: 4px; }

.toast { --bs-toast-bg: #fff; --bs-toast-header-bg: #fff; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 34, 51, .18) !important; }
.hhr-tooltip {--bs-tooltip-bg: #17212b; --bs-tooltip-color: #fff; --bs-tooltip-font-size: .76rem; --bs-tooltip-padding-x: 9px; --bs-tooltip-padding-y: 4px; --bs-tooltip-border-radius: 7px; --bs-tooltip-opacity: 1; font-family: 'Kanit', system-ui, sans-serif; }
.hhr-tooltip .tooltip-inner { box-shadow: 0 6px 16px rgba(15, 34, 51, .22); white-space: nowrap; max-width: none; }
.hhr-tooltip-wide .tooltip-inner { white-space: normal; max-width: 300px; text-align: left; line-height: 1.5; padding: 8px 12px; }

.form-control, .form-select { border-radius: var(--hhr-radius-sm); border-color: var(--hhr-line); padding-top: 9px; padding-bottom: 9px; font-weight: 300; }
.form-control:focus, .form-select:focus { border-color: var(--hhr-blue); box-shadow: 0 0 0 3px rgba(29, 143, 207, .18); }
.hhr-search { position: relative; }
.hhr-search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hhr-muted); }
.hhr-search .form-control { padding-left: 40px; }

/* Status pill */
.hhr-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: .82rem; font-weight: 400;
}
.hhr-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hhr-pill.done { background: var(--hhr-green-50); color: var(--hhr-green-700); }
.hhr-pill.wait { background: var(--hhr-amber-50); color: var(--hhr-amber-700); }
.hhr-pill.live { background: var(--hhr-blue-50); color: var(--hhr-blue-700); }
.hhr-pill.live::before { animation: hhr-pulse 1.4s infinite; }
.hhr-pill.err { background: var(--hhr-line-2); color: var(--hhr-muted); }
@keyframes hhr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .hhr-pill.live::before { animation: none; } }

.hhr-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 6px; font-size: .78rem; font-weight: 400;
  background: var(--hhr-line-2); color: var(--hhr-ink-2);
}
.hhr-tag.in { background: var(--hhr-blue-50); color: var(--hhr-blue-700); }
.hhr-tag.out { background: var(--hhr-green-50); color: var(--hhr-green-700); }

/* ---------- Stat cards ---------- */
.hhr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin: 0 0 var(--gutter); }
@media (max-width: 767.98px) { .hhr-stats { grid-template-columns: 1fr; gap: 10px; } }
.hhr-stat {
  position: relative; overflow: hidden; isolation: isolate;
  background: #fff; border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius);
  padding: 18px 20px; box-shadow: var(--hhr-shadow);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.hhr-stat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--stat-soft), rgba(255, 255, 255, 0) 70%);
}
.hhr-stat::after {
  content: ""; position: absolute; width: 96px; height: 96px; right: -28px; bottom: -40px; z-index: -1;
  border-radius: 50%; background: var(--stat-color); opacity: .1;
}
.hhr-stat-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; order: 2;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: var(--stat-color); color: #fff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--stat-color) 30%, transparent);
}
.hhr-stat-label { color: var(--hhr-muted); font-size: .92rem; font-weight: 400; margin-bottom: 6px; }
.hhr-stat-value { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 600; line-height: 1; }
.hhr-stat-value small { font-size: .95rem; font-weight: 400; color: var(--hhr-ink-2); margin-left: 6px; }
.hhr-stat.c-blue { --stat-color: #2563eb; --stat-soft: rgba(37, 99, 235, .1); }
.hhr-stat.c-amber { --stat-color: #e08a00; --stat-soft: rgba(245, 158, 11, .14); }
.hhr-stat.c-sky { --stat-color: #0e9ad6; --stat-soft: rgba(14, 165, 233, .13); }
@media (max-width: 767.98px) {
  .hhr-stat { padding: 12px 16px; align-items: center; }
  .hhr-stat-icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 11px; }
  .hhr-stat-label { margin-bottom: 2px; }
  .hhr-stat-value { font-size: 1.7rem; }
}

/* ---------- Course table ---------- */
.hhr-panel {
  background: #fff; border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius);
  box-shadow: var(--hhr-shadow); padding: var(--gutter);
}
.hhr-panel + .hhr-panel { margin-top: var(--gutter); }
.hhr-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--gutter); }
.hhr-panel-head h1 { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 600; margin: 0; line-height: 1.4; }
.hhr-panel-head h1 .hhr-title-icon { color: var(--hhr-blue-600); margin-right: 6px; }
.hhr-panel-head p { margin: 4px 0 0; color: var(--hhr-muted); font-size: .92rem; }
.hhr-divider { border: 0; border-top: 1px solid var(--hhr-line); margin: 0 0 var(--gutter); opacity: 1; }

.hhr-table-wrap { border: 1px solid var(--hhr-line); border-radius: 12px; overflow: hidden; }
.hhr-table-wrap .table-responsive { margin: 0; }
.hhr-table { margin: 0; font-size: .95rem; --bs-table-hover-bg: #f3f8fc; }
.hhr-table thead th {
  background: #e4f1fb; color: #0b4f7c; font-weight: 500; font-size: .9rem;
  border-bottom: 1px solid #cfe3f3; padding: 9px 8px; white-space: nowrap; vertical-align: middle;
}
.hhr-table tbody td { padding: 6px 8px; border-color: var(--hhr-line-2); vertical-align: middle; line-height: 1.4; }
.hhr-table .hhr-icon-btn { width: 30px; height: 30px; border-radius: 8px; font-size: .9rem; }
.hhr-table .hhr-pill { padding: 2px 9px; font-size: .8rem; }
.hhr-table .time-chip { padding: 1px 7px; }
.hhr-table tbody tr.row-wait > td { background: #fffaeb; }
.hhr-table tbody tr.row-live > td { background: #eaf6fd; }
.hhr-table tbody tr.row-today > td { background: #fff3cd; }
.hhr-table tbody tr:hover > td { filter: brightness(.985); }
.sortable { cursor: pointer; -webkit-user-select: none; user-select: none; }
.sortable:hover { background: #d3e8f8 !important; }
.sort-icon { font-size: .7rem; opacity: .45; margin-left: 4px; }
.sort-icon.active { opacity: 1; color: var(--hhr-blue-700); }

.c-date { white-space: nowrap; font-weight: 400; }
.c-time { white-space: nowrap; min-width: 150px; }
.time-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .82rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.time-chip.start { background: var(--hhr-green-50); color: var(--hhr-green-700); }
.time-chip.end { background: var(--hhr-red-50); color: var(--hhr-red-700); }
.c-time .bi-arrow-right { color: #9aa7b4; margin: 0 4px; font-size: .8rem; }
.c-title { min-width: 300px; width: 30%; }
.c-title .title-text {
  font-weight: 400; color: var(--hhr-ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.c-inst { color: var(--hhr-ink-2); min-width: 140px; max-width: 220px; }
.c-plan { white-space: nowrap; color: var(--hhr-ink-2); }
.c-form, .c-actions { white-space: nowrap; }
.c-form .hhr-icon-btn + .hhr-icon-btn,
.c-actions .hhr-icon-btn + .hhr-icon-btn { margin-left: 4px; }
.c-resp a { text-decoration: none; font-weight: 500; white-space: nowrap; color: var(--hhr-blue-600); }
.c-resp a:hover { text-decoration: underline; }
@media (max-width: 1599.98px) {
  .hhr-table { font-size: .9rem; }
  .c-title { min-width: 220px; }
  .c-inst { min-width: 150px; }
  .c-time { min-width: 0; }
  .c-time .time-chip { padding: 1px 5px; font-size: .78rem; }
  .c-time .bi-arrow-right { margin: 0 2px; }
  .c-plan { white-space: normal; min-width: 90px; }
  .hhr-table tbody td, .hhr-table thead th { padding-left: 6px; padding-right: 6px; }
  .hhr-table .hhr-pill { padding: 2px 7px; font-size: .76rem; }
}
.hhr-table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 12px 2px 0; color: var(--hhr-muted); font-size: .9rem; }
.hhr-table-foot b { color: var(--hhr-ink); }
.sort-mobile { display: none; }

@media (max-width: 767.98px) {
  .sort-mobile { display: flex; }
  .hhr-table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .hhr-table thead { display: none; }
  .hhr-table, .hhr-table tbody { display: block; }
  .hhr-table tbody { display: grid; gap: 12px; }
  .hhr-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
    border: 1px solid var(--hhr-line); border-radius: 14px; padding: 14px; background: #fff;
  }
  .hhr-table tbody tr.row-wait { background: #fffaeb; border-color: #f5dfa6; }
  .hhr-table tbody tr.row-live { background: #eaf6fd; border-color: #b9def3; }
  .hhr-table tbody tr td { display: block; padding: 0 !important; border: 0; background: transparent !important; min-width: 0; width: auto; }
  .hhr-table td.c-title { grid-column: 1 / -1; order: -3; }
  .hhr-table td.c-title .title-text { font-size: 1.02rem; font-weight: 500; -webkit-line-clamp: 3; line-clamp: 3; }
  .hhr-table tbody td { text-align: left !important; }
  .hhr-table td.c-date { order: -2; }
  .hhr-table td.c-time { order: -1; min-width: 0; }
  .hhr-table td.c-time, .hhr-table td.c-plan, .hhr-table td.c-resp { text-align: right !important; }
  .hhr-table td.c-time .bi-arrow-right { display: inline; }
  .hhr-table td.c-time .time-chip { display: inline-block; margin: 0; }
  .hhr-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: .74rem; color: var(--hhr-muted); margin-bottom: 2px;
  }
  .hhr-table td.c-inst, .hhr-table td.c-plan { max-width: none; white-space: normal; }
  .hhr-table td.c-form, .hhr-table td.c-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .hhr-table td.c-form { padding-top: 10px !important; border-top: 1px dashed var(--hhr-line); }
  .hhr-table td.c-form::before { display: inline !important; margin: 0 auto 0 0 !important; }
  .hhr-table td.c-actions::before { display: none !important; }
  .hhr-table td.c-form .hhr-icon-btn + .hhr-icon-btn,
  .hhr-table td.c-actions .hhr-icon-btn + .hhr-icon-btn { margin-left: 0; }
  .hhr-table td.c-actions .hhr-icon-btn { flex: 1 1 0; width: auto; height: 40px; }
  .hhr-table td.c-actions .hhr-tip-wrap { flex: 1 1 0; display: flex; margin-left: 0; }
  .hhr-table tbody tr.empty-row { display: block; }
}

.hhr-pagination .page-link { border-radius: 10px !important; margin: 0 3px; border: 1px solid var(--hhr-line); color: var(--hhr-ink-2); min-width: 40px; text-align: center; }
.hhr-pagination .page-item.active .page-link { background: var(--hhr-blue-600); border-color: var(--hhr-blue-600); color: #fff; }
.hhr-pagination .page-item.disabled .page-link { color: #b5c0cb; }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 18px; overflow: hidden; }
.hhr-modal-head { background: linear-gradient(120deg, var(--hhr-blue-700), var(--hhr-blue-600) 60%, var(--hhr-green-700)); color: #fff; border: 0; padding: 18px 22px; }
.hhr-modal-head .modal-title { color: #fff; font-size: 1.05rem; line-height: 1.45; }
.hhr-dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; }
.hhr-dl dt { color: var(--hhr-muted); font-weight: 400; }
.hhr-dl dd { margin: 0; }
@media (max-width: 575.98px) { .hhr-dl { grid-template-columns: 1fr; gap: 2px; } .hhr-dl dd { margin-bottom: 10px; } }

/* ---------- Footer ---------- */
.hhr-footer { flex-shrink: 0; background: #17212b; color: rgba(255, 255, 255, .72); font-size: .85rem; padding: 12px 0; }
.hhr-footer .hhr-wide { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; text-align: center; }

/* ---------- Report page ---------- */
.rp-hero { border-bottom: 1px solid var(--hhr-line); padding: 8px 0 24px; margin-bottom: 28px; }
.rp-crumb { font-size: .85rem; color: var(--hhr-muted); margin-bottom: 10px; }
.rp-crumb a { color: var(--hhr-muted); text-decoration: none; }
.rp-crumb a:hover { color: var(--hhr-blue-600); }
.rp-hero h1 { font-size: clamp(1.35rem, 2.8vw, 2rem); font-weight: 600; line-height: 1.35; margin: 6px 0 14px; max-width: 1400px; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--hhr-ink-2); font-size: .93rem; }
.rp-meta span { display: inline-flex; align-items: center; gap: 7px; }
.rp-meta .bi { color: var(--hhr-blue-600); }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.rp-overview { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin-bottom: 28px; }
@media (max-width: 991.98px) { .rp-overview { grid-template-columns: 1fr; } }
.rp-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px; border-radius: var(--hhr-radius); border: 1px solid var(--hhr-line);
  background: radial-gradient(120% 90% at 50% 0%, var(--level-soft) 0%, #fff 70%);
}
.rp-ring {
  --p: 0;
  width: 168px; height: 168px; border-radius: 50%;
  background: conic-gradient(var(--level-color) calc(var(--p) * 1%), #e9eef3 0);
  display: grid; place-items: center; margin-bottom: 14px;
}
.rp-ring > div { width: 132px; height: 132px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rp-ring strong { font-size: 2.4rem; font-weight: 600 !important; line-height: 1; color: var(--hhr-ink); }
.rp-ring small { color: var(--hhr-muted); font-size: .8rem; margin-top: 4px; }
.rp-level { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; background: var(--level-color); color: #fff; font-weight: 500; font-size: 1.05rem; }
.rp-score p { margin: 10px 0 0; color: var(--hhr-muted); font-size: .88rem; }

.lv-0 { --level-color: var(--hhr-green-700); --level-soft: var(--hhr-green-50); }
.lv-1 { --level-color: var(--hhr-blue-600); --level-soft: var(--hhr-blue-50); }
.lv-2 { --level-color: var(--hhr-amber-700); --level-soft: var(--hhr-amber-50); }
.lv-3 { --level-color: var(--hhr-red-700); --level-soft: var(--hhr-red-50); }

.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 767.98px) { .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-kpi { border: 1px solid var(--hhr-line); border-radius: 14px; padding: 14px 16px; background: #fff; }
.rp-kpi span { display: block; color: var(--hhr-muted); font-size: .84rem; }
.rp-kpi strong { display: block; font-size: 1.6rem; font-weight: 600 !important; line-height: 1.25; }
.rp-kpi em { font-style: normal; font-size: .82rem; color: var(--hhr-ink-2); }
.rp-summary {
  margin-top: 12px; padding: 16px 18px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--hhr-line);
  line-height: 1.85; color: var(--hhr-ink-2); text-indent: 2.5em;
}

.rp-section-title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 600; margin: 0 0 14px; }
.rp-section-title .bi { color: var(--hhr-green-700); }
.rp-block { margin-bottom: 36px; }

.rp-dist { display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: var(--hhr-line-2); }
.rp-dist span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .82rem; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .86rem; color: var(--hhr-ink-2); }
.rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.t-0 { background: var(--hhr-green); }
.t-1 { background: var(--hhr-blue); }
.t-2 { background: var(--hhr-amber); }
.t-3 { background: var(--hhr-red); }

.rp-chart { border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); padding: 8px 20px 16px; }
.rp-chart-group { padding-top: 12px; }
.rp-chart-group + .rp-chart-group { border-top: 1px solid var(--hhr-line-2); margin-top: 8px; }
.rp-chart-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; font-size: .92rem; color: var(--hhr-ink); margin-bottom: 6px; }
.rp-chart-head span:last-child { white-space: nowrap; color: var(--hhr-muted); font-weight: 400; }
.rp-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 42%) 48px; align-items: center; gap: 12px; padding: 6px 0; }
.rp-bar-row .q { font-size: .9rem; color: var(--hhr-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-bar-row .q b { color: var(--hhr-ink); margin-right: 6px; }
.rp-track { position: relative; height: 12px; border-radius: 99px; background: var(--hhr-line-2); }
.rp-track span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--level-color); }
.rp-bar-row .v { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.rp-axis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 42%) 48px; gap: 12px; font-size: .72rem; color: var(--hhr-muted); margin-top: 4px; }
.rp-axis div:nth-child(2) { display: flex; justify-content: space-between; }
@media (max-width: 575.98px) {
  .rp-bar-row, .rp-axis { grid-template-columns: minmax(0, 1fr) 40px; }
  .rp-bar-row .q { grid-column: 1 / -1; white-space: normal; }
  .rp-axis div:first-child { display: none; }
}

.rp-qgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 991.98px) { .rp-qgrid { grid-template-columns: 1fr; } }
.rp-q { border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); padding: 18px; background: #fff; display: flex; flex-direction: column; }
.rp-q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rp-q-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--hhr-blue-50); color: var(--hhr-blue-700); font-weight: 600; }
.rp-q-head h3 { font-size: .98rem; font-weight: 400; line-height: 1.55; margin: 0; flex: 1; }
.rp-q-avg { flex: 0 0 auto; text-align: right; }
.rp-q-avg strong { display: block; font-size: 1.3rem; font-weight: 600 !important; line-height: 1; color: var(--level-color); }
.rp-q-avg span { font-size: .75rem; color: var(--level-color); }
.rp-opt { display: grid; grid-template-columns: 112px minmax(0, 1fr) 82px; gap: 10px; align-items: center; padding: 5px 0; font-size: .9rem; }
.rp-opt .lbl { color: var(--hhr-ink-2); }
.rp-opt .bar { height: 22px; border-radius: 6px; background: var(--hhr-line-2); overflow: hidden; }
.rp-opt .bar span { display: block; height: 100%; border-radius: 6px; }
.rp-opt .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-opt .num b { margin-right: 4px; }
.rp-opt .num small { color: var(--hhr-muted); }
.rp-opt.zero .lbl, .rp-opt.zero .num { color: #9aa7b4; }
.rp-opt.top .lbl { color: var(--hhr-ink); font-weight: 500; }
.rp-q-foot { margin-top: auto; padding-top: 10px; font-size: .8rem; color: var(--hhr-muted); }
@media (max-width: 420px) { .rp-opt { grid-template-columns: 92px minmax(0, 1fr) 74px; gap: 8px; } }

.rp-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 767.98px) { .rp-criteria { grid-template-columns: 1fr; } }
.rp-crit { border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); overflow: hidden; }
.rp-crit h3 { font-size: .95rem; font-weight: 500; margin: 0; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--hhr-line); }
.rp-crit table { width: 100%; font-size: .9rem; }
.rp-crit td { padding: 9px 16px; border-bottom: 1px solid var(--hhr-line-2); }
.rp-crit tr:last-child td { border-bottom: 0; }
.rp-crit tr.is-current td { background: var(--hhr-blue-50); font-weight: 500; }
.rp-crit tr.is-current td:last-child::after { content: "  ← ผลประเมินนี้"; color: var(--hhr-blue-700); font-size: .8rem; }
.rp-crit td:first-child { width: 42%; font-variant-numeric: tabular-nums; color: var(--hhr-ink-2); }

.rp-written { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 991.98px) { .rp-written { grid-template-columns: 1fr; } }
.rp-w { border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); padding: 18px; }
.rp-w h3 { font-size: .98rem; font-weight: 500; line-height: 1.55; margin: 0 0 12px; display: flex; gap: 10px; }
.rp-w h3 .n { flex: 0 0 auto; color: var(--hhr-green-700); }
.rp-w ul { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; }
.rp-w li { position: relative; padding: 8px 0 8px 18px; border-top: 1px solid var(--hhr-line-2); color: var(--hhr-ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.rp-w li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--hhr-green); }
.rp-w .cnt { font-size: .78rem; color: var(--hhr-muted); font-weight: 400; margin-left: auto; white-space: nowrap; }

.rp-empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--hhr-line); border-radius: var(--hhr-radius); color: var(--hhr-muted); }
.rp-empty .bi { font-size: 2.2rem; display: block; margin-bottom: 8px; color: #a9b6c3; }

@media print {
  .hhr-nav, .hhr-footer, .rp-actions, .rp-crumb { display: none !important; }
  .rp-w ul { max-height: none; }
  .rp-q, .rp-w, .rp-chart { break-inside: avoid; }
}

/* ---------- Shared spacing helper ---------- */
.hhr-mb { margin-bottom: var(--gutter) !important; }

/* ---------- Forms (add / edit course) ---------- */
.form-label { font-weight: 400; color: var(--hhr-ink-2); font-size: .92rem; margin-bottom: 6px; }
.form-label .req { color: var(--hhr-red); margin-left: 2px; }
.hhr-form-section { padding-bottom: var(--gutter); margin-bottom: var(--gutter); border-bottom: 1px dashed var(--hhr-line); }
.hhr-form-section h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 500; color: var(--hhr-blue-700); margin: 0 0 14px; }
.hhr-form-section h2 .bi { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--hhr-blue-50); font-size: .95rem; }
.hhr-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hhr-form-actions .btn { min-width: 120px; padding-top: 9px; padding-bottom: 9px; }
@media (max-width: 575.98px) { .hhr-form-actions .btn { flex: 1 1 0; } }
.hhr-head-icon { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; color: #fff; background: var(--hhr-blue-600); flex: 0 0 auto; }
.hhr-head-icon.amber { background: var(--hhr-amber); }
.hhr-head-icon.green { background: var(--hhr-green-700); }
.hhr-head-title { display: flex; align-items: center; gap: 14px; }

/* ---------- Calendar ---------- */
.hhr-cal .fc {
  --fc-border-color: var(--hhr-line);
  --fc-today-bg-color: #eaf5fc;
  --fc-page-bg-color: #fff;
  --fc-neutral-bg-color: #f8fafc;
  --fc-button-bg-color: #fff;
  --fc-button-border-color: var(--hhr-line);
  --fc-button-text-color: var(--hhr-ink-2);
  --fc-button-hover-bg-color: var(--hhr-line-2);
  --fc-button-hover-border-color: var(--hhr-line);
  --fc-button-active-bg-color: var(--hhr-blue-600);
  --fc-button-active-border-color: var(--hhr-blue-600);
  font-family: 'Kanit', system-ui, sans-serif;
}
.hhr-cal .fc .fc-button { border-radius: 10px; font-weight: 400; box-shadow: none !important; padding: 6px 14px; }
.hhr-cal .fc .fc-button-primary:not(:disabled).fc-button-active,
.hhr-cal .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.hhr-cal .fc .fc-button-group > .fc-button { border-radius: 0; }
.hhr-cal .fc .fc-button-group > .fc-button:first-child { border-radius: 10px 0 0 10px; }
.hhr-cal .fc .fc-button-group > .fc-button:last-child { border-radius: 0 10px 10px 0; }
.hhr-cal .fc .fc-toolbar-title { font-size: 1.3rem; font-weight: 600; color: var(--hhr-ink); }
.hhr-cal .fc .fc-scrollgrid { border-radius: 12px; overflow: hidden; }
.hhr-cal .fc .fc-col-header, .hhr-cal .fc .fc-daygrid-body, .hhr-cal .fc .fc-scrollgrid-sync-table, .hhr-cal .fc .fc-timegrid-body, .hhr-cal .fc .fc-timegrid-slots table, .hhr-cal .fc .fc-timegrid-cols table { width: 100% !important; }
.hhr-cal .fc .fc-col-header-cell { background: #e4f1fb; }
.hhr-cal .fc .fc-col-header-cell-cushion { color: #0b4f7c; font-weight: 500; text-decoration: none; padding: 8px 4px; }
.hhr-cal .fc .fc-daygrid-day-number { color: var(--hhr-ink-2); text-decoration: none; font-size: .88rem; padding: 6px 8px; }
.hhr-cal .fc .fc-day-today .fc-daygrid-day-number { background: var(--hhr-blue-600); color: #fff; border-radius: 999px; min-width: 26px; text-align: center; margin: 4px; padding: 2px 6px; }
.hhr-cal .fc .fc-daygrid-day-frame { min-height: 96px; }
.hhr-cal .fc-event { border: 0 !important; border-radius: 7px; padding: 2px 6px; font-size: .8rem; cursor: pointer; overflow: hidden; }
.hhr-cal .fc-event .ev-line { display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.hhr-cal .fc-event .ev-time { font-weight: 500; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.hhr-cal .fc-event .ev-title { overflow: hidden; text-overflow: ellipsis; }
.hhr-cal .fc-event:hover { filter: brightness(1.06); }
.hhr-cal .fc-event.ev-live { animation: hhr-ring 1.6s infinite; }
@keyframes hhr-ring { 0% { box-shadow: 0 0 0 0 rgba(15, 111, 168, .55); } 70% { box-shadow: 0 0 0 8px rgba(15, 111, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 111, 168, 0); } }
@media (prefers-reduced-motion: reduce) { .hhr-cal .fc-event.ev-live { animation: none; } }
.hhr-cal .fc .fc-list-day-cushion a, .hhr-cal .fc .fc-list-event-title a { text-decoration: none; color: inherit; }
.hhr-cal .fc .fc-list-day-cushion { background: #e4f1fb; color: #0b4f7c; }
.hhr-cal .fc .fc-list-event { cursor: pointer; }
.hhr-cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: var(--hhr-ink-2); }
.hhr-cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
@media (max-width: 767.98px) {
  .hhr-cal .fc .fc-toolbar { flex-direction: column; gap: 10px; }
  .hhr-cal .fc .fc-toolbar-title { font-size: 1.1rem; }
  .hhr-cal .fc .fc-daygrid-day-frame { min-height: 64px; }
  .hhr-cal .fc .fc-button { padding: 5px 10px; font-size: .85rem; }
}

/* ---------- Trainees ---------- */
.hhr-count-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--hhr-blue-50); color: var(--hhr-blue-700); font-weight: 500; font-size: .9rem; }
.hhr-table tbody tr.is-clickable { cursor: pointer; }
.hhr-course-badge { display: inline-block; min-width: 92px; padding: 2px 10px; border-radius: 999px; background: var(--hhr-blue-50); color: var(--hhr-blue-700); font-weight: 500; font-size: .82rem; }
.hhr-person { display: flex; align-items: center; gap: 10px; }
.hhr-person .hhr-avatar { width: 30px; height: 30px; font-size: .85rem; flex: 0 0 auto; }

/* ---------- Login ---------- */
body.hhr-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(135deg, rgba(11, 90, 138, .82), rgba(23, 33, 43, .78)), url('../img/bg.jpg') center / cover no-repeat fixed;
}
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 32px 28px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
@media (min-width: 576px) { .login-card { padding: 36px; } }
.login-card .login-logo { display: block; width: 96px; height: auto; margin: 0 auto 14px; }
.login-card h1 { font-size: 1.35rem; font-weight: 600; text-align: center; margin: 0; }
.login-card .login-sub { text-align: center; color: var(--hhr-muted); font-size: .92rem; margin: 4px 0 24px; }
.login-field { position: relative; }
.login-field .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--hhr-muted); }
.login-field .form-control { padding-left: 42px; height: 46px; }
.login-card .btn-brand { height: 48px; font-size: 1.02rem; font-weight: 500; margin-top: 8px; }
.login-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hhr-line); text-align: center; font-size: .84rem; color: var(--hhr-muted); }
.login-foot a { color: var(--hhr-blue-600); text-decoration: none; }

/* ---------- Public survey form ---------- */
.sv-topbar { background: #17212b; color: #fff; padding: 10px 0; }
.sv-topbar .sv-brand { display: flex; align-items: center; gap: 12px; }
.sv-topbar img { width: 44px; height: auto; }
.sv-topbar strong { display: block; font-size: 1rem; font-weight: 600 !important; line-height: 1.15; }
.sv-topbar small { color: rgba(255, 255, 255, .65); font-size: .74rem; }
.sv-wrap { max-width: 880px; margin: 0 auto; padding: var(--gutter) var(--gutter) calc(var(--gutter) * 2); }
.sv-hero { background: #fff; border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); box-shadow: var(--hhr-shadow); overflow: hidden; margin-bottom: var(--gutter); }
.sv-hero-top { background: linear-gradient(120deg, var(--hhr-blue-700), var(--hhr-blue-600) 60%, var(--hhr-green-700)); color: #fff; padding: 20px var(--gutter); }
.sv-hero-top .eyebrow { font-size: .82rem; opacity: .85; }
.sv-hero-top h1 { color: #fff; font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 600; margin: 4px 0 0; line-height: 1.45; }
.sv-hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px var(--gutter); }
.sv-hero-meta div span { display: block; font-size: .78rem; color: var(--hhr-muted); }
.sv-hero-meta div b { font-weight: 400 !important; color: var(--hhr-ink); }
@media (max-width: 575.98px) { .sv-hero-meta { grid-template-columns: 1fr; gap: 8px; } }
.sv-card { background: #fff; border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); box-shadow: var(--hhr-shadow); margin-bottom: var(--gutter); overflow: hidden; }
.sv-card-head { display: flex; align-items: center; gap: 12px; padding: 14px var(--gutter); border-bottom: 1px solid var(--hhr-line); background: #f8fafc; }
.sv-card-head .num { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; background: var(--sec-color, var(--hhr-blue-600)); flex: 0 0 auto; }
.sv-card-head h2 { font-size: 1.02rem; font-weight: 500; margin: 0; line-height: 1.4; }
.sv-card-body { padding: 4px var(--gutter) var(--gutter); }
.sv-card.sec-info { --sec-color: #0e9ad6; }
.sv-card.sec-1 { --sec-color: var(--hhr-blue-600); }
.sv-card.sec-2 { --sec-color: var(--hhr-green-700); }
.sv-card.sec-3 { --sec-color: var(--hhr-amber); }
.sv-q { padding-top: 16px; }
.sv-q + .sv-q { border-top: 1px dashed var(--hhr-line); margin-top: 16px; }
.sv-q-title { display: flex; gap: 8px; color: var(--hhr-ink); font-weight: 400; margin-bottom: 10px; line-height: 1.5; }
.sv-q-title .n { color: var(--sec-color); font-weight: 600; flex: 0 0 auto; }
.sv-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 575.98px) { .sv-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sv-opts label {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px;
  padding: 8px 10px; border: 1px solid var(--hhr-line); border-radius: 11px; background: #fff;
  color: var(--hhr-ink-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s; line-height: 1.3;
}
.sv-opts label:hover { border-color: var(--sec-color); background: #f8fafc; }
.sv-opts .btn-check:checked + label { background: var(--sec-color); border-color: var(--sec-color); color: #fff; font-weight: 500; }
.sv-opts .btn-check:focus-visible + label { outline: 3px solid rgba(29, 143, 207, .45); outline-offset: 2px; }
.sv-card textarea.form-control { min-height: 96px; border-radius: 11px; }
.sv-submit { height: 54px; font-size: 1.1rem; font-weight: 500; border-radius: 14px; }
.sv-name-list { position: absolute; z-index: 999; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 260px; overflow-y: auto; display: none; border-radius: 12px; box-shadow: 0 12px 28px rgba(15, 34, 51, .16); }

/* ---------- Custom dropdown (replaces native select lists) ---------- */
.hhr-dd { position: relative; }
.hhr-dd-native { position: absolute !important; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.hhr-dd-btn { display: flex; align-items: center; text-align: left; background-color: #fff; cursor: pointer; min-height: 44px; }
.hhr-dd-btn.form-select-sm { min-height: 34px; }
.hhr-dd-btn:hover { border-color: #b9cbdb; }
.hhr-dd-btn[aria-expanded="true"] { border-color: var(--hhr-blue); box-shadow: 0 0 0 3px rgba(29, 143, 207, .18); }
.hhr-dd.is-invalid .hhr-dd-btn { border-color: var(--hhr-red); box-shadow: 0 0 0 3px rgba(207, 63, 63, .15); }
.hhr-dd-face { display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hhr-ink); }
.hhr-dd-face.is-placeholder { color: #8a97a5; }
.hhr-dd-face .hhr-dd-icon { color: var(--hhr-blue-600); }
.hhr-dd-menu {
  width: 100%; min-width: 100%; padding: 6px; margin-top: 6px !important;
  border: 1px solid var(--hhr-line); border-radius: 12px; box-shadow: 0 16px 36px rgba(15, 34, 51, .16);
  max-height: 320px; overflow-y: auto; z-index: 1060;
}
.hhr-dd-menu li + li { margin-top: 2px; }
.hhr-dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; font-weight: 300; color: var(--hhr-ink); white-space: normal;
}
.hhr-dd-item:hover, .hhr-dd-item:focus { background: var(--hhr-blue-50); color: var(--hhr-blue-700); }
.hhr-dd-item.active, .hhr-dd-item:active { background: var(--hhr-blue-600); color: #fff; font-weight: 500; }
.hhr-dd-item.active::after { content: "\F272"; font-family: "bootstrap-icons"; margin-left: auto; font-size: 1.05rem; }
.hhr-dd-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--hhr-blue-50); color: var(--hhr-blue-600); font-size: .95rem;
}
.hhr-dd-face .hhr-dd-icon { width: auto; height: auto; background: none; }
.hhr-dd-item.active .hhr-dd-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.hhr-dd-label { display: flex; flex-direction: column; line-height: 1.35; }
.hhr-dd-desc { font-size: .78rem; opacity: .72; font-weight: 300; }

/* ---------- Date / time picker (flatpickr, Buddhist-era display) ---------- */
.hhr-pick { position: relative; }
.hhr-pick > .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--hhr-blue-600); pointer-events: none; z-index: 2; }
.hhr-pick .form-control { padding-left: 38px; background-color: #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.flatpickr-calendar {
  font-family: 'Kanit', system-ui, sans-serif; border: 1px solid var(--hhr-line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 34, 51, .18); padding: 6px;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months { padding: 4px 0 6px; }
.flatpickr-months .flatpickr-month { height: 40px; color: var(--hhr-ink); }
.flatpickr-current-month { font-size: 1.02rem; font-weight: 500; padding-top: 8px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.flatpickr-current-month .numInputWrapper { display: none; }
.flatpickr-current-month .cur-month { font-weight: 500; margin: 0; }
.hhr-be-year { font-weight: 500; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 6px; padding: 8px 10px; border-radius: 9px; }
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { background: var(--hhr-blue-50); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--hhr-blue-600); }
span.flatpickr-weekday { color: var(--hhr-muted); font-weight: 500; font-size: .82rem; }
.flatpickr-day { border-radius: 10px; color: var(--hhr-ink); font-weight: 300; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--hhr-blue-50); border-color: var(--hhr-blue-50); }
.flatpickr-day.today { border-color: var(--hhr-blue); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--hhr-blue-600); border-color: var(--hhr-blue-600); color: #fff; font-weight: 500; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #b8c3ce; }
.flatpickr-time { border-top: 0 !important; }
.flatpickr-calendar.noCalendar { width: 210px; padding: 8px; }
.flatpickr-time input { font-family: 'Kanit', system-ui, sans-serif; font-size: 1.25rem; font-weight: 500; color: var(--hhr-ink); border-radius: 10px; }
.flatpickr-time input:hover, .flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:hover { background: var(--hhr-blue-50); }
.flatpickr-time .flatpickr-time-separator { font-weight: 600; color: var(--hhr-muted); }
.flatpickr-time input::selection { background: var(--hhr-blue-50); color: var(--hhr-blue-700); }
.sv-card { overflow: visible; }
.sv-card-head { border-radius: var(--hhr-radius) var(--hhr-radius) 0 0; }
.rp-summary p { margin: 0; }
.rp-summary p + p { margin-top: 10px; }
.rp-w h3 { align-items: flex-start; }
.rp-w h3 .rp-q-num { margin-top: -2px; }
.sv-card-head .num.sec, .rp-sec-badge {
  width: 52px; height: 52px; flex-direction: column; line-height: 1; font-size: 1.35rem; font-weight: 600; border-radius: 13px; gap: 2px;
}
.sv-card-head .num.sec small, .rp-sec-badge small { font-size: .62rem; font-weight: 400; opacity: .9; letter-spacing: .2px; }
.rp-sec-badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; background: var(--hhr-blue-600); }
.rp-sec-badge.s2 { background: var(--hhr-green-700); }
.rp-sec-badge.s3 { background: var(--hhr-amber); }
.rp-section-title.has-badge { gap: 12px; }
.rp-overview > .rp-score { align-self: start; }

/* ---------- Report page: single 1024px column ---------- */
.rp-page { max-width: calc(1024px + 2 * var(--gutter)); margin: 0 auto; }
.rp-page .rp-hero { padding-top: 0; }
.rp-page .rp-overview { grid-template-columns: 1fr; }
.rp-page .rp-score { flex-direction: row; justify-content: center; gap: 28px; padding: 20px 24px; }
.rp-page .rp-score .rp-ring { width: 150px; height: 150px; margin-bottom: 0; }
.rp-page .rp-score .rp-ring > div { width: 118px; height: 118px; }
.rp-page .rp-score .rp-ring strong { font-size: 2.2rem; }
.rp-page .rp-score-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; }
.rp-page .rp-score-text p { margin: 0; }
.rp-page .rp-qgrid, .rp-page .rp-written, .rp-page .rp-criteria { grid-template-columns: 1fr; }
.rp-page .rp-opt { grid-template-columns: 140px minmax(0, 1fr) 96px; }
@media (max-width: 575.98px) {
  .rp-page .rp-score { flex-direction: column; text-align: center; }
  .rp-page .rp-score-text { align-items: center; text-align: center; }
  .rp-page .rp-opt { grid-template-columns: 92px minmax(0, 1fr) 74px; }
}

/* Overview row: score card beside a 2x2 grid of KPI cards; summary text full width below. */
.rp-page .rp-overview { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 12px; margin-bottom: var(--gutter); align-items: stretch; }
.rp-page .rp-overview > .rp-score { align-self: stretch; flex-direction: column; gap: 12px; padding: 20px; }
.rp-page .rp-score-text { align-items: center; text-align: center; }
.rp-page .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-page .rp-kpi { display: flex; flex-direction: column; justify-content: center; }
.rp-page .rp-summary { margin-top: 0; }
@media (max-width: 767.98px) {
  .rp-page .rp-overview { grid-template-columns: 1fr; }
  .rp-page .rp-overview > .rp-score { flex-direction: row; justify-content: center; }
  .rp-page .rp-score-text { align-items: flex-start; text-align: left; }
}
@media (max-width: 575.98px) {
  .rp-page .rp-overview > .rp-score { flex-direction: column; }
  .rp-page .rp-score-text { align-items: center; text-align: center; }
}

/* Section badge: "ตอนที่ 1" on one line */
.sv-card-head .num.sec, .rp-sec-badge {
  width: auto; height: 36px; padding: 0 14px; flex-direction: row; gap: 5px;
  font-size: 1.05rem; font-weight: 600; line-height: 1; border-radius: 10px; white-space: nowrap;
}
.sv-card-head .num.sec small, .rp-sec-badge small { font-size: inherit; font-weight: 500; opacity: 1; letter-spacing: 0; }

/* Per-question numbers table (replaces bars on the report page) */
.rp-opt-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.rp-opt-table th { background: #f1f6fa; color: var(--hhr-ink-2); font-weight: 500; font-size: .85rem; padding: 8px 12px; border-bottom: 1px solid var(--hhr-line); }
.rp-opt-table th:first-child { border-radius: 8px 0 0 8px; }
.rp-opt-table th:last-child { border-radius: 0 8px 8px 0; }
.rp-opt-table td { padding: 8px 12px; border-bottom: 1px solid var(--hhr-line-2); color: var(--hhr-ink); }
.rp-opt-table .num { text-align: right; width: 120px; }
.rp-opt-table tr.top td { font-weight: 500; background: #f6fbf7; }
.rp-opt-table tr.zero td { color: #9aa7b4; }
.rp-opt-table tfoot td { font-weight: 500; color: var(--hhr-ink-2); border-bottom: 0; border-top: 1px solid var(--hhr-line); }
.rp-opt-table .tier-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 10px; vertical-align: 1px; }
.rp-opt-table tr.zero .tier-dot { opacity: .35; }
@media (max-width: 575.98px) { .rp-opt-table .num { width: 84px; } .rp-opt-table th, .rp-opt-table td { padding: 7px 8px; } }

/* Per-question table with proportion bars (matches the PDF layout) */
.rp-opt-table .lbl { width: 190px; white-space: nowrap; }
.rp-opt-table .bar-col { width: auto; }
.rp-opt-table th.bar-col { text-align: center; }
.rp-opt-table .num { width: 110px; text-align: center; }
.rp-opt-table .opt-track { display: block; height: 16px; border-radius: 99px; background: var(--hhr-line-2); overflow: hidden; }
.rp-opt-table .opt-track span { display: block; height: 100%; border-radius: 99px; min-width: 0; }
.rp-opt-table tr.zero .opt-track { opacity: .6; }
.rp-opt-table .tier-dot { width: 12px; height: 12px; border-radius: 3px; }
.rp-opt-table tfoot .total-label { text-align: right; }
@media (max-width: 575.98px) {
  .rp-opt-table .lbl { width: auto; white-space: normal; }
  .rp-opt-table .bar-col { display: none; }
  .rp-opt-table .num { width: 76px; }
  .rp-opt-table tfoot .total-label { text-align: left; }
}

/* Survey header: official company logo (white wordmark for the dark bar) */
.sv-topbar { padding: 12px 0; }
.sv-topbar .sv-brand { justify-content: space-between; gap: 16px; }
.sv-topbar img.sv-company-logo { width: auto; height: 40px; max-width: 70vw; }
.sv-brand-sub { color: rgba(255, 255, 255, .72); font-size: .85rem; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .2); white-space: nowrap; }
@media (max-width: 575.98px) {
  .sv-topbar img.sv-company-logo { height: 32px; }
  .sv-brand-sub { display: none; }
}

/* Answer-proportion cards under the stacked bar */
.rp-tier-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 767.98px) { .rp-tier-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-tier-card { border: 1px solid var(--hhr-line); border-top: 4px solid var(--tc); border-radius: 12px; padding: 12px 14px; background: #fff; }
.rp-tier-card.tc-0 { --tc: var(--hhr-green); }
.rp-tier-card.tc-1 { --tc: var(--hhr-blue); }
.rp-tier-card.tc-2 { --tc: var(--hhr-amber); }
.rp-tier-card.tc-3 { --tc: var(--hhr-red); }
.rp-tier-label { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--hhr-ink-2); }
.rp-tier-label i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.rp-tier-card strong { display: block; font-size: 1.55rem; font-weight: 600 !important; line-height: 1.25; margin-top: 4px; color: var(--hhr-ink); font-variant-numeric: tabular-nums; }
.rp-tier-card em { font-style: normal; font-size: .82rem; color: var(--hhr-muted); }
.rp-tier-card.is-zero strong { color: #a9b6c3; }

/* Report header as a card */
.rp-page .rp-hero.rp-hero-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #f5faff 0%, #fff 70%);
  border: 1px solid var(--hhr-line); border-radius: var(--hhr-radius); box-shadow: var(--hhr-shadow);
  padding: calc(var(--gutter) + 4px) var(--gutter) var(--gutter); margin-bottom: var(--gutter);
}
.rp-hero-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--hhr-blue-600), var(--hhr-green)); }
.rp-hero-card h1 { margin-bottom: 16px; }
.rp-hero-card .rp-meta { gap: 8px; }
.rp-hero-card .rp-meta span {
  padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--hhr-line);
  font-size: .88rem; line-height: 1.4;
}
.rp-hero-card .rp-meta small { font-size: .78rem; }

/* Written answers: show every comment in full (no scroll box) */
.rp-w ul { max-height: none; overflow: visible; }

/* All table headers bold */
.hhr-table thead th,
.rp-opt-table th,
.rp-crit h3,
.modal .table thead th,
table thead th { font-weight: 600 !important; }
.rp-opt-table tfoot td { font-weight: 600; }

/* Per-item rows on the 5-level criteria, with the worked mean underneath */
.rp-opt-table .lbl { width: 230px; }
.rp-opt-table .lv-score { color: var(--hhr-muted); font-weight: 400; font-size: .85rem; }
.rp-opt-table .lv-ans { display: block; margin-left: 22px; color: var(--hhr-muted); font-size: .78rem; font-weight: 400; line-height: 1.3; }
.rp-opt-table tr.zero .lv-ans { color: #b3bec9; }
.rp-opt-table tfoot tr.calc td { border-top: 0; background: #f4f9fd; border-radius: 8px; padding: 9px 12px; font-weight: 400; color: var(--hhr-ink-2); text-align: left; font-variant-numeric: tabular-nums; }
.rp-opt-table tr.calc strong { font-weight: 600; }
.rp-opt-table tr.calc .lv-0 { color: #20793b; }
.rp-opt-table tr.calc .lv-1 { color: #1677b0; }
.rp-opt-table tr.calc .lv-2 { color: #a86506; }
.rp-opt-table tr.calc .lv-3 { color: #c03535; }
.rp-opt-table tr.calc .sep { margin: 0 10px; color: #b3bec9; }
@media (max-width: 575.98px) { .rp-opt-table .lbl { width: auto; } .rp-opt-table tr.calc .sep { display: block; height: 0; overflow: hidden; margin: 0; } }
