/* RFQ lists, cards, uploads and forms. */
#rfqPanel,
#uploadPanel,
#detail,
#cardForm,
#quotePanel,
#replyPanel,
#salesPanel,
#purchasePanel,
#poPanel,
#assignmentPanel {
  scroll-margin-top: var(--scroll-offset);
}

#uploadPanel > h2 {
  font-size: 19px;
}

.drop {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 30px 20px;
  border: 1px dashed var(--border-hover);
  background: var(--surface-soft);
  border-radius: 9px;
  cursor: pointer;
}

.drop strong {
  font-size: 14px;
  font-weight: 550;
}

.drop span {
  color: var(--subtle);
  font-size: 12px;
}

.drop input {
  max-width: 100%;
  font-size: 12px;
  margin-top: 10px;
}

.drop input::file-selector-button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 7px 10px;
  margin-right: 10px;
  cursor: pointer;
}

.drop.over {
  background: var(--peach);
  border-color: var(--orange);
}

#selection {
  font-size: 12px;
  margin-top: 12px;
}

#upload.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

#upload.primary:hover {
  background: var(--action-hover);
}

#message {
  white-space: pre-wrap;
  font-size: 12px;
  margin-top: 12px;
}

.queue-filter {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}

.queue-filter select {
  font-size: 12px;
}

.rfq-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  background: var(--surface);
}

.view-switch button {
  border: 0;
  background: transparent;
  color: var(--subtle);
  padding: 6px 12px;
  min-height: 34px;
  font-size: 11px;
}

.view-switch button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--nav-shadow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
  margin-top: 20px;
}

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-wrap: anywhere;
  background: var(--paper);
  transition: border-color 0.14s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card h3 {
  font-size: 16px;
  line-height: 1.4;
  margin: 13px 0 10px;
  letter-spacing: -0.03em;
}

.card h4 {
  margin-top: 0;
}

.card p {
  margin: 8px 0;
  font-size: 12px;
  color: var(--muted);
}

.card .rfq-actions {
  padding-top: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--surface-hover);
}

.badge {
  display: inline-block;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 7px;
  line-height: 1.4;
}

.rfq-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rfq-actions button {
  font-size: 12px;
  min-height: 38px;
}

.rfq-actions button:first-child {
  color: var(--ink);
}

.rfq-list-wrap {
  max-height: none;
}

.rfq-list td:first-child {
  min-width: 220px;
  max-width: 320px;
  overflow-wrap: anywhere;
}

.rfq-list td:nth-child(2) {
  min-width: 140px;
}

.rfq-list td:nth-child(4) {
  min-width: 180px;
}

.rfq-list td {
  padding: 12px;
  font-size: 12px;
  vertical-align: middle;
}

.rfq-list td p {
  margin: 5px 0;
  font-size: 11px;
}

.rfq-list td small {
  display: block;
  margin-top: 5px;
  white-space: nowrap;
  color: var(--subtle);
  font-size: 10px;
}

.rfq-list .rfq-actions {
  flex-direction: column;
  align-items: start;
}

.rfq-list button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 11px;
}

.empty {
  padding: 24px;
  color: var(--subtle);
}

/* All business tables retain bounded internal scrolling. */
.scroll {
  overflow: auto;
  max-height: 560px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-top: 16px;
  scroll-margin-top: var(--scroll-offset);
  overscroll-behavior-inline: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.6;
}

td,
th {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  min-width: 95px;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 10px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0.01em;
}

tr:last-child > td {
  border-bottom: 0;
}

td:nth-child(2) {
  min-width: 170px;
}

tbody tr:hover > td {
  background: var(--table-hover);
}

tbody tr:focus-within > td {
  background: var(--table-focus);
}

td strong {
  font-weight: 550;
}

.bad {
  color: var(--danger-text);
  background: var(--danger-bg);
  padding: 9px;
  border-radius: 7px;
  font-size: 12px;
}

.warn {
  color: var(--warning-text);
  background: var(--warning-bg);
  padding: 9px;
  border-radius: 7px;
  font-size: 12px;
}

.workflow-feedback {
  white-space: pre-line;
  overflow-wrap: anywhere;
  scroll-margin-top: var(--scroll-offset);
  padding: 12px 14px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--peach);
  color: var(--accent-text);
  font-size: 12px;
}

.workflow-feedback:empty {
  display: none;
}

.workflow-feedback[data-kind="error"] {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.workflow-feedback[data-kind="success"] {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

[aria-invalid="true"] {
  border-color: var(--danger-border) !important;
}

#detailTitle {
  overflow-wrap: anywhere;
}

#detailStatus {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 20px;
}

#accessNotice {
  margin-bottom: 20px;
}

/* Keep RFQ filter captions above their controls, including wrapped/mobile layouts. */
.rfq-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 22px;
}
.rfq-filters > .rfq-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 1 280px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.rfq-filter > select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
