/* helpdesk_dense.css — 2026-08-14
   Dense "Excel ผสม SabuySoft" re-skin for the 13 Helpdesk pages.
   Scope: everything is gated behind the .hd-dense class that each reworked
   page adds to its main container, so ticket detail / claims pages that share
   helpdesk/_style.html are untouched.
   Do NOT put comments inside declaration blocks (contract-test parser). */

.hd-dense { font-size: 13px; }
.hd-dense > * { min-width: 0; }

/* ============ 1. One-line header bar (<=48px) ============ */
.hd-dense .hd-page-head,
.hd-dense.hd-i16-main .hd-i16-page-head,
.hd-dense .hd-v13-top,
.hd-dense .hd-v10-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 6px;
  padding: 5px 10px;
  min-height: 0;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
}
.hd-dense .hd-page-head > div:first-child,
.hd-dense .hd-i16-page-head > div:first-child,
.hd-dense .hd-v13-top > div:first-child,
.hd-dense .hd-v10-top > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hd-dense .hd-title,
.hd-dense .hd-page-head h1,
.hd-dense .hd-i16-page-head h1,
.hd-dense .hd-v13-title-line h1,
.hd-dense .hd-v10-title-line h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.hd-dense .hd-v13-title-line { gap: 8px; }
/* old subtitles move into the ⓘ tooltip; keep them in the DOM for contracts */
.hd-dense .hd-page-head .hd-muted,
.hd-dense .hd-i16-page-head > div:first-child p,
.hd-dense .hd-v13-subtitle,
.hd-dense .hd-v10-top > div > p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hd-dense-kicker {
  font-size: .7rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .02em;
  white-space: nowrap;
}
.hd-dense-info {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid #b9cce3;
  border-radius: 50%;
  color: #1356a0;
  background: #f6faff;
  font-size: .66rem;
  font-weight: 700;
  font-style: normal;
  cursor: help;
}
.hd-dense .hd-page-tools,
.hd-dense .hd-i16-page-actions,
.hd-dense .hd-v13-top-actions,
.hd-dense .hd-v10-create-actions,
.hd-dense .hd-v10-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.hd-dense .hd-v13-top { grid-template-columns: none; }
.hd-dense .hd-v13-top-actions .btn,
.hd-dense .hd-page-tools .btn,
.hd-dense .hd-i16-page-actions .btn,
.hd-dense .hd-work-tools .btn,
.hd-dense .hd-v10-create-actions a,
.hd-dense .hd-v10-export-actions a {
  min-height: 26px;
  padding: 2px 9px;
  font-size: .74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.hd-dense .hd-v13-display summary,
.hd-dense .hd-display-menu summary {
  min-height: 26px;
  padding: 2px 9px;
  font-size: .74rem;
  font-weight: 600;
}
.hd-dense .hd-v13-concept,
.hd-dense .hd-v10-live-data-badge {
  min-height: 20px;
  padding: 1px 8px;
  font-size: .68rem;
}
.hd-dense .hd-v13-asof,
.hd-dense .hd-i16-updated,
.hd-dense .hd-v10-live { font-size: .7rem; }

/* ============ 2. Summary (LINE) panel: one slim band ============ */
.hd-dense .hd-summary-panel {
  padding: 5px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
}
.hd-dense .hd-summary-head { align-items: center; gap: 8px; }
.hd-dense .hd-summary-heading { align-items: center; gap: 8px; }
.hd-dense .hd-summary-icon { width: 20px; height: 20px; font-size: .8rem; }
.hd-dense .hd-summary-heading h2 { font-size: .8rem; margin: 0; }
.hd-dense .hd-summary-heading p { margin: 0; font-size: .66rem; }
.hd-dense .hd-summary-actions .btn {
  min-height: 24px;
  padding: 1px 8px;
  font-size: .7rem;
}
.hd-dense .hd-summary-headlines {
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
}
.hd-dense .hd-summary-headlines li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .7rem;
}
.hd-dense .hd-summary-headlines li small { font-size: .68rem; }
.hd-dense .hd-summary-headlines li b { font-size: .78rem; }
.hd-dense .hd-summary-note { display: none; }

