/* Till history windows reuse the native dialog and POS theme. */
#botTabs button.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; font: inherit; }
#historyDlg { width: min(1180px, calc(100vw - 32px)); height: min(760px, calc(100dvh - 40px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); color: var(--txt); background: var(--win-panel); }
#historyDlg[open] { display: flex; flex-direction: column; overflow: hidden; }
#historyDlg .history-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--win-border); flex: none; }
#historyDlg h2 { margin: 0 0 5px; font-size: 22px; }
#historySubtitle, #historySummary, #historyCount { color: var(--dim); font-size: 13px; }
#historyDlg .win-btn { min-height: 42px; }
#historyDlg .history-close { white-space: nowrap; }
#historyToolbar { flex: none; padding: 12px 22px; border-bottom: 1px solid var(--win-border); background: var(--grid-head); }
#historySearch { width: 100%; font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid var(--btn-border); border-radius: 8px; }
#historySummary { margin-top: 8px; }
#historyRecords { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#historyRecords .history-section { padding: 12px 22px; font-weight: 700; background: var(--grid-head); }
#historyRecords .history-message { padding: 20px 22px; color: var(--dim); }
#historyRecords table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; }
#historyRecords th { position: sticky; top: 0; z-index: 1; background: var(--grid-head); color: var(--dim); text-align: left; font-size: 12px; }
#historyRecords th, #historyRecords td { padding: 11px 12px; border-bottom: 1px solid var(--grid-line); vertical-align: top; overflow-wrap: anywhere; }
#historyRecords th:first-child, #historyRecords td:first-child { padding-left: 22px; }
#historyRecords th:last-child, #historyRecords td:last-child { padding-right: 22px; }
#historyRecords tbody tr:nth-child(even) { background: var(--win-soft); }
#historyRecords .history-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#historyRecords small { display: block; color: var(--dim); margin-top: 3px; font-size: 12px; }
#historyRecords .history-date { white-space: nowrap; }
#historyRecords .history-earned { color: var(--green-d); }
#historyRecords .history-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#historyRecords .history-actions button { padding: 7px 9px; font-size: 12px; }
#historyRecords .history-void { color: var(--red); border-color: var(--red); }
#historyRecords .history-voided { color: var(--dim); }
#historyRecords .history-voided .history-number { text-decoration: line-through; }
#historyDlg .history-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--win-border); flex: none; }
#historyDlg .history-foot-actions { display: flex; gap: 10px; flex: none; }
#historyDlg .history-foot .history-close { min-width: 110px; }
#historyDlg [hidden] { display: none !important; }
@media (max-width: 600px) {
  #historyDlg { width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); }
  #historyDlg .history-head, #historyToolbar, #historyDlg .history-foot { padding: 12px; }
  #historyDlg .history-foot { flex-wrap: wrap; }
}
