/* Aurum Finance shell — adapted from aurum-pursuit-dashboard (tokens + topbar chrome). */

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    var(--atmosphere-radial),
    var(--atmosphere-vignette),
    var(--atmosphere-base);
  background-color: var(--color-bg, #020304);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-veil-32);
  transition: var(--transition-hover);
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection {
  background: var(--gold-veil-32);
  color: inherit;
}

/* ── Shell ───────────────────────────────────────────────────── */
.ap-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.ap-shell-body {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-nav-gap) var(--page-gutter) var(--page-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--page-section-gap);
}

/* ── Topbar — two rows so primary nav never overlaps brand/search ─ */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 0 8px;
  background: rgba(2, 3, 4, 0.96);
  border-bottom: 1px solid var(--gold-veil-12);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 32px 10px;
  min-width: 0;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}
.topbar-logo {
  border-bottom: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-heading);
  min-width: 0;
}
.topbar-logo:hover {
  border-bottom: none;
  color: var(--text-heading);
}
.topbar-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
}
.topbar-wordmark {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-veil-88);
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0 24px 10px 32px;
  border-top: 1px solid var(--gold-veil-8, rgba(201, 162, 74, 0.08));
}
.topbar-nav::-webkit-scrollbar {
  height: 3px;
}
.topbar-nav::-webkit-scrollbar-thumb {
  background: var(--gold-veil-22);
}
.nav-links,
.nav-utils {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-links a,
.nav-utils a {
  border-bottom: none;
  position: relative;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-veil-55);
  padding: 8px 10px;
  border-radius: 0;
  background: transparent;
  transition: color var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  flex: 0 0 auto;
}
.nav-links a:hover,
.nav-utils a:hover {
  color: var(--gold-pale);
  box-shadow: none;
}
.nav-links a.is-active,
.nav-utils a.is-active {
  color: var(--text-heading);
  background: transparent;
}
.nav-links a.is-active::after,
.nav-utils a.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 1px;
  background: var(--gold-mid);
}
.topbar-signout {
  border: 0 !important;
  background: transparent !important;
  color: inherit;
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-divider {
  width: 1px;
  height: 14px;
  background: var(--gold-veil-16);
  flex: 0 0 auto;
  margin: 0 4px;
}
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-pale);
  background: rgba(14, 18, 20, 0.9);
  border: 1px solid var(--gold-veil-22);
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .topbar-row {
    padding: 12px 16px 8px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar-brand {
    flex: 1 1 auto;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .topbar-nav {
    padding: 0 12px 10px 16px;
  }
  .topbar-wordmark {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
  .ap-shell-body {
    padding: 20px 16px 48px;
  }
}

/* ── Page header ─────────────────────────────────────────────── */
.page-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-hero::after {
  content: "";
  display: block;
  height: var(--rule-thin);
  width: min(220px, 40%);
  background: var(--gradient-gold-rule);
  opacity: 0.9;
  margin-top: 2px;
}
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text-heading);
}
.page-sub {
  margin: 0;
  max-width: 44rem;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}
.tiny {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.muted {
  color: var(--text-muted);
}

.write-banner {
  background: var(--gold-veil-08);
  border: 1px solid var(--gold-veil-22);
  border-left: 3px solid var(--gold-mid);
  color: var(--status-caution-soft, #e8d49a);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* Feature underline tabs */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 0 4px;
}
.subnav a {
  border-bottom: none;
  position: relative;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 4px 12px;
  margin-bottom: -1px;
}
.subnav a:hover {
  color: var(--gold-pale);
  border-bottom: none;
}
.subnav a.active {
  color: var(--text-heading);
  border-bottom: 2px solid var(--color-gold);
}

/* ── Metric band / cards ─────────────────────────────────────── */
.grid {
  display: grid;
  gap: 0;
}
.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 0;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Contained panels (default .card) */
.card {
  background: var(--depth-2);
  border: 1px solid var(--border-hairline);
  border-left: 2px solid color-mix(in srgb, var(--sem-gold) 45%, transparent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
  padding: 18px 20px;
}
.card-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.card-value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 40px);
  color: var(--color-gold);
  letter-spacing: -0.015em;
  line-height: 1;
}
.card-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 0.45rem;
}

