/* Business table styling */
.biz-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 01px 2px rgba(0, 0, 0, .05);
}

/* Horizontal scroll wrapper for small screens */
.biz-table-scroll { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

.biz-table caption { text-align:left; padding:1rem 1.25rem; font-weight:600; background:linear-gradient(#f8fafc,#f1f5f9); border-bottom:1px solid #d0d7e2; }
.biz-table thead th { background:linear-gradient(#f1f5f9,#e2e8f0); color:#334155; font-weight:600; padding:.8rem 1rem; font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid #cbd5e1; position:sticky; top:0; z-index:2; white-space:nowrap; }
.biz-table tbody td { padding:.8rem 1rem; border-bottom:1px solid #eef2f6; color:#1e293b; vertical-align:top; max-width:28rem; /* removed white-space:nowrap */ }

/* Optional manual keep-nowrap usage */
.biz-table tbody td.keep-nowrap { white-space:nowrap; }

/* Manual wrapping opt-in */
.biz-table thead th.wrap,
.biz-table tbody td.wrap,
.biz-table thead th.conditions-col,
.biz-table tbody td.conditions-col { white-space:normal; overflow-wrap:anywhere; word-break:break-word; }

@media (min-width:821px) {
  /* Desktop: if developer wants old behavior globally, apply .desktop-nowrap on table */
  .biz-table.desktop-nowrap tbody td { white-space:nowrap; }
}

/* Mobile auto wrap */
@media (max-width:820px) {
  .biz-table[data-mobile-autowrap] { width:100% !important; min-width:0 !important; table-layout:fixed; }
  .biz-table[data-mobile-autowrap] tbody td { white-space:normal !important; overflow-wrap:anywhere !important; word-break:break-word !important; hyphens:auto; line-height:1.3; padding:.6rem .65rem; font-size:.9rem; }
  .biz-table[data-mobile-autowrap] tbody td * { white-space:normal !important; overflow-wrap:anywhere !important; word-break:break-word !important; hyphens:auto !important; }
  .biz-table[data-mobile-autowrap] tbody td a { word-break:break-all !important; }
  .biz-table[data-mobile-autowrap] tbody td pre,
  .biz-table[data-mobile-autowrap] tbody td code { white-space:pre-wrap !important; }
  .mobile-hide { display:none !important; }
  .mobile-truncate-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .mobile-truncate-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
}

/* Zebra striping */
.biz-table tbody tr:nth-child(odd):not(.selected):not(.error):not(.warning):not(.empty-row):not(.loading-row) td { background-color:#dbeafe; }
.biz-table tbody tr:nth-child(even):not(.selected):not(.error):not(.warning):not(.empty-row):not(.loading-row) td { background-color:#bfdbfe; }
.biz-table tbody tr.row-odd td { background-color:#dbeafe; }
.biz-table tbody tr.row-even td { background-color:#bfdbfe; }
.biz-table tbody tr:hover td { background-color:inherit; }

.biz-table thead th + th,
.biz-table tbody td + td,
.biz-table tfoot td + td { border-left:1px solid #e5e9f2; }
.biz-table tbody tr:last-child td { border-bottom:none; }

.biz-table tbody tr.selected td { background:#b6e0ff; }
.biz-table tbody tr.error td { background:#fee2e2; }
.biz-table tbody tr.warning td { background:#fef9c3; }

.biz-table .empty-row td,
.biz-table .loading-row td { text-align:center; color:#64748b; font-style:italic; background:#f1f5f9; }

.biz-table tfoot td { background:#f8fafc; font-weight:600; padding:.8rem 1rem; border-top:1px solid #d0d7e2; white-space:nowrap; }

@media (max-width:760px) { .biz-table { min-width:640px; } }
@media (max-width:600px) { .biz-table thead th { padding:.55rem .6rem; font-size:.68rem; } .biz-table tbody td { padding:.55rem .6rem; font-size:.8rem; } .biz-table caption { padding:.7rem .8rem; } .biz-table tfoot td { padding:.55rem .6rem; } }

.biz-table .spinner { width:18px; height:18px; border:2px solid #cbd5e1; border-top-color:#0d6efd; border-radius:50%; display:inline-block; margin-right:.6rem; animation:bt-spin .6s linear infinite; }
@keyframes bt-spin { to { transform:rotate(360deg); } }
