/* =============================================================================
   QuickBooks Replace — forms.css
   Transaction forms: the ribbon, the header band, the form "paper", the
   line-item grid, the footer totals, and the right-hand history panel.
   ========================================================================== */

.qb-form { display: flex; flex-direction: column; height: 100%; background: var(--qb-app-bg); }
.qb-form-main { flex: 1 1 auto; display: flex; min-height: 0; }
.qb-form-scroll { flex: 1 1 auto; overflow: auto; min-width: 0; display: flex; flex-direction: column; }

/* -------------------------------------------------------------------------
   1.  Ribbon
   ---------------------------------------------------------------------- */
.qb-ribbon { flex: 0 0 auto; border-bottom: 1px solid var(--qb-ribbon-rule); }
.qb-ribbon-tabs {
  height: 24px;
  background: linear-gradient(to bottom, var(--qb-ribbon-tab-top), var(--qb-ribbon-tab-bot));
  display: flex; align-items: stretch; padding-left: 6px;
}
.qb-ribbon-tabs .qb-rt {
  padding: 0 15px; display: flex; align-items: center; font-size: 12px;
  border: 1px solid transparent; border-bottom: none;
}
.qb-ribbon-tabs .qb-rt.active {
  background: var(--qb-ribbon-top);
  border-color: #BFBFBF;
  position: relative; z-index: 2;
  box-shadow: 0 1px 0 var(--qb-ribbon-top);
}
.qb-ribbon-tabs .qb-rt:hover:not(.active) { background: rgba(255,255,255,.5); }
.qb-ribbon-tabs .qb-rt-spacer { flex: 1 1 auto; }
.qb-ribbon-tabs .qb-rt-collapse {
  width: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #4A4A4A;
}

.qb-ribbon-body {
  background: linear-gradient(to bottom, var(--qb-ribbon-top), var(--qb-ribbon-bot));
  min-height: 68px;
  display: flex; align-items: stretch; padding: 3px 4px 0; gap: 0;
  overflow-x: auto; overflow-y: hidden;
}
.qb-ribbon.collapsed .qb-ribbon-body { display: none; }

