.sub-table-wrap {
  max-height: 16rem;
  overflow: auto;
  max-width: 100%;
  border: 1px solid #ddd;
  margin: 0.4rem 0 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.sub-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.sub-table th {
  position: sticky;
  top: 0;
  background: #f4f4f4;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  width: auto;
}

.sub-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  white-space: nowrap;
  width: auto;
}

.sub-table td:first-child { font-weight: 600; }
.sub-row { cursor: pointer; }
.sub-row:hover { background: #eef6ff; }
.sub-row.picked { background: #d6e8ff; }
.sub-row.new-row td { font-style: italic; color: #1a5fd6; }
#subSearch { width: 100%; box-sizing: border-box; padding: 0.4rem 0.5rem; }

.context-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.4rem 1rem;
  box-sizing: border-box;
  background: #ecfdf3;
  color: #14532d;
  font-size: 0.9rem;
}

.context-bar .context-user {
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}

.tenant-logo,
.logo-preview {
  display: block;
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.logo-preview { height: 64px; max-width: 240px; }

/* Loaded after site.css. site.css sets table { width: 100% } and .work-report th { width: 32% },
   which scrunches every extra column into the remaining space. Lists keep their natural width
   and the wrapper scrolls sideways. */
.work-report-wrap,
.pos-config-section {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table.work-report,
table.js-index-list,
table.pos-config-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

table.work-report th,
table.work-report td,
table.js-index-list th,
table.js-index-list td,
table.pos-config-table th,
table.pos-config-table td {
  white-space: nowrap;
  width: auto;
}
