/* Workspace chrome — last file, html+body specificity so older KPI/sidebar locks lose. */
html body[data-auth-state="authenticated"]{
  --books-ink:#172b46;
  --books-muted:#52647a;
  --books-line:#dbe3ed;
  --books-bg:#f3f6fa;
  --books-panel:#fff;
  --books-green:#087b80;
  --books-green-dark:#06666b;
  --books-hover:#edf5f7;
  --books-radius:10px;
  --books-font:"Avenir Next","Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif;
  --esb-kpi-height:76px;
  --esb-kpi-gap:8px;
  font-family:var(--books-font) !important;
  background:var(--books-bg) !important;
  color:var(--books-ink);
}
html[data-theme="dark"] body[data-auth-state="authenticated"]{
  --books-ink:#edf5ff;
  --books-muted:#9eb1c5;
  --books-line:#263d55;
  --books-bg:#07182b;
  --books-panel:#0d2238;
  --books-hover:#102a42;
  --books-green:#167f88;
  --books-green-dark:#3d9aa2;
}
html body[data-auth-state="authenticated"] #app,
html body[data-auth-state="authenticated"] button,
html body[data-auth-state="authenticated"] input:not([type=date]),
html body[data-auth-state="authenticated"] select,
html body[data-auth-state="authenticated"] textarea{
  font-family:var(--books-font) !important;
}
html body[data-auth-state="authenticated"] main,
html body[data-auth-state="authenticated"] #app.content,
html body[data-auth-state="authenticated"] .content{
  background:var(--books-bg) !important;
}
html body[data-auth-state="authenticated"] #app.content:not(:has(.presentation-studio)),
html body[data-auth-state="authenticated"] .content:not(:has(.presentation-studio)){
  padding:20px 24px 28px !important;
}

html body[data-auth-state="authenticated"] header.topbar{
  background:#fff !important;
  border-bottom:1px solid var(--books-line) !important;
}
html body[data-auth-state="authenticated"] #sb-module-back,
html body[data-auth-state="authenticated"] #sb-module-forward{
  display:inline-flex !important;
  align-items:center !important;
  flex:0 0 auto !important;
  width:32px !important;
  height:32px !important;
  margin:0 4px 0 0 !important;
  padding:0 !important;
  justify-content:center !important;
  border:1px solid var(--books-line) !important;
  border-radius:var(--books-radius) !important;
  background:var(--books-panel) !important;
  color:var(--books-ink) !important;
  font:inherit !important;
  font-size:13px !important;
  font-weight:700 !important;
  line-height:1 !important;
  cursor:pointer;
}
html body[data-auth-state="authenticated"] #sb-module-back[hidden],
html body[data-auth-state="authenticated"] #sb-module-forward[hidden]{
  display:none !important;
}
html body[data-auth-state="authenticated"] #sb-module-back:hover,
html body[data-auth-state="authenticated"] #sb-module-forward:hover{
  border-color:var(--books-green) !important;
  color:var(--books-green) !important;
}
/* Unified topbar alignment moved to responsive.css */
@media print{
  #sb-module-back,#sb-module-forward{display:none !important}
}
html body[data-auth-state="authenticated"] header.topbar #page-title{
  font-size:22px !important;
  font-weight:700 !important;
  letter-spacing:-.035em;
  color:var(--books-ink) !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] header.topbar{
  background:var(--books-panel) !important;
}

html body[data-auth-state="authenticated"] #app .sbpay > .page-actions,
html body[data-auth-state="authenticated"] #app .ex-toolbar.sb-inv-toolbar{
  display:flex !important;
  align-items:flex-end !important;
  justify-content:space-between !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 0 6px !important;
  padding:0 0 4px !important;
  background:transparent !important;
  border:0 !important;
  border-bottom:1px solid var(--books-line) !important;
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:visible !important;
}
html body[data-auth-state="authenticated"] #app .sb-inv-tools{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-end !important;
  gap:8px !important;
  flex:0 0 auto;
}
html body[data-auth-state="authenticated"] #app .sb-inv-style-field{
  min-width:140px !important;
  max-width:220px !important;
}
html body[data-auth-state="authenticated"] #app .sb-inv-style-field select{
  appearance:none !important;
  background-image:none !important;
  padding-right:28px !important;
}
/* Keep scrolling available without redundant native arrow buttons. */
html body[data-auth-state="authenticated"] ::-webkit-scrollbar-button{
  display:none;
  width:0;
  height:0;
}





html body[data-auth-state="authenticated"] #app .btn{
  min-height:36px;
  padding:8px 14px !important;
  border-radius:var(--books-radius) !important;
  font-size:13px !important;
  font-weight:600 !important;
  border:1px solid var(--books-line);
  background:#fff;
  color:var(--books-ink);
}
html body[data-auth-state="authenticated"] #app .btn.primary,
html body[data-auth-state="authenticated"] #app .sbpay-run,
html body[data-auth-state="authenticated"] aside.sidebar .create-btn{
  background:var(--books-green) !important;
  background-image:none !important;
  border:1px solid var(--books-green-dark) !important;
  border-radius:var(--books-radius) !important;
  color:#fff !important;
  box-shadow:none !important;
}
html body[data-auth-state="authenticated"] #app .panel,
html body[data-auth-state="authenticated"] #app .form-card,
html body[data-auth-state="authenticated"] #app .ex-register,
html body[data-auth-state="authenticated"] #app .table-wrap{
  background:var(--books-panel) !important;
  border:1px solid var(--books-line) !important;
  border-radius:var(--books-radius) !important;
  box-shadow:none !important;
}
html body[data-auth-state="authenticated"] #app .panel > .table-wrap,
html body[data-auth-state="authenticated"] #app .ex-register .table-wrap{
  border:0 !important;
}
html body[data-auth-state="authenticated"] #app .panel-head{
  padding:14px 16px !important;
  border-bottom:1px solid var(--books-line);
}
html body[data-auth-state="authenticated"] #app .panel-head h2{
  font-size:14px !important;
  font-weight:600 !important;
  line-height:1.25 !important;
  color:var(--books-ink) !important;
}
html body[data-auth-state="authenticated"] #app table th{
  background:#f2f6fa !important;
  color:#344b66 !important;
  font-size:11px !important;
  font-weight:700 !important;
  text-transform:uppercase;
  letter-spacing:.04em;
  padding:6px 10px !important;
  line-height:1.25 !important;
  border-bottom:1px solid var(--books-line) !important;
  text-align:left !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app table th{
  background:#102a42 !important;
  color:#edf5ff !important;
  border-bottom-color:var(--books-line) !important;
}
html body[data-auth-state="authenticated"] #app table td{
  font-size:13px !important;
  color:#111827;
  padding:6px 10px !important;
  line-height:1.25 !important;
  border-bottom:1px solid #e5e7eb !important;
  vertical-align:middle;
}
html body[data-auth-state="authenticated"] #app table th.num,
html body[data-auth-state="authenticated"] #app table td.num,
html body[data-auth-state="authenticated"] #app table th.amount,
html body[data-auth-state="authenticated"] #app table td.amount,
html body[data-auth-state="authenticated"] #app table .amount-display,
html body[data-auth-state="authenticated"] #app .metric strong,
html body[data-auth-state="authenticated"] #app .ex-summary strong{
  text-align:right !important;
  font-variant-numeric:tabular-nums !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app table td{
  border-bottom-color:var(--books-line) !important;
}
html body[data-auth-state="authenticated"] #app table tbody tr:hover td{
  background:var(--books-hover) !important;
}

/* KPI geometry and typography are owned by hero-system.css. */
html body[data-auth-state="authenticated"] #app .ex-toolbar:not(.sb-inv-toolbar){
  border:1px solid var(--books-line);
  border-radius:var(--books-radius);
  background:var(--books-panel) !important;
  padding:8px 10px !important;
  margin:0 0 8px;
}
html body[data-auth-state="authenticated"] #app .page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
  margin:0 0 8px !important;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
}


html body[data-auth-state="authenticated"] aside.sidebar{
  background:#0c2340 !important;
  background-image:linear-gradient(180deg,#0a1c33,#081628) !important;
  color:#fff !important;
  border-right:1px solid #061221 !important;
  box-shadow:none !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] aside.sidebar{
  background:#0c2340 !important;
  color:#fff !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .brand{
  background:#fff !important;
  border-bottom:1px solid #d5dee8 !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .esb-word{
  display:block !important;
  letter-spacing:-.02em !important;
  font-family:"Segoe UI",Inter,Arial,sans-serif !important;
  font-weight:650 !important;
  font-size:15px !important;
  color:#102033 !important;
  -webkit-text-fill-color:#102033 !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .brand > div{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  width:max-content !important;
  max-width:calc(100% - 48px) !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .esb-tag{
  display:block !important;
  width:100% !important;
  margin-top:2px !important;
  font-size:11px !important;
  font-weight:500 !important;
  letter-spacing:.01em !important;
  text-align:center !important;
  color:#5c6b7a !important;
}
html body[data-auth-state="authenticated"] .topbar .esb-top-logo{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  border-radius:50% !important;
  margin-right:8px !important;
}
html body .loading .brandmark{
  display:block;
  width:48px;
  height:48px;
  margin:0 auto 10px;
  border-radius:50%;
}
html body[data-auth-state="authenticated"] aside.sidebar .brandmark{
  width:36px !important;
  height:36px !important;
  min-width:36px !important;
  border-radius:50% !important;
  box-shadow:var(--esb-logo-shadow,none) !important;
  background:var(--esb-logo-background,transparent) !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .esb-word .esb-e{
  color:var(--brand-gold-shine,#FFD766) !important;
  -webkit-text-fill-color:var(--brand-gold-shine,#FFD766) !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] aside.sidebar .esb-word{
  color:#f4f7fb !important;
  -webkit-text-fill-color:#f4f7fb !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] aside.sidebar .esb-word .esb-e{
  color:var(--brand-gold-shine,#FFD766) !important;
  -webkit-text-fill-color:var(--brand-gold-shine,#FFD766) !important;
}
html body[data-auth-state="authenticated"] aside.sidebar #nav .nav-item,
html body[data-auth-state="authenticated"] aside.sidebar #nav .nav-item b{
  color:#f8fafc !important;
  opacity:1 !important;
}
html body[data-auth-state="authenticated"] aside.sidebar #nav .nav-item:hover,
html body[data-auth-state="authenticated"] aside.sidebar #nav .nav-item.active{
  background:rgba(255,255,255,.14) !important;
  color:#fff !important;
}
html body[data-auth-state="authenticated"] aside.sidebar .sidebar-foot,
html body[data-auth-state="authenticated"] aside.sidebar .sidebar-foot small{
  color:#d5dee8 !important;
}
html body[data-auth-state="authenticated"] #global-menubar{
  background:#fff !important;
  border-bottom:1px solid var(--books-line) !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #global-menubar{
  background:var(--books-panel) !important;
}

html body[data-auth-state="authenticated"] #app .emphub-form-tabs{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:0;
  border-bottom:1px solid var(--books-line);
  margin:0 0 6px;
  background:transparent;
}
html body[data-auth-state="authenticated"] #app .emphub-form-tabs button{
  height:34px !important;
  padding:0 12px !important;
  margin:0 0 -1px !important;
  border:0 !important;
  border-bottom:3px solid transparent !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--books-ink) !important;
  font-size:14px !important;
  font-weight:600 !important;
}
html body[data-auth-state="authenticated"] #app .emphub-form-tabs button.active{
  color:var(--books-green) !important;
  border-bottom-color:var(--books-green) !important;
}

html body[data-auth-state="authenticated"] #app .sbpay-hero,
html body[data-auth-state="authenticated"] #app .sbpay-card,
html body[data-auth-state="authenticated"] #app .sbpay-setup{
  background:var(--books-panel) !important;
  border:1px solid var(--books-line) !important;
  border-radius:var(--books-radius) !important;
}

html body[data-auth-state="authenticated"] #app.content:has(.presentation-studio){
  padding:0 !important;
}

html body #app .print-table,
html body #app .qr-table,
html body .sb-doc-paper .print-table{
  table-layout:auto !important;
  width:100% !important;
}
html body #app .print-table:not(.sb-inv-grid) th,
html body #app .print-table:not(.sb-inv-grid) td,
html body #app .qr-table th,
html body #app .qr-table td{
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  width:auto !important;
  vertical-align:middle !important;
}
html body .sb-layout .print-table th,
html body .sb-layout .print-table td{
  white-space:normal !important;
  overflow-wrap:break-word !important;
  word-break:normal !important;
  overflow:hidden !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
}
html body #app .print-table .sb-col-desc,
html body #app .qr-table .sb-col-desc,
html body .sb-layout .sb-col-desc{
  white-space:normal !important;
  word-break:keep-all !important;
}
html body #app .doc-print .print-table:not(.sb-inv-grid) thead th,
html body #app .qr-document .qr-table thead th,
html body #app .sb-doc-paper .print-table:not(.sb-inv-grid) thead th,
html body .doc-print .print-table:not(.sb-inv-grid) thead th,
html body .qr-document .qr-table thead th,
html body .sb-doc-paper .print-table:not(.sb-inv-grid) thead th{
  background:transparent !important;
  color:#1b2836 !important;
  -webkit-text-fill-color:#1b2836 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  word-break:keep-all !important;
  letter-spacing:.02em !important;
  border-bottom:1.5px solid #1b2836 !important;
}
html body .sb-layout table.sb-inv-grid thead th{
  background:transparent !important;
  color:#1b2836 !important;
  -webkit-text-fill-color:#1b2836 !important;
  font-weight:800 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
  overflow:hidden !important;
  letter-spacing:.02em !important;
  border-bottom:1.5px solid #1b2836 !important;
}
html body .sb-doc-paper{
  display:flex !important;
  flex-direction:column !important;
  min-height:277mm !important;
  box-sizing:border-box !important;
}
html body .sb-doc-paper[data-paper="LETTER"]{min-height:259mm !important}
html body .sb-doc-paper[data-orientation="landscape"]{min-height:190mm !important}
html body .sb-doc-paper[data-paper="LETTER"][data-orientation="landscape"]{min-height:196mm !important}
html body .sb-print-grow{flex:1 1 auto !important}
@media print{
  html body .sb-doc-paper,
  html body .sb-doc-paper[data-paper="LETTER"],
  html body .sb-doc-paper[data-orientation="landscape"],
  html body .sb-doc-paper[data-paper="LETTER"][data-orientation="landscape"]{
    min-height:0 !important;
    height:auto !important;
    overflow:visible !important;
  }
  html body .sb-print-grow{display:none !important;height:0 !important;flex:none !important}
}
html.sb-privacy-on .amount-display,
html.sb-privacy-on body .amount-display,
html.sb-privacy-on #app .metric strong,
html.sb-privacy-on #app .ex-summary strong,
html.sb-privacy-on #app td.amount,
html.sb-privacy-on #app .esb-dash-big,
html.sb-privacy-on #app .docform-summary-row b,
html.sb-privacy-on #app .docform-summary-row input,
html.sb-privacy-on #app .sb-adv-rate,
html.sb-privacy-on #app .doc-lines td.num,
html.sb-privacy-on #app .doc-lines td.num input,
html.sb-privacy-on #app .doc-lines [data-calc],
html.sb-privacy-on #app .doc-lines .col-rate,
html.sb-privacy-on #app .doc-lines .col-tax_rate,
html.sb-privacy-on #app .doc-lines .col-tax_amount,
html.sb-privacy-on #app .doc-lines .col-line_total,
html.sb-privacy-on #app #subtotal,
html.sb-privacy-on #app #tax-total,
html.sb-privacy-on #app #advance-tax,
html.sb-privacy-on #app #grand-total{
  filter:blur(8px) !important;
  user-select:none !important;
  pointer-events:none !important;
}
html body[data-auth-state="authenticated"] header.topbar .sb-privacy-bar{
  display:inline-flex !important;
  align-items:center !important;
  gap:6px !important;
  flex:0 0 auto !important;
  width:auto !important;
  min-width:0 !important;
  overflow:visible !important;
  font-size:12px !important;
  font-weight:600 !important;
  color:var(--books-ink) !important;
  cursor:pointer;
}
html body[data-auth-state="authenticated"] header.topbar #sb-privacy-toggle{
  transform:none !important;
  pointer-events:auto !important;
  cursor:pointer !important;
}

