.quote-tracking {
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.quote-reference {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-bottom: 18px;
}
.quote-reference strong {
  color: var(--green);
}
.quote-reference span {
  font-size: 13px;
  color: #626957;
}
.field select,
.quote-filter select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.quote-filter {
  font-size: 12px;
  color: #626957;
}
.quote-filter select {
  display: block;
  max-width: 230px;
}
.list-toolbar:has(.quote-filter:not([hidden])) {
  flex-wrap: wrap;
}
.quote-card-tracking {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 12px 0;
  font-size: 13px;
  color: #46583e;
}
.quote-card-tracking span {
  overflow-wrap: anywhere;
}
.quote-status-badge {
  background: var(--green-soft);
  border-radius: 5px;
  padding: 2px 6px;
}
.quote-upload {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.quote-upload summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 28px;
}
.quote-upload fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.quote-upload .field {
  min-width: 0;
}
.quote-upload input[type="file"] {
  padding: 10px 0;
  background: none;
  border: 0;
  max-width: 100%;
}
.quote-document {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.quote-document h3 {
  margin: 0 0 6px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.quote-document p {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.quote-document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 10px;
}
.quote-document-actions a {
  color: var(--green);
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.quote-document details {
  margin-top: 12px;
}
.quote-document summary {
  min-height: 44px;
  cursor: pointer;
  padding: 12px 0;
  font-size: 14px;
}
.quote-document-history {
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-top: 12px;
}
.quote-document-expired,
#quote-document-status[data-state="error"] {
  color: #a13b2c;
}
@media (max-width: 760px) {
  .quote-filter {
    width: 100%;
  }
  .quote-filter select {
    max-width: none;
  }
  .quote-tracking .field-grid,
  .quote-upload .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Quote views share a single editor and save controller. */
.quote-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.quote-tabs button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  cursor: pointer;
}
.quote-tabs button[aria-pressed="true"] {
  border-bottom: 3px solid var(--green);
  font-weight: 600;
}
.quote-pending {
  padding: 12px;
  margin-bottom: 16px;
  background: #fff0cd;
  color: #654600;
  border: 1px solid #a77b22;
  border-radius: 8px;
  font-size: 14px;
}
.quote-copy-menu {
  position: relative;
}
.quote-copy-menu > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}
.quote-copy-choices {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  width: min(280px, 85vw);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px #0002;
}
.quote-copy-choices button {
  display: block;
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 10px;
  font: inherit;
  cursor: pointer;
}
.quote-documents summary,
.quote-tracking summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: 14px;
}
.quote-documents summary::before,
.quote-tracking summary::before {
  content: "▸";
  margin-right: 8px;
}
.quote-documents details[open] > summary::before,
.quote-tracking details[open] > summary::before {
  content: "▾";
}
.quote-documents .quote-section-heading {
  margin-bottom: 10px;
}
.quote-documents .quote-upload {
  margin: 12px 0;
}
.quote-document {
  padding: 12px 0;
}
.quote-document p {
  margin: 3px 0;
}
.quote-document-actions {
  gap: 4px 14px;
  margin-top: 4px;
}
.quote-tracking {
  margin: 16px 0;
  padding: 12px 0;
}
.quote-tracking .quote-reference {
  margin-bottom: 8px;
}
.quote-tracking .field-grid {
  gap: 10px;
}
.quote-tracking label {
  font-size: 12px;
}
#quote-edit-dialog {
  max-height: 90dvh;
  overflow-y: auto;
}
.quote-tabs button:focus-visible,
.quote-copy-menu summary:focus-visible,
.quote-documents summary:focus-visible,
.quote-tracking summary:focus-visible,
.quote-documents input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
#app[data-category="quotes"] #entries {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
#app[data-category="quotes"] .entry-card {
  min-height: 0;
  padding: 14px 16px;
}
#app[data-category="quotes"] .entry-card .card-top {
  float: right;
  margin: 0 0 0 8px;
}
#app[data-category="quotes"] .entry-card .card-icon {
  display: none;
}
#app[data-category="quotes"] .entry-card h2 {
  font-size: 20px;
  margin: 0;
}
#app[data-category="quotes"] .quote-card-tracking {
  margin: 6px 0;
}
#app[data-category="quotes"] .card-preview {
  display: none;
}
#app[data-category="quotes"] .card-footer {
  margin-top: 6px;
  padding-top: 0;
  border: 0;
}
@media (max-width: 760px) {
  .quote-tracking .field-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #app[data-category="quotes"] .editor-actions {
    gap: 2px;
  }
  #app[data-category="quotes"] .save-status {
    max-width: 92px;
    font-size: 11px;
  }
}