/* Metric-band cells inside .grid */
.grid > .card,
.grid > a.card {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-hairline);
  box-shadow: none;
  border-radius: 0;
  padding: 8px 20px;
}
.grid > .card:first-child,
.grid > a.card:first-child {
  border-left: 0;
  padding-left: 0;
}
a.card.card-link {
  color: inherit;
  display: block;
  border-bottom: none;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
a.card.card-link:hover {
  color: inherit;
  border-bottom: none;
  background: var(--gold-veil-06);
}

.remaining-diff {
  background: var(--surface-plate);
  border: 1px solid var(--border-hairline);
  border-left: 2px solid color-mix(in srgb, var(--sem-gold) 70%, transparent);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
}
.remaining-diff .card-value {
  color: var(--color-gold);
}

.recon-totals .card-hint {
  max-height: 3.2em;
  overflow: hidden;
}

/* ── Badges / pills ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--cream-veil-04);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
}
.badge-ok {
  background: rgba(95, 122, 90, 0.16);
  color: var(--status-positive-soft, #8fa88a);
  border-color: rgba(143, 168, 138, 0.28);
}
.badge-warn {
  background: rgba(184, 149, 78, 0.14);
  color: var(--status-caution-soft, #e8d49a);
  border-color: rgba(197, 160, 89, 0.28);
}
.badge-danger {
  background: rgba(154, 86, 76, 0.16);
  color: var(--status-negative-soft, #c4847a);
  border-color: rgba(196, 132, 122, 0.28);
}
.badge-info {
  background: rgba(107, 117, 124, 0.14);
  color: var(--status-neutral-soft, #9aa3a9);
  border-color: rgba(154, 163, 169, 0.22);
}
.badge-gold {
  background: var(--gold-veil-08);
  border-color: var(--gold-veil-22);
  color: var(--gold-pale);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
table.data th {
  position: sticky;
  top: 0;
  background: var(--onyx-750, #121618);
  text-align: left;
  padding: 0.7rem 0.85rem;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-hairline);
}
table.data.sortable-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.data.sortable-table th.sortable-th:hover {
  color: var(--text-heading, #f2f4f5);
}
table.data.sortable-table th.sortable-th::after {
  content: "⇅";
  display: inline-block;
  margin-left: 0.35rem;
  opacity: 0.35;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}
table.data.sortable-table th.sortable-th.is-sorted-asc::after {
  content: "↑";
  opacity: 0.9;
  color: var(--ap-gold, #c9a24a);
}
table.data.sortable-table th.sortable-th.is-sorted-desc::after {
  content: "↓";
  opacity: 0.9;
  color: var(--ap-gold, #c9a24a);
}
table.data.sortable-table th.sortable-th:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}
table.data td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}
table.data tr:hover td {
  background: var(--gold-veil-06);
}
table.data tr.is-active td {
  background: var(--gold-veil-16);
}
table.data tr.is-active td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}
table.data a {
  border-bottom: none;
  color: var(--text-heading);
}
table.data a:hover {
  color: var(--gold-pale);
  border-bottom: none;
}
.party-cell {
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.source-amt {
  color: var(--text-muted);
}
.billable-amt {
  color: var(--status-positive-soft, #8fa88a);
  font-weight: 600;
}
.amt {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

/* ── Buttons / forms ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--color-gold-border, var(--gold-veil-22));
  background: transparent;
  color: var(--text-body);
  text-decoration: none;
  transition: var(--transition-hover);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--gold-veil-32);
  color: var(--text-heading);
  background: var(--gold-veil-06);
}
.btn-primary {
  background: var(--color-gold, var(--gold-mid));
  color: var(--text-on-gold);
  border-color: transparent;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-on-gold);
  border-color: transparent;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-danger {
  border-color: rgba(154, 86, 76, 0.45);
  color: var(--status-negative-soft);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  align-items: center;
}
.filters .btn {
  padding: 8px 12px;
}
input,
select,
textarea {
  background: var(--surface-inset, rgba(2, 3, 4, 0.62));
  color: var(--text-heading);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drawer-layout {
  display: grid;
  grid-template-columns: 1.35fr minmax(18rem, 1fr);
  gap: 1rem;
  align-items: start;
}
.drawer-layout > .card {
  max-height: min(78vh, 52rem);
  overflow: auto;
}
.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.drawer-actions .btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}
@media (max-width: 1000px) {
  .drawer-layout {
    grid-template-columns: 1fr;
  }
}
.compare-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.92rem;
}
.compare-row .ok {
  color: var(--status-positive-soft, #8fa88a);
}
.compare-row .diff {
  color: var(--status-caution-soft, #e8d49a);
}
.compare-row .miss {
  color: var(--status-negative-soft, #c4847a);
}
.evidence {
  padding-left: 1.1rem;
  margin: 0.4rem 0;
}
.evidence li {
  margin: 0.25rem 0;
}
.empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-inset, transparent);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
form.inline {
  display: inline;
}

.bol-workspace {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.bol-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 26rem);
  gap: 1rem;
  align-items: start;
}
.bol-invoice-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(26rem, 34rem);
  gap: 1rem;
  align-items: start;
}
.bol-invoice-stage > * {
  min-width: 0;
}
.bol-invoice-form {
  max-height: min(78vh, 56rem);
  overflow: auto;
}
.bol-ship-addr {
  min-height: 4.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  white-space: pre-line;
  line-height: 1.45;
}
.bol-invoice-lines input,
.bol-invoice-lines select {
  width: 100%;
  min-width: 0;
}
.bol-blockers {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--danger, #c4847a);
}
.bol-pricing {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-hairline);
}
.bol-write-bar {
  position: sticky;
  bottom: 0;
  padding-top: 0.75rem;
  background: var(--surface, inherit);
}
.bol-queue {
  max-height: min(78vh, 56rem);
  overflow: auto;
  padding: 0.4rem;
}
.bol-queue-item {
  display: block;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border-hairline);
  color: inherit;
  border-radius: var(--radius-sm);
}
.bol-queue-item a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.bol-queue-item-bulk {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: start;
}
.bol-queue-check {
  padding-top: 0.15rem;
}
.bol-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-hairline);
}
.bol-queue-item:hover,
.bol-queue-item.is-selected {
  background: var(--surface-inset, rgba(255,255,255,0.04));
  border-bottom-color: transparent;
}
.bol-queue-item-top {
  margin-bottom: 0.3rem;
}
.bol-document {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.bol-email-context {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-hairline);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.bol-email-body {
  margin: 0.45rem 0 0;
  padding: 0.65rem 0.75rem;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.35;
  background: var(--surface-inset, rgba(255,255,255,0.03));
  border-radius: var(--radius-sm);
}
.bol-qbo-panel {
  margin-bottom: 1rem;
  border-color: rgba(45, 140, 140, 0.35);
}
.bol-qbo-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}
.bol-qbo-panel-body {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.85rem;
}
.bol-qbo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
}
.bol-qbo-send {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}
.bol-qbo-send .field {
  margin: 0;
  min-width: min(18rem, 100%);
}
.bol-pages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  min-width: 0;
  max-height: min(70vh, 48rem);
  overflow: auto;
  background: var(--surface-inset, #111);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
}
.bol-pages iframe,
.bol-page {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 4px;
  background: #fff;
}
.bol-pages iframe {
  min-height: 36rem;
}
.bol-snippets pre {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
  font-size: 0.8rem;
}
.bol-filters {
  margin-bottom: 0.75rem;
}
.bol-choices {
  border: 0;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
  display: grid;
  gap: 0.5rem;
}
.bol-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}
.bol-choice strong {
  display: block;
  margin-bottom: 0.2rem;
}
.bol-choice.is-selected,
.bol-choice:has(input:checked) {
  border-color: var(--ap-gold, #c9a24a);
  background: var(--surface-inset, rgba(201,162,74,0.08));
}
.bol-choice input {
  margin-top: 0.2rem;
}
.bol-outbound-fields {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-hairline);
}
.bol-checks {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
}
.bol-check {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.bol-check-ok { border-color: rgba(45,140,140,0.35); }
.bol-check-weak { border-color: rgba(201,162,74,0.4); }
.bol-check-missing { border-color: rgba(196,132,122,0.45); }
.bol-qbo-hint {
  margin: 0.75rem 0 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-inset, rgba(255,255,255,0.04));
}
.bol-qbo-hint p { margin: 0 0 0.4rem; }
.bol-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.bol-stat .card-value {
  font-size: 1.6rem;
}
.bol-chip {
  display: inline-block;
  margin: 0.1rem 0.2rem 0.1rem 0;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  font-size: 0.75rem;
}
.bol-compare {
  display: grid;
  gap: 0.75rem;
}
.bol-identity .compare-row {
  grid-template-columns: minmax(7rem, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
}
.bol-doc-fields {
  display: grid;
  gap: 0.45rem;
  margin: 0.85rem 0 0.5rem;
}
.bol-doc-fields > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.5rem;
}
.bol-doc-fields dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted, #8a8680);
}
.bol-doc-fields dd {
  margin: 0;
}
.bol-invoice-doc h4 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}
.bol-lines {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.4rem;
  font-size: 0.88rem;
}
.bol-lines th,
.bol-lines td {
  padding: 0.3rem 0.25rem;
  vertical-align: top;
  text-align: left;
}
.bol-lines input {
  width: 100%;
}
.ap-line-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}
.ap-add-line {
  min-width: 2.25rem;
  padding: 0.25rem 0.65rem;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 500;
}
.ap-line-total {
  margin-left: auto;
}
@media (max-width: 1100px) {
  .bol-workspace,
  .bol-stage {
    grid-template-columns: 1fr;
  }
}

h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-heading);
  letter-spacing: -0.005em;
}
h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.1rem 0 0.4rem;
}

/* Global search + notifications */
.topbar-search {
  display: flex;
  align-items: center;
}
.topbar-search input {
  width: min(180px, 22vw);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--surface-inset, rgba(0, 0, 0, 0.25));
  color: var(--text-body);
  font: inherit;
  font-size: 0.85rem;
}
.topbar-search input:focus {
  border-color: var(--border-focus);
  outline: none;
  width: min(240px, 36vw);
}
.nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-bottom: none !important;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.nav-bell:hover {
  color: var(--gold-soft, #c9a96e);
}
.nav-bell-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--teal-accent, #2a8f8a);
  color: #041210;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.notif-item {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-hairline);
  border-bottom-color: var(--border-hairline);
  text-decoration: none;
  color: inherit;
}
.notif-item.unread {
  border-left: 2px solid var(--teal-accent, #2a8f8a);
  padding-left: 0.75rem;
}
.search-hit {
  display: block;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-hairline);
}
@media (max-width: 960px) {
  .topbar-search {
    flex: 1 1 140px;
    min-width: 120px;
  }
  .topbar-search input {
    width: 100%;
  }
}
