.quote-catalog-workspace {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quote-catalog-header { padding: 24px 28px 18px; }
.quote-catalog-header h2 { margin: 0 0 6px; font-size: 25px; }
.quote-catalog-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.quote-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.button.danger { border-color: #d99f9f; background: #fff5f5; color: #a52e2e; }
.button.danger:hover { background: #fde7e7; }

#nav-section-quotes .quote-nav-list { max-height: min(48vh, 470px); overflow: auto; scrollbar-width: thin; padding-right: 3px; }
#nav-section-quotes .quote-nav-actions { padding-block: 5px; }
#nav-section-quotes .quote-nav-create { border-style: dashed; }
#nav-section-quotes .quote-nav-empty { margin: 8px 10px; color: rgba(238, 249, 245, .68); font-size: 12px; }
#nav-section-quotes .quote-category-nav > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quote-import-status {
  margin: 0 28px 16px;
  padding: 11px 14px;
  border: 1px solid #cfe2d8;
  border-radius: 9px;
  background: #f3faf6;
  color: #315b4d;
}
.quote-import-status.running { border-color: #d8c58d; background: #fff9e8; color: #785b0d; }
.quote-import-status.error { border-color: #efc6c6; background: #fff2f2; color: #9d2e2e; }
.quote-import-status.success { border-color: #a8d8c5; background: #edf9f3; color: #07634f; }

.quote-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) 110px auto;
  gap: 12px;
  align-items: end;
  padding: 17px 28px;
  border-block: 1px solid var(--line);
  background: #fbfdfb;
}
.quote-category-fallback { display: none !important; }
.quote-filter-form label, .quote-add-field label, .quote-row-fields label, .quote-upload { display: grid; gap: 6px; color: #31584b; font-weight: 700; }
.quote-filter-form span, .quote-add-field span, .quote-row-fields span, .quote-upload span { font-size: 12px; }
.quote-filter-form input, .quote-filter-form select, .quote-add-field input, .quote-add-field select, .quote-row-fields input {
  min-height: 40px;
  border: 1px solid #c8dcd3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}
.quote-filter-form input:focus, .quote-filter-form select:focus, .quote-add-field input:focus, .quote-add-field select:focus, .quote-row-fields input:focus {
  outline: 3px solid rgba(23, 128, 109, .2);
  border-color: #17806d;
}

.quote-summary { padding: 14px 28px; color: var(--muted); }
.quote-summary b { color: var(--forest); }
.quote-table-shell { overflow: auto; max-height: calc(100vh - 330px); border-top: 1px solid var(--line); }
.quote-table-shell table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; }
.quote-table-shell th, .quote-table-shell td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: pre-wrap; }
.quote-table-shell th { position: sticky; top: 0; z-index: 2; background: #edf7f2; color: #264c40; font-size: 12px; white-space: nowrap; }
.quote-table-shell tbody tr:hover { background: #f7fbf8; }
.quote-table-shell td { max-width: 310px; }
.quote-table-shell .quote-source-row { color: #71877f; font-size: 12px; white-space: nowrap; }
.quote-sort-button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 2px; }
.quote-sort-button:hover, .quote-sort-button:focus-visible { color: var(--forest); outline: 2px solid #8edbc4; outline-offset: 2px; }
.quote-row-actions { display: flex; gap: 6px; white-space: nowrap; }
.quote-row-actions button { border: 1px solid #bfd5cb; border-radius: 6px; background: #fff; color: #075a4b; cursor: pointer; padding: 5px 8px; }
.quote-row-actions .danger { border-color: #edc5c5; color: #a93232; }

.quote-image-cell { min-width: 94px; }
.quote-thumbnails { display: flex; gap: 6px; align-items: center; }
.quote-thumbnail {
  width: 70px;
  height: 70px;
  border: 1px solid #d4e2dc;
  border-radius: 8px;
  background: #f1f6f3;
  object-fit: cover;
  cursor: zoom-in;
}
.quote-thumbnail:focus-visible { outline: 3px solid #8edbc4; outline-offset: 2px; }
.quote-no-image { display: grid; place-items: center; width: 70px; height: 70px; border: 1px dashed #c5d8d0; border-radius: 8px; color: #8b9e97; font-size: 12px; }

.quote-pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 28px 22px; }
.quote-pagination button { min-width: 36px; min-height: 34px; border: 1px solid #c5d9d0; border-radius: 7px; background: #fff; color: #31584b; cursor: pointer; }
.quote-pagination button.active { border-color: #075a4b; background: #075a4b; color: #fff; }
.quote-pagination button:disabled { cursor: default; opacity: .45; }
.quote-pagination span { color: var(--muted); }

.quote-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 26px 70px rgba(10, 45, 36, .3);
  color: var(--ink);
}
.quote-dialog::backdrop, .quote-image-dialog::backdrop { background: rgba(7, 31, 25, .58); backdrop-filter: blur(2px); }
.quote-dialog form > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.quote-dialog h2 { margin: 0; }
.quote-dialog-close, .quote-image-close { border: 0; border-radius: 999px; background: #edf5f1; color: #31584b; cursor: pointer; font: 700 22px/1 inherit; width: 36px; height: 36px; }
.quote-row-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-height: 52vh; overflow: auto; padding: 20px 24px; }
.quote-row-fields label[data-wide="true"] { grid-column: 1 / -1; }
.quote-existing-images, .quote-upload { margin: 0 24px 18px; }
.quote-existing-images h3 { margin: 0 0 10px; font-size: 14px; }
.quote-existing-images > div { display: flex; flex-wrap: wrap; gap: 10px; }
.quote-existing-image { position: relative; display: grid; gap: 6px; }
.quote-image-actions { display: flex; gap: 5px; }
.quote-image-actions button { min-height: 29px; flex: 1; border: 1px solid #b9d0c6; border-radius: 6px; background: #fff; color: #075a4b; cursor: pointer; font-size: 12px; }
.quote-image-actions button.danger { border-color: #e4b5b5; color: #a52e2e; }
.quote-upload input { padding: 10px; border: 1px dashed #a9c8bb; border-radius: 8px; background: #f7fbf9; }
.quote-upload small { color: var(--muted); font-weight: 400; }
.quote-dialog form > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line); }

.quote-add-field { display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto; align-items: end; gap: 10px; padding: 18px 24px; }
.quote-field-list { max-height: 52vh; overflow: auto; padding: 0 24px 18px; }
.quote-field-row { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 90px auto auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.quote-field-row input, .quote-field-row select { min-height: 36px; border: 1px solid #c8dcd3; border-radius: 7px; padding: 7px 9px; font: inherit; }
.quote-field-row button { min-height: 36px; }
.quote-field-usage { color: var(--muted); font-size: 12px; white-space: nowrap; }

.quote-category-form-body { display: grid; gap: 18px; padding: 22px 24px; }
.quote-category-form-body [hidden] { display: none !important; }
.quote-category-form-body > label { display: grid; gap: 7px; color: #31584b; font-weight: 700; }
.quote-category-form-body input[type="text"], .quote-category-form-body input:not([type]), .quote-category-form-body select { min-height: 42px; border: 1px solid #c8dcd3; border-radius: 8px; padding: 8px 10px; font: inherit; }
.quote-category-form-body fieldset { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 14px; border: 1px solid #d5e3dd; border-radius: 9px; }
.quote-category-form-body fieldset legend { padding: 0 6px; color: #31584b; font-weight: 700; }
.quote-category-form-body fieldset label { display: flex; align-items: center; gap: 7px; }
.quote-category-form-body small, .quote-dialog-note { color: var(--muted); font-weight: 400; }
.quote-settings-footer { align-items: center; }
.quote-settings-footer > span { flex: 1; }

.quote-trash-dialog > div > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.quote-trash-dialog > div > footer { display: flex; justify-content: flex-end; padding: 16px 24px 22px; border-top: 1px solid var(--line); }
.quote-trash-list { min-height: 160px; max-height: 58vh; overflow: auto; padding: 8px 24px 20px; }
.quote-trash-item { display: flex; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.quote-trash-item h3 { margin: 0 0 5px; font-size: 16px; }
.quote-trash-item p { margin: 0 0 5px; color: #31584b; }
.quote-trash-item small { color: var(--muted); }
.quote-trash-item > div:last-child { display: flex; align-items: center; gap: 8px; }

.quote-image-dialog { position: relative; max-width: min(92vw, 1280px); max-height: 92vh; padding: 12px; border: 0; border-radius: 12px; background: #11231e; }
.quote-image-dialog img { display: block; max-width: calc(92vw - 24px); max-height: calc(92vh - 24px); object-fit: contain; }
.quote-image-close { position: absolute; z-index: 2; top: 18px; right: 18px; background: rgba(255,255,255,.9); }

@media (max-width: 900px) {
  .quote-catalog-header { align-items: flex-start; gap: 16px; }
  .quote-admin-actions { justify-content: flex-start; }
  .quote-filter-form { grid-template-columns: 1fr 1fr; }
  .quote-category-fallback { display: grid !important; }
  .quote-search { grid-column: 1 / -1; }
  .quote-table-shell { max-height: none; }
}

@media (max-width: 600px) {
  .quote-catalog-header, .quote-filter-form, .quote-summary { padding-inline: 16px; }
  .quote-import-status { margin-inline: 16px; }
  .quote-filter-form, .quote-row-fields, .quote-add-field, .quote-field-row { grid-template-columns: 1fr; }
  .quote-search { grid-column: auto; }
  .quote-dialog form > header, .quote-dialog form > footer, .quote-row-fields, .quote-add-field, .quote-field-list { padding-inline: 16px; }
  .quote-trash-item { display: grid; }
  .quote-trash-item > div:last-child { justify-content: flex-start; }
  .quote-settings-footer { flex-wrap: wrap; }
  .quote-settings-footer > span { display: none; }
}
