/* Styles unique to the Workspace pane's content - editing this file never affects User or Assistant. */

.ai-ws-results { font-size: 13px; }

.ai-ws-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  table-layout: fixed;
}
.ai-ws-table th:nth-child(1), .ai-ws-table td:nth-child(1) { width: 32px; }
.ai-ws-table th:nth-child(2), .ai-ws-table td:nth-child(2) { width: 42%; }
.ai-ws-table th:nth-child(3), .ai-ws-table td:nth-child(3) { width: 60px; }
.ai-ws-table th:nth-child(4), .ai-ws-table td:nth-child(4) { width: auto; }
.ai-ws-table th:nth-child(5), .ai-ws-table td:nth-child(5) { width: 28px; }
.ai-ws-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #a0aec0;
  padding: 6px 4px;
  border-bottom: 1px solid #eef0f3;
}
.ai-ws-table td {
  padding: 8px 4px;
  border-bottom: 1px solid #f5f6f8;
  vertical-align: top;
}
.ai-ws-product-cell { min-width: 180px; }
.ai-ws-name { font-weight: 600; color: #0d141a; margin-bottom: 2px; }
.ai-ws-desc { font-size: 12px; color: #718096; margin-bottom: 4px; line-height: 1.4; }
.ai-ws-meta { font-size: 11px; color: #a0aec0; margin-bottom: 6px; }
.ai-ws-price-row { display: flex; align-items: center; gap: 8px; }
.ai-ws-price-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--ai-primary,#2563EB);
  background: var(--ai-tint,#e6f4fb);
  border: 1px solid var(--ai-tint-border,#c2e4f5);
  border-radius: 6px;
  padding: 2px 8px;
}
.ai-ws-rfi-badge {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 2px 8px;
}
.ai-ws-add-cart {
  background: var(--ai-accent,#0EA5E9);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.ai-ws-add-cart:hover { opacity: 0.9; }
.ai-ws-add-cart:disabled { opacity: 0.6; cursor: default; }
.ai-ws-qty {
  width: 56px;
  padding: 5px 6px;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  font-size: 13px;
}
.ai-ws-note {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
.ai-ws-remove-row {
  background: none;
  border: none;
  color: #cbd5e0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.ai-ws-remove-row:hover { color: #b91c1c; }

.ai-ws-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.ai-ws-submit-status {
  font-size: 12px;
  min-height: 16px;
  margin: 8px 0;
}
.ai-ws-status-error { color: #b91c1c; }
.ai-ws-status-success { color: #16a34a; font-weight: 600; }

.ai-ws-submit-rfi {
  background: linear-gradient(135deg, var(--ai-primary,#2563EB), var(--ai-accent,#0EA5E9));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.ai-ws-submit-rfi:hover { opacity: 0.9; }

/* v0.41.0 (D40): guest double opt-in - the email field above the submit
   button and the inline resend link in the success message. */
.ai-ws-email-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #718096;
  margin: 0 0 10px;
}
.ai-ws-email-field input {
  padding: 6px 8px;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
  width: 100%;
}
.ai-ws-email-field input:focus {
  border-color: var(--ai-primary,#2563EB);
  outline: none;
}
.ai-ws-resend {
  background: none;
  border: none;
  color: var(--ai-primary,#2563EB);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
}
.ai-ws-resend:hover { color: var(--ai-primary-dark,#1e4fc0); }

/* Document extraction review - rendered at the top of the Workspace. */
.ai-extraction-review {
  font-size: 13px;
  border: 1px solid var(--ai-tint-border,#c2e4f5);
  background: #fbfdff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}
.ai-ex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ai-ex-head strong { font-size: 13px; color: #0d141a; }
.ai-ex-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--ai-primary,#2563EB);
  background: var(--ai-tint,#e6f4fb);
  border: 1px solid var(--ai-tint-border,#c2e4f5);
  border-radius: 6px;
  padding: 2px 8px;
  text-transform: uppercase;
}
.ai-ex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.ai-ex-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #a0aec0;
}
.ai-ex-field input {
  padding: 5px 6px;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
  width: 100%;
}
.ai-ex-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.ai-ex-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #a0aec0;
  padding: 4px;
  border-bottom: 1px solid #eef0f3;
}
.ai-ex-table td { padding: 4px; border-bottom: 1px solid #f5f6f8; }
.ai-ex-table input {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
.ai-ex-empty { color: #a0aec0; font-size: 12px; padding: 8px 4px; }
.ai-ex-note { font-size: 11px; color: #718096; margin: 0; line-height: 1.4; }
.ai-ex-error {
  font-size: 12px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

/* Milestone B: catalogue-match bucket rows under each extracted line. */
.ai-ex-match-row {
  background: #f7fafc;
}
.ai-ex-match-row td {
  font-size: 12px;
  color: #2d3748;
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.6;
}
.ai-ex-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 6px;
  vertical-align: 1px;
}
.ai-ex-badge-match {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.ai-ex-badge-ambig {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.ai-ex-badge-none {
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.ai-ex-source {
  font-size: 11px;
  color: #718096;
  font-style: italic;
  margin-right: 6px;
}
.ai-ex-parties {
  background: #f7fafc;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 10px 0;
}
.ai-ex-parties-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #718096;
  margin-bottom: 6px;
}
.ai-ex-party {
  font-size: 12px;
  color: #2d3748;
  line-height: 1.7;
  border-bottom: 1px dashed #e2e8f0;
  padding: 3px 0;
}
.ai-ex-party:last-of-type { border-bottom: none; }
.ai-ex-party-role {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #3730a3;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 8px;
}
.ai-ex-party-field {
  margin-right: 12px;
}
.ai-ex-party-field b {
  color: #4a5568;
  font-weight: 600;
}
.ai-ex-cand-sku,
.ai-ex-chip-sku {
  font-size: 11px;
  color: #a0aec0;
}
.ai-ex-chip {
  font-size: 11px;
  font-weight: 600;
  color: #1e40af;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 10px;
  margin: 1px 4px 1px 0;
  cursor: pointer;
}
.ai-ex-chip:hover { background: #eff6ff; }
.ai-ex-chip-selected {
  color: #fff;
  background: var(--ai-primary,#2563EB);
  border-color: var(--ai-primary,#2563EB);
}
.ai-ex-chip-selected:hover { background: var(--ai-primary-dark,#1e4fc0); }
.ai-ex-chip-label {
  font-size: 11px;
  color: #6b7280;
}
.ai-ex-none-label {
  font-size: 11px;
  color: #6b7280;
  margin-right: 6px;
}
.ai-ex-add {
  font-size: 11px;
  font-weight: 600;
  color: var(--ai-primary,#2563EB);
  background: #fff;
  border: 1px solid var(--ai-primary,#2563EB);
  border-radius: 6px;
  padding: 3px 10px;
  margin-left: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.ai-ex-add:hover { background: var(--ai-tint,#e6f4fb); }
.ai-ex-add:disabled {
  opacity: 0.5;
  cursor: default;
}
.ai-ex-add:disabled:hover { background: #fff; }

/* ---- Layout beautification (v0.124.0, D226): glass + rhythm ----
   Same token set as the admin sheets (navy #104058, flask #2088c0,
   radii 8/12/14/999). Additive only; grid/table structure untouched. */

/* Product + extraction tables: navy header band, zebra, roomy cells */
.ai-ws-table th {
  color: #104058;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 8px 6px;
  border-bottom: 2px solid rgba(32, 136, 192, 0.3);
}
.ai-ws-table td {
  padding: 10px 6px;
}
.ai-ws-table tbody tr:nth-child(even) {
  background: rgba(234, 241, 247, 0.45);
}
.ai-ex-table th {
  color: #104058;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(32, 136, 192, 0.3);
}
.ai-ex-table tbody tr:nth-child(even) {
  background: rgba(234, 241, 247, 0.45);
}

/* Badges become translucent pills */
.ai-ws-price-badge,
.ai-ws-rfi-badge,
.ai-ex-type,
.ai-ex-badge,
.ai-ex-party-role {
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.ai-ws-price-badge {
  background: rgba(230, 244, 251, 0.9);
}
.ai-ws-rfi-badge {
  background: rgba(255, 251, 235, 0.9);
}
.ai-ex-badge-match {
  background: rgba(240, 253, 244, 0.9);
}
.ai-ex-badge-ambig {
  background: rgba(255, 251, 235, 0.9);
}
.ai-ex-badge-none {
  background: rgba(243, 244, 246, 0.9);
}

/* Review + parties cards go frosted with accent edges */
.ai-extraction-review {
  background: rgba(251, 253, 255, 0.8);
  border: 1px solid rgba(16, 64, 88, 0.12);
  border-top: 3px solid #2088c0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 6px 18px rgba(16, 64, 88, 0.08);
}
.ai-ex-parties {
  background: rgba(247, 250, 252, 0.8);
  border: 1px solid rgba(16, 64, 88, 0.12);
  border-radius: 10px;
}
.ai-ex-error {
  border-radius: 0 10px 10px 0;
  border: 1px solid rgba(198, 40, 40, 0.3);
  border-left: 4px solid #c62828;
}

/* Inputs + buttons: radius rhythm, flask focus, pill actions */
.ai-ws-qty,
.ai-ws-note,
.ai-ws-email-field input,
.ai-ex-field input,
.ai-ex-table input {
  border-radius: 8px;
}
.ai-ws-email-field input:focus,
.ai-ws-note:focus,
.ai-ws-qty:focus,
.ai-ex-field input:focus,
.ai-ex-table input:focus {
  border-color: #2088c0;
  box-shadow: 0 0 0 1px #2088c0;
  outline: none;
}
.ai-ws-add-cart,
.ai-ex-add,
.ai-ex-chip {
  border-radius: 999px;
}
.ai-ws-submit-rfi {
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .ai-extraction-review,
  .ai-ex-parties {
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
  }
}
