/* =========================
   Base Layout (BizSuite-like)
   Desktop: fixed sidebar visible + fixed top nav
   Mobile: sidebar off-canvas using transform (NOT left)
   ========================= */

:root{
  --bg:#f8f6f2;
  --card:#ffffff;
  --text:#14211a;
  --muted:#66756d;
  --border:#e5e9e3;

  --afri-green:#145c3a;
  --afri-green-dark:#0d3c27;
  --afri-green-light:#2a8a52;
  --afri-orange:#f5740b;
  --afri-orange-dark:#d95a06;

  --brand-green:var(--afri-green);
  --brand-green-2:var(--afri-green-dark);
  --brand-orange:var(--afri-orange);
  --brand-orange-2:var(--afri-orange-dark);

  --nav-bg:#194d30;
  --nav-bg2:#123b26;
  --accent:var(--brand-orange);
  --focus:rgba(241,130,10,.25);

  --sidebar-bg:var(--brand-green);
  --sidebar-active-bg:rgba(255,255,255,.14);
  --sidebar-active-text:#ffffff;

  --success:#2f9b5c;
  --warning:#d9921d;
  --danger:#d45454;

  --sidebar-w: 280px;
  --nav-h: 56px;
  --radius:14px;
  --radius-sm:12px;
  --shadow-sm:0 8px 20px rgba(16,24,18,.07);
  --shadow:0 16px 36px rgba(16,24,18,.10);
  
  --sidebar-gradient: radial-gradient(circle at 20% 20%, var(--afri-green-light) 0%, var(--afri-green) 40%, var(--afri-green-dark) 100%);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Segoe UI", system-ui, -apple-system, sans-serif;
  color:var(--text);
  background:var(--bg);
}

body,
button,
input,
select,
textarea,
.btn,
.table,
.card,
label,
h1,h2,h3,h4,h5,h6{
  font-family:"Segoe UI", system-ui, -apple-system, sans-serif;
}

/* -------------------------
   Top Navbar - UPDATED: positioned on right column only
   ------------------------- */
.topnav{
  position:fixed;
  top:0;
  left:var(--sidebar-w); /* Start after sidebar */
  width:calc(100% - var(--sidebar-w)); /* Take remaining width */
  height:var(--nav-h);
  background:white; /* White background for workspace area */
  color:var(--text);
  z-index:1200;
  box-shadow:0 2px 8px rgba(0,0,0,0.05);
  border-bottom:1px solid var(--border);
}

.topnav-inner{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text); /* Dark text for brand on white bg */
  font-weight:800;
  letter-spacing:.2px;
}

.brand-badge{
  width:40px; height:40px;
  border-radius:14px;
  background:var(--brand-green);
  border:1px solid transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  overflow:hidden;
}

.brand-logo{
  max-width:30px;
  max-height:30px;
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  filter:brightness(0) invert(1); /* Makes logo white */
}

.nav-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:0;
  background:#f0f3f0;
  color:var(--text);
  font-size:13px;
  white-space:nowrap;
}

.topnav-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 10px;
  border-radius:0;
  background:#f0f3f0;
  color:var(--text);
}

.avatar{
  width:34px;
  height:34px;
  border-radius:0;
  background:var(--brand-green);
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}

/* -------------------------
   Sidebar + Main Layout - UPDATED
   IMPORTANT: Sidebar never uses left:-xxxpx
   ------------------------- */
.layout{
  display:flex;
  min-height:100vh;
}

/* Use an ID to avoid legacy CSS targeting #side */
#app-sidebar.sidebar{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:var(--sidebar-w);
  background:var(--sidebar-gradient) !important;
  border-right:1px solid rgba(245,158,11,0.14);
  overflow:auto;
  z-index:1300;
  box-shadow:none;
  padding:8px 10px 18px;
  display:flex;
  flex-direction:column;
}

#app-sidebar.sidebar::after{
  content:"✦";
  position:absolute;
  right:16px;
  bottom:12px;
  color:var(--afri-orange);
  font-size:18px;
  opacity:.85;
  pointer-events:none;
}

#app-sidebar.sidebar::-webkit-scrollbar{ width:6px; }
#app-sidebar.sidebar::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.18);
  border-radius:0;
}

