/* Shared additions for multi-page CSI dashboard and preferred bidder UI. */

.master-dashboard-region[hidden],
.trade-workspace-shell[hidden] {
  display: none;
}

.dashboard-summary-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem 0;
}

.dashboard-summary-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  color: #1e3a8a;
}

.trade-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.trade-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  background: #ffffff;
}

.trade-card-title {
  margin: 0 0 0.5rem 0;
}

.trade-card-meta {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.trade-card-link-button {
  display: inline-block;
  margin-top: 0.55rem;
  text-decoration: none;
}

.preferred-bidder-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preferred-bidder-pill {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.preferred-bidder-button {
  margin-top: 0.25rem;
  border: 1px solid #94a3b8;
  background: #ffffff;
  color: #0f172a;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.preferred-bidder-column {
  outline: 2px solid #22c55e;
  outline-offset: -2px;
}

.workspace-backup-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.trade-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

/* Lets the main column shrink so the grid stays two columns and the table scrolls inside .table-scroll */
.trade-main-content {
  min-width: 0;
}

/* Reinforces hide after analysis (alongside the hidden attribute) */
#bid-upload-section.upload-section-hidden {
  display: none !important;
}

.trade-sidebar-card {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.trade-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.trade-sidebar-link {
  display: block;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  color: #0f172a;
  background: #ffffff;
}

.trade-sidebar-link.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
}

.category-collapse-toggle {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 4px;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 0.4rem;
}

.category-collapse-toggle.is-collapsed {
  transform: rotate(-90deg);
}

.category-label-text[contenteditable="true"] {
  border-bottom: 1px dashed #94a3b8;
  padding: 0 0.15rem;
}

.category-line-collapsed {
  display: none;
}

/* Bidder column headers: name + percent above lowest grand total */
.results-table thead th[data-header-kind="sub"] .bidder-header-name {
  display: block;
  white-space: normal;
}

.results-table thead th[data-header-kind="sub"] .bidder-header-pct {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 0.25rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Stack only on very narrow viewports so "Navigate scopes" stays a side rail on tablets and laptops */
@media (max-width: 480px) {
  .trade-layout {
    grid-template-columns: 1fr;
  }
}