html body[data-auth-state="authenticated"] #app .sb-sales-path-wrap{
  display:block !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  white-space:normal !important;
}
html body[data-auth-state="authenticated"] #app .sb-sales-path,
html body[data-auth-state="authenticated"] #app .listpage-flow{
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  overflow-x:auto !important;
  white-space:nowrap !important;
  gap:2px !important;
  max-width:100% !important;
}
html body[data-auth-state="authenticated"] #app .sb-sales-path button{
  background:transparent !important;
  color:var(--books-ink) !important;
  border-bottom-color:transparent !important;
}
html body[data-auth-state="authenticated"] #app .sb-sales-path button.is-on{
  color:var(--books-green) !important;
  border-bottom-color:var(--books-green) !important;
}
html body[data-auth-state="authenticated"] #app .sb-sales-path-sep,
html body[data-auth-state="authenticated"] #app .sb-sales-path-hint{
  color:var(--books-muted) !important;
}
/* Section tabs (pages that sit side by side) read as tabs on one line, not as process steps. */

html body #app .sb-bar-template{margin:0 !important}
html body #app .sb-bar-template select{min-width:160px;max-width:220px;min-height:34px}
html body #app .sb-inv-sheet{
  display:block !important;
  margin:0 0 4px !important;
}
html body #app .sb-inv-party{
  display:flex !important;
  align-items:flex-end !important;
  gap:12px 20px !important;
  flex-wrap:nowrap !important;
}
html body #app .sb-inv-party>.field{flex:1 1 280px;max-width:420px;margin:0 !important}
html body #app .sb-inv-meta{
  display:grid !important;
  grid-auto-flow:row !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:14px 16px !important;
  align-items:end !important;
  margin:16px 0 !important;
}
@media (max-width:1100px){
  html body #app .sb-inv-meta{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
}
@media (max-width:700px){
  html body #app .sb-inv-meta{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}
html body #app .sb-inv-meta>.field:not([hidden]){
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
  margin:0 !important;
  min-width:0 !important;
}
html body #app .sb-inv-meta label{
  margin:0 !important;
  text-align:left !important;
  font-size:11px !important;
  font-weight:700 !important;
  letter-spacing:.03em !important;
  text-transform:uppercase !important;
  color:#667085 !important;
}
html body #app .sb-inv-meta input,
html body #app .sb-inv-meta select{
  width:100% !important;
  min-height:32px !important;
  margin:0 !important;
}
html body #app .sb-inv-meta .sb-search-select>select{
  position:absolute !important;
  width:0 !important;
  height:0 !important;
  min-height:0 !important;
  max-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  opacity:0 !important;
  pointer-events:none !important;
  visibility:hidden !important;
}
html body #app .sb-inv-meta .field[hidden],
html body #app .sb-inv-meta>input[hidden],
html body #app .sb-inv-meta>textarea[hidden],
html body #app .sb-inv-meta>select[hidden],
html body #app .sb-inv-meta>select[data-doc="terms"],
html body #app .sb-inv-meta>.sb-search-select:has(>select[data-doc="terms"]){display:none !important}
html body #app .sb-inv-sheet .sb-dc-address{margin-top:4px}
html body #app #sb-desc-slot{flex:1 1 520px;min-width:0;margin:0 !important}
html body #app .sb-inv-sheet .sb-dc-address p{margin:0;color:#475467;font-size:13px;line-height:1.45;white-space:pre-line}
html body #app .sb-dc-paper .sb-inv-meta input,
html body #app .sb-dc-paper .sb-inv-meta select,
html body #app .sb-dc-paper .sb-dc-customer select{
  background:#fff !important;
  color:#1f2933 !important;
  border:1px solid #c5c9d0 !important;
}
html[data-theme="dark"] body #app .sb-dc-paper{
  background:var(--books-panel) !important;
  color:var(--books-ink) !important;
  border-color:var(--books-line) !important;
  box-shadow:none !important;
}
html[data-theme="dark"] body #app .sb-dc-paper input:not([type=date]),
html[data-theme="dark"] body #app .sb-dc-paper select,
html[data-theme="dark"] body #app .sb-dc-paper textarea,
html[data-theme="dark"] body #app .sb-bar-template select{
  background:#07182b !important;
  color:#edf5ff !important;
  border-color:#263d55 !important;
}
html[data-theme="dark"] body #app .sb-inv-meta label,
html[data-theme="dark"] body #app .sb-inv-party label,
html[data-theme="dark"] body #app .sb-dc-narration label,
html[data-theme="dark"] body #app .sb-doc-code span,
html[data-theme="dark"] body #app .sb-inv-sheet .sb-dc-address p,
html[data-theme="dark"] body #app .sb-dc-taxids,
html[data-theme="dark"] body #app .sb-dc-message label{
  color:#9eb1c5 !important;
}
html[data-theme="dark"] body #app .sb-dc-lines .doc-lines th{
  background:#102a42 !important;
  color:#edf5ff !important;
  border-bottom-color:#263d55 !important;
}
html[data-theme="dark"] body #app .sb-dc-lines .doc-lines td{
  color:#edf5ff !important;
  border-bottom-color:#263d55 !important;
}
html[data-theme="dark"] body #app .sb-dc-lines .doc-lines input:not([type=date]),
html[data-theme="dark"] body #app .sb-dc-lines .doc-lines select{
  background:transparent !important;
  color:#edf5ff !important;
}
html[data-theme="dark"] body #app .docform-summary-row,
html[data-theme="dark"] body #app .docform-summary-row span,
html[data-theme="dark"] body #app .docform-summary-row b{
  color:#edf5ff !important;
}
html body #app .sb-inv-opt{display:flex;gap:14px;justify-content:flex-end;margin:0 0 8px;font-size:12px;color:var(--books-muted,#667085)}
html body #app .sb-inv-opt label{display:flex;align-items:center;gap:6px;cursor:pointer}
html body #app .sb-opt-discount[hidden],
html body #app .sb-opt-advance[hidden],
html body #app .sb-opt-adv-disc[hidden]{display:none !important}
html body #app .sb-adv-label{display:inline-flex !important;align-items:center !important;gap:8px !important}
html body #app .sb-adv-rate{width:58px !important;min-width:58px !important;max-width:58px !important;min-height:28px !important;margin:0 !important;text-align:right !important;padding:2px 6px !important}
html[data-theme="dark"] body #app .sb-adv-rate{
  background:#102a42 !important;
  color:#edf5ff !important;
  border-color:#263d55 !important;
}
html body #app .sb-dc-narration{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-end !important;
  gap:12px 20px !important;
  margin:0 0 8px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  border-radius:0 !important;
}
html body #app .sb-dc-narration .field{width:min(320px,100%);min-width:0;flex:0 1 320px;max-width:100%;margin:0}
html body #app #doc-desc-mode{display:block!important;width:100%!important;min-height:36px;padding:6px 10px;border:1px solid var(--books-line);border-radius:4px;background:var(--books-panel)!important;color:var(--books-ink)!important;opacity:1!important;visibility:visible!important}
html body #app .sb-dc-taxids{
  margin:6px 0 0 !important;
  color:var(--books-muted) !important;
  font-size:12px !important;
}
html body #app .sb-dc-more[open]{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(140px,1fr)) !important;
  gap:8px 12px !important;
  align-items:end !important;
}
html body #app .sb-dc-more[open]>summary{
  grid-column:1 / -1 !important;
}
html body #app .sb-dc-more .sb-meta-row{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:4px !important;
  min-width:0 !important;
}
html body[data-auth-state="authenticated"] #app .sb-inv-style-field span{
  color:var(--books-muted) !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app .sb-inv-toolbar .btn:not(.primary){
  background:#143049 !important;
  color:#f4f8ff !important;
  border-color:#3d5d7a !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app .sb-inv-style-field select{
  background:#0a1a2c !important;
  color:#f4f8ff !important;
  border-color:#35506b !important;
}
html body[data-auth-state="authenticated"] #app .sb-crm-play{display:none !important}
html body[data-auth-state="authenticated"] #app .sb-crm-board{
  display:flex !important;
  flex-wrap:nowrap !important;
  overflow-x:auto !important;
  max-width:100% !important;
}

@media(max-width:900px){
  html body[data-auth-state="authenticated"] #app .cards,
  html body[data-auth-state="authenticated"] #app .ex-summary,
  html body[data-auth-state="authenticated"] #app .sb-funnel,
  html body[data-auth-state="authenticated"] #app .commercial-register-summary,
  html body[data-auth-state="authenticated"] #app .dash-kpis{
    flex-wrap:wrap !important;
  }
  html body[data-auth-state="authenticated"] #app .metric,
  html body[data-auth-state="authenticated"] #app .commercial-summary-card,
  html body[data-auth-state="authenticated"] #app .ex-summary > article{
    flex:1 1 calc(50% - 8px) !important;
    max-height:var(--esb-kpi-height) !important;
  }
}