/* ============ 3. Chip strips replace KPI-card walls ============ */
.hd-dense .hd-i16-kpi-grid,
.hd-dense .hd-report-kpi-grid,
.hd-dense .hd-v13-kpis,
.hd-dense .hd-customer-focus-grid,
.hd-dense .hd-settings-summary-grid,
.hd-dense .hd-kpi-grid,
.hd-dense .hd-kpi-grid.hd-kpi-grid-5 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.hd-dense .hd-i16-kpi,
.hd-dense .hd-report-kpi,
.hd-dense .hd-v13-kpi,
.hd-dense .hd-focus-item,
.hd-dense .hd-settings-summary-grid > a,
.hd-dense .hd-kpi-grid .hd-stat {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  height: auto;
  padding: 2px 10px;
  border: 1px solid #cfd9e4;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: .74rem;
  text-align: left;
  text-decoration: none;
  transform: none;
}
.hd-dense a.hd-v13-kpi:hover,
.hd-dense .hd-i16-kpi:hover,
.hd-dense .hd-report-kpi:hover,
.hd-dense .hd-focus-item:hover {
  transform: none;
  background: #f0f7ff;
  border-color: #7fb3fa;
}
.hd-dense .hd-i16-kpi small,
.hd-dense .hd-report-kpi small,
.hd-dense .hd-v13-kpi small,
.hd-dense .hd-focus-item div strong,
.hd-dense .hd-settings-summary-grid > a small,
.hd-dense .hd-kpi-grid .hd-stat .label {
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  color: #46586e;
  white-space: nowrap;
}
.hd-dense .hd-i16-kpi strong,
.hd-dense .hd-report-kpi strong,
.hd-dense .hd-v13-kpi b,
.hd-dense .hd-focus-item > b,
.hd-dense .hd-settings-summary-grid > a strong,
.hd-dense .hd-kpi-grid .hd-stat .value {
  font-size: .88rem;
  font-weight: 800;
  line-height: 1;
  color: #075fcf;
}
/* descriptions inside chips are noise at this density */
.hd-dense .hd-i16-kpi span,
.hd-dense .hd-report-kpi span,
.hd-dense .hd-focus-item div span,
.hd-dense .hd-settings-summary-grid > a span { display: none; }
.hd-dense .hd-v13-kpi-icon {
  width: auto;
  height: auto;
  background: transparent;
  font-size: .8rem;
}
.hd-dense .hd-i16-kpi.is-danger,
.hd-dense .hd-report-kpi.is-danger,
.hd-dense .hd-focus-item.danger { border-color: #f3b4b4; background: #fef5f5; }
.hd-dense .hd-i16-kpi.is-danger strong,
.hd-dense .hd-report-kpi.is-danger strong,
.hd-dense .hd-v13-kpi.is-danger b,
.hd-dense .hd-focus-item.danger > b { color: #d92d2d; }
.hd-dense .hd-i16-kpi.is-warning,
.hd-dense .hd-report-kpi.is-warning,
.hd-dense .hd-focus-item.warning { border-color: #f2d5ae; background: #fffaf1; }
.hd-dense .hd-i16-kpi.is-warning strong,
.hd-dense .hd-report-kpi.is-warning strong,
.hd-dense .hd-v13-kpi.is-warning b,
.hd-dense .hd-focus-item.warning > b { color: #c35f00; }
.hd-dense .hd-report-kpi.is-success strong,
.hd-dense .hd-v13-kpi.is-success b { color: #148247; }
.hd-dense .hd-focus-item.purple { border-color: #d8ccf4; background: #faf8ff; }
.hd-dense .hd-focus-item.purple > b { color: #5b4bc4; }
.hd-dense .hd-focus-item.import { border-color: #c9e4f6; background: #f4fbff; }
.hd-dense .hd-focus-item i.bi { font-size: .78rem; }
.hd-dense .hd-kpi-grid .hd-stat.success .value { color: #148247; }
.hd-dense .hd-kpi-grid .hd-stat.warning .value { color: #c35f00; }
.hd-dense .hd-kpi-grid .hd-stat.danger .value { color: #d92d2d; }
.hd-dense .hd-kpi-grid .hd-stat.purple .value { color: #5b4bc4; }

/* stage rows become a slim linked flow strip */
.hd-dense .hd-i16-stage-row,
.hd-dense .hd-claim-strip-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.hd-dense .hd-i16-stage-row a,
.hd-dense .hd-claim-strip-flow a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 1px 9px;
  border: 1px solid #cfd9e4;
  border-radius: 999px;
  background: #fff;
  font-size: .72rem;
  text-decoration: none;
  color: #334155;
}
.hd-dense .hd-i16-stage-row a small { font-size: .7rem; font-weight: 600; }
.hd-dense .hd-i16-stage-row a b { font-size: .82rem; font-weight: 800; }
.hd-dense .hd-strip-step {
  width: 18px;
  height: 18px;
  font-size: .62rem;
}

/* sheet tabs (Excel-like) stay but tighter */
.hd-dense .hd-sheet-tabs { gap: 3px; margin-bottom: 5px; }
.hd-dense .hd-sheet-tab {
  min-height: 30px;
  padding: 2px 10px;
  font-size: .74rem;
}
.hd-dense .hd-sheet-count { font-size: .7rem; }
.hd-dense .hd-chip-row { gap: 4px; margin-bottom: 5px; }
.hd-dense .hd-chip {
  min-height: 26px;
  padding: 1px 9px;
  font-size: .72rem;
}

/* ============ 4. Section chrome ============ */
.hd-dense .hd-i16-section,
.hd-dense .hd-report-section,
.hd-dense .hd-v13-section,
.hd-dense .hd-settings-overview,
.hd-dense .hd-card {
  margin-bottom: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: none;
}
.hd-dense .hd-v13-section { border-top-width: 2px; }
.hd-dense .hd-i16-section-title,
.hd-dense .hd-report-section-head,
.hd-dense .hd-v13-section-head,
.hd-dense .hd-v12-section-head,
.hd-dense .hd-settings-section-head { margin-bottom: 5px; gap: 7px; align-items: center; }
.hd-dense .hd-i16-section-title > span,
.hd-dense .hd-report-section-no,
.hd-dense .hd-v13-section-no,
.hd-dense .hd-v12-section-number,
.hd-dense .hd-settings-section-head > span {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.hd-dense .hd-i16-section-title h2,
.hd-dense .hd-report-section-head h2,
.hd-dense .hd-v13-section-head h2,
.hd-dense .hd-v12-section-head h2,
.hd-dense .hd-settings-section-head h2 { font-size: .88rem; margin: 0; }
.hd-dense .hd-i16-section-title p,
.hd-dense .hd-report-section-head p:not([data-helpdesk-report-sort-summary]),
.hd-dense .hd-v13-section-head p,
.hd-dense .hd-v12-section-head p,
.hd-dense .hd-settings-section-head p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hd-dense .hd-report-section-head p[data-helpdesk-report-sort-summary] { margin: 0; font-size: .68rem; }
.hd-dense .hd-v13-section-meta { font-size: .74rem; }
.hd-dense .hd-card-head { padding: 0 0 5px; }
.hd-dense .hd-card-title { font-size: .8rem; font-weight: 700; }
.hd-dense .hd-card-head .small,
.hd-dense .hd-card-head .hd-muted { font-size: .68rem; }
.hd-dense .hd-card-body { padding: 6px 0 0; }
.hd-dense .hd-i16-overlap-note,
.hd-dense .hd-report-count-note,
.hd-dense .hd-v13-overlap-note,
.hd-dense .hd-v12-overlap-note,
.hd-dense .hd-v12-management-label,
.hd-dense .hd-i16-filter-hint,
.hd-dense .hd-list-scope-hint,
.hd-dense .hd-v14-filter-note,
.hd-dense .hd-v13-filter-note,
.hd-dense .hd-settings-capability-note {
  margin: 4px 0 0;
  padding: 2px 8px;
  font-size: .68rem;
  line-height: 1.35;
}

/* ============ 5. One-row filter bands ============ */
.hd-dense .hd-i16-filter { padding: 6px 10px; }
.hd-dense .hd-i16-filter-head { margin-bottom: 4px; }
.hd-dense .hd-i16-filter-head h2 { font-size: .8rem; margin: 0; }
.hd-dense .hd-i16-filter-head p { display: none; }
.hd-dense .hd-i16-filter-grid,
.hd-dense .hd-report-filter-grid { gap: 5px; align-items: end; }
.hd-dense .hd-i16-field label,
.hd-dense .hd-report-filter-grid label > span,
.hd-dense .hd-v13-field label,
.hd-dense .hd-v14-filter-field label {
  margin: 0 0 2px;
  font-size: .66rem;
  font-weight: 700;
}
.hd-dense .hd-i16-field input,
.hd-dense .hd-i16-field select,
.hd-dense .hd-v13-field input,
.hd-dense .hd-v13-field select,
.hd-dense .hd-v14-filter-field input,
.hd-dense .hd-v14-filter-field select,
.hd-dense .form-control,
.hd-dense .form-select {
  min-height: 28px;
  padding: 2px 8px;
  font-size: .78rem;
  border-radius: 6px;
}
.hd-dense textarea.form-control { min-height: 0; height: auto; }
.hd-dense input[type="file"].form-control { padding: 3px 8px; }
.hd-dense .hd-v13-filter-wrap { padding: 6px 8px; border-radius: 8px; }
.hd-dense .hd-v13-filter { gap: 5px; }
.hd-dense .hd-v13-filter-actions .btn,
.hd-dense .hd-i16-filter-submit,
.hd-dense .hd-v14-filter-submit .btn,
.hd-dense .hd-report-filter-actions .btn {
  min-height: 28px;
  padding: 2px 10px;
  font-size: .74rem;
  font-weight: 700;
}
.hd-dense .hd-search-input .form-control { padding-left: 28px; }
.hd-dense .hd-search-input i { font-size: .74rem; }
.hd-dense .hd-i16-search-input input { min-height: 28px; }
.hd-dense .hd-customer-filter-search,
.hd-dense .hd-list-filter { gap: 5px; }
.hd-dense .hd-filter-details summary.btn { padding: 2px 10px; font-size: .74rem; }
.hd-dense .hd-v14-filter-more summary { font-size: .74rem; padding: 3px 8px; }
.hd-dense .hd-v14-filter-grid { gap: 5px; }
.hd-dense .hd-v14-filter-chip { font-size: .68rem; padding: 1px 8px; }
.hd-dense .hd-v14-filter-active,
.hd-dense .hd-active-filter-row { gap: 4px; margin-top: 4px; }

/* ============ 6. Dense data grids: gridlines + zebra + 23-26px rows ===== */
.hd-dense table.hd-table th,
.hd-dense table.hd-table td,
.hd-dense .hd-i16-grid th,
.hd-dense .hd-i16-grid td,
.hd-dense .hd-v14-table th,
.hd-dense .hd-v14-table td,
.hd-dense .hd-report-table th,
.hd-dense .hd-report-table td,
.hd-dense .hd-excel-table th,
.hd-dense .hd-excel-table td {
  padding: 3px 8px;
  font-size: .76rem;
  line-height: 1.3;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}
.hd-dense table.hd-table thead th,
.hd-dense .hd-i16-grid thead th,
.hd-dense .hd-v14-table thead th,
.hd-dense .hd-report-table thead th,
.hd-dense .hd-excel-table thead th {
  font-size: .7rem;
  font-weight: 700;
  background: #f1f5f9;
  white-space: nowrap;
}
.hd-dense table.hd-table tbody tr:nth-child(even) > td,
.hd-dense .hd-i16-grid tbody tr:nth-child(even) > td,
.hd-dense .hd-report-table tbody tr:nth-child(even) > td {
  background-color: #f8fafc;
}
.hd-dense table.hd-table td small,
.hd-dense .hd-i16-grid td small,
.hd-dense .hd-v14-table td small,
.hd-dense .hd-report-table td small {
  display: block;
  font-size: .66rem;
  line-height: 1.25;
}
.hd-dense .hd-status {
  padding: 1px 8px;
  font-size: .68rem;
  border-radius: 999px;
}
.hd-dense table .btn,
.hd-dense .hd-i16-grid .btn,
.hd-dense .hd-report-table .btn {
  padding: 1px 7px;
  font-size: .7rem;
  min-height: 22px;
}
.hd-dense .hd-i16-next-link,
.hd-dense .hd-v13-row-action { font-size: .72rem; padding: 1px 7px; }

/* import-history numeric tints (Excel-standard column colors) */
/* เดิมระบายสีสี่คอลัมน์ตัวเลขด้วย nth-child(4)..(7) ซึ่งผูกกับ "ตำแหน่ง" คอลัมน์
   พอแยกคอลัมน์ ไฟล์/Hash/Comment ออกจากกันตามกฎหนึ่งช่องหนึ่งข้อมูล ตำแหน่งเลื่อน
   ไปเป็น 6..9 สีจึงไปตกบน Comment กับ โหมด แทน  ตอนนี้ยึดกับ class ของคอลัมน์
   ที่ template ประกาศเอง (col.cls) จึงไม่เลื่อนอีกไม่ว่าจะเพิ่มหรือลดคอลัมน์ */
.hd-dense .hd-import-history-table td.ih-total { background-color: rgba(250, 204, 21, .18); }
.hd-dense .hd-import-history-table td.ih-created { background-color: rgba(34, 197, 94, .10); }
.hd-dense .hd-import-history-table td.ih-dup { background-color: rgba(6, 182, 212, .10); }
.hd-dense .hd-import-history-table td.ih-error { background-color: rgba(236, 72, 153, .09); }
.hd-dense .hd-import-history-table td.ih-total,
.hd-dense .hd-import-history-table td.ih-created,
.hd-dense .hd-import-history-table td.ih-dup,
.hd-dense .hd-import-history-table td.ih-error {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* pagination bars */
.hd-dense .hd-pagination-bar,
.hd-dense .hd-report-pagination,
.hd-dense .hd-i16-pagination,
.hd-dense .hd-v13-pagination { margin-top: 5px; font-size: .72rem; }
.hd-dense .hd-page-buttons .btn { padding: 1px 7px; font-size: .7rem; }
.hd-dense .hd-i16-pagination a,
.hd-dense .hd-i16-pagination span,
.hd-dense .hd-report-pagination nav a,
.hd-dense .hd-report-pagination nav span { padding: 1px 8px; font-size: .72rem; }
.hd-dense .hd-i16-grid-toolbar { gap: 6px; padding: 4px 0; font-size: .72rem; }
.hd-dense .hd-i16-grid-toolbar label { font-size: .68rem; margin: 0 3px 0 0; }
.hd-dense .hd-i16-grid-toolbar select { min-height: 26px; padding: 1px 6px; font-size: .74rem; }
.hd-dense .hd-i16-grid-toolbar .btn { min-height: 26px; padding: 1px 9px; font-size: .72rem; }
.hd-dense .hd-report-table-tools { font-size: .72rem; gap: 3px; }
.hd-dense .hd-report-table-tools a { padding: 1px 7px; }
.hd-dense .hd-v14-detail-tools { gap: 5px; }
.hd-dense .hd-v14-detail-tools label { font-size: .66rem; margin-bottom: 2px; }
.hd-dense .hd-v14-detail-tools .btn { min-height: 28px; padding: 2px 9px; font-size: .74rem; }
.hd-dense .hd-v14-smartbar { padding: 4px 8px; gap: 6px; }
.hd-dense .hd-v14-smartbar-title { font-size: .68rem; }
.hd-dense .hd-v14-preset,
.hd-dense .hd-v14-grid-button { padding: 2px 8px; font-size: .7rem; min-height: 26px; }
.hd-dense .hd-v14-menu summary { padding: 2px 8px; font-size: .7rem; min-height: 26px; }
.hd-dense .hd-v14-grid-help { font-size: .66rem; margin: 3px 0; }

/* ============ 7. Guided-flow / scope strips: slim single lines ========= */
.hd-dense .hd-flow-card .hd-card-body { padding: 4px 8px; }
.hd-dense .hd-flow-head { margin-bottom: 3px; }
.hd-dense .hd-flow-head .hd-kicker { font-size: .6rem; }
.hd-dense .hd-flow-head .hd-card-title { font-size: .76rem; }
.hd-dense .hd-flow-head .small { display: none; }
.hd-dense .hd-flow-switch { font-size: .68rem; }
.hd-dense .hd-flow-steps { gap: 4px; }
.hd-dense .hd-flow-step { padding: 2px 8px; gap: 5px; }
.hd-dense .hd-flow-step .fw-bold { font-size: .7rem; }
.hd-dense .hd-flow-step .small { display: none; }
.hd-dense .hd-flow-no { width: 18px; height: 18px; font-size: .62rem; }
.hd-dense .hd-next-panel { padding: 3px 8px; gap: 7px; }
.hd-dense .hd-next-icon { width: 22px; height: 22px; font-size: .74rem; }
.hd-dense .hd-next-panel .small { font-size: .64rem; }
.hd-dense .hd-next-panel .fw-bold { font-size: .74rem; }
.hd-dense .hd-next-button { padding: 2px 10px; font-size: .72rem; min-height: 26px; }
.hd-dense .hd-section-guide { padding: 3px 8px; margin-bottom: 6px; }
.hd-dense .hd-section-guide-steps { gap: 4px; }
.hd-dense .hd-section-guide-step { padding: 1px 6px; gap: 5px; }
.hd-dense .hd-section-guide-step em { display: none; }
.hd-dense .hd-section-guide-step strong { font-size: .7rem; }
.hd-dense .hd-section-guide-step span { width: 16px; height: 16px; font-size: .6rem; }
.hd-dense .hd-section-guide-summary { font-size: .72rem; padding: 2px 4px; }
.hd-dense .hd-section-guide-summary em { font-size: .64rem; }
.hd-dense .hd-customer-scope-strip,
.hd-dense .hd-internal-scope-strip,
.hd-dense .hd-import-map-strip,
.hd-dense .hd-claim-console-strip,
.hd-dense .hd-internal-console-strip,
.hd-dense .hd-settings-split-note,
.hd-dense .hd-i16-system-note,
.hd-dense .hd-v13-compat-strip {
  padding: 3px 10px;
  margin-bottom: 6px;
  gap: 6px 12px;
  font-size: .7rem;
}
.hd-dense .hd-customer-scope-strip em,
.hd-dense .hd-internal-scope-strip em,
.hd-dense .hd-import-map-strip span,
.hd-dense .hd-settings-split-note span { font-size: .66rem; }
.hd-dense .hd-claim-strip-title strong { font-size: .74rem; }
.hd-dense .hd-claim-strip-title span { font-size: .66rem; }
.hd-dense .hd-customer-scope-strip .btn,
.hd-dense .hd-internal-scope-strip .btn { padding: 1px 8px; font-size: .7rem; min-height: 24px; }
.hd-dense .hd-list-help-details summary { padding: 2px 8px; font-size: .72rem; }

/* v12 hub (ศูนย์รวม Helpdesk) */
.hd-dense .hd-v12-overview-grid { gap: 6px; }
.hd-dense .hd-v12-overview-card { padding: 6px 9px; }
.hd-dense .hd-v12-overview-card header { gap: 7px; margin-bottom: 4px; }
.hd-dense .hd-v12-overview-card header h3 { font-size: .8rem; margin: 0; }
.hd-dense .hd-v12-overview-card header p { display: none; }
.hd-dense .hd-v12-stream-icon { width: 22px; height: 22px; font-size: .78rem; }
.hd-dense .hd-v12-open-count { padding: 2px 9px; }
.hd-dense .hd-v12-open-count small { font-size: .62rem; }
.hd-dense .hd-v12-open-count b { font-size: .95rem; }
.hd-dense .hd-v12-open-count span { font-size: .6rem; }
.hd-dense .hd-v12-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.hd-dense .hd-v12-kpis a {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .7rem;
}
.hd-dense .hd-v12-kpis a small { margin: 0; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.hd-dense .hd-v12-kpis a b { font-size: .8rem; }
.hd-dense .hd-v12-kpi-icon { width: 16px; height: 16px; font-size: .62rem; }
.hd-dense .hd-v12-overview-card footer { padding-top: 3px; font-size: .68rem; }
.hd-dense .hd-v12-priority-grid,
.hd-dense .hd-v12-detail-stack { gap: 6px; }
.hd-dense .hd-v12-priority-card,
.hd-dense .hd-v12-detail-card { padding: 6px 9px; }
.hd-dense .hd-v12-priority-card header h3,
.hd-dense .hd-v12-detail-card-head h3 { font-size: .8rem; margin: 0; }
.hd-dense .hd-v12-priority-card header p,
.hd-dense .hd-v12-detail-card-head p { font-size: .64rem; margin: 0; }
.hd-dense .hd-v12-stream-label { font-size: .64rem; }
.hd-dense .hd-v12-priority-row,
.hd-dense .hd-v12-detail-row { padding: 3px 8px; gap: 6px; }
.hd-dense .hd-v12-priority-row strong,
.hd-dense .hd-v12-detail-row strong { font-size: .74rem; }
.hd-dense .hd-v12-ticket-issue { font-size: .7rem; }
.hd-dense .hd-v12-ticket-context,
.hd-dense .hd-v12-ticket-received { font-size: .64rem; }
.hd-dense .hd-v12-priority-row dl,
.hd-dense .hd-v12-detail-row span { font-size: .66rem; }
.hd-dense .hd-v12-priority-reason { font-size: .66rem; padding: 1px 7px; }
.hd-dense .hd-v12-row-action,
.hd-dense .hd-v12-detail-action { padding: 2px 8px; font-size: .7rem; }
.hd-dense .hd-v10-recommendation { padding: 4px 8px; }
.hd-dense .hd-v10-recommendation header h3 { font-size: .72rem; }
.hd-dense .hd-v12-stages { padding: 3px 8px; }
.hd-dense .hd-v12-stages header h4 { font-size: .7rem; margin: 0; }
.hd-dense .hd-v12-stages header span { font-size: .66rem; }
.hd-dense .hd-v12-stages > div { gap: 4px; }
.hd-dense .hd-v12-stages > div span { padding: 1px 8px; font-size: .68rem; }
.hd-dense .hd-v12-section-head { margin-bottom: 4px; }
.hd-dense .hd-v12-primary-section { margin-bottom: 7px; padding: 6px 9px; }
.hd-dense .hd-v12-detail-tools { gap: 5px; margin-bottom: 4px; }
.hd-dense .hd-v12-search input { min-height: 28px; font-size: .76rem; }
.hd-dense .hd-v12-search button { min-height: 28px; padding: 1px 9px; font-size: .72rem; }
.hd-dense .hd-v12-detail-size select { min-height: 26px; font-size: .72rem; }
.hd-dense .hd-v12-detail-size button { min-height: 26px; padding: 1px 8px; font-size: .7rem; }
.hd-dense .hd-v12-pagination { font-size: .7rem; }
.hd-dense .hd-v10-readiness-grid { gap: 5px; }
.hd-dense .hd-v10-readiness-card { padding: 4px 8px; font-size: .7rem; }
.hd-dense .hd-v7-learning summary,
.hd-dense .hd-v10-readiness summary { padding: 3px 9px; font-size: .74rem; }

/* internal trend + action rows */
.hd-dense .hd-i16-trend-layout { gap: 6px; }
.hd-dense .hd-i16-trend-summary article { padding: 4px 9px; }
.hd-dense .hd-i16-trend-summary strong { font-size: 1rem; }
.hd-dense .hd-i16-trend-summary small,
.hd-dense .hd-i16-trend-summary span,
.hd-dense .hd-i16-trend-summary em { font-size: .66rem; }
.hd-dense .hd-i16-week-chart { padding: 4px 8px; }
.hd-dense .hd-i16-chart-bars { min-height: 90px; }
.hd-dense .hd-i16-recommendation { padding: 4px 9px; gap: 7px; }
.hd-dense .hd-i16-recommendation h3 { font-size: .78rem; margin: 0; }
.hd-dense .hd-i16-recommendation p { font-size: .66rem; margin: 0; }
.hd-dense .hd-i16-recommendation .btn { padding: 2px 9px; font-size: .72rem; }
.hd-dense .hd-i16-action-list { gap: 4px; }
.hd-dense .hd-i16-action-row { padding: 3px 8px; gap: 6px; }
.hd-dense .hd-i16-action-row small { font-size: .62rem; }
.hd-dense .hd-i16-action-row strong { font-size: .72rem; }
.hd-dense .hd-i16-action-row span { font-size: .64rem; }
.hd-dense .hd-i16-action-row .btn { padding: 2px 8px; font-size: .7rem; }
.hd-dense .hd-i16-list-foot { font-size: .7rem; }

/* ============ 8. Compact forms (tickets/new x3, public/new) ============ */
.hd-dense .form-label { margin-bottom: 2px; font-size: .68rem; font-weight: 700; }
.hd-dense .form-text { margin-top: 1px; font-size: .62rem; }
.hd-dense .row.g-3 { --bs-gutter-x: .5rem; --bs-gutter-y: .4rem; }
.hd-dense .hd-two-col { gap: 7px; }
.hd-dense .hd-filter-stack { gap: 6px; }
.hd-dense .alert { padding: 4px 9px; font-size: .7rem; margin-bottom: 5px; }
.hd-dense .hd-actions { gap: 5px; }
.hd-dense .hd-actions .btn,
.hd-dense form .btn { padding: 3px 10px; font-size: .76rem; }
.hd-dense form .btn-lg { padding: 5px 12px; font-size: .82rem; }
.hd-dense .hd-public-panel { padding: 10px 12px; }
.hd-dense .hd-public-panel h2 { font-size: 1rem; margin-bottom: 2px; }
.hd-dense .hd-public-panel .hd-kicker { font-size: .64rem; }
.hd-dense .hd-public-panel > div > p.hd-muted { font-size: .7rem; margin-bottom: 8px; }
.hd-dense .invalid-feedback { font-size: .64rem; }

/* ============ 9. Settings: flat hairline groups (uca- pattern) ========= */
.hd-dense .hd-settings-section-nav { gap: 4px; margin-bottom: 6px; }
.hd-dense .hd-settings-section-nav a { padding: 2px 9px; font-size: .72rem; }
.hd-dense .hd-settings-section-nav a span { width: 15px; height: 15px; font-size: .6rem; }
.hd-dense .hd-settings-overview,
.hd-dense.hd-settings-dense .hd-card {
  border: 1px solid #e2e8f0;
  background: #fff;
}
.hd-dense.hd-settings-dense .hd-card-head {
  border-bottom: 1px solid #eef2f6;
  margin-bottom: 4px;
}
.hd-dense .hd-settings-integration-grid { gap: 5px; }
.hd-dense .hd-settings-integration-grid article { padding: 4px 8px; font-size: .7rem; gap: 3px; }
.hd-dense .hd-settings-integration-grid article strong { font-size: .72rem; }
.hd-dense .hd-settings-integration-grid article span { font-size: .64rem; }
.hd-dense .hd-integration-db-health { font-size: .62rem; }
.hd-dense .hd-integration-provenance { font-size: .6rem; }
.hd-dense .hd-integration-action { font-size: .66rem; }
.hd-dense .hd-required-summary-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.hd-dense .hd-required-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 1px 9px;
  border: 1px solid #cfd9e4;
  border-radius: 999px;
  background: #fff;
  font-size: .7rem;
}
.hd-dense .hd-required-summary-item strong { font-size: .7rem; font-weight: 600; }
.hd-dense .hd-required-summary-item span { font-weight: 800; color: #075fcf; }
.hd-dense .hd-required-summary-item small code { font-size: .58rem; }
.hd-dense .hd-readiness-item { padding: 4px 8px; border: 1px solid #eef2f6; border-radius: 6px; }
.hd-dense .hd-readiness-item .fw-bold { font-size: .72rem; }
.hd-dense .hd-readiness-item .small { font-size: .64rem; }
.hd-dense .hd-advanced-panel summary { font-size: .74rem; padding: 2px 6px; }
.hd-dense .hd-timeline .hd-event { padding: 3px 0; font-size: .72rem; }
.hd-dense .hd-timeline .fw-semibold { font-size: .72rem; }

/* import page extras */
.hd-dense .hd-import-breakdown { gap: 5px; }
.hd-dense .hd-import-breakdown-box { padding: 4px 8px; font-size: .7rem; }
.hd-dense .hd-kv-row { font-size: .68rem; }
.hd-dense .hd-preview-tools { gap: 5px; }
.hd-dense .hd-preview-tools .btn { padding: 1px 8px; font-size: .7rem; }

/* measured refinements (QA 8210, 1440px): headbar to one line, filter to one
   row, audit cells to two lines max */
.hd-dense .hd-i16-page-actions { gap: 3px; }
.hd-dense .hd-i16-page-actions .btn {
  padding: 1px 6px;
  font-size: .7rem;
  min-height: 24px;
}
.hd-dense .hd-i16-updated { font-size: .64rem; white-space: nowrap; }
.hd-dense .hd-i16-filter-grid { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.hd-dense .hd-i16-field-search { grid-column: span 2; }
.hd-dense .hd-summary-live:empty { display: none; }
.hd-dense .hd-control-cluster {
  gap: 4px;
  padding: 1px 6px;
  font-size: .64rem;
  flex-wrap: nowrap;
}
.hd-dense .hd-control-cluster .hd-control-title { font-size: .64rem; }
.hd-dense .hd-lang-switch,
.hd-dense .hd-zoom-control { gap: 2px; font-size: .64rem; }
.hd-dense .hd-lang-switch button,
.hd-dense .hd-zoom-control button {
  padding: 0 5px;
  min-height: 20px;
  font-size: .62rem;
}
.hd-dense .hd-zoom-control input[type="number"] {
  min-height: 20px;
  padding: 0 2px;
  font-size: .62rem;
  width: 40px;
}
.hd-dense .hd-summary-panel > * + * { margin-top: 3px; }
.hd-dense .hd-latest-audit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: .64rem;
  line-height: 1.25;
}
.hd-dense .hd-latest-audit-meta { display: inline-flex; align-items: center; gap: 3px; }
.hd-dense .hd-latest-audit-action { display: inline; }
.hd-dense .hd-latest-audit-comment {
  flex: 1 1 100%;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hd-dense .hd-i16-grid td small { display: inline; margin-left: 4px; }
.hd-dense .hd-i16-grid td strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.hd-dense .hd-v14-table td small { display: inline; margin-left: 4px; }
.hd-dense .hd-v14-table td.is-issue,
.hd-dense .hd-v14-table td.is-product { max-width: 260px; }
.hd-dense .hd-v14-filter-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hd-dense .hd-v14-filter-primary { gap: 5px; }

/* keep the grid owning the viewport: trim outer paddings */
.hd-dense.hd-main,
.hd-main.hd-dense { padding-top: 8px; }
@media (min-width: 992px) {
  .hd-dense .hd-i16-grid-scroll,
  .hd-dense .hd-report-table-wrap,
  .hd-dense .hd-v14-table-wrap { max-height: min(72vh, 860px); }
}

/* Master-data pickers: say whether the typed name actually linked.
   helpdesk_master_search.js has always set these two attributes and nothing
   has ever styled them, so an operator gets no signal either way. A name that
   does not resolve saves as free text with a NULL foreign key — which is how
   branch_id ended up NULL on 151 of 156 tickets. */
/* inset box-shadow, not border: base.html carries an inline
   `main .form-control { border: 1px solid ... !important }` of equal
   specificity and later document order, so a border here loses its colour
   even with !important. Nothing else in the stack sets box-shadow on these
   inputs, so the marker cannot be overridden by accident. */
input[data-helpdesk-master-kind][data-helpdesk-master-selected] {
  box-shadow: inset 3px 0 0 0 var(--bs-success, #198754);
}
input[data-helpdesk-master-kind][data-helpdesk-master-error] {
  box-shadow: inset 3px 0 0 0 var(--bs-warning, #ffc107);
  background: #fff8e1;
}

/* ---- /helpdesk: ตาราง Excel ใบเดียวแทนรายการการ์ด 4 ชุดคู่ขนาน ---- */
.hd-v12-stage-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 10px;
}

.hd-v12-hub-grid-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.hd-v12-hub-count {
  color: #415269;
  font-size: .82rem;
  font-weight: 700;
  margin-right: auto;
}

.hd-v12-hub-grid-scroll {
  border: 1px solid #d7dfe8;
  border-radius: 10px;
  max-width: 100%;
  overflow: auto;
}

.hd-hub-stream {
  align-items: center;
  display: inline-flex;
  font-weight: 700;
  gap: 4px;
  white-space: nowrap;
}

.hd-hub-stream.is-internal { color: #1461a8; }
.hd-hub-stream.is-customer { color: #a94f00; }

.hd-hub-urgency { font-weight: 800; }
.hd-hub-urgency.is-danger { color: #d92d2d; }
.hd-hub-urgency.is-warning { color: #b65500; }
.hd-hub-urgency.is-success { color: #147a48; }
.hd-hub-urgency.is-info { color: #1461a8; }
.hd-hub-urgency.is-primary,
.hd-hub-urgency.is-neutral { color: #6a7b90; }
