/* HeistBench visual refinement layer — additive and aligned with the existing design tokens. */
:root {
  --hb-surface-soft: #11151a;
  --hb-surface-hover: #191e25;
  --hb-line-strong: #303844;
  --hb-focus: rgba(233, 162, 59, .78);
}

html { scroll-padding-top: 5.5rem; }
body { font-size: 14px; line-height: 1.55; }

/* A consistent depth and radius system without turning every element into a card. */
.panel {
  border-color: color-mix(in srgb, var(--color-line-soft) 78%, #46505e 22%);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}
.panel-raised {
  border-color: var(--hb-line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #171b22 0%, #14181e 100%);
}
.panel-title, .micro, .field-label {
  color: #a2aab6;
  letter-spacing: .11em;
}
.panel-title, .field-label { font-size: 10px; }

/* Inputs and buttons get consistent hit areas and visible keyboard focus. */
.input {
  min-height: 38px;
  padding: .5rem .625rem;
  border-color: #303741;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.input:hover { border-color: #424b58; }
.input:focus-visible {
  border-color: var(--color-brass);
  box-shadow: 0 0 0 3px rgba(233, 162, 59, .12);
}
.btn {
  min-height: 36px;
  border-radius: 8px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 2px 10px rgba(233, 162, 59, .12); }
.btn-sm { min-height: 32px; }
.chip {
  border-color: #343b46;
  background: #12161c;
  color: #bac1cb;
  letter-spacing: .025em;
}
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--hb-focus);
  outline-offset: 2px;
}

/* Dense data should be scannable at normal desktop zoom. */
table { font-variant-numeric: tabular-nums; }
thead th {
  padding-block: .68rem !important;
  padding-inline: .8rem !important;
  color: #a7b0bc;
  background: #151a20;
  border-bottom: 1px solid #343b45;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .065em;
}
tbody td {
  padding-block: .62rem !important;
  padding-inline: .8rem !important;
  border-bottom-color: rgba(75, 86, 101, .30);
  font-size: 12px;
  line-height: 1.45;
  vertical-align: middle;
}
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .012); }
tbody tr:hover { background: rgba(233, 162, 59, .045); }
th.text-right, td.text-right { text-align: right; }
.mono, .tabular-nums, table td.text-right {
  font-variant-numeric: tabular-nums lining-nums;
}
.scroll-thin {
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.scroll-thin::-webkit-scrollbar-thumb { background: #3a424e; }

/* Only the growing sale ledger gets its own vertical scroll region and sticky header. */
.hb-table-viewport {
  max-height: min(70vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-radius: 9px;
}
.hb-table-viewport thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #151a20;
}

/* Vehicle quick views. */
.hb-quick-filters {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(87, 99, 115, .22);
}
.hb-quick-filters__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hb-quick-filters__eyebrow {
  color: #a0a9b5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
}
.hb-quick-filters__status {
  color: #a7b1bf;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}
.hb-quick-filters__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.hb-quick-filters__actions .btn { min-height: 36px; }
.hb-quick-filters__actions button[aria-pressed="true"] {
  color: #f5c877;
  border-color: rgba(233, 162, 59, .48);
  background: rgba(233, 162, 59, .10);
}
.hb-quick-filters__actions button:disabled { opacity: .42; cursor: not-allowed; }

/* Keyboard-first navigation palette. */
.hb-command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: min(16vh, 120px) 18px 24px;
  background: rgba(3, 5, 8, .76);
  backdrop-filter: blur(8px);
}
.hb-command-backdrop[hidden] { display: none !important; }
.hb-command {
  width: min(100%, 590px);
  overflow: hidden;
  border: 1px solid #3a424e;
  border-radius: 14px;
  background: #11151b;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .55);
}
.hb-command__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #2b323d;
  color: #aeb7c3;
  font-size: 20px;
}
.hb-command__search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f1f3f6;
  font-size: 14px;
}
.hb-command__search input::placeholder { color: #7f8997; }
.hb-command kbd {
  padding: 3px 6px;
  border: 1px solid #343d49;
  border-radius: 5px;
  color: #9ca6b3;
  font-size: 10px;
}
.hb-command__meta {
  padding: 12px 16px 6px;
  color: #828d9b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
}
.hb-command__results {
  max-height: min(55vh, 420px);
  overflow: auto;
  padding: 5px 8px 10px;
}
.hb-command__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #e9edf2;
  text-decoration: none;
}
.hb-command__item:hover,
.hb-command__item.is-active {
  border-color: rgba(233, 162, 59, .24);
  background: rgba(233, 162, 59, .09);
}
.hb-command__item-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  background: #202630;
  color: #e9b35f;
}
.hb-command__item > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.hb-command__item strong { font-size: 12px; font-weight: 600; }
.hb-command__item small { color: #a0aab8; font-size: 10px; }
.hb-command__empty { padding: 18px 12px; color: #b0bac7; font-size: 12px; }
.hb-command__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #2b323d;
  color: #9aa5b3;
  font-size: 10px;
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .panel { border-radius: 12px; }
  .hb-quick-filters__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-quick-filters__actions .btn { justify-content: center; white-space: normal; }
  .hb-table-viewport { max-height: none; overflow: visible; }
  table.hb-mobile-stack {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
  }
  table.hb-mobile-stack thead { display: none; }
  table.hb-mobile-stack tbody { display: grid; gap: 9px; padding: 8px; }
  table.hb-mobile-stack tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 12px;
    padding: 7px 10px;
    border: 1px solid #2a323d;
    border-radius: 10px;
    background: #11161c;
  }
  table.hb-mobile-stack tbody tr:hover { background: #151b22; }
  table.hb-mobile-stack tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 7px 1px !important;
    border: 0;
    text-align: right;
    font-size: 11px;
  }
  table.hb-mobile-stack tbody td::before {
    content: attr(data-label);
    flex: 0 1 auto;
    color: #9aa5b3;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .045em;
    text-align: left;
  }
  table.hb-mobile-stack tbody td:nth-child(2) {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 9px !important;
    border-bottom: 1px solid #29313b;
    text-align: left;
    font-size: 12px;
  }
  table.hb-mobile-stack tbody td:last-child { justify-content: flex-end; }
  .hb-command-backdrop { padding: 8vh 10px 16px; }
  .hb-command__footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
