/* ===== Layout Fix (override) ===== */
html, body { height: 100%; }
body { overflow: auto !important; }

.app-shell{
  height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 56px 1fr;
  background: #f6f7fb;
}

/* Topbar across full width */
.app-topbar{
  grid-column: 1 / -1;
  grid-row: 1;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Sidebar left */
.app-sidebar{
  grid-column: 1;
  grid-row: 2;
  overflow: auto;
  background: #0f172a;
  color: #fff;
}

/* Main content right */
.app-main{
  grid-column: 2;
  grid-row: 2;
  overflow: auto !important;
  padding: 14px;
  min-width: 0; /* important for tables */
}

/* Mobile: sidebar hidden, main takes full width */
@media (max-width: 991.98px){
  .app-shell{
    grid-template-columns: 1fr;
  }
  .app-sidebar{
    display: none !important;
  }
  .app-main{
    grid-column: 1;
  }
}

/* ===== EMERGENCY VISIBILITY OVERRIDE ===== */
.app-main{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: calc(100vh - 56px) !important;
  overflow: auto !important;
  position: relative !important;
  background: #f6f7fb !important;
  padding: 14px !important;
  z-index: 1 !important;
}

/* ===== Stable Layout Override (BullionSuite) ===== */
html, body { height: 100%; }
body { overflow: hidden; } /* page itself no scroll; only panels scroll */

.app-shell{
  height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 56px 1fr;
  background: #f6f7fb;
}

.app-topbar{
  grid-column: 1 / -1;
  grid-row: 1;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-sidebar{
  grid-column: 1;
  grid-row: 2;
  background: #0f172a;
  color: #fff;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-main{
  grid-column: 2;
  grid-row: 2;
  overflow: auto;
  padding: 14px;
  min-width: 0; /* CRITICAL: prevents blank/collapsed main */
}

/* Mobile: sidebar off, main full width */
@media (max-width: 991.98px){
  body { overflow: auto; }
  .app-shell{
    grid-template-columns: 1fr;
  }
  .app-sidebar{
    display: none !important;
  }
  .app-main{
    grid-column: 1;
    min-width: 0;
  }
}

.app-sidebar{
  width: 240px; /* was probably ~280 */
}

.sb-link.active{
  position: relative;
}

.sb-link.active::before{
  content:'';
  position:absolute;
  left:-8px;
  top:6px;
  bottom:6px;
  width:3px;
  border-radius:2px;
  background:#4f9cff;
}

<style>
/* ---------- SCREEN ---------- */
.receipt-paper{
  max-width: 980px;
  margin: 0 auto;
}

/* ---------- PRINT (A5 one-page) ---------- */
@media print {
  .no-print { display:none !important; }
  .app-sidebar, .app-topbar { display:none !important; }
  body { background:#fff !important; }

  /* Force A5 and tight margins */
  @page { size: A5 portrait; margin: 8mm; }

  /* Remove bootstrap card look */
  .receipt-paper { border:none !important; box-shadow:none !important; padding: 0 !important; }

  /* Reduce spacing */
  hr { margin: 8px 0 !important; }
  .row { --bs-gutter-x: 10px; --bs-gutter-y: 8px; }
  .mb-3, .my-4, .mt-4 { margin: 8px 0 !important; }

  /* Reduce typography */
  .receipt-paper * { line-height: 1.15 !important; }
  .receipt-paper .text-muted { font-size: 11px !important; }
  .receipt-paper div, .receipt-paper span { font-size: 12px !important; }

  /* Key headings */
  .receipt-paper [style*="font-size:22px"] { font-size: 16px !important; }
  .receipt-paper [style*="font-size:20px"] { font-size: 14px !important; }
  .receipt-paper [style*="font-size:18px"] { font-size: 13px !important; }
  .receipt-paper [style*="font-size:22px; font-weight:800"] { font-size: 16px !important; }

  /* Avoid page breaks inside important box/table */
  .avoid-break { break-inside: avoid; page-break-inside: avoid; }
  table { font-size: 11px !important; }
}
</style>