.qb-rgroup { display: flex; flex-direction: column; padding: 0 5px; flex: 0 0 auto; }
.qb-rgroup + .qb-rgroup { border-left: 1px solid #D6D6D6; }
.qb-rgroup .qb-rg-items { display: flex; align-items: flex-start; gap: 1px; flex: 1 1 auto; }
.qb-rgroup .qb-rg-caption {
  text-align: center; font-size: 10px; color: #7A7A7A; padding: 1px 0 2px;
}
.qb-rbtn {
  min-width: 46px; max-width: 74px; padding: 3px 5px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid transparent; border-radius: 2px; text-align: center;
}
.qb-rbtn .qb-rb-art { height: 24px; display: flex; align-items: center; justify-content: center; }
.qb-rbtn .qb-rb-label { font-size: 10.5px; line-height: 11.5px; color: #2A2A2A; }
.qb-rbtn .qb-rb-caret { font-size: 7px; color: #666; margin-top: -2px; }
.qb-rbtn:hover { background: linear-gradient(to bottom, #FDFEFF, #DCE9F8); border-color: #A8C6E8; }
.qb-rbtn:active { background: #CFE0F3; }
.qb-rbtn.disabled { opacity: .45; }
.qb-rbtn.disabled:hover { background: transparent; border-color: transparent; }
.qb-rbtn.stacked {
  flex-direction: row; align-items: center; min-width: 0; max-width: none;
  gap: 5px; padding: 2px 6px; height: 20px;
}
.qb-rbtn.stacked .qb-rb-art { height: 16px; }
.qb-rgroup .qb-rg-stack { display: flex; flex-direction: column; gap: 1px; justify-content: center; }
.qb-rgroup .qb-rg-check { display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 6px; }

/* -------------------------------------------------------------------------
   2.  Form header band (the slate strip carrying CUSTOMER:JOB / CLASS / TEMPLATE)
   ---------------------------------------------------------------------- */
.qb-form-band {
  flex: 0 0 auto; min-height: var(--qb-band-h);
  background: var(--qb-form-band);
  display: flex; align-items: center; gap: 18px;
  padding: 4px 14px; color: #fff;
}
.qb-form-band .qb-fb-field { display: flex; flex-direction: column; gap: 1px; }
.qb-form-band .qb-fb-field > label {
  font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; color: #E6EDF5;
}
.qb-form-band .qb-fieldwrap { width: 190px; }
.qb-form-band .qb-field { height: 21px; background: #fff; border-color: #46617F; font-size: 11.5px; }
.qb-form-band .qb-fieldwrap .qb-drop { height: 19px; }
.qb-form-band .qb-fb-spacer { flex: 1 1 auto; }
.qb-form-band .qb-fb-readout { text-align: right; }
.qb-form-band .qb-fb-readout .qb-fb-val { font-size: 15px; font-weight: 600; font-family: var(--qb-font-num); }

/* -------------------------------------------------------------------------
   3.  The form "paper"
   ---------------------------------------------------------------------- */
.qb-paper {
  background: #fff; margin: 0; padding: 14px 16px 0;
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
}
.qb-paper-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 8px; }
.qb-paper-title {
  font-size: 30px; font-weight: 300; color: #4A4A4A; line-height: 1;
  letter-spacing: -.5px; flex: 0 0 auto; padding-top: 2px;
}
.qb-paper-title .qb-pt-sub { font-size: 11px; color: #8A8A8A; display: block; margin-top: 4px; letter-spacing: 0; }
.qb-paper-spacer { flex: 1 1 auto; }
.qb-paper-topright { display: flex; gap: 14px; align-items: flex-start; }
.qb-paper-topright .qb-fieldwrap { width: 108px; }

.qb-addr-row { display: flex; gap: 26px; margin-bottom: 10px; }
.qb-addr-block { flex: 0 0 auto; width: 240px; }
.qb-addr-block textarea.qb-field { height: 62px; }

.qb-subrow {
  display: flex; gap: 0; border-top: 1px solid #D8D8D8; border-bottom: 1px solid #D8D8D8;
  margin-bottom: 10px; background: #FBFBFB;
}
.qb-subrow .qb-sr-cell { flex: 1 1 0; padding: 4px 6px; border-right: 1px solid #E8E8E8; min-width: 0; }
.qb-subrow .qb-sr-cell:last-child { border-right: none; }
.qb-subrow .qb-field { height: 21px; font-size: 11.5px; }
.qb-subrow .qb-fieldwrap .qb-drop { height: 19px; }

/* ---- the line-item grid ------------------------------------------------- */
.qb-lines { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; }
.qb-lines .qb-gridwrap { border: 1px solid var(--qb-grid-border); }

/* ---- footer ------------------------------------------------------------- */
.qb-paper-foot {
  flex: 0 0 auto; display: flex; gap: 22px; padding: 10px 0 12px; align-items: flex-start;
}
.qb-foot-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-foot-left .qb-fieldwrap { max-width: 320px; }
.qb-foot-right { flex: 0 0 auto; width: 300px; }
.qb-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; }
.qb-totals .qb-tl-label {
  text-align: right; font-size: var(--qb-fs-caps); text-transform: uppercase;
  letter-spacing: .35px; color: var(--qb-label);
}
.qb-totals .qb-tl-value { text-align: right; font-family: var(--qb-font-num); font-size: 12px; min-width: 92px; }
.qb-totals .qb-tl-row.grand .qb-tl-label { font-weight: 700; color: #333; }
.qb-totals .qb-tl-row.grand .qb-tl-value { font-weight: 700; font-size: 14px; }
.qb-totals .qb-tl-taxrow { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.qb-totals .qb-tl-taxrow .qb-fieldwrap { width: 120px; }
.qb-totals .qb-tl-taxrow .qb-field { height: 21px; font-size: 11.5px; }

.qb-form-actions {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: #F4F4F4; border-top: 1px solid #D2D2D2;
}
.qb-form-actions .qb-spacer { flex: 1 1 auto; }
.qb-form-actions .qb-checks { display: flex; gap: 16px; }

/* -------------------------------------------------------------------------
   4.  Write Checks — the paper-check facsimile
   ---------------------------------------------------------------------- */
.qb-check-face {
  background: var(--qb-check-paper);
  border: 1px solid #B9CDB4;
  border-radius: 2px;
  padding: 12px 16px 14px;
  margin-bottom: 12px;
  position: relative;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(160,200,155,.10) 0 2px, transparent 2px 6px);
}
.qb-check-face .qb-cf-top { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.qb-check-face .qb-cf-payer { flex: 1 1 auto; font-size: 11px; color: #3F5A3A; line-height: 14px; }
.qb-check-face .qb-cf-payer b { font-size: 12.5px; color: #23401F; display: block; }
.qb-check-face .qb-cf-numbers { display: flex; gap: 12px; }
.qb-check-face .qb-cf-numbers .qb-fieldwrap { width: 104px; }
.qb-check-face .qb-cf-numbers .qb-field { background: rgba(255,255,255,.85); border-color: #A9C3A4; }
.qb-check-face .qb-cf-payline { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.qb-check-face .qb-cf-payline .qb-cf-pto { flex: 1 1 auto; }
.qb-check-face .qb-cf-payline .qb-cf-pto .qb-field { background: rgba(255,255,255,.9); border-color: #A9C3A4; }
.qb-check-face .qb-cf-payline .qb-cf-amt { width: 150px; display: flex; align-items: center; gap: 5px; }
.qb-check-face .qb-cf-payline .qb-cf-amt .dollar { font-size: 15px; color: #2F4A2B; }
.qb-check-face .qb-cf-words {
  display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid #8FAE8A; padding-bottom: 2px; margin-bottom: 12px;
  font-size: 12.5px; color: #23401F; min-height: 19px;
}
.qb-check-face .qb-cf-words .qb-cf-wtext { flex: 1 1 auto; font-style: italic; }
.qb-check-face .qb-cf-words .qb-cf-dollars { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; }
.qb-check-face .qb-cf-bottom { display: flex; gap: 20px; align-items: flex-start; }
.qb-check-face .qb-cf-addr { width: 260px; }
.qb-check-face .qb-cf-addr textarea.qb-field { height: 56px; background: rgba(255,255,255,.85); border-color: #A9C3A4; }
.qb-check-face .qb-cf-memo { flex: 1 1 auto; }
.qb-check-face .qb-cf-memo .qb-field { background: rgba(255,255,255,.85); border-color: #A9C3A4; }
.qb-check-face .qb-cf-micr {
  margin-top: 10px; font-family: "Courier New", monospace; font-size: 13px;
  color: #4A6A45; letter-spacing: 2px;
}

/* -------------------------------------------------------------------------
   5.  Right-hand history / context panel
   ---------------------------------------------------------------------- */
.qb-histpanel {
  width: 268px; flex: 0 0 auto; background: #F7F9FB;
  border-left: 1px solid #C8D2DA; display: flex; flex-direction: column;
  overflow: auto;
}
.qb-histpanel.hidden { display: none; }
.qb-histpanel .qb-hp-hdr {
  background: #B5BEC6; color: #1F3244; padding: 6px 10px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
  border-bottom: 1px solid #A3ADB6;
}
.qb-histpanel .qb-hp-sect { padding: 8px 10px; border-bottom: 1px solid #E2E8ED; }
.qb-histpanel .qb-hp-sect > h4 {
  margin: 0 0 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #5F7183;
}
.qb-histpanel .qb-hp-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 2px 0; }
.qb-histpanel .qb-hp-kv .v { font-family: var(--qb-font-num); }
.qb-histpanel .qb-hp-txn { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 3px 0; }
.qb-histpanel .qb-hp-txn:hover { background: #E8F0F8; }
.qb-histpanel .qb-hp-txn .d { color: #63757F; }
.qb-histpanel .qb-hp-txn .a { font-family: var(--qb-font-num); }
.qb-histpanel .qb-hp-notes { font-size: 11.5px; color: #3C4C58; line-height: 15px; }
.qb-histsplit {
  width: 13px; flex: 0 0 auto; background: #E9EEF2; border-left: 1px solid #D2DAE1;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #55707F; writing-mode: vertical-rl;
}
.qb-histsplit:hover { background: #DCE6EE; }

/* -------------------------------------------------------------------------
   6.  Timeline (invoice history tracker)
   ---------------------------------------------------------------------- */
.qb-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #CBD6DF; }
.qb-timeline li { position: relative; padding: 0 0 10px 12px; font-size: 11.5px; color: #3C4C58; }
.qb-timeline li::before {
  content: ''; position: absolute; left: -20px; top: 3px;
  width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #8FA7B8;
}
.qb-timeline li.done::before { background: var(--qb-select); border-color: var(--qb-select); }
.qb-timeline li .when { display: block; color: #6C7E8B; font-size: 10.5px; }