html body[data-auth-state="authenticated"] #modal-root .modal.sb-inv-ways-modal{
  width:min(480px,calc(100vw - 32px)) !important;
  max-width:480px !important;
  min-width:0 !important;
  left:50% !important;
  right:auto !important;
  transform:translateX(-50%);
}
html body[data-auth-state="authenticated"] #modal-root .modal.sb-inv-ways-modal .sb-win-btns [data-sb-min],
html body[data-auth-state="authenticated"] #modal-root .modal.sb-inv-ways-modal .sb-win-btns [data-sb-max]{
  display:none !important;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-ways{
  display:flex;
  flex-direction:column;
  gap:8px;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-ways-label{
  margin:14px 0 6px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--books-muted);
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way-wrap{
  position:relative;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-picks{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-top:4px;
  padding:6px;
  border:1px solid var(--books-line);
  border-radius:8px;
  background:var(--books-panel);
  max-height:220px;
  overflow:auto;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-picks[hidden]{
  display:none;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-picks p{
  margin:0;
  padding:8px 10px;
  color:var(--books-muted);
  font-size:12px;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-pick{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  width:100%;
  text-align:left;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--books-ink);
  padding:8px 10px;
  cursor:pointer;
  font:inherit;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-pick:hover,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-pick:focus-visible{
  background:var(--books-hover);
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-pick:hover,
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-pick:focus-visible{
  background:#16324c;
  color:#f4f8ff;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-pick b{
  font-size:13px;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-pick small{
  color:var(--books-muted);
  font-size:12px;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  text-align:left;
  border:1px solid var(--books-line);
  background:var(--books-panel);
  border-radius:8px;
  padding:12px 14px;
  cursor:pointer;
  font:inherit;
  color:var(--books-ink);
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way:hover,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way:focus-visible{
  border-color:var(--books-green);
  background:#f4f7fb;
  color:#0c2340;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way:hover small,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way:focus-visible small{
  color:#3d5270;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:hover,
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:focus-visible{
  background:#16324c;
  color:#f4f8ff;
  border-color:#0c2340;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:hover small,
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:focus-visible small{
  color:#d5e2f0;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:hover i,
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root .sb-inv-way:focus-visible i{
  border-color:#d5e2f0;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary:hover,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary:focus-visible{
  background:var(--books-green);
  color:#fff;
  border-color:var(--books-green);
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary:hover small,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary:focus-visible small{
  color:rgba(255,255,255,.9);
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way b{
  display:block;
  font-size:14px;
  font-weight:700;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way small{
  display:block;
  margin-top:3px;
  color:var(--books-muted);
  font-size:12px;
  line-height:1.35;
  font-weight:400;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary{
  background:var(--books-green);
  border-color:var(--books-green);
  color:#fff;
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way.is-primary small{
  color:rgba(255,255,255,.9);
}
html body[data-auth-state="authenticated"] #modal-root .sb-inv-way i{
  width:7px;
  height:7px;
  border-right:2px solid #9ca3af;
  border-top:2px solid #9ca3af;
  transform:rotate(45deg);
  flex:0 0 auto;
}

html body[data-auth-state="authenticated"] select:not([multiple]),
html body[data-auth-state="authenticated"] #modal-root select:not([multiple]){
  appearance:none !important;
  -webkit-appearance:none !important;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%234b5563' d='M0 0h10L5 6z'/></svg>") !important;
  background-repeat:no-repeat !important;
  background-position:right 12px center !important;
  background-size:10px 6px !important;
  padding-right:30px !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] select:not([multiple]),
html[data-theme="dark"] body[data-auth-state="authenticated"] #modal-root select:not([multiple]){
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23d5e4f2' d='M0 0h10L5 6z'/></svg>") !important;
}
html body[data-auth-state="authenticated"] .sb-search-select > select{
  width:0 !important;
  height:0 !important;
  min-height:0 !important;
  max-height:0 !important;
  opacity:0 !important;
  padding:0 !important;
  border:0 !important;
  background-image:none !important;
  pointer-events:none !important;
  position:absolute !important;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="month"]::-webkit-inner-spin-button,
input[type="month"]::-webkit-outer-spin-button,
select::-webkit-inner-spin-button,
select::-webkit-outer-spin-button{
  -webkit-appearance:none !important;
  appearance:none !important;
  display:none !important;
  margin:0 !important;
}

/* Collapsed rail: name sits beside the icon, outside the clipped sidebar. */
#sb-rail-tip{
  position:fixed;
  z-index:50000;
  margin:0;
  padding:6px 10px;
  border-radius:4px;
  background:#0c2340;
  color:#fff;
  font:600 13px "Segoe UI",Inter,system-ui,Arial,sans-serif;
  line-height:1.2;
  white-space:nowrap;
  pointer-events:none;
  box-shadow:0 6px 16px rgba(12,35,64,.28);
}
#sb-rail-tip[hidden]{display:none !important}
html[data-theme="dark"] #sb-rail-tip{background:#e8f2fc;color:#102033}

/* Document templates: labels, line headings, warranty and totals stay readable. */
html body .sb-layout .print-company,
html body .template-preview .print-company{
  margin:0 0 4px !important;
  line-height:1.35 !important;
}
html body .sb-layout .print-company h1,
html body .template-preview .print-company h1{
  margin:0 0 2px !important;
  font-size:22px !important;
  line-height:1.15 !important;
}
html body .sb-layout .print-company p,
html body .template-preview .print-company p{
  margin:0 !important;
  line-height:1.4 !important;
}
html body .sb-layout .print-title,
html body .template-preview .print-title{
  margin:8px 0 12px !important;
}
html body .sb-layout .sb-meta-grid{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:8px 14px !important;
  border:0 !important;
  margin:0 !important;
}
html body .sb-layout .sb-meta-item{
  display:flex !important;
  flex-direction:column !important;
  gap:2px !important;
  min-width:0 !important;
  border:0 !important;
  padding:0 !important;
}
html body .sb-layout .sb-meta-label{
  display:block !important;
  font-size:10px !important;
  font-weight:700 !important;
  letter-spacing:.04em !important;
  text-transform:uppercase !important;
  color:#5c6b7a !important;
}
html body .sb-layout .sb-meta-value{
  display:block !important;
  margin:0 !important;
  font-size:12px !important;
  font-weight:650 !important;
  color:#111827 !important;
  overflow-wrap:anywhere !important;
}
html body .doc-print .print-meta > div,
html body .dc-meta > div{
  display:flex !important;
  flex-direction:column !important;
  gap:3px !important;
  min-width:0 !important;
}
html body .doc-print .print-meta small,
html body .doc-print .print-meta b,
html body .dc-meta small,
html body .dc-meta b{
  display:block !important;
}
html body .sb-layout .table-wrap,
html body .template-preview .table-wrap,
html body .sb-doc-paper .table-wrap,
html body .dc-print{
  overflow:visible !important;
}
html body .sb-layout .print-table{
  table-layout:fixed !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
}
html body .template-preview .print-table{
  table-layout:auto !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
}
html body .sb-layout .print-table th,
html body .sb-layout .print-table td{
  white-space:normal !important;
  overflow-wrap:break-word !important;
  word-break:normal !important;
  overflow:hidden !important;
  line-height:1.25 !important;
  font-size:12px !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
html body .template-preview .print-table th,
html body .template-preview .print-table td{
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  overflow:visible !important;
  line-height:1.25 !important;
  font-size:12px !important;
}
html body .sb-layout .print-table th,
html body .template-preview .print-table th,
html body .dc-stock th{
  font-size:11px !important;
  letter-spacing:.02em !important;
  text-align:left !important;
}
html body .sb-layout .sb-col-desc,
html body .template-preview .sb-col-desc{
  white-space:normal !important;
  text-align:left !important;
}
html body .sb-layout .sb-col-num,
html body .template-preview .sb-col-num{
  text-align:right !important;
}
html body .sb-layout .print-table td.sb-col-num,
html body .sb-layout .total-row b,
html body .sb-layout .sb-totals-table td:last-child,
html body .template-preview .print-table td.sb-col-num{
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  overflow:visible !important;
}
html body .sb-layout .sb-doc-foot{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(220px,280px) !important;
  gap:16px !important;
  align-items:start !important;
  margin-top:12px !important;
}
html body .sb-layout .sb-doc-notes span{
  display:block !important;
  margin:0 0 2px !important;
  font-size:10px !important;
  font-weight:700 !important;
  letter-spacing:.04em !important;
  text-transform:uppercase !important;
}
html body .sb-layout .sb-doc-foot .totals{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
}
html body .sb-layout .total-row{
  display:flex !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:3px 0 !important;
  margin:0 !important;
}
html body .dc-print{
  min-height:0 !important;
  background:#fff !important;
  color:#0c2340 !important;
}
html[data-theme="dark"] #app .dc-print,
html[data-theme="dark"] #app .dc-print h1,
html[data-theme="dark"] #app .dc-print h2,
html[data-theme="dark"] #app .dc-print h3,
html[data-theme="dark"] #app .dc-print p,
html[data-theme="dark"] #app .dc-print b,
html[data-theme="dark"] #app .dc-print td{
  color:#c5d4e6 !important;
  -webkit-text-fill-color:#0c2340 !important;
  background:transparent !important;
}
html[data-theme="dark"] #app .dc-print{
  background:#fff !important;
}
html[data-theme="dark"] #app .dc-print .dc-party small,
html[data-theme="dark"] #app .dc-print .dc-meta small,
html[data-theme="dark"] #app .dc-print .dc-qr small{
  color:#c5d4e6 !important;
  -webkit-text-fill-color:#4a5b6b !important;
}
html[data-theme="dark"] #app .dc-print .dc-stock th{
  background:#0c2340 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}
html body #app .dc-print{max-width:100% !important;overflow:visible !important;box-sizing:border-box !important;}
html body #app .dc-print .dc-stock{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
  border-spacing:0 !important;
}
html body #app .dc-print .dc-stock th,
html body #app .dc-print .dc-stock td{
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  box-sizing:border-box !important;
  padding:6px 5px !important;
  border:1px solid #4a5b6b !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
}
html body #app .dc-print .dc-stock td{
  background:#fff !important;
  color:#0c2340 !important;
  -webkit-text-fill-color:#0c2340 !important;
}
html body #app .dc-print .dc-stock th{
  background:#0c2340 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

/* Printed esmartbooks.com mark sits in the bottom-right corner, not across the footer. */
html body .esb-software-stamp{
  width:max-content !important;
  max-width:100% !important;
  margin:8px 0 0 auto !important;
  padding:0 !important;
  border:0 !important;
  text-align:right !important;
  letter-spacing:.12em !important;
}
@media print{
  html body .esb-software-stamp{
    position:static !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;
    width:max-content !important;
    max-width:100% !important;
    margin:8px 0 0 auto !important;
  }
  html body.sb-print-cheque .esb-software-stamp{
    display:none !important;
  }
}

/* Journal: labels sit above the fields, and the line grid stays inside the window. */
html body #modal-root .modal.im-journal-modal{
  width:min(1240px, calc(100vw - 24px)) !important;
}
html body #modal-root .im-journal-modal .modal-body{
  overflow:auto !important;
}
html body #modal-root .im-journal-modal .ja-head-fields{
  display:grid !important;
  grid-template-columns:200px 220px minmax(220px, 1fr) !important;
  gap:14px 16px !important;
  align-items:end !important;
  margin:0 0 12px !important;
  overflow:visible !important;
}
html body #modal-root .im-journal-modal .ja-head-fields .field.ja-flags{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:12px !important;
  min-height:38px !important;
}
html body #modal-root .im-journal-modal .ja-head-fields .field.ja-flags select{
  width:160px !important;
  flex:0 0 160px !important;
}
html body #modal-root .im-journal-modal .ja-memo-block{
  margin:12px 0 0 !important;
}
html body #modal-root .im-journal-modal .ja-memo-block textarea{
  width:100% !important;
  min-height:64px !important;
  height:auto !important;
  resize:vertical !important;
}
html body #modal-root .im-journal-modal .ja-head-fields .field{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  align-self:start !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
  position:static !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
}
html body #modal-root .im-journal-modal .ja-head-fields .field label{
  display:block !important;
  position:static !important;
  top:auto !important;
  left:auto !important;
  transform:none !important;
  height:auto !important;
  width:auto !important;
  margin:0 0 6px !important;
  padding:0 !important;
  line-height:1.3 !important;
  font-size:12px !important;
  font-weight:650 !important;
  background:transparent !important;
  overflow:visible !important;
  z-index:auto !important;
}
html body #modal-root .im-journal-modal .ja-head-fields .field input:not([type="checkbox"]):not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="time"]),
html body #modal-root .im-journal-modal .ja-head-fields .field select{
  width:100% !important;
  min-width:0 !important;
  min-height:38px !important;
  height:38px !important;
  margin:0 !important;
  position:static !important;
  box-sizing:border-box !important;
}
html body #modal-root .im-journal-modal .ja-hint{
  margin:0 0 10px !important;
}
html body #modal-root .im-journal-modal .ja-table-wrap{
  overflow:auto !important;
}
html body #modal-root .im-journal-modal .ja-table{
  width:100% !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
}
html body #modal-root .im-journal-modal .ja-table th{
  text-align:left !important;
  font-size:11px !important;
  letter-spacing:.04em !important;
  text-transform:uppercase !important;
  padding:8px 6px !important;
}
html body #modal-root .im-journal-modal .ja-table th:nth-child(1){width:36px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-amt,
html body #modal-root .im-journal-modal .ja-table td.ja-amt{width:108px !important;text-align:right !important}
html body #modal-root .im-journal-modal .ja-table th.ja-dim,
html body #modal-root .im-journal-modal .ja-table td.ja-dim{width:140px !important}
html body #modal-root .im-journal-modal .ja-cat-fields{
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap:14px 16px !important;
  margin:0 0 12px !important;
}
html body #modal-root .im-journal-modal .ja-cat-fields .field{
  display:flex !important;
  flex-direction:column !important;
  margin:0 !important;
}
html body #modal-root .im-journal-modal .ja-cat-fields .field label{
  display:block !important;
  position:static !important;
  margin:0 0 6px !important;
  font-size:12px !important;
  font-weight:650 !important;
}
html body #modal-root .im-journal-modal .ja-cat-fields select{
  width:100% !important;
  min-height:38px !important;
}
html body #modal-root .im-journal-modal #ja-lines [data-ja-debit],
html body #modal-root .im-journal-modal #ja-lines [data-ja-credit]{text-align:right !important}
html body #modal-root .im-journal-modal #ja-lines select.ja-name-need{border-color:#b42318 !important}
html body #modal-root .im-journal-modal .ja-table td{
  padding:4px 6px !important;
  vertical-align:middle !important;
}
html body #modal-root .im-journal-modal #ja-lines select,
html body #modal-root .im-journal-modal #ja-lines input{
  width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