/* PO-led job lookup and one-open-at-a-time status sections. */
#quote-status-selector {
  flex: 1 1 190px;
  min-width: 0;
  max-width: 320px;
}
#quote-section-select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
#quote-fields[data-view="documents"] > .quote-tracking > .field-grid {
  display: none;
}
#quote-document-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  overflow-wrap: anywhere;
}
#quote-document-summary strong {
  flex-basis: 100%;
}
#quote-edit-latest {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#app[data-category="quotes"] .list-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  flex-wrap: wrap;
  padding: 8px 0;
  gap: 6px 12px;
}
#app[data-category="quotes"] .search-box {
  flex-basis: 100%;
}
#quote-groups {
  scroll-margin-top: 125px;
}
.quote-group {
  border-top: 1px solid var(--line);
}
.quote-group > h2 {
  margin: 0;
  font: inherit;
}
.quote-group-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--ink, #263238);
  text-align: left;
  font: inherit;
  font-weight: 600;
  scroll-margin-top: 125px;
}
.quote-group-toggle[aria-expanded="true"] {
  background: #e9eeee;
}
.quote-group-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.quote-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: #697378;
}
[data-status="released"] .quote-status-dot {
  background: #326a9c;
}
[data-status="completed"] .quote-status-dot {
  background: #33734e;
}
[data-status="po_received"] .quote-status-dot {
  background: #68558d;
}
[data-status="on_hold"] .quote-status-dot {
  background: #966313;
}
.quote-status-badge[data-status="released"] {
  background: #e5eff8;
  color: #245780;
}
.quote-status-badge[data-status="completed"] {
  background: #e5f0e8;
  color: #285d3c;
}
.quote-status-badge[data-status="on_hold"] {
  background: #f6ecd8;
  color: #775015;
}
#quote-sort-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 0;
}
.quote-sort-caption {
  font-size: 12px;
  color: #515d61;
}
#quote-sort {
  display: inline-flex;
  min-width: 0;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
#quote-sort button {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #515d61;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}
#quote-sort button[aria-pressed="true"] {
  background: #dfe9e5;
  color: #264d3c;
  font-weight: 650;
}
#quote-sort button:hover {
  background: #edf1ef;
}
#quote-sort button[aria-pressed="true"]:hover {
  background: #dfe9e5;
}
#quote-sort button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
@media (max-width: 400px) {
  #quote-sort-label {
    justify-content: flex-start;
  }
  #quote-sort {
    flex: 1;
  }
  #quote-sort button {
    flex: 1;
    padding: 8px 6px;
  }
}
#app[data-category="quotes"] #entries {
  gap: 0;
}
#app[data-category="quotes"] .entry-card {
  border-bottom: 1px solid var(--line);
  padding: 12px;
}
.quote-job-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
#app[data-category="quotes"] .quote-job h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.quote-job p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.quote-job-name {
  font-size: 15px;
  font-weight: 600;
}
.quote-job-context {
  font-size: 13px;
  color: #515d61;
}
.quote-job .quote-status-badge {
  display: inline-block;
  font-size: 12px;
  margin-top: 6px;
}
.quote-job .card-footer {
  gap: 10px;
  font-size: 12px;
  color: #515d61;
}
.quote-job mark {
  background: #f6df94;
  color: #263238;
}
.quote-tracking {
  margin: 0 0 12px;
  padding: 0;
  border-bottom: 0;
}
.quote-tracking .quote-reference {
  font-size: 12px;
  margin-bottom: 10px;
}
.quote-tracking .field-grid {
  align-items: start;
}
#quote-po {
  font-weight: 600;
}
.quote-po-links a,
.quote-po-links summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
}
.quote-po-links {
  margin-bottom: 8px;
}
.quote-po-links details > a {
  padding-left: 12px;
}
.quote-group-toggle:focus-visible,
.quote-po-links summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
#quote-documents-list article[data-kind="po"],
#quote-documents-list article[data-kind="client_quote"] {
  border-left: 3px solid #607b70;
  padding-left: 12px;
}
@media (max-width: 760px) {
  .quote-tracking .field-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

#app[data-category="quotes"] .quote-job .card-footer span:last-child {
  color: inherit;
}

.quote-job .quote-no-po {
  font-weight: 400;
  color: #515d61;
}