/* Logo Area - Full width at top */
.sidebar-logo-area {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  text-align: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-logo {
  display: block;
  width: 250px;
  height: 75px;
  object-fit: contain;
  margin: 0 auto;
}

/* Remove the span styling */
.sidebar-logo span {
  display: none;
}

/* Branch Info Card */
.branch-info-card {
  background:transparent;
  border-radius:0;
  padding:0 4px 8px;
  margin:0 0 10px;
  border:0;
  border-bottom:1px solid rgba(245,158,11,.16);
}

.branch-info-card .branch-label {
  color: rgba(255,255,255,0.72);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.branch-info-card .branch-name {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}

.branch-info-card .branch-meta {
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick Actions - Two buttons */
.sidebar-quick-actions {
  padding:0 4px;
  margin-top:14px;
  margin-bottom:0;
}

.sidebar-quick-actions .btn-block {
  width: 100%;
  margin-bottom: 8px;
  padding:10px 12px;
  font-weight: 600;
  font-size:12px;
  text-align: center;
  display: block;
  text-decoration: none;
  border-radius:0;
  transition:all .2s ease;
}

.btn-primary-light {
  background:var(--afri-orange);
  color:#fff;
  border: none;
  box-shadow:none;
}

.btn-primary-light:hover {
  background:var(--afri-orange-dark);
  color:#fff;
}

.btn-outline-light {
  background: transparent;
  border:1px solid rgba(255,255,255,.55);
  color: white;
}

.btn-outline-light:hover {
  background:rgba(245,158,11,.08);
  border-color:rgba(245,158,11,.45);
  color:#fff7ea;
}

/* Navigation Menu */
.sidebar-nav {
  flex:1;
  overflow:visible;
  margin-top:18px;
  padding-top:8px;
  border-top:1px solid rgba(245,158,11,.16);
  padding-bottom:28px;
}

.sidebar .section-title {
  display: none;
}

/* Regular side links */
.side-link{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 10px;
  border-radius:0;
  color:rgba(255,255,255,.94);
  text-decoration:none;
  margin-bottom:2px;
  font-size:13px;
  line-height:1.2;
  user-select:none;
  transition:.18s ease;
  border-left:3px solid transparent;
}
.side-link:hover{
  background:rgba(0,0,0,.18);
  border-left-color:rgba(245,158,11,.7);
}
.side-link.active{
  background:rgba(0,0,0,.34);
  color:var(--sidebar-active-text);
  font-weight:600;
  border-left:3px solid var(--brand-orange);
}

.side-link.active .side-icon,
.nav-item-header:not(.collapsed) .nav-icon{
  color:var(--afri-orange);
}
.side-icon{
  width:16px;
  font-size:13px;
  text-align:center;
  flex-shrink:0;
  opacity:.95;
}

/* Menu items with collapsible functionality */
.nav-item {
  margin-bottom: 2px;
}

/* Add subtle separator between main groups */
.nav-item.group-end {
  margin-bottom: 10px;
  position: relative;
}

.nav-item.group-end::after {
  content: '';
  display: block;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 10px 12px 2px 12px;
}

.nav-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap:12px;
  padding:8px 10px;
  border-radius:0;
  color:rgba(255,255,255,0.9);
  cursor:pointer;
  transition:.18s ease;
  margin-bottom:2px;
  font-size:13px;
  line-height:1.2;
  user-select:none;
  border-left:3px solid transparent;
}

.nav-item-header:hover {
  background:rgba(0,0,0,.18);
  border-left-color:rgba(245,158,11,.7);
}

.nav-item-header .nav-title {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:13px;
  font-weight:500;
}

.nav-item-header .nav-icon {
  width: 16px;
  text-align: center;
}

.nav-item-header:not(.collapsed) {
  background:rgba(0,0,0,.18);
  font-weight: 600;
  border-left-color:rgba(245,158,11,.55);
}

.nav-item-header:not(.collapsed) .collapse-icon {
  transform: rotate(0deg);
}

.nav-item-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.collapse-icon{
  font-size:11px;
  color:var(--afri-orange);
}

/* Submenu */
.nav-submenu {
  padding-left:10px;
  margin:2px 0 6px 28px;
  border-left:1px solid rgba(245,158,11,.22);
}

.nav-submenu .side-link {
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  margin:2px 0;
  border-radius:0;
  font-size:12px;
  color:rgba(255,255,255,0.9);
  cursor:pointer;
  transition:.18s ease;
  border-left:0;
}

.nav-submenu .side-link:hover {
  background: rgba(245,158,11,0.12);
  color:#fff8ef;
}

.nav-submenu .side-link.active {
  background: rgba(0,0,0,.3);
  border-left: 2px solid var(--brand-orange);
  color: white;
  font-weight:600;
}

/* Hide old quick-card */
.quick-card {
  display: none;
}

/* Main content area */
.main{
  flex:1;
  margin-left:var(--sidebar-w); /* desktop space for sidebar */
  padding-top:var(--nav-h);
  position:relative;
  z-index:1;
  background:#F5F6F7; /* Spec background color */
  min-height:100vh;
}

/* Avoid class collisions with legacy ".container" */
.app-container{
  max-width:1400px;
  margin:0 auto;
  padding:12px 22px 24px;
}

/* -------------------------
   Page Header
   ------------------------- */
.page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin:0 0 16px;
}
.page-title h1{
  margin:0;
  font-size:24px;
  font-weight:700;
  letter-spacing:-.02em;
}
.breadcrumb{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
}
.page-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

/* -------------------------
   Cards / Buttons / Badges
   ------------------------- */
.card{
  background:var(--card);
  border:1px solid rgba(20,33,26,.08);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  margin-bottom:14px;
}
.card + .card{ margin-top:14px; }

.card-header{
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:#f7faf8;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.card-header h2{
  margin:0;
  font-size:14px;
  text-transform:none;
  letter-spacing:.01em;
  font-weight:700;
}

.card-body{ padding:16px; }
.card-muted{ color:var(--muted); font-size:13px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 14px;
  border-radius:10px !important;
  border:1px solid transparent;
  text-decoration:none;
  cursor:pointer;
  font-weight:600;
  font-size:13px;
  white-space:nowrap;
  transition:background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-primary{ background:var(--brand-orange); color:#fff; border-color:var(--brand-orange); box-shadow:0 8px 18px rgba(245,116,11,.2); }
.btn-primary:hover{ background:var(--brand-orange-2); border-color:var(--brand-orange-2); color:#fff; }
.btn-outline{ background:#fff; border-color:#d7e0d7; color:#1b2a22; }
.btn-outline:hover{ background:#f7faf6; border-color:#c6d3c8; }
.btn-secondary{ background:#fff; border-color:#d5ddd7; color:#223228; }
.btn-secondary:hover{ background:#f4f8f5; border-color:#c5d0c8; }
.btn-danger{ background:#fff5f5; border-color:#f1c9c9; color:#a23d3d; }
.btn-danger:hover{ filter:brightness(.96); }
.btn-ghost{ background:transparent; border-color:transparent; color:#1b2a22; }
.btn-ghost:hover{ background:#edf2ee; }
.btn-sm{ padding:6px 10px; border-radius:8px !important; font-size:11px; }

.badge{
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  color:#173124;
  letter-spacing:.02em;
}
.badge-success{ background:#dff4e8; color:#1f6a3e; }
.badge-warning{ background:#fff1d8; color:#925c0c; }
.badge-danger{ background:#fee7e7; color:#9b2c2c; }
.badge-info{ background:#e2f0e8; color:#236045; }
.badge-secondary{ background:#eceff2; color:#475467; }

/* -------------------------
   Tables
   ------------------------- */
.table-wrap{ width:100%; overflow:auto; border:1px solid rgba(20,33,26,.08); border-radius:12px; background:#fff; }
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.table th, .table td{
  padding:10px 12px;
  border-bottom:1px solid #eef2ef;
  vertical-align:middle;
  white-space:nowrap;
}
.table th{
  font-size:11px;
  font-weight:700;
  text-align:left;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#4e5d53;
  background:#f7faf8;
  border-bottom:1px solid #dde6df;
  position:sticky;
  top:0;
  z-index:1;
}
.table tr:hover td{ background:#fbfdfb; }
.table td.wrap{ white-space:normal; }
.table-actions{ text-align:right; }
.table .btn,
.table .btn-sm{ font-size:11px; padding:4px 8px; }
.amt,
.num,
.table td.text-end,
.table th.text-end,
.table td.text-right,
.table th.text-right{
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.chip-unpaid{ background:#fff3cd; color:#7c5a00; }
.chip-draft{ background:#eef2ff; color:#3730a3; }

/* -------------------------
   Purchase Page
   ------------------------- */
.purchase-page{
  padding:1rem;
}
.purchase-page .card{
  padding:0.95rem;
}
.purchase-page .card h3{
  margin-bottom:1rem;
  color:var(--brand-green);
}
.purchase-note{
  margin-bottom:0.75rem;
}
.purchase-grid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:0.9rem;
  margin-top:0.9rem;
}
.purchase-actions{
  margin-top:0.75rem;
}
.purchase-recent{
  margin-top:0.9rem;
}
.purchase-page .form-row{
  display:flex;
  gap:0.75rem;
  flex-wrap:wrap;
  margin-bottom:0.75rem;
}
.purchase-page .form-group{
  flex:1;
  min-width:180px;
}
.purchase-page label{
  display:block;
  font-weight:600;
  margin-bottom:3px;
}
.purchase-page select,
.purchase-page input{
  width:100%;
  min-height:32px;
  padding:4px 8px;
  border:1px solid var(--border);
  border-radius:0;
  font-size:13px;
}
.quantity-field{
  display:flex;
  align-items:center;
  gap:0.5rem;
}
.items-col-item{ width:30%; }
.items-col-qty{ width:15%; }
.items-col-price{ width:18%; }
.items-col-subtotal{ width:15%; }
.items-col-action{ width:10%; }
.table-footer{
  display:flex;
  justify-content:flex-end;
  gap:1.25rem;
  margin-top:0.5rem;
  font-weight:600;
  flex-wrap:wrap;
}
.muted{
  color:var(--muted);
  font-size:0.85rem;
}
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.4);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:2000;
}
.purchase-summary-modal{
  background:#fff;
  border-radius:12px;
  padding:1rem;
  width:min(480px, 90vw);
  box-shadow:0 2px 12px rgba(0,0,0,0.2);
}
.purchase-summary-modal h4{
  margin-bottom:1rem;
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:0.75rem;
  margin-top:1rem;
}
.purchase-page .alert{
  padding:0.6rem 0.8rem;
  border-radius:0;
  margin-bottom:1rem;
  background:#fff4dc;
  border:1px solid #f7dfab;
  color:#7e5b19;
}
.recent-table td,
.recent-table th{
  font-size:0.85rem;
}
.chip{
  padding:0.2rem 0.55rem;
  border-radius:999px;
  font-size:0.7rem;
  font-weight:700;
  text-transform:uppercase;
  display:inline-block;
}
.chip-active{
  background:#dff1e7;
  color:#1f6a3e;
}
.chip-cancelled{
  background:#f6dddf;
  color:#7b2b34;
}

input:focus,
select:focus,
textarea:focus,
.btn:focus-visible,
.btn:focus{
  outline:none;
  border-color:var(--brand-orange);
  box-shadow:0 0 0 3px var(--focus);
}

.biz-form-card{
  background:var(--card);
  border:1px solid rgba(20,33,26,.08);
  box-shadow:var(--shadow);
}

.form-grid,
.form-grid-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.form-group,
.section-block,
.tab-pane,
.panel,
.form-card{
  margin-bottom:12px;
}

.form-group label,
.form-label,
label.form-label{
  display:block;
  font-size:12px;
  margin-bottom:3px;
}

.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
select,
textarea{
  width:100%;
  min-height:38px;
  padding:8px 10px;
  font-size:13px;
  border:1px solid #d8e1da;
  border-radius:10px;
  background:#fff;
}

.form-select{min-height:38px;border-radius:10px;border-color:#d8e1da;}

.filter-grid,
.filter-toolbar,
form.d-flex.flex-wrap.align-items-end.gap-2{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:end;
  background:#f7faf8;
  border:1px solid #e2e9e4;
  border-radius:12px;
  padding:12px;
  margin-bottom:14px;
}

.filter-grid > *{ flex:1 1 170px; min-width:140px; }
.filter-grid .btn{ flex:0 0 auto; }

.nav-tabs{ border-bottom:1px solid #dbe5de; gap:6px; }
.nav-tabs .nav-link,
.tab-link{
  border:1px solid transparent;
  border-radius:10px 10px 0 0;
  color:#42544a;
  padding:8px 12px;
  font-weight:600;
}
.nav-tabs .nav-link.active,
.tab-link.active{
  background:#fff;
  border-color:#dbe5de #dbe5de #fff;
  color:var(--brand-green);
}

.modal-content{
  border-radius:14px !important;
  border:1px solid rgba(20,33,26,.08);
  box-shadow:var(--shadow);
}

textarea,
.form-control[type="textarea"]{
  min-height:72px;
}

input[type="date"],
.field-date,
.field-date input,
.field-date select{
  max-width:140px;
}

.field-short,
.field-short input,
.field-short select,
input[name*="truck"],
input[name*="trailer"],
input[name*="seal"],
input[name*="appointment"],
input[name*="container"]{
  max-width:180px;
}

.tab-content{
  padding:12px;
}

.tab-content .tab-pane:last-child,
.form-group:last-child{
  margin-bottom:0;
}

.card > h3,
.card-body > h3,
.card-body > h4{
  margin:0 0 8px;
}

.card h4{
  font-size:14px;
}

@media(max-width: 1200px){
  .form-grid,
  .form-grid-3{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media(max-width: 768px){
  .form-grid,
  .form-grid-3,
  .purchase-grid{
    grid-template-columns:1fr;
  }

  input[type="date"],
  .field-date,
  .field-short,
  input[name*="truck"],
  input[name*="trailer"],
  input[name*="seal"],
  input[name*="appointment"],
  input[name*="container"]{
    max-width:none;
  }
}

/* -------------------------
   Messages
   ------------------------- */
.messages{ margin:12px 0; display:grid; gap:8px; }
.message{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
}
.message.success{ border-color:rgba(47,155,92,.35); background:rgba(47,155,92,.08); }
.message.error{ border-color:rgba(212,84,84,.35); background:rgba(212,84,84,.08); }
.message.warning{ border-color:rgba(217,146,29,.35); background:rgba(217,146,29,.08); }
.message.info{ border-color:rgba(77,143,104,.35); background:rgba(77,143,104,.08); }

/* -------------------------
   Mobile behavior
   Sidebar becomes off-canvas using transform
   ------------------------- */
#app-backdrop{
  display:none;
  position:fixed;
  inset:0 0 0 0;
  background:rgba(0,0,0,.25);
  z-index:1250;
}

@media(max-width: 980px){
  .topnav{
    left:0;
    width:100%;
  }
  
  .main{
    margin-left:0;
  }

  #app-sidebar.sidebar{
    transform:translateX(-105%);
    transition:transform .25s ease;
    top:0;
    height:100vh;
  }
  #app-sidebar.sidebar.open{
    transform:translateX(0);
  }

  #app-backdrop.show{ display:block; }

  /* Show hamburger only on mobile */
  .nav-toggle{ display:inline-flex; }
}

/* Desktop: hamburger hidden */
.nav-toggle{ display:none; }

/* -------------------------
   Hard guard rails (prevents legacy CSS from breaking layout)
   Only a few !important, targeted to layout.
   ------------------------- */
.topnav-inner{ display:flex !important; }
.topnav-right{ display:flex !important; }
#app-sidebar.sidebar{ background:var(--sidebar-gradient) !important; left:0 !important; }


.items-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-top:8px;
}

.items-toolbar .table-footer{
  margin-top:0;
  margin-left:auto;
}

@media(max-width: 768px){
  .items-toolbar{
    align-items:flex-start;
  }
  .items-toolbar .table-footer{
    margin-left:0;
    justify-content:flex-start;
  }
}

.modal-content{ border-radius:0 !important; }

.card .table-wrap{ border-left:0; border-right:0; border-bottom:0; }

/* ==========================================================================
   PRINT STYLES - Standardized Document View
   ========================================================================== */

@media print {
    /* 1. Force-hide all non-report UI elements */
    .topnav, 
    .topnav-inner, 
    .sidebar, 
    #app-sidebar, 
    .btn, 
    .page-actions, 
    .action-buttons, 
    .no-print, 
    .report-filters-panel, 
    .filter-panel,
    .messages, 
    .breadcrumb, 
    header:not(.report-header), 
    footer, 
    button,
    #app-backdrop,
    .sidebar-logo-area,
    .branch-info-card,
    .sidebar-quick-actions,
    .sidebar-nav,
    .nav-tabs,
    .tab-navigation,
    .modal-header .btn-close {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* 2. Reset Layout for Print */
    body, html {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        width: 100% !important;
    }

    .layout, .main, .app-container {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        top: 0 !important;
        box-shadow: none !important;
    }

    .page-head {
        display: none !important;
    }

    /* 3. Standardize Report Tables & Containers */
    .report-table-container,
    .report-container,
    .card,
    .panel {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: white !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px !important;
    }

    th, td {
        color: black !important;
        border-bottom: 1px solid #eee !important;
        font-size: 9pt !important;
        padding: 8px 4px !important;
    }

    th {
        background-color: #f4f4f4 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 4. Numeric Alignment & Formatting */
    .num, 
    .text-end,
    .text-right,
    [class*="text-right"] {
        text-align: right !important;
    }

    /* 5. Force Header on Every Page */
    .report-header-table {
        display: table !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    /* Page Breaks */
    .page-break {
        page-break-before: always;
    }
}