html body #modal-root .im-journal-modal .ja-under-table{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  margin-top:10px !important;
}
html body #modal-root .im-journal-modal .ja-totals{
  margin-left:auto !important;
  display:flex !important;
  gap:16px !important;
  font-weight:700 !important;
}
html body .ja-unbalanced{color:#b42318 !important}
html body .ja-balanced{color:#16365c !important}
@media (max-width:760px){
  html body #modal-root .im-journal-modal .ja-head-fields{
    grid-template-columns:1fr !important;
  }
}

/* Match a statement: equation plus deposits and payments. */
html[data-theme="dark"] body .sb-win-btns button,
html[data-theme="dark"] body .sb-win-controls button,
html[data-theme="dark"] body .im-window-controls button,
html[data-theme="dark"] body .im-so-win-controls button,
html[data-theme="dark"] body #modal-root .modal-head .close,
html[data-theme="dark"] body #modal-root .sb-win-close{
  color:#f4f8ff !important;
  opacity:1 !important;
}
html[data-theme="dark"] body .sb-win-btns button:hover,
html[data-theme="dark"] body .sb-win-controls button:hover,
html[data-theme="dark"] body .im-window-controls button:hover,
html[data-theme="dark"] body .im-so-win-controls button:hover{
  background:#2a4664 !important;
  color:#fff !important;
}
html[data-theme="dark"] body .sb-win-btns .close:hover,
html[data-theme="dark"] body .sb-win-btns .sb-win-close:hover,
html[data-theme="dark"] body .im-window-controls [data-win-close]:hover,
html[data-theme="dark"] body .im-so-win-controls [data-so-close]:hover,
html[data-theme="dark"] body #modal-root .modal-head .close:hover{
  background:#e81123 !important;
  color:#fff !important;
}
html body #app .sb-recon-panel{overflow:visible !important}
html body #app .sb-recon-bar{
  display:grid !important;
  grid-template-columns:minmax(220px,1.5fr) minmax(150px,.8fr) minmax(160px,.9fr) minmax(180px,1.1fr) !important;
  gap:12px !important;
  align-items:end !important;
  padding:12px 14px !important;
  min-height:0 !important;
  height:auto !important;
}
html body #app .sb-recon-bar .field{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  min-width:0 !important;
  height:auto !important;
  overflow:visible !important;
}
html body #app .sb-recon-bar .field label{
  display:block !important;
  position:static !important;
  margin:0 0 6px !important;
  font-size:12px !important;
  font-weight:650 !important;
}
html body #app .sb-recon-bar select,
html body #app .sb-recon-bar input{
  display:block !important;
  width:100% !important;
  min-height:36px !important;
  height:36px !important;
  box-sizing:border-box !important;
}
html body #app .sb-recon-panel > .side-note{margin:0 14px 8px !important;color:var(--books-muted,#4b5563) !important}
html body #app .sb-recon-head .field{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  height:auto !important;
  overflow:visible !important;
}
html body #app .sb-recon-head .field label{
  display:block !important;
  position:static !important;
  margin:0 0 6px !important;
}
html body .sb-recon-eq{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  gap:8px !important;
  margin:12px 0 !important;
}
html body .sb-recon-eq article{
  border:1px solid #d5dee8 !important;
  border-radius:8px !important;
  padding:10px 12px !important;
  background:var(--panel, #fff) !important;
}
html body .sb-recon-eq small{
  display:block !important;
  font-size:11px !important;
  font-weight:700 !important;
  letter-spacing:.03em !important;
  text-transform:uppercase !important;
}
html body .sb-recon-eq strong{display:block !important;margin-top:4px !important;font-size:16px !important}
html body .sb-recon-eq .is-diff{color:#b42318 !important}
html body .sb-recon-eq .is-ok{color:#16365c !important}
html body .sb-recon-sheet{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:16px !important;
  align-items:start !important;
}
html body .sb-recon-col header{
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:8px !important;
  margin-bottom:6px !important;
}
html body .sb-recon-col h3{margin:0 !important;font-size:14px !important}
html body .sb-recon-all{font-size:12px !important;font-weight:650 !important}
html body .sb-stmt-calc td{font-weight:750 !important;border-top:1px solid #c5d4e6 !important}
html body .sb-recon-tools[hidden]{display:none !important}
html body .sb-recon-tools:not([hidden]){
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-end !important;
  gap:8px 12px !important;
  margin:0 14px 12px !important;
}
html body .sb-recon-tools #recon-post{margin-left:auto !important}
html body .sb-recon-tools label{
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
  font-size:12px !important;
  font-weight:650 !important;
}
html body .sb-recon-tools input{width:140px !important}
html body .sb-recon-report{
  border:1px solid #d5dee8 !important;
  background:#f4f6f8 !important;
  border-radius:8px !important;
  padding:12px 14px !important;
  margin:0 0 12px !important;
}
html body .sb-recon-report h3{margin:0 0 4px !important;font-size:14px !important}
html body .sb-recon-report p{margin:4px 0 !important}
@media (max-width:800px){
  html body .sb-recon-eq,
  html body .sb-recon-sheet,
  html body #app .sb-recon-bar{grid-template-columns:1fr !important}
}
html body #app .chq-leaf,
html body #cheque-print-root .chq-leaf{
  background:#fff !important;
  color:#111 !important;
}
html body .chq-field,
html body .chq-cross,
html body .chq-cross span{
  color:#111 !important;
  -webkit-text-fill-color:#111 !important;
}
html body #app .sb-plan{overflow:auto;max-width:100%;border:1px solid var(--books-line,#d5dbe3);border-radius:8px}
html body #app .sb-plan table{min-width:1180px;border-collapse:separate;border-spacing:0}
html body #app .sb-plan th,
html body #app .sb-plan td{white-space:nowrap;vertical-align:middle}
html body #app .sb-plan th:first-child,
html body #app .sb-plan td:first-child{position:sticky;left:0;z-index:1;background:var(--books-panel,#fff);min-width:220px;text-align:left}
html body #app .sb-plan input{width:88px;text-align:right;height:32px;box-sizing:border-box}
html body #app .sb-plan .sb-stmt-calc td{font-weight:750}
html[data-theme="dark"] body #app .sb-plan th:first-child,
html[data-theme="dark"] body #app .sb-plan td:first-child{background:var(--books-panel,#1b2430)}
/* Product code stays centered and short. Description stays left and wider. Widths are not locked here. */
html body #app th.sb-align-code,
html body #app td.sb-align-code,
html body #app td.sb-align-code input,
html body #app td.sb-align-code select,
html body #app .doc-lines td.col-item_code,
html body #app .doc-lines td.col-item_code input,
html body #app .doc-lines td.col-item_code select,
html body #app .doc-lines td.col-item_code .sb-search-select-input{
  text-align:left !important;
  text-align-last:left !important;
}
html body #app table thead th.sb-align-code .sb-col-sort{
  justify-content:flex-start !important;
  text-align:left !important;
}
html body #app th.sb-align-desc,
html body #app td.sb-align-desc,
html body #app td.sb-align-desc textarea,
html body #app td.sb-align-desc input,
html body #app .doc-lines td.col-description,
html body #app .doc-lines td.col-description textarea,
html body #app .doc-lines td.col-description input{
  text-align:left !important;
  text-align-last:left !important;
}
html body #app table thead th.sb-align-desc .sb-col-sort{
  justify-content:flex-start !important;
  text-align:left !important;
}
html body #app th.sb-align-code,
html body #modal-root th.sb-align-code,
html body #app .commercial-table th,
html body #modal-root .commercial-table th,
html body #modal-root table th.sb-align-code{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.25 !important;
}
html body #modal-root th.sb-align-code,
html body #modal-root td.sb-align-code,
html body #modal-root td.sb-align-code input,
html body #modal-root td.sb-align-code select,
html body #modal-root td.sb-align-code .sb-search-select-input{
  text-align:left !important;
  text-align-last:left !important;
}
html body #modal-root th.sb-align-desc,
html body #modal-root td.sb-align-desc,
html body #modal-root td.sb-align-desc input,
html body #modal-root td.sb-align-desc textarea{
  text-align:left !important;
  text-align-last:left !important;
}
html body #app table.sb-user-cols td,
html body #app .doc-lines td.col-item_code,
html body #app .doc-lines td.col-description{
  max-width:none !important;
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  box-sizing:border-box !important;
}
html body #app table.sb-user-cols td :is(span,a,strong,b,small,p),
html body #modal-root table.sb-user-cols td :is(span,a,strong,b,small,p){
  white-space:nowrap !important;
  overflow-wrap:normal !important;
}
html body :is(#app,#modal-root) table.sb-user-cols :is(th,td) > :not(.sb-col-resizer){
  min-width:0 !important;
  max-width:100% !important;
}
html body :is(#app,#modal-root) table.sb-user-cols td .btn{
  white-space:nowrap !important;
  overflow-wrap:normal !important;
}
html body #app .sb-col-resizer{
  position:absolute;
  right:-5px;
  top:0;
  width:12px;
  height:100%;
  cursor:col-resize;
  z-index:40;
  touch-action:none;
}
html body #app .sb-col-resizer::after{
  content:"";
  position:absolute;
  right:5px;
  top:18%;
  height:64%;
  border-right:1px solid rgba(148,163,184,.55);
}
html body #app table thead th,
html body #modal-root table thead th,
html body .sb-report-result table thead th,
html body #app table tbody td,
html body #modal-root table tbody td,
html body #app .doc-lines thead th,
html body #app .doc-lines tbody td,
html body #app .financial-statement thead th,
html body #app .financial-statement tbody td,
html body #app .report-table thead th,
html body #app .report-table tbody td{
  text-align:left !important;
  text-align-last:left !important;
}
html body :is(#app,#modal-root) table :is(th,td):is(.num,.amount,.sb-col-num,.align-number),
html body #app table thead th.num,
html body #app table tbody td.num,
html body #modal-root table thead th.num,
html body #modal-root table tbody td.num,
html body #app .doc-lines thead th.num,
html body #app .doc-lines thead th.align-number,
html body #app .doc-lines tbody td.num,
html body #app .doc-lines tbody td.align-number,
html body #app .financial-statement thead th.num,
html body #app .financial-statement tbody td.num,
html body #app .report-table thead th.num,
html body #app .report-table tbody td.num,
html body .sb-report-result table thead th.num,
html body .sb-report-result table tbody td.num{
  text-align:right !important;
  text-align-last:right !important;
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table){
  border-collapse:collapse;
  background:var(--surface,#fff);
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table) thead th{
  background:var(--panel,#f5f7fa);
  color:var(--text,#24364b);
  font-size:12px;
  font-weight:600;
  letter-spacing:0;
  text-transform:none !important;
  height:44px;
  border-bottom:1px solid var(--line,#dfe5ed);
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table) tbody td{
  padding:10px 14px;
  line-height:1.4;
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
  overflow:hidden;
  text-overflow:clip;
  vertical-align:middle;
  border-bottom:1px solid var(--line,#e8edf3);
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table) tbody tr:hover{
  background:var(--panel,#f5f7fa);
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table) td.num{
  text-align:right;
  font-variant-numeric:tabular-nums;
}
html body :is(#app,#modal-root) table:not(.print-table,.qr-table,.im-print-table) td .btn{
  padding:6px 12px;
  min-height:32px;
  font-size:13px;
}
html body :is(#app,#modal-root) table th,
html body :is(#app,#modal-root) table th :is(span,a,strong,b,small,p,button){
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
html body #app table thead th .sb-col-sort,
html body #modal-root table thead th .sb-col-sort{
  justify-content:flex-start !important;
  text-align:left !important;
  min-width:0;
  max-width:100%;
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  overflow:hidden;
}
html body #app table thead th.num .sb-col-sort,
html body #modal-root table thead th.num .sb-col-sort{
  justify-content:flex-end !important;
  text-align:right !important;
}
/* Numeric headings end where the figures end; the sort mark sits before the label. */
html body :is(#app,#modal-root) table thead th:is(.num,.amount,.sb-col-num,.align-number) .sb-col-sort{
  display:flex !important;
  width:100% !important;
  flex-direction:row-reverse !important;
  justify-content:flex-start !important;
  padding-right:0 !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .table-wrap table:not(.sb-user-cols):not([data-esb-preserve-format]),
html[data-theme] body[data-auth-state="authenticated"] #modal-root .table-wrap table:not(.sb-user-cols):not([data-esb-preserve-format]){
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  table-layout:auto !important;
  font-size:13px !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-grn-page .table-wrap.sb-receipt-lines > table{
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-grn-page .sb-receipt-lines th.sb-grn-lot,
html[data-theme] body[data-auth-state="authenticated"] #app .sb-grn-page .sb-receipt-lines td.sb-grn-lot{
  width:18rem !important;
  min-width:18rem !important;
  max-width:none !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-grn-page .sb-receipt-lines td.sb-grn-lot input[data-lot]{
  width:100% !important;
  min-width:16rem !important;
  max-width:none !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-bill-page .sb-bill-lines th,
html[data-theme] body[data-auth-state="authenticated"] #app .sb-bill-page .sb-bill-lines td{
  overflow:visible !important;
  max-width:none !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-bill-page .sb-bill-lines td.sb-align-desc,
html[data-theme] body[data-auth-state="authenticated"] #app .sb-bill-page .sb-bill-lines th.sb-align-desc{
  white-space:normal !important;
}
html[data-theme] body[data-auth-state="authenticated"] #app .sb-bill-page .sb-bill-lines input[type=number]{
  width:6.5rem !important;
  min-width:6.5rem !important;
  max-width:none !important;
}
html body #app .sb-switch,
html[data-theme="dark"] body #app .sb-switch{
  appearance:none !important;
  -webkit-appearance:none !important;
  width:42px !important;
  height:24px !important;
  min-width:42px !important;
  max-width:42px !important;
  flex:0 0 42px !important;
  margin:0 !important;
  border:0 !important;
  border-radius:999px !important;
  background:#3d5168 !important;
  position:relative !important;
  cursor:pointer !important;
  accent-color:auto !important;
}
html body #app .sb-switch::after,
html[data-theme="dark"] body #app .sb-switch::after{
  content:"" !important;
  position:absolute !important;
  top:3px !important;
  left:3px !important;
  width:18px !important;
  height:18px !important;
  border-radius:50% !important;
  background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.35) !important;
}
html body #app .sb-switch:checked{
  background:#0c2340 !important;
}
html[data-theme="dark"] body #app .sb-switch:checked{
  background:#5b93d6 !important;
}
html body #app .sb-switch:checked::after,
html[data-theme="dark"] body #app .sb-switch:checked::after{
  transform:translateX(18px) !important;
}
html body #app .sb-switch-row{
  display:inline-flex !important;
  align-items:center !important;
  gap:10px !important;
}
html body #app .sb-switch-row > input{
  position:absolute !important;
  opacity:0 !important;
  width:1px !important;
  height:1px !important;
  pointer-events:none !important;
}
html body #app .sb-switch-row > .sb-switch{
  display:inline-block !important;
  width:42px !important;
  height:24px !important;
  flex:0 0 42px !important;
  border-radius:999px !important;
  background:#3d5168 !important;
  position:relative !important;
}
html body #app .sb-switch-row > .sb-switch::after{
  content:"" !important;
  position:absolute !important;
  top:3px !important;
  left:3px !important;
  width:18px !important;
  height:18px !important;
  border-radius:50% !important;
  background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.35) !important;
  transition:transform .15s ease;
}
html body #app .sb-switch-row > input:checked + .sb-switch{
  background:#0c2340 !important;
}
html body #app .sb-switch-row > input:checked + .sb-switch::after{
  transform:translateX(18px) !important;
}
html body #app .sb-lot-pick{
  cursor:pointer !important;
  background-image:none !important;
  appearance:none !important;
}
.sb-lot-menu{
  position:fixed;
  z-index:80;
  min-width:280px;
  max-width:420px;
  max-height:320px;
  overflow:auto;
  background:#fff;
  color:#182333;
  border:1px solid #c5d0dc;
  border-radius:8px;
  box-shadow:0 10px 28px rgba(16,32,48,.18);
  padding:6px;
}
#modal-root .modal.sb-pay-window{width:min(1120px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
html body #modal-root .sb-pay-head{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(150px,.75fr) minmax(190px,.9fr);gap:10px 16px;align-items:end;margin-bottom:8px}
html body #modal-root .sb-pay-head .field{min-width:0}
html body #modal-root .sb-pay-head input,html body #modal-root .sb-pay-head select{width:100%;max-width:100%;min-width:0}
html body #modal-root .sb-pay-head input[type=date]{min-width:11rem}
html body #modal-root .sb-pay-amount{display:flex;align-items:center;gap:8px}
html body #modal-root .sb-pay-amount>span{font-weight:700;white-space:nowrap}
html body #modal-root .sb-pay-amount input{flex:1 1 auto;min-width:0}
html body #modal-root .sb-pay-memo{grid-column:1}
html body #modal-root .sb-pay-find{display:flex;justify-content:flex-end;margin:4px 0 8px}
html body #modal-root .sb-pay-find input{width:240px}
html body #modal-root .modal.sb-pay-window .modal-body{display:block;overflow-x:hidden;overflow-y:auto;max-height:min(78vh,820px)}
html body #modal-root .sb-pay-sheet{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
html body #modal-root #entry-r-invoices{overflow-x:auto;overflow-y:visible;min-height:72px;max-width:100%}
html body #modal-root .sb-pay-bottom{display:grid;grid-template-columns:minmax(220px,1fr) minmax(300px,380px);gap:16px;align-items:end;position:sticky;bottom:0;background:#10243a;color:#eef4fb;border-top:1px solid #35516d;padding-top:10px;margin-top:8px;z-index:2}
html body #modal-root .sb-pay-summary{margin-left:auto}
html body #modal-root .sb-pay-summary-lines{text-align:right}
html body #modal-root .sb-pay-summary-lines h3{text-align:right}
html body #modal-root .sb-pay-summary-lines div{justify-content:flex-end}
html body #modal-root .sb-pay-summary-lines span,html body #modal-root .sb-pay-summary-lines b{text-align:right}
html body #modal-root .sb-pay-credit-hint{margin:0 0 8px;font-size:13px}
html body #modal-root .sb-credit-panel{border:1px solid #c5ced6;padding:12px;margin:8px 0;background:#fff}
html body #modal-root .sb-credit-panel h3{margin:0 0 8px;font-size:15px}
html body #modal-root .sb-pay-under{border:1px solid #c5ced6;padding:10px 12px;max-width:none}
html body #modal-root .sb-pay-under label{display:block;margin:4px 0}
html body #modal-root .sb-pay-summary{margin-top:0}
html body #modal-root .sb-pay-summary-lines h3{margin:0 0 8px;font-size:14px}
html body #modal-root .sb-pay-bal{text-align:right;padding-bottom:4px}
html body #modal-root .sb-pay-bal span{display:block;font-size:12px}
html body #modal-root .sb-pay-bal strong{display:block;font-size:18px;white-space:nowrap}
html body #modal-root .sb-pay-summary{display:grid;grid-column:2;grid-template-columns:auto minmax(0,1fr);gap:16px;align-items:start;align-self:end;margin:0;min-width:0;width:100%}
html body #modal-root .sb-pay-summary-actions{display:flex;flex-direction:column;gap:8px}
html body #modal-root .sb-pay-summary-lines{min-width:0;text-align:left}
html body #modal-root .sb-pay-summary-lines div{display:grid;grid-template-columns:minmax(0,1fr) auto;justify-content:stretch;align-items:center;gap:16px;margin:4px 0}
html body #modal-root .sb-pay-summary-lines b{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
html body #modal-root .sb-pay-summary-lines input{width:8.5rem;text-align:right}
html body #modal-root .sb-pay-ledger tfoot td{font-weight:700;border-top:1px solid #c5ced6}
html body #modal-root .sb-pay-ledger{width:max-content;min-width:100%;table-layout:auto !important;border-collapse:collapse}
html body #modal-root .sb-pay-ledger th{font-size:12px;text-align:left;padding:8px 10px}
html body #modal-root .sb-pay-ledger td{padding:10px;vertical-align:middle}
html body #modal-root .sb-pay-ledger th,html body #modal-root .sb-pay-ledger td{white-space:nowrap !important;overflow:visible !important;max-width:none !important;height:auto !important;text-overflow:clip !important}
html body #modal-root .sb-pay-ledger .num,html body #app .sb-pay-ledger .num{text-align:right !important;min-width:8.5rem;font-variant-numeric:tabular-nums}
html body #modal-root .sb-pay-ledger input[type="number"]{width:7.5rem;text-align:right}
html body #modal-root .sb-credit-window{width:min(640px,calc(100vw - 32px))}
html body #modal-root .sb-credit-apply{width:100%;table-layout:fixed;border-collapse:collapse}
html body #modal-root .sb-credit-apply th,html body #modal-root .sb-credit-apply td{padding:10px 12px;white-space:nowrap;vertical-align:middle}
html body #modal-root .sb-credit-apply .num{text-align:right}
html body #modal-root .sb-credit-apply input[type="number"]{width:8.5rem;max-width:100%;margin-left:auto;text-align:right}
html body #modal-root .sb-pay-kept{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:8px 0 4px}
html body #modal-root .sb-pay-kept label{display:grid;gap:4px;font-size:12px}
html body #modal-root .sb-pay-kept input,html body #modal-root .sb-pay-kept select{width:100%}
html body #modal-root .sb-pay-kept-row td{padding-top:0}
html body #modal-root .sb-pay-totals{display:flex;gap:18px;justify-content:flex-end;margin-top:12px;font-size:14px}
html body #modal-root .sb-pay-ledger-title{margin:12px 0 8px;font-size:14px}
html body #modal-root .sb-pay-simple .form-grid{grid-template-columns:1fr 1fr}
html body #modal-root .sb-pay-more{margin-top:8px}
html body #modal-root .sb-pay-more summary{cursor:pointer;font-size:13px}
html body #modal-root tr.sb-pay-extra td{background:#f4f6f8;padding:8px 12px}
html body #app .sb-pay-actions{justify-content:flex-end}
html body[data-auth-state="authenticated"] #app .sb-receive-page{display:flex;flex-direction:column;gap:8px}
html body[data-auth-state="authenticated"] #app .sb-receive-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
html body[data-auth-state="authenticated"] #app .sb-receive-page .cards{width:auto!important;flex:0 1 auto!important;margin:0!important;gap:8px!important}
html body[data-auth-state="authenticated"] #app .sb-receive-page .metric{flex:0 0 auto!important;width:auto!important;min-width:168px;height:auto!important;min-height:0!important;max-height:none!important;flex-direction:row!important;align-items:baseline!important;justify-content:space-between!important;gap:16px!important;padding:6px 12px!important}
html body[data-auth-state="authenticated"] #app .sb-receive-page .metric small,
html body[data-auth-state="authenticated"] #app .sb-receive-page .metric strong{width:auto!important;font-size:13px!important}
html body[data-auth-state="authenticated"] #app .sb-receive-page .metric strong{font-size:15px!important}
html body[data-auth-state="authenticated"] #app .sb-receive-page .page-actions{margin:0!important}
html body[data-auth-state="authenticated"] #app .sb-receive-page .panel{margin:0}
html body[data-auth-state="authenticated"] #app .sb-receive-page .panel-head{padding:8px 12px;min-height:0}
html body[data-auth-state="authenticated"] #app .sb-receive-page .panel-head h2{font-size:14px;margin:0}
html body[data-auth-state="authenticated"] #app .sb-receive-note{margin:0;flex:1 1 280px;font-size:14px;line-height:1.4}
html body[data-auth-state="authenticated"] #app .sb-receive-more{border:1px solid var(--books-line, #d7dde5);border-radius:8px;padding:8px 12px;background:#fff}
html body[data-auth-state="authenticated"] #app .sb-receive-more summary{cursor:pointer;font-size:14px}
html body[data-auth-state="authenticated"] #app .sb-pay-open td:last-child{width:1%;white-space:nowrap;text-align:right}
html body #app .sb-pay-ledger{width:100%;table-layout:auto}
#modal-root .modal.sb-window{display:flex;flex-direction:column;overflow:hidden}
#modal-root .modal.sb-window .modal-body{overflow:auto;flex:1 1 auto;min-height:0;max-height:none}
#modal-root .modal.sb-window .modal-foot{flex:none}
html body[data-auth-state="authenticated"] #app .sb-bank-page .page-actions{
  display:flex;justify-content:flex-end;flex-wrap:wrap;gap:6px;margin-bottom:8px
}
html body[data-auth-state="authenticated"] #app .sb-bank-lines{display:grid}
html body[data-auth-state="authenticated"] #app .sb-bank-line{
  display:grid;grid-template-columns:7rem minmax(0,1fr) 7rem 8rem;gap:8px;align-items:center;
  width:100%;padding:7px 10px;border:0;border-bottom:1px solid var(--books-line,#cfd3d8);
  background:var(--books-panel,#fff);color:var(--books-ink,#111827);text-align:left;font:inherit;cursor:pointer
}
html body[data-auth-state="authenticated"] #app .sb-bank-line:hover{background:var(--books-hover,#f3f4f6)}
html body[data-auth-state="authenticated"] #app .sb-bank-line-head{font-size:12px;font-weight:700;color:var(--books-muted,#4b5563);cursor:default;background:transparent}
html body[data-auth-state="authenticated"] #app .sb-bank-line-head:hover{background:transparent}
html body[data-auth-state="authenticated"] #app .sb-bank-line small{display:block;color:var(--books-muted,#4b5563)}
html body[data-auth-state="authenticated"] #app .sb-bank-line span:nth-child(3),
html body[data-auth-state="authenticated"] #app .sb-bank-line span:nth-child(4){text-align:right;white-space:nowrap}
html body[data-auth-state="authenticated"] #app tr.sb-click-row{cursor:pointer}
html body[data-auth-state="authenticated"] #app tr.sb-click-row:hover td{background:var(--books-hover,#f3f4f6)}
html body[data-auth-state="authenticated"] #app .sb-click-row{cursor:pointer}
html body[data-auth-state="authenticated"] #app .sb-inv-page,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-lines{max-width:100%;overflow:hidden}
html body[data-auth-state="authenticated"] #app .sb-inv-lines,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-lines{display:grid;width:100%}
html body[data-auth-state="authenticated"] #app .sb-inv-line,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-line{
  display:grid;grid-template-columns:8.5rem minmax(0,1fr) 4.5rem 9.5rem;gap:12px;align-items:center;
  width:100%;padding:12px 14px;border-bottom:1px solid var(--books-line,#d7e0ea);background:transparent;color:inherit
}
html body[data-auth-state="authenticated"] #app .sb-inv-line[data-item-id]{cursor:pointer}
html body[data-auth-state="authenticated"] #app .sb-inv-line[data-item-id]:hover{background:#f4f7fb}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app .sb-inv-line[data-item-id]:hover{background:#102a42}
html body[data-auth-state="authenticated"] #app .sb-inv-head,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-head{font-size:12px;font-weight:700;color:var(--books-muted,#667085);cursor:default}
html body[data-auth-state="authenticated"] #app .sb-inv-line small,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-line small{display:block;color:var(--books-muted,#667085);font-weight:400}
html body[data-auth-state="authenticated"] #app .sb-inv-line span:nth-child(n+3),
html body[data-auth-state="authenticated"] #modal-root .sb-inv-line span:nth-child(n+3){text-align:right;white-space:nowrap}
html body[data-auth-state="authenticated"] #app .sb-inv-move,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-move{grid-template-columns:7rem 8.5rem minmax(0,1fr) 8rem 4.5rem}
html body[data-auth-state="authenticated"] #app .sb-inv-val,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-val{grid-template-columns:minmax(0,1.2fr) repeat(auto-fit,minmax(5.5rem,1fr))}
html body[data-auth-state="authenticated"] #app .sb-inv-hist,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-hist{grid-template-columns:7rem minmax(0,1fr) 4.5rem 8rem minmax(0,1fr)}
html body[data-auth-state="authenticated"] #app .sb-inv-move span,
html body[data-auth-state="authenticated"] #modal-root .sb-inv-hist span:nth-child(-n+2){text-align:left;white-space:normal}
html body[data-auth-state="authenticated"] #app .sb-inv-move span:last-child{text-align:right;white-space:nowrap}
html body[data-auth-state="authenticated"] #app .sb-bank-detail button{
  border:0;background:transparent;color:#8eb0d4;font-weight:700;cursor:pointer;margin-left:14px
}
html body[data-auth-state="authenticated"] #app .sb-bank-page .table-wrap{overflow:visible!important}
html body[data-auth-state="authenticated"] #app .sb-bank-page .table-wrap table.sb-bank-table{
  width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;font-size:14px!important
}
html body[data-auth-state="authenticated"] #app .sb-bank-page .sb-bank-table th:last-child,
html body[data-auth-state="authenticated"] #app .sb-bank-page .sb-bank-table td:last-child{width:7.5rem;text-align:right}
html body[data-auth-state="authenticated"] #app .sb-bank-card{cursor:pointer}
html body[data-auth-state="authenticated"] #app .sb-bank-card.is-on{outline:2px solid #0c2340;outline-offset:2px}
html body[data-auth-state="authenticated"] #app .sb-bank-page tr[data-app-review],
html body[data-auth-state="authenticated"] #app .sb-bank-page tr[data-app-bank-row-id]{cursor:pointer}
html body[data-auth-state="authenticated"] #app .sb-bank-table{width:100%;table-layout:auto}
html body[data-auth-state="authenticated"] #app table th,
html body[data-auth-state="authenticated"] #app table td{
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
html body[data-auth-state="authenticated"] #app table td:has(small),
html body[data-auth-state="authenticated"] #app table td:has(br),
html body[data-auth-state="authenticated"] #app table .sb-col-desc,
html body[data-auth-state="authenticated"] #app table td.col-description{
  white-space:normal !important;
  overflow-wrap:break-word !important;
  word-break:normal !important;
}
html body[data-auth-state="authenticated"] #app table .btn,
html body[data-auth-state="authenticated"] #app table button,
html body[data-auth-state="authenticated"] #app table .badge,
html body[data-auth-state="authenticated"] #app table .pill{
  white-space:nowrap !important;
  word-break:keep-all !important;
}
html body[data-auth-state="authenticated"] #app .sb-bank-table td small{display:block;color:var(--books-muted,#9eb1c5);font-weight:400}
html body[data-auth-state="authenticated"] #app .sb-bank-page .panel{overflow:visible}
html body[data-auth-state="authenticated"] #app .sb-bank-page .table-wrap{overflow:visible;max-height:none}
.sb-lot-menu{z-index:400;min-width:min(460px,calc(100vw - 16px));max-width:min(560px,calc(100vw - 16px));padding:0;overflow:auto}
.sb-lot-table{width:100%;border-collapse:collapse;font-size:13px}
.sb-lot-table thead tr,.sb-lot-menu button{display:grid;grid-template-columns:1fr 1.15fr 1.3fr .7fr 1.15fr;align-items:center;gap:8px}
.sb-lot-table thead tr{padding:8px 10px;background:#eef3f8;border-bottom:1px solid #c5d0dc}
.sb-lot-table th{text-align:center;padding:0;color:#243140;font-weight:650;min-width:0;overflow-wrap:anywhere}
.sb-lot-table .num{text-align:center}
.sb-lot-table td{padding:0;border-bottom:1px solid #e4ebf2}
.sb-lot-menu button{
  width:100%;
  text-align:center;
  border:0;
  background:#fff;
  color:#182333;
  border-radius:0;
  padding:9px 10px;
  cursor:pointer;
}
.sb-lot-menu button span{color:#243140;font-size:13px;line-height:1.3;min-width:0;overflow-wrap:anywhere}
.sb-lot-menu button:hover{background:#f4f6f8}
.sb-lot-menu p{margin:8px 10px;color:#243140}
.sb-lot-total{display:flex;justify-content:space-between;gap:12px;margin:0;padding:9px 10px;border-top:0;font-size:13px;color:#182333;background:#f7fafc}
.sb-lot-total span{font-weight:700}
.sb-cust-window .modal-body{max-height:min(78vh,820px)}
.sb-cust-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.sb-cust-head small{display:block;color:var(--books-muted,#5d6a75);font-size:12px}
.sb-form-win{height:100%;min-height:100vh;display:flex;flex-direction:column;background:#f4f7fb}
.sb-form-win-bar,.sb-form-win-foot{display:flex;gap:8px;align-items:center;padding:10px 16px;background:#fff;border-bottom:1px solid #d5dee8;flex:0 0 auto}
.sb-form-win-foot{border-bottom:0;border-top:1px solid #d5dee8;justify-content:flex-end}
.sb-form-win-bar b{font-size:16px}
.sb-form-win-bar span{color:#9a3412;font-size:13px}
.sb-form-win .sb-cust{flex:1;min-height:0;display:flex;flex-direction:column;padding:12px 16px 0}
.sb-cust-split{display:grid;grid-template-columns:minmax(420px,1.05fr) 10px minmax(280px,.95fr);gap:0;align-items:stretch;flex:1;min-height:0}
.sb-cust-split>div.sb-cust-edit,.sb-cust-split>div.sb-cust-view{min-width:0;overflow:auto}
.sb-cust-edit{background:#fff;border:1px solid #d5dee8;border-radius:8px 0 0 8px;padding:8px 12px 12px}
.sb-cust-view{background:#e8edf2;border:1px solid #d5dee8;border-radius:0 8px 8px 0;padding:10px 12px}
.sb-cust-grip{cursor:col-resize;background:#d5dee8;border-radius:0;position:relative}
.sb-cust-grip::after{content:'';position:absolute;top:0;bottom:0;left:-4px;right:-4px}



.sb-cust-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:auto}
.sb-cust-table th,.sb-cust-table td{padding:6px 8px;text-align:left;border-bottom:1px solid var(--books-line,#e6edf4);overflow:visible;vertical-align:middle}
.sb-cust-table td:first-child{white-space:nowrap;font-weight:600;color:#1b2836}
.sb-cust-table input,.sb-cust-table select{max-width:100%;box-sizing:border-box}
.sb-cust-table th:nth-child(2),.sb-cust-table th:nth-child(3),.sb-cust-table td:nth-child(2),.sb-cust-table td:nth-child(3){text-align:center;width:72px}
.sb-cust-table input[type="text"],.sb-cust-table input:not([type]){width:100%;min-width:140px}
.sb-cust-table input[data-k="order"]{width:64px}
.sb-cust-preview-label{font-size:12px;font-weight:700;color:#3d4d5c;margin-bottom:8px}
#sb-cust-preview{background:transparent;padding:8px;max-height:none;overflow:auto}
#sb-form-layer .sb-cust-view{overflow:auto}
#sb-form-layer #sb-cust-preview .sb-inv-paper{width:max-content !important;min-width:100% !important;max-width:none !important;margin:0 auto;box-shadow:0 8px 28px rgba(15,23,42,.12)}
#sb-form-layer #sb-cust-preview .sb-inv-paper.sb-free{width:var(--place-w,100%) !important;min-width:var(--place-w,100%) !important;height:var(--place-h,auto) !important;max-width:none !important}
#sb-form-layer #sb-cust-preview [data-place]{position:relative;cursor:grab}
#sb-form-layer #sb-cust-preview .sb-free [data-place]{position:absolute !important;cursor:grab}
#sb-form-layer #sb-cust-preview .sb-place-size{position:absolute;right:0;bottom:0;width:12px;height:12px;padding:0;border:0;background:transparent;border-right:2px solid #0c2340;border-bottom:2px solid #0c2340;cursor:nwse-resize;opacity:0;z-index:5}
#sb-form-layer #sb-cust-preview [data-place]:hover>.sb-place-size{opacity:1}
#sb-form-layer #sb-cust-preview table.sb-inv-grid{table-layout:auto !important;width:max-content !important;min-width:100% !important}
#sb-form-layer #sb-cust-preview table.sb-inv-grid th,
#sb-form-layer #sb-cust-preview table.sb-inv-grid td{white-space:nowrap !important;overflow-wrap:normal !important;word-break:keep-all !important;overflow:visible !important}
#sb-form-layer #sb-cust-preview table.sb-inv-grid .sb-col-desc{white-space:normal !important;max-width:280px !important}
#sb-form-layer .sb-page-order{margin-top:10px}
#sb-form-layer .sb-page-order ol{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:4px}
#sb-form-layer .sb-page-order li{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid #d5dee8;border-radius:6px;background:#fff;cursor:grab}
#sb-form-layer #sb-cust-preview [data-edit]{cursor:text;border-radius:2px;outline:1px dashed transparent;outline-offset:2px;-webkit-user-select:text !important;user-select:text !important;pointer-events:auto !important}
#sb-form-layer #sb-cust-preview [data-edit]:hover,#sb-form-layer #sb-cust-preview [data-edit]:focus{outline-color:#0c2340;background:rgba(12,35,64,.08)}
#sb-form-layer #sb-cust-preview .table-wrap{overflow:visible !important}
#sb-form-layer #sb-cust-preview [data-move],
#sb-form-layer .sb-cust-table tr[data-move]{cursor:grab;-webkit-user-drag:none}
#sb-form-layer #sb-cust-preview [data-move] input,
#sb-form-layer .sb-cust-table tr[data-move] input,
#sb-form-layer .sb-cust-table tr[data-move] select,
#sb-form-layer .sb-cust-table tr[data-move] textarea{cursor:auto}
#sb-form-layer .sb-move,#sb-cust-table .sb-move{width:18px;height:18px;margin:0 6px 0 0;padding:0;border:0;cursor:grab;vertical-align:middle;background:transparent;background-image:radial-gradient(#5d6a75 1.15px,transparent 1.3px);background-size:6px 6px;background-position:center;touch-action:none;position:relative;z-index:2;pointer-events:auto}
#sb-form-layer #sb-cust-preview .sb-section{position:relative;margin:0 0 8px}
#sb-form-layer #sb-cust-preview .sb-section>.sb-move{position:absolute;left:-16px;top:2px;margin:0}
#sb-form-layer #sb-cust-preview .sb-fact,#sb-form-layer #sb-cust-preview th,#sb-form-layer #sb-cust-preview .total-row,#sb-form-layer #sb-cust-preview .sb-party-box,#sb-form-layer #sb-cust-preview .sb-behalf{position:relative}
#sb-form-layer #sb-cust-preview .sb-drop{outline:2px solid #0c2340;outline-offset:1px}
#sb-form-layer .sb-inv-paper[data-header-align="center"] .sb-fact,#sb-form-layer .sb-inv-paper[data-header-align="center"] .sb-fact span,#sb-form-layer .sb-inv-paper[data-header-align="center"] .sb-fact b{text-align:center !important}
#sb-form-layer .sb-inv-paper[data-header-align="right"] .sb-fact,#sb-form-layer .sb-inv-paper[data-header-align="right"] .sb-fact span,#sb-form-layer .sb-inv-paper[data-header-align="right"] .sb-fact b{text-align:right !important}
#sb-form-layer .sb-inv-paper[data-header-case="typed"] .sb-fact span{text-transform:none !important}
#sb-form-layer .sb-inv-paper[data-heading-case="upper"] .sb-inv-grid th{text-transform:uppercase}
#sb-form-layer .sb-inv-paper[data-heading-weight="normal"] .sb-inv-grid th{font-weight:500 !important}
#sb-form-layer .sb-inv-paper[data-footer-align="center"] .sb-doc-notes{text-align:center}
#sb-form-layer .sb-inv-paper[data-footer-align="right"] .sb-doc-notes{text-align:right}
.sb-cust-arrange{margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid #e6edf4}
.sb-cust-paper{background:#fff;color:#111;padding:16px 18px;font-family:Arial,Helvetica,sans-serif;font-size:11px;border:1px solid #c5d0da;box-shadow:0 1px 4px rgba(16,32,48,.06);overflow:hidden}
.sb-cust-paper[data-orient="landscape"]{min-height:280px}
.sb-cust-doc-title{text-align:right;margin:0 0 10px;font-size:18px;letter-spacing:.02em}
.sb-cust-top{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px;align-items:flex-start}
.sb-cust-box{border:1px solid #1b2836;padding:8px 10px;min-width:0;flex:1;min-height:64px}
.sb-cust-box b{display:block;font-size:10px;letter-spacing:.04em;text-transform:uppercase;margin-bottom:4px}
.sb-cust-box p{margin:0;line-height:1.35}
.sb-cust-bank{font-size:10px}
.sb-cust-meta,.sb-cust-lines,.sb-cust-totals{width:100%;border-collapse:collapse;margin:8px 0;table-layout:auto}
.sb-cust-meta th,.sb-cust-meta td,.sb-cust-lines th,.sb-cust-lines td,.sb-cust-totals td{border:1px solid #1b2836;padding:4px 6px;white-space:normal;word-break:normal}
.sb-cust-lines{font-size:10px}
.sb-cust-lines td:nth-child(n+5),.sb-cust-meta td{text-align:right}
.sb-cust-lines td:nth-child(-n+4),.sb-cust-lines th:nth-child(-n+4){text-align:left}
html body #app .center-split{grid-template-columns:minmax(220px,320px) minmax(0,1fr);gap:0;min-width:0;min-height:calc(100vh - 150px);border:1px solid #d5dee8;border-radius:10px;overflow:hidden;background:#fff}
html body #app .center-split:has(> .sb-split-grip){grid-template-columns:320px 8px minmax(0,1fr)}
html body #app .center-split > .panel{min-width:0;overflow:auto;background:#fff}
html body #app .sb-split-grip{cursor:col-resize;background:#d5dee8;position:relative;min-width:8px}
html body #app .sb-split-grip::after{content:'';position:absolute;top:0;bottom:0;left:-5px;right:-5px}
html[data-theme="dark"] body #app .sb-split-grip{background:var(--line,#263d55)}
/* One column: styles.css switches this page to one column at 1100px and below (with !important), so this must use
   the same width. There the list sits above the details, the drag handle between them has no use and used to show
   as a large empty light block, and the list no longer stretches to fill the screen. */
@media (max-width:1100px){
html body #app .center-split,html body #app .center-split:has(> .sb-split-grip){grid-template-columns:minmax(0,1fr);min-height:0;align-content:start}
html body #app .center-split > .sb-split-grip{display:none}
html body #app .center-list{border-right:0;border-bottom:1px solid var(--line,#d5dee8)}
}
html body #app .center-list,html body #app .center-detail{border:0;border-radius:0;min-height:0}
html body #app .center-list{border-right:1px solid #d5dee8;background:#f7f9fb}
html body #app .center-detail{display:flex;flex-direction:column;background:#fff}
html body #app .center-list-rows{max-height:none;flex:1}
html body #app .sb-paybills-bar,html body #app .sb-paybills-pay{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin:0 0 10px}
html body #app .sb-paybills-pay{margin-top:10px;padding:10px 12px;background:#fff;border:1px solid #d5dee8;border-radius:8px}
html body #app .sb-paybills-bar label,html body #app .sb-paybills-pay label{display:flex;gap:6px;align-items:center;font-size:13px}
html body #app .sb-paybills .table-wrap{overflow:auto}
html body #app .sb-paybills-table{width:max-content !important;min-width:100% !important;max-width:none !important;table-layout:auto}
html body #app .sb-paybills-table :is(th,td){overflow:visible !important;max-width:none !important}
html body #app .sb-paybills-table .num,html body #app .sb-paybills-table tfoot td{text-align:right;white-space:nowrap;min-width:8.5rem}
html body #app .sb-paybills-table tfoot td{font-weight:700;border-top:2px solid #1b2836}
html body #app .sb-paybills-table input[type="number"]{width:8.5rem;min-width:8.5rem;text-align:right}
html body #app .sb-paybills-table .sb-pay-actions{white-space:nowrap}
html body #app .sb-paybills-table .sb-pay-actions .btn{margin-right:6px}
html body #app .sb-paybills-pay strong{margin-left:auto;font-size:16px}
#modal-root .sb-bill-amt{position:sticky;right:0;background:#fff;text-align:right;white-space:nowrap;font-weight:700;z-index:1}
#modal-root td.po-line-amount,#modal-root th.po-line-amount{white-space:nowrap !important;overflow:visible !important;text-align:right !important;font-variant-numeric:tabular-nums;font-weight:700}
#modal-root thead .sb-bill-amt{background:#f4f6f8}
#modal-root .sb-bill-total{margin:8px 0 0;text-align:right;font-size:15px}
html body #app .center-detail>.center-actions{padding:10px 12px;border-bottom:1px solid #e5e7eb;background:#fff}
html body #app .center-party{display:flex;justify-content:space-between;align-items:center;gap:8px}
html body #app .center-party b{min-width:0;white-space:normal;text-align:left}
html body #app .center-party em{font-style:normal;font-weight:700;white-space:nowrap}
html body #app .center-tabbar{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #d5dee8}




html body #app .center-detail-body{overflow:auto;flex:1;min-width:0}
html body[data-auth-state="authenticated"] #app .center-ledger{max-width:100%;overflow-x:auto}
html body[data-auth-state="authenticated"] #app .center-ledger table:not(.sb-user-cols){width:100%;table-layout:auto}
html body[data-auth-state="authenticated"] #app .center-ledger table:not(.sb-user-cols) :is(th,td){white-space:nowrap;vertical-align:middle}
.sb-cust-foot{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin-top:8px}
.sb-cust-note{max-width:46%;margin:0;font-size:10px}
.sb-cust-totals{width:auto;min-width:180px;margin-left:auto}
.sb-cust-totals td:last-child{text-align:right;white-space:nowrap}
.sb-cust-totals tr.is-total td{font-weight:700}
.sb-cust-page{text-align:center;font-size:10px;margin:8px 0 0}
.sb-cust-radio{display:flex;gap:8px;align-items:center;margin:6px 0}
.sb-cust-print-grid{display:grid;grid-template-columns:1fr 120px 160px;gap:10px;margin:10px 0}
.sb-cust-format{display:grid;gap:16px}
.sb-cust-format h3{margin:0 0 8px;font-size:14px}
.sb-cust-format-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sb-cust-format .sb-cust-line{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:650}
.sb-cust-format .sb-cust-line input,.sb-cust-format .sb-cust-line select{width:100%;box-sizing:border-box;height:34px;padding:0 8px;border:1px solid #c5d0da;border-radius:6px;background:#fff}
.sb-cust-checks{display:flex;flex-wrap:wrap;gap:8px 14px}
.sb-cust-checks label{display:inline-flex;gap:6px;align-items:center;font-size:13px}
.sb-cust-remove{margin-left:8px;padding:2px 8px;font-size:11px}
.sb-cust-table textarea{width:100%;min-width:140px;min-height:64px;box-sizing:border-box}
.sb-cust-add{display:flex;gap:8px;align-items:center;margin:10px 0 4px}
.sb-cust-add input{flex:1;min-width:0;height:34px;padding:0 8px;border:1px solid #c5d0da;border-radius:6px}
.sb-cust-drag{outline:1px dashed #7aa;cursor:move}
.sb-bar-template{display:flex;gap:6px;align-items:end}
html body #modal-root .modal.im-journal-modal{width:min(1100px,96vw);max-width:1100px}
html body #modal-root .im-journal-modal .ja-top{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:end;margin-bottom:8px}
html body #modal-root .im-journal-modal .ja-top .field{margin:0;min-width:140px}
html body #modal-root .im-journal-modal .ja-rate{display:flex;gap:6px;align-items:center}
html body #modal-root .im-journal-modal .ja-rate input{width:64px}
html body #modal-root .im-journal-modal .ja-adj{margin:0 0 6px}
html body #modal-root .im-journal-modal .ja-type{margin:0 0 4px;height:32px}
html body #modal-root .im-journal-modal .ja-totals-row{display:grid;grid-template-columns:minmax(180px,1.4fr) 120px 120px 1fr;gap:8px;align-items:center;padding:6px 8px;border:1px solid var(--books-line,#d5dee8);border-top:0;background:#f4f7fb;font-weight:700}
html body #modal-root .im-journal-modal .ja-totals-row b{text-align:right}
html body #modal-root .im-journal-modal .ja-picked{margin-top:14px;border-top:1px solid var(--books-line,#d5dee8);padding-top:8px}
html body #modal-root .im-journal-modal .ja-picked-bar{display:flex;gap:10px;align-items:center;margin-bottom:6px}
html body #modal-root .im-journal-modal .ja-picked-table{width:100%;border-collapse:collapse;font-size:13px}
html body #modal-root .im-journal-modal .ja-picked-table th,html body #modal-root .im-journal-modal .ja-picked-table td{border:1px solid var(--books-line,#d5dee8);padding:4px 6px}
html body #modal-root .im-journal-modal .ja-picked-table tbody tr{cursor:pointer}
html body #modal-root .im-journal-modal #ja-list-wrap{max-height:180px;overflow:auto}
@media(max-width:900px){.sb-cust-split,.sb-cust-print-grid,.sb-cust-format-grid{grid-template-columns:1fr}}

/* Statements and every printed page stay inside A4 or Letter. Amounts stay on the same row. */
html body #app .financial-statement,
html body .sb-report-result .financial-statement,
html body .sb-report-preview-sheet .financial-statement{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
  box-sizing:border-box !important;
  border-collapse:collapse !important;
}
html body .financial-sheet,
html body #sb-report-output,
html body .sb-paper{
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

html body .sb-report-preview-sheet .financial-sheet,
html body .sb-report-preview-sheet .sb-paper{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}
html body .financial-statement .fs-col-no,
html body .financial-statement .fs-no{
  width:22mm !important;
  white-space:nowrap !important;
}
html body .financial-statement .fs-col-name,
html body .financial-statement .fs-name{
  width:auto !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
html body .financial-statement thead th.num,
html body .financial-statement tbody td.num{
  width:32mm !important;
  max-width:32mm !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  box-sizing:border-box !important;
}
@media print{
  html,body,main,#app,.content,.doc-print,.listpage-paper,.dc-print,.financial-sheet,.sb-paper,.table-wrap,.slipview-slip,.paycenter-tax-cert,.sbpay-letter,.undertaking-paper,.docform-invoice{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow:visible !important;
    height:auto !important;
  }
  body:not(.sb-print-cheque) table{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
  }
  body:not(.sb-print-cheque) th,
  body:not(.sb-print-cheque) td{
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    white-space:normal !important;
    min-width:0 !important;
  }
  body:not(.sb-print-cheque) th.num,
  body:not(.sb-print-cheque) td.num,
  body:not(.sb-print-cheque) .num,
  body:not(.sb-print-cheque) .amount-display{
    white-space:nowrap !important;
    width:28mm !important;
    max-width:34mm !important;
  }
  body:not(.sb-print-cheque) td.sb-col-num,
  body:not(.sb-print-cheque) .total-row b,
  body:not(.sb-print-cheque) .sb-totals-table td:last-child{
    white-space:nowrap !important;
    overflow-wrap:normal !important;
    word-break:keep-all !important;
    width:auto !important;
    max-width:none !important;
  }
  body:not(.sb-print-cheque) tr,
  body:not(.sb-print-cheque) thead,
  body:not(.sb-print-cheque) tfoot{
    break-inside:avoid;
    page-break-inside:avoid;
  }

  /* print containment safety */
  html body main,
  html body #app,
  html body .content,
  html body .doc-print,
  html body .dc-print,
  html body .listpage-paper,
  html body .docform-invoice,
  html body .undertaking-paper,
  html body .slipview-slip,
  html body .paycenter-tax-cert,
  html body .sbpay-letter,
  html body .financial-sheet,
  html body .sb-paper{
    box-sizing:border-box !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  html body .doc-print img,
  html body .dc-print img,
  html body .listpage-paper img,
  html body .docform-invoice img,
  html body .undertaking-paper img,
  html body .slipview-slip img,
  html body .paycenter-tax-cert img,
  html body .sbpay-letter img,
  html body .financial-sheet img,
  html body .sb-paper img,
  html body .doc-print svg,
  html body .dc-print svg,
  html body .listpage-paper svg,
  html body .docform-invoice svg{
    max-width:100% !important;
    height:auto;
  }

  html body .doc-print table,
  html body .dc-print table,
  html body .listpage-paper table,
  html body .docform-invoice table,
  html body .undertaking-paper table,
  html body .slipview-slip table,
  html body .paycenter-tax-cert table,
  html body .sbpay-letter table,
  html body .financial-sheet table,
  html body .sb-paper table{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  html body .doc-print th,
  html body .doc-print td,
  html body .dc-print th,
  html body .dc-print td,
  html body .listpage-paper th,
  html body .listpage-paper td,
  html body .docform-invoice th,
  html body .docform-invoice td,
  html body .financial-sheet th,
  html body .financial-sheet td,
  html body .sb-paper th,
  html body .sb-paper td{
    max-width:100% !important;
    overflow-wrap:break-word;
    word-break:normal;
  }

  html body .sb-col-desc,
  html body .col-description,
  html body td:has(small),
  html body td:has(br){
    white-space:normal !important;
    overflow-wrap:break-word !important;
    word-break:normal !important;
  }

}


/* CUSTOMER_COMPACT_LAYOUT_START */

/* Reduce spacing between the customer toolbar and panel */
html body #app.route-customers .center-center {
    gap: 6px !important;
}

/* Remove the extra padding above the action buttons */
html body #app.route-customers .center-detail {
    padding: 0 !important;
}

/* Compact, responsive customer action buttons */
html body #app.route-customers .center-detail > .center-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 6px 10px !important;
    margin: 0 !important;
}

html body #app.route-customers .center-actions .btn {
    margin: 0 !important;
    min-height: 34px;
    padding: 5px 11px !important;
    white-space: nowrap;
}

/* Bring the transaction tabs closer to the buttons */
html body #app.route-customers .center-tabbar {
    margin: 0 !important;
    padding: 0 10px !important;
    gap: 4px !important;
}



/* Tighten spacing above the transaction table */
html body #app.route-customers .center-detail-body {
    padding-top: 4px !important;
}

/* CUSTOMER_COMPACT_LAYOUT_END */

/* Dark pages are already navy, so the brand control is a light navy fill with navy text. */
html[data-theme="dark"] body[data-auth-state="authenticated"]{
  --books-green:#d6e6f7;
  --books-green-dark:#b7cce6;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] #app .btn.primary,
html[data-theme="dark"] body[data-auth-state="authenticated"] #app .sbpay-run,
html[data-theme="dark"] body[data-auth-state="authenticated"] aside.sidebar .create-btn{
  background:#16365c !important;
  border-color:#63829e !important;
  color:#fff !important;
}
html[data-theme="dark"] body[data-auth-state="authenticated"] aside.sidebar{
  background:#061018 !important;
  background-image:none !important;
  border-right:1px solid #2a4560 !important;
  color:#fff !important;
}
html body img.brandmark,
html body img.esb-top-logo,
html[data-theme="dark"] body aside.sidebar .brandmark{
  background:var(--esb-logo-background,transparent) !important;
  box-shadow:var(--esb-logo-shadow,none) !important;
}
/* Form customization stays in the current workspace. */
#sb-form-layer {
  width: min(1280px, calc(100vw - 32px));
  height: min(860px, calc(100dvh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #d5dee8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(12, 35, 64, .3);
}
#sb-form-layer::backdrop { background: rgba(12, 35, 64, .4); }
#sb-form-layer .sb-form-win { min-height: 0; height: 100%; }
#sb-form-layer .sb-cust-head { flex-wrap: wrap; }
#sb-form-layer .sb-form-win-foot { flex-wrap: wrap; }
@media (max-width: 900px) {
  #sb-form-layer .sb-cust-split { overflow: auto; grid-template-rows: auto auto; }
  #sb-form-layer .sb-cust-grip { display: none; }
  #sb-form-layer .sb-cust-edit, #sb-form-layer .sb-cust-view { overflow: visible; }
}

/* Standard journal grid: account width is independent of the line number. */
html body #modal-root .im-journal-modal .ja-table th:nth-child(1){width:44px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-account{width:280px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-amt,
html body #modal-root .im-journal-modal .ja-table td.ja-amt{width:120px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-description{width:auto !important}
html body #modal-root .im-journal-modal .ja-table th.ja-party{width:200px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-dim,
html body #modal-root .im-journal-modal .ja-table td.ja-dim{width:150px !important}
html body #modal-root .im-journal-modal .ja-table th.ja-action{width:40px !important}
html body #modal-root .im-journal-modal .ja-table-wrap{max-height:360px;border:1px solid var(--line,#d5dee8);border-radius:6px}
html body #modal-root .im-journal-modal .ja-table th{position:sticky;top:0;z-index:2;background:var(--panel,#f4f7fb);white-space:nowrap}
html body #modal-root .im-journal-modal #ja-lines td{padding:5px 6px !important}
html body #modal-root .im-journal-modal #ja-lines input,
html body #modal-root .im-journal-modal #ja-lines select,
html body #modal-root .im-journal-modal #ja-lines .sb-search-select-input{height:36px !important;min-height:36px !important;padding-top:6px !important;padding-bottom:6px !important;font-size:13px !important;border-radius:4px !important}
html body #modal-root .im-journal-modal #ja-lines .ja-sr{text-align:center;color:var(--muted,#667085);font-size:12px;font-variant-numeric:tabular-nums}
html body #modal-root .im-journal-modal #ja-lines .ja-amt input{font-variant-numeric:tabular-nums}
html body #modal-root .im-journal-modal .ja-remove-line{display:block;width:28px;height:28px;min-width:0;padding:0;border:0;border-radius:4px;background:transparent;color:var(--muted,#667085);font-size:20px;cursor:pointer}
html body #modal-root .im-journal-modal .ja-remove-line:hover{background:var(--line,#e5e7eb);color:var(--ink,#182333)}
html body #modal-root .im-journal-modal .ja-line-tools{display:flex;gap:8px;margin:10px 0}
html body #modal-root .im-journal-modal .ja-totals-row{grid-template-columns:minmax(80px,1fr) 120px 120px minmax(140px,1fr);background:var(--panel,#f4f7fb);color:var(--ink,#182333);border-top:1px solid var(--line,#d5dee8);border-radius:6px}
html body #modal-root .im-journal-modal .ja-picked-bar{flex-wrap:wrap}
@media(max-width:600px){html body #modal-root .im-journal-modal .ja-totals-row{grid-template-columns:1fr 1fr;gap:10px}html body #modal-root .im-journal-modal .ja-totals-row b{text-align:left}}

html body #modal-root .im-journal-modal #ja-lines{display:table !important}
html body #modal-root .im-journal-modal #ja-lines thead{display:table-header-group !important}
html body #modal-root .im-journal-modal #ja-lines tbody{display:table-row-group !important}
html body #modal-root .im-journal-modal #ja-lines tr{display:table-row !important}
html body #modal-root .im-journal-modal #ja-lines th,
html body #modal-root .im-journal-modal #ja-lines td{display:table-cell !important}
html body #modal-root .im-journal-modal #ja-lines th.ja-description{width:200px !important}
html body #modal-root .im-journal-modal #ja-lines td:before{display:none !important}
html body #modal-root .im-journal-modal #ja-lines input{border:1px solid var(--line,#cbd5e1) !important;background:var(--panel,#fff);color:var(--ink,#182333)}

html body :is(#app,#modal-root) table input[type="date"],
html body :is(#app,#modal-root) table input[type="datetime-local"],
html body :is(#app,#modal-root) table input[type="month"]{
  position:relative !important;
}
html body :is(#app,#modal-root) table input[type="date"]::-webkit-calendar-picker-indicator,
html body :is(#app,#modal-root) table input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html body :is(#app,#modal-root) table input[type="month"]::-webkit-calendar-picker-indicator{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  opacity:0;
  cursor:pointer;
  background:transparent;
}
html body :is(#app,#modal-root) table td.col-item_code .sb-search-select:after,
html body :is(#app,#modal-root) table td.sb-align-code .sb-search-select:after,
html body :is(#app,#modal-root) table td:has(select[data-line="item_id"]) .sb-search-select:after,
html body :is(#app,#modal-root) table td:has(select[data-order-ref-item]) .sb-search-select:after{
  content:none !important;
  display:none !important;
}
html body :is(#app,#modal-root) table td.col-item_code select,
html body :is(#app,#modal-root) table td.sb-align-code select,
html body :is(#app,#modal-root) table select[data-line="item_id"],
html body :is(#app,#modal-root) table select[data-order-ref-item]{
  background-image:none !important;
  padding-right:8px !important;
}
html body :is(#app,#modal-root) table td.col-item_code .sb-search-select-input,
html body :is(#app,#modal-root) table td.sb-align-code .sb-search-select-input,
html body :is(#app,#modal-root) table td:has(select[data-line="item_id"]) .sb-search-select-input{
  padding-right:8px !important;
}

/* Registers share one compact vertical rhythm; the table owns its panel. */
html body[data-auth-state="authenticated"] #app .commercial-register{gap:8px!important;align-content:start!important}
html body[data-auth-state="authenticated"] #app .commercial-register-summary{margin:0!important}
html body[data-auth-state="authenticated"] #app .commercial-register-head{margin:0!important;padding:8px 10px!important}
html body[data-auth-state="authenticated"] #app .commercial-register>.panel{margin:0!important;padding:0!important;min-height:0!important}
html body[data-auth-state="authenticated"] #app .commercial-register .table-wrap{margin:0!important;padding:0!important}
html body[data-auth-state="authenticated"] #app .commercial-register table.sb-user-cols tbody td{padding:8px 10px!important;height:auto!important}

/* Module navigation uses a native company picker, not a decorative arrow. */
html body #app .esb-mod-section select[data-open-module]{appearance:auto!important;display:block!important;position:static!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;width:100%!important;min-width:180px!important;max-width:100%!important;height:34px!important;min-height:34px!important;padding:4px 8px!important;background:var(--panel,#fff)!important;color:var(--ink,#0c2340)!important;border:1px solid var(--line,#ccd5df)!important;background-image:none!important}

/* Company formats owns its columns; summaries and actions never overlap. */
html body #app table.esb-company-formats{width:100%!important;min-width:720px!important;table-layout:fixed!important}
html body #app table.esb-company-formats :is(th,td){width:auto!important;min-width:0!important;max-width:none!important;padding:10px 12px!important;white-space:normal!important;overflow-wrap:anywhere!important;vertical-align:middle!important}
html body #app table.esb-company-formats td.esb-co-actions .btn{display:inline-flex!important;max-width:100%!important;white-space:normal!important;margin:3px!important;font-size:12px!important;padding:6px 9px!important;min-height:32px!important;height:auto!important}

/* Template editor page sizing and discoverable drag handles. Print markup is untouched. */
#sb-form-layer #sb-cust-preview .sb-inv-paper:not(.sb-free){width:210mm !important;min-width:210mm !important;box-sizing:border-box !important}
#sb-form-layer #sb-cust-preview .sb-inv-paper[data-orientation="landscape"]:not(.sb-free){width:297mm !important;min-width:297mm !important}
#sb-form-layer #sb-cust-preview table.sb-inv-grid{table-layout:fixed !important;width:100% !important;min-width:0 !important}
#sb-form-layer #sb-cust-preview table.sb-inv-grid :is(th,td){white-space:normal !important;overflow-wrap:anywhere !important;word-break:normal !important;min-width:0 !important}
#sb-form-layer #sb-cust-preview [data-place]{outline:1px dashed #9baec4;touch-action:none}
#sb-form-layer #sb-cust-preview .sb-place-size{opacity:1;background:#dbeafe;min-width:12px;min-height:12px;touch-action:none}
#sb-form-layer #sb-cust-preview table.sb-inv-grid th{position:relative !important}
#sb-form-layer #sb-cust-preview .sb-column-size{position:absolute;right:0;top:0;bottom:0;width:7px;min-width:7px;padding:0;border:0;background:#2563eb55;cursor:col-resize;z-index:6;touch-action:none}
#sb-form-layer #sb-cust-preview .sb-inv-paper[data-paper="Letter"]:not(.sb-free){width:216mm !important;min-width:216mm !important}
#sb-form-layer #sb-cust-preview .sb-inv-paper[data-paper="Letter"][data-orientation="landscape"]:not(.sb-free){width:279mm !important;min-width:279mm !important}

/* The paper designer is a light editing surface in either workspace theme.
   Keep this local to the dialog: page-order labels inherit the dialog color. */
html body[data-auth-state] dialog#sb-form-layer {
  color-scheme:light !important;
  color:#172b45 !important;
  background:#fff !important;
  --books-ink:#172b45;
  --books-muted:#475569;
  --books-panel:#fff;
  --books-line:#cbd5e1;
}
html body[data-auth-state] #sb-form-layer .sb-form-win :not(:where(#sb-cust-preview,#sb-cust-preview *)) {
  color:#172b45 !important;
  -webkit-text-fill-color:currentColor !important;
  color-scheme:light !important;
}
html body[data-auth-state] #sb-form-layer .sb-form-win :is(input,select,textarea,button,.sb-cust-table,.sb-cust-table tr,.sb-cust-table th,.sb-cust-table td) {
  background-color:#fff !important;
  border-color:#cbd5e1 !important;
}
html body[data-auth-state] #sb-form-layer .sb-form-win :is(input,textarea)::placeholder {
  color:#475569 !important;
  -webkit-text-fill-color:#475569 !important;
  opacity:1 !important;
}

html body[data-auth-state] #sb-form-layer .sb-form-win #sb-form-ok {
  background-color:#12324c !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

html body[data-auth-state] #sb-form-layer .sb-form-win .sb-form-win-bar span {
  color:#9a3412 !important;
}
html body[data-auth-state] #sb-form-layer .sb-form-win :is(.sb-place-size,.sb-column-size) {
  background-color:#bfdbfe !important;
  border-color:#12324c !important;
}
html body[data-auth-state] #sb-form-layer .sb-form-win select {
  appearance:auto !important;
  background-image:none !important;
  padding-right:8px !important;
}

/* Free placement uses a single containing block: the measured paper. */
#sb-form-layer #sb-cust-preview .sb-inv-paper.sb-free{position:relative !important}
#sb-form-layer #sb-cust-preview .sb-inv-paper.sb-free :is(.sb-section,.print-title,.sb-inv-head,.sb-inv-parties,.print-parties,.sb-inv-facts,.sb-doc-foot,.sb-doc-notes,.totals:not([data-place]),.print-signatures){display:contents !important;position:static !important}
#sb-form-layer #sb-cust-preview .sb-inv-paper.sb-free [data-place]{position:absolute !important;margin:0 !important;box-sizing:border-box !important;max-width:none !important}
#sb-form-layer #sb-cust-preview .sb-inv-paper :is(.sb-note,.sb-company-top){display:flow-root !important}
#sb-form-layer .sb-cust-preview-label{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
#sb-form-layer .sb-cust-preview-label [data-reset-positions]{padding:5px 8px;font-size:12px}

/* Shared screen refinements; document paper and print styles retain their owners. */
@media screen {
  html body[data-auth-state="authenticated"] :is(#app,#modal-root) :is(button,a,input,select,textarea):focus-visible{
    outline:2px solid #178c96 !important;outline-offset:3px;
  }
  html body[data-auth-state="authenticated"] #app :is(.panel,.form-card,.esb-dash-card){
    box-shadow:0 4px 18px -12px rgba(12,35,64,.2) !important;
  }
  html body[data-auth-state="authenticated"] #app .panel>.table-wrap{border-radius:0 0 var(--books-radius) var(--books-radius) !important}
  html body[data-auth-state="authenticated"] #modal-root .modal:not(.presentation-studio){border:1px solid var(--books-line);border-radius:14px;box-shadow:0 24px 80px rgba(4,18,34,.28)}
  html body[data-auth-state="authenticated"] #modal-root :is(.modal-head,.modal-foot){border-color:var(--books-line)}
  html body[data-auth-state="authenticated"] #app .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="file"]),select,textarea){border-radius:8px}
  html body[data-auth-state="authenticated"] .topbar .sb-search{border-radius:8px}
}
@media screen and (min-width:1001px){
  html body[data-auth-state="authenticated"] header.topbar{min-height:64px;padding:12px 24px !important}
}
@media screen and (max-width:1000px){
  html body[data-auth-state="authenticated"] #app.content:not(:has(.presentation-studio)){padding:14px 12px 24px !important}
}
@media screen and (max-width:600px){
  html body[data-auth-state="authenticated"] #app.content:not(:has(.presentation-studio)){padding:12px 10px 24px !important}
}

/* Payroll uses shared module chrome and respects focused workflows. */
html body[data-auth-state="authenticated"] #app .sbpay > .page-actions[hidden]{display:none !important}
html body[data-auth-state="authenticated"] #app .sbpay-runpage{margin:0;padding:16px 0;min-height:0;background:transparent}
html body[data-auth-state="authenticated"] #app .sbpay-dates > div{min-width:0;flex:1 1 220px}
html body[data-auth-state="authenticated"] #app .sbpay-dates > div > small{display:block;margin-top:6px;max-width:48ch;line-height:1.5}
html body[data-auth-state="authenticated"] #app .sbpay-stick{position:static;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:12px;margin-top:20px;padding:16px 0 0;background:transparent;border-color:var(--books-line)}
html body[data-auth-state="authenticated"] #app .sbpay-stick > span:last-child{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}

/* General entry uses the main workspace, with its own persistent actions. */

html body #app .journal-entry-page .modal-body{
  overflow:auto !important;
}

html body #app .journal-entry-page .ja-head-fields{
  display:grid !important;
  grid-template-columns:200px 220px minmax(220px, 1fr) !important;
  gap:14px 16px !important;
  align-items:end !important;
  margin:0 0 12px !important;
  overflow:visible !important;
}

html body #app .journal-entry-page .ja-head-fields .field.ja-flags{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:12px !important;
  min-height:38px !important;
}

html body #app .journal-entry-page .ja-head-fields .field.ja-flags select{
  width:160px !important;
  flex:0 0 160px !important;
}

html body #app .journal-entry-page .ja-memo-block{
  margin:12px 0 0 !important;
}

html body #app .journal-entry-page .ja-memo-block textarea{
  width:100% !important;
  min-height:64px !important;
  height:auto !important;
  resize:vertical !important;
}

html body #app .journal-entry-page .ja-head-fields .field{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  align-self:start !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
  position:static !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
}

html body #app .journal-entry-page .ja-head-fields .field label{
  display:block !important;
  position:static !important;
  top:auto !important;
  left:auto !important;
  transform:none !important;
  height:auto !important;
  width:auto !important;
  margin:0 0 6px !important;
  padding:0 !important;
  line-height:1.3 !important;
  font-size:12px !important;
  font-weight:650 !important;
  background:transparent !important;
  overflow:visible !important;
  z-index:auto !important;
}

html body #app .journal-entry-page .ja-head-fields .field input:not([type="checkbox"]):not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="time"]),
html body #app .journal-entry-page .ja-head-fields .field select{
  width:100% !important;
  min-width:0 !important;
  min-height:38px !important;
  height:38px !important;
  margin:0 !important;
  position:static !important;
  box-sizing:border-box !important;
}

html body #app .journal-entry-page .ja-hint{
  margin:0 0 10px !important;
}

html body #app .journal-entry-page .ja-table-wrap{
  overflow:auto !important;
}

html body #app .journal-entry-page .ja-table{
  width:100% !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
}

html body #app .journal-entry-page .ja-table th{
  text-align:left !important;
  font-size:11px !important;
  letter-spacing:.04em !important;
  text-transform:uppercase !important;
  padding:8px 6px !important;
}

html body #app .journal-entry-page .ja-table th:nth-child(1){width:36px !important}

html body #app .journal-entry-page .ja-table th.ja-amt,
html body #app .journal-entry-page .ja-table td.ja-amt{width:108px !important;text-align:right !important}

html body #app .journal-entry-page .ja-table th.ja-dim,
html body #app .journal-entry-page .ja-table td.ja-dim{width:140px !important}

html body #app .journal-entry-page .ja-cat-fields{
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap:14px 16px !important;
  margin:0 0 12px !important;
}

html body #app .journal-entry-page .ja-cat-fields .field{
  display:flex !important;
  flex-direction:column !important;
  margin:0 !important;
}

html body #app .journal-entry-page .ja-cat-fields .field label{
  display:block !important;
  position:static !important;
  margin:0 0 6px !important;
  font-size:12px !important;
  font-weight:650 !important;
}

html body #app .journal-entry-page .ja-cat-fields select{
  width:100% !important;
  min-height:38px !important;
}

html body #app .journal-entry-page #ja-lines [data-ja-debit],
html body #app .journal-entry-page #ja-lines [data-ja-credit]{text-align:right !important}

html body #app .journal-entry-page #ja-lines select.ja-name-need{border-color:#b42318 !important}

html body #app .journal-entry-page .ja-table td{
  padding:4px 6px !important;
  vertical-align:middle !important;
}

html body #app .journal-entry-page #ja-lines select,
html body #app .journal-entry-page #ja-lines input{
  width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

html body #app .journal-entry-page .ja-under-table{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  margin-top:10px !important;
}

html body #app .journal-entry-page .ja-totals{
  margin-left:auto !important;
  display:flex !important;
  gap:16px !important;
  font-weight:700 !important;
}

  html body #app .journal-entry-page .ja-head-fields{
    grid-template-columns:1fr !important;
  }

html body #app .journal-entry-page .ja-top{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:end;margin-bottom:8px}

html body #app .journal-entry-page .ja-top .field{margin:0;min-width:140px}

html body #app .journal-entry-page .ja-rate{display:flex;gap:6px;align-items:center}

html body #app .journal-entry-page .ja-rate input{width:64px}

html body #app .journal-entry-page .ja-adj{margin:0 0 6px}

html body #app .journal-entry-page .ja-type{margin:0 0 4px;height:32px}

html body #app .journal-entry-page .ja-totals-row{display:grid;grid-template-columns:minmax(180px,1.4fr) 120px 120px 1fr;gap:8px;align-items:center;padding:6px 8px;border:1px solid var(--books-line,#d5dee8);border-top:0;background:#f4f7fb;font-weight:700}

html body #app .journal-entry-page .ja-totals-row b{text-align:right}

html body #app .journal-entry-page .ja-picked{margin-top:14px;border-top:1px solid var(--books-line,#d5dee8);padding-top:8px}

html body #app .journal-entry-page .ja-picked-bar{display:flex;gap:10px;align-items:center;margin-bottom:6px}

html body #app .journal-entry-page .ja-picked-table{width:100%;border-collapse:collapse;font-size:13px}

html body #app .journal-entry-page .ja-picked-table th,html body #app .journal-entry-page .ja-picked-table td{border:1px solid var(--books-line,#d5dee8);padding:4px 6px}

html body #app .journal-entry-page .ja-picked-table tbody tr{cursor:pointer}

html body #app .journal-entry-page #ja-list-wrap{max-height:180px;overflow:auto}


/* Standard journal grid: account width is independent of the line number. */
html body #app .journal-entry-page .ja-table th:nth-child(1){width:44px !important}

html body #app .journal-entry-page .ja-table th.ja-account{width:280px !important}

html body #app .journal-entry-page .ja-table th.ja-amt,
html body #app .journal-entry-page .ja-table td.ja-amt{width:120px !important}

html body #app .journal-entry-page .ja-table th.ja-description{width:auto !important}

html body #app .journal-entry-page .ja-table th.ja-party{width:200px !important}

html body #app .journal-entry-page .ja-table th.ja-dim,
html body #app .journal-entry-page .ja-table td.ja-dim{width:150px !important}

html body #app .journal-entry-page .ja-table th.ja-action{width:40px !important}

html body #app .journal-entry-page .ja-table-wrap{max-height:360px;border:1px solid var(--line,#d5dee8);border-radius:6px}

html body #app .journal-entry-page .ja-table th{position:sticky;top:0;z-index:2;background:var(--panel,#f4f7fb);white-space:nowrap}

html body #app .journal-entry-page #ja-lines td{padding:5px 6px !important}

html body #app .journal-entry-page #ja-lines input,
html body #app .journal-entry-page #ja-lines select,
html body #app .journal-entry-page #ja-lines .sb-search-select-input{height:36px !important;min-height:36px !important;padding-top:6px !important;padding-bottom:6px !important;font-size:13px !important;border-radius:4px !important}

html body #app .journal-entry-page #ja-lines .ja-sr{text-align:center;color:var(--muted,#667085);font-size:12px;font-variant-numeric:tabular-nums}

html body #app .journal-entry-page #ja-lines .ja-amt input{font-variant-numeric:tabular-nums}

html body #app .journal-entry-page .ja-remove-line{display:block;width:28px;height:28px;min-width:0;padding:0;border:0;border-radius:4px;background:transparent;color:var(--muted,#667085);font-size:20px;cursor:pointer}

html body #app .journal-entry-page .ja-remove-line:hover{background:var(--line,#e5e7eb);color:var(--ink,#182333)}

html body #app .journal-entry-page .ja-line-tools{display:flex;gap:8px;margin:10px 0}

html body #app .journal-entry-page .ja-totals-row{grid-template-columns:minmax(80px,1fr) 120px 120px minmax(140px,1fr);background:var(--panel,#f4f7fb);color:var(--ink,#182333);border-top:1px solid var(--line,#d5dee8);border-radius:6px}

html body #app .journal-entry-page .ja-picked-bar{flex-wrap:wrap}
html body #app .journal-entry-page .ja-totals-row{grid-template-columns:1fr 1fr;gap:10px}
html body #app .journal-entry-page .ja-totals-row b{text-align:left}


html body #app .journal-entry-page #ja-lines{display:table !important}

html body #app .journal-entry-page #ja-lines thead{display:table-header-group !important}

html body #app .journal-entry-page #ja-lines tbody{display:table-row-group !important}

html body #app .journal-entry-page #ja-lines tr{display:table-row !important}

html body #app .journal-entry-page #ja-lines th,
html body #app .journal-entry-page #ja-lines td{display:table-cell !important}

html body #app .journal-entry-page #ja-lines th.ja-description{width:200px !important}

html body #app .journal-entry-page #ja-lines td:before{display:none !important}

html body #app .journal-entry-page #ja-lines input{border:1px solid var(--line,#cbd5e1) !important;background:var(--panel,#fff);color:var(--ink,#182333)}
#app .journal-entry-page{width:100%;min-width:0}
#app .journal-page-actions,#app .journal-page-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 0;background:var(--panel);color:var(--ink)}
#app .journal-page-actions{position:sticky;top:0;z-index:5;border-bottom:1px solid var(--line);margin-bottom:18px}
#app .journal-page-actions>div{display:flex;gap:8px;flex-wrap:wrap}
#app .journal-page-actions small{display:block;font-size:12px;font-weight:400;color:var(--muted)}
#app .journal-page-footer{position:sticky;bottom:0;z-index:4;justify-content:flex-end;border-top:1px solid var(--line);margin-top:18px}
#app .journal-memo{margin-top:16px}#app .journal-memo textarea{width:100%;resize:vertical}
#app .journal-entry-page .ja-top .field{flex:1;max-width:220px}
#app .journal-entry-page .ja-picked-bar select{width:auto;min-width:170px}

/* Column edges resize the journal without replacing the editor controls. */
#app .journal-entry-page #ja-lines th{position:relative}
#app .journal-entry-page #ja-lines .sb-col-resizer{position:absolute;right:0;top:0;bottom:0;width:10px;cursor:col-resize;touch-action:none;z-index:4}
#app .journal-entry-page #ja-lines .sb-col-resizer:after{content:"";position:absolute;right:3px;top:20%;bottom:20%;border-right:1px solid var(--line,#8193a5)}
#app .journal-entry-page #ja-lines input:not([type=hidden]),#app .journal-entry-page #ja-lines .sb-search-select{width:100%;min-width:0;box-sizing:border-box}
#app .journal-entry-page #ja-lines th.ja-description{width:380px!important}

/* Journal selectors stay native: no hidden select/custom-input pair. */
html body #app .journal-entry-page select[data-no-search]{display:block!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;position:static!important;clip:auto!important;clip-path:none!important;max-width:100%!important;width:100%;min-height:36px;padding:7px 30px 7px 9px;border:1px solid var(--line,#8193a5);border-radius:4px;background-color:var(--panel,#fff);color:var(--ink,#182333);font:inherit;cursor:pointer}
html body #app .journal-entry-page #ja-type{width:auto}
html body #app .journal-entry-page .ja-totals-row{grid-template-columns:minmax(80px,1fr) 130px 130px minmax(140px,1fr)}
@media(max-width:600px){html body #app .journal-entry-page .ja-totals-row{grid-template-columns:1fr 1fr}}

/* The visible journal combobox must stay independent of its hidden select. */
html body #app .journal-entry-page .sb-search-select{display:block!important;position:relative!important;width:100%!important;min-width:0!important;visibility:visible!important;opacity:1!important}
html body #app .journal-entry-page .sb-search-select>input.sb-search-select-input{display:block!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;position:relative!important;inset:auto!important;clip:auto!important;clip-path:none!important;width:100%!important;min-width:0!important;max-width:100%!important;height:36px!important;min-height:36px!important;padding:7px 30px 7px 9px!important;border:1px solid var(--line,#8193a5)!important;border-radius:4px!important;background:var(--panel,#fff)!important;color:var(--ink,#182333)!important;font:inherit!important;box-sizing:border-box!important}
html body #app .journal-entry-page .sb-search-select>select{display:none!important;width:0!important;height:0!important;min-height:0!important;pointer-events:none!important}
