/* Version B — single-column Issue Invoice layout, Figma node 6641-61374.
   Loaded alongside css/app.css; everything here is scoped to .builder-b or to
   the B-only modal modifiers, so version A is untouched. Cards, deduction rows
   and the item form keep their app.css styles — only the page around them
   changes. */

/* ================================================================ A/B switch */

/* Demo scaffolding, not part of either version under test: the design system
   ships no segmented control. */
.abswitch {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px; margin-right: 8px;
}
.abswitch__b {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 5px 12px; border-radius: 999px; line-height: 1.2;
}
.abswitch__b:hover { color: var(--ink); }
.abswitch__b:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.abswitch__b.is-on {
  background: var(--white); color: var(--brand);
  box-shadow: var(--shadow-1);
}

/* ================================================================== B shell */

.modal__body--b { overflow: auto; }
.modal__main--b {
  flex: 1; overflow: visible; background: var(--white);
  padding: 32px 24px 48px;
}

.builder-b { max-width: 880px; }
.builder__h1--b { margin: 0 0 22px; font-size: 26px; font-weight: 800; }
.builder__rule--tight { margin: 20px 0; }
.builder__actions--b { margin: 20px 0 4px; }

.bsec { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.bsec--items { margin: 24px 0 12px; }

/* --------------------------------------------------------- invoice details */

.binfo__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 24px; }
.binfo__k { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.binfo__v { font-size: 16px; }

/* ---------------------------------------------------------------- groups */

.builder-b .bgroup + .bgroup { margin-top: 28px; }
.builder-b .group__head { margin-bottom: 10px; }

.bgroup__foot {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-top: 12px;
}
.bgroup__acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ---------------------------------------------------------- figure tables */

/* Two-column bordered table — group sub-totals and the invoice totals share it.
   The design system's data-table cells are row-oriented (header row + content
   rows); this is a label/value pair per row, so the cell padding and 48px row
   height are matched by hand. See DESIGN-SYSTEM-AUDIT.md § E. */
.btbl {
  width: 408px; flex: none; align-self: flex-start;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); overflow: hidden;
}
.btbl__row { display: grid; grid-template-columns: 1fr 130px; min-height: 48px; }
.btbl__row + .btbl__row { border-top: 1px solid var(--line); }
.btbl__k, .btbl__v {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 12px 16px; font-size: 16px; text-align: right;
}
.btbl__k { color: var(--ink); border-right: 1px solid var(--line); }
.btbl__v { font-variant-numeric: tabular-nums; }
.btbl__row--ded .btbl__v { color: var(--green); }
.btbl__row--grand .btbl__k,
.btbl__row--grand .btbl__v { color: var(--brand); font-weight: 700; }

/* ---------------------------------------------------------- remarks + totals */

.bbottom {
  display: grid; grid-template-columns: 1fr 408px; gap: 32px;
  align-items: start; margin-top: 20px;
}
.bbottom .btbl { width: 100%; }
.bremarks .remarks { min-height: 110px; }

/* --------------------------------------------------------------- narrow */

@media (max-width: 960px) {
  .modal__main--b { padding: 24px 20px 40px; }
  .binfo__grid { grid-template-columns: 1fr 1fr; }
  .bgroup__foot { flex-direction: column; }
  .bgroup__foot .btbl { width: 100%; }
  .bbottom { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .abswitch__b { padding: 5px 9px; font-size: 12px; }
  .binfo__grid { grid-template-columns: 1fr; }
}
