:root {
  --sidebar: #1f232b;
  --topbar: #0d4a28;
  --green: #0d4a28;
  --green-soft: #eff7f1;
  --head: #3a4353;
  --paper: #f3f4f5;
  --panel: #ffffff;
  --line: #d9dde2;
  --muted: #6b7480;
  --ink: #121820;
  --link: #0086c9;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.quotes-page {
  width: 100%;
  margin: 0;
  padding: 32px 32px 34px;
  color: #1c232b;
  background: #ffffff;
  font-size: 12px;
}

.quotes-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid #2c9ccc;
}

.quotes-header p,
.quotes-header h1 {
  margin: 0;
}

.quotes-header p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.quotes-header h1 {
  color: #08111d;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.quotes-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quotes-header button,
.quotes-actions button,
.quotes-load-more {
  min-height: 32px;
  padding: 5px 11px;
  color: #06391f;
  background: #ffffff;
  border: 1px solid #bfc8c2;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.quotes-header button:hover,
.quotes-actions button:hover,
.quotes-load-more:hover {
  background: #f4f7f5;
}

.quotes-warning {
  margin: 0 0 10px;
  padding: 10px 12px;
  color: #8b2f21;
  background: #fff2ec;
  border: 1px solid rgba(139, 47, 33, 0.22);
  font-weight: 700;
}

.quotes-filter-card {
  margin: 0;
  background: #ffffff;
}

.quotes-filter-card h2 {
  margin: 0;
  padding: 9px 10px;
  color: #151d28;
  background: #e5e9ef;
  font-size: 12px;
  font-weight: 800;
}

.quotes-filters {
  display: grid;
  grid-template-columns: 150px 150px 150px 150px minmax(220px, 1fr) 170px;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #e5e8eb;
}

.quotes-filters label {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e8eb;
  color: #1c2430;
  font-size: 12px;
  font-weight: 700;
}

.quotes-filters span {
  font-size: 12px;
}

.quotes-filters input,
.quotes-filters select {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 6px 8px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
}

.quotes-filters .wide {
  grid-column: span 2;
}

.check-row {
  align-content: end;
}

.check-row input {
  width: 13px;
  height: 13px;
  min-height: 13px;
  padding: 0;
}

.quotes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.quotes-actions > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quotes-actions span {
  color: #0f1722;
  font-weight: 400;
}

.quotes-actions button {
  color: #1d2732;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.quotes-actions button::first-letter {
  color: inherit;
}

.quotes-actions #quotesCreate {
  padding-left: 0;
}

.quotes-actions #quotesFilter::before {
  content: "\25BC";
  display: inline-block;
  margin-right: 5px;
  color: #222222;
  font-size: 10px;
  transform: rotate(-90deg);
}

.quotes-table-wrap {
  overflow: auto;
  border: 0;
}

.quotes-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.quotes-table th {
  padding: 10px 12px;
  color: #ffffff;
  background: var(--head);
  border-right: 1px solid #566070;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
}

.quotes-table th:nth-child(1) { width: 90px; }
.quotes-table th:nth-child(2) { width: 108px; }
.quotes-table th:nth-child(3) { width: 245px; }
.quotes-table th:nth-child(4) { width: 245px; }
.quotes-table th:nth-child(5) { width: 135px; }
.quotes-table th:nth-child(6) { width: 130px; }
.quotes-table th:nth-child(7) { width: 54px; }
.quotes-table th:nth-child(8) { width: 178px; }

.quotes-table th:last-child {
  text-align: right;
}

.quotes-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e3e6e8;
  color: #111827;
  line-height: 1.22;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.quotes-table tbody tr:nth-child(even) td {
  background: #f0f2f4;
}

.quotes-table tr.quote-status-rascunho td { background: #ffffff; }
.quotes-table tr.quote-status-cotizar td { background: #fff8cf; }
.quotes-table tr.quote-status-cotizado td { background: #d6f4ee; }
.quotes-table tr.quote-status-pedido td { background: #eee1f7; }
.quotes-table tr.quote-status-comprado td { background: #edfbdc; }
.quotes-table tr.quote-status-entregado td { background: #e7f6dc; }
.quotes-table tr.quote-status-rechazado td { background: #f8dddd; }
.quotes-table tr.quote-status-anulado td { background: #fde7d5; }

.quotes-table button.link-button {
  padding: 0;
  color: var(--link);
  background: none;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
}

.quotes-state-select,
.quotes-note-input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
}

.quotes-note-readonly {
  max-width: 100%;
  min-height: 26px;
  padding: 4px 0;
  overflow: hidden;
  color: #111827;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-total-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 150px;
}

.quote-total-value {
  white-space: nowrap;
}

.quote-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quote-square-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #2e3743;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.quote-save-action {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.quote-cancel-action {
  color: #ffffff;
  background: #b42318;
  border-color: #b42318;
}

.quote-menu-wrap {
  position: relative;
}

.quote-action-menu {
  position: fixed;
  top: auto;
  left: auto;
  z-index: 1000;
  display: grid;
  min-width: 168px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  box-shadow: 0 8px 18px rgba(15, 23, 34, 0.16);
}

.quote-action-menu button {
  min-height: 29px;
  padding: 0 9px;
  color: #1f252d;
  background: transparent;
  border: 0;
  border-radius: 2px;
  font-weight: 400;
  text-align: left;
}

.quote-action-menu button:hover {
  background: #eef2f4;
}

.quote-detail-row td {
  padding: 0;
  background: #ffffff !important;
}

.quote-new-row > td {
  padding: 0 !important;
  background: #ffffff !important;
}

.quote-new-form {
  display: grid;
  gap: 10px;
  padding: 10px 0 0;
  color: #111827;
  background: #ffffff;
}

.quote-new-section-title {
  margin: 0 10px;
  padding: 9px 10px;
  color: #151d28;
  background: #e5e9ef;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-new-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px 220px;
  gap: 8px 12px;
  padding: 0 10px;
}

.quote-new-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #1c2430;
  font-size: 12px;
  font-weight: 700;
}

.quote-new-grid small {
  color: #69727d;
  font-size: 11px;
  font-weight: 400;
}

.quote-new-grid .wide {
  grid-column: 1 / -1;
}

.quote-new-grid input,
.quote-new-grid select,
.quote-new-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 6px 8px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
  font: inherit;
}

.quote-new-grid textarea {
  min-height: 64px;
  resize: vertical;
}

.quote-new-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 10px;
  padding: 10px;
  background: #e9edf2;
}

.quote-new-footer button {
  min-height: 32px;
  padding: 5px 13px;
  color: #1d2732;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 34, 0.08);
}

.quote-new-footer [data-new-quote-save] {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.quote-detail-panel {
  display: grid;
  gap: 10px;
  padding: 10px 0 12px;
  border-bottom: 1px solid #e3e6e8;
}

.quote-detail-panel h3 {
  margin: 0;
  padding: 8px 10px;
  color: #151d28;
  background: #e5e9ef;
  font-size: 12px;
  font-weight: 800;
}

.quote-product-add {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0 10px 4px;
}

.quote-product-title {
  padding: 9px 10px;
  color: #151d28;
  background: #e5e9ef;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-product-add-row {
  display: grid;
  grid-template-columns: 162px minmax(280px, 1fr) 92px 86px 112px 116px;
  gap: 8px;
  align-items: center;
}

.quote-product-add input,
.quote-product-add button {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 5px 8px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
  font-size: 12px;
}

.quote-product-add button {
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 34, 0.08);
}

.quote-product-sku-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.quote-product-sku-wrap input {
  border-radius: 2px 0 0 2px;
}

.quote-product-sku-wrap button {
  border-left: 0;
  border-radius: 0 2px 2px 0;
  font-size: 15px;
  line-height: 1;
}

.quote-product-results {
  position: absolute;
  top: 82px;
  left: 180px;
  right: 150px;
  z-index: 20;
  display: grid;
  max-height: 260px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  box-shadow: 0 8px 18px rgba(15, 23, 34, 0.16);
}

.quote-product-results button {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 210px;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.quote-product-results button:hover {
  background: #eef2f4;
}

.quote-product-results span,
.quote-product-results small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-product-results small {
  color: #68717d;
}

.quote-items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.quote-items-table th {
  padding: 8px 10px;
  color: #ffffff;
  background: var(--head) !important;
  border-right: 1px solid #566070;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.quote-items-table td {
  padding: 7px 10px;
  color: #1f252d;
  background: #ffffff !important;
  border: 1px solid #e3e6e8;
  font-weight: 400;
  text-align: left;
}

.quote-items-table input {
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
}

.quote-totals-summary {
  justify-self: end;
  display: grid;
  gap: 5px;
  min-width: 280px;
  margin: 0 10px;
  padding: 10px 12px;
  background: #f7f8fa;
  border: 1px solid #d9dde2;
}

.quote-totals-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #1f252d;
}

.quote-totals-summary span {
  font-weight: 700;
}

.quote-totals-summary strong {
  white-space: nowrap;
}

.quote-totals-grand {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 2px solid var(--green);
  color: var(--green) !important;
  font-size: 14px;
  font-weight: 900;
}

.quote-general-notes {
  display: grid;
  gap: 4px;
  padding: 0 10px;
}

.quote-general-notes span {
  color: #1c2430;
  font-size: 12px;
  font-weight: 700;
}

.quote-general-notes textarea {
  width: 100%;
  min-height: 64px;
  padding: 7px 8px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
  resize: vertical;
  font: inherit;
}

.quote-general-notes-readonly p {
  margin: 0;
  padding: 7px 8px;
  color: #1f252d;
  background: #ffffff;
  border: 1px solid #cfd4d8;
  border-radius: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quotes-empty {
  padding: 12px !important;
  background: #ffffff !important;
  color: #1f252d !important;
  text-align: left !important;
  font-weight: 400;
}

.quotes-load-more {
  display: block;
  margin: 12px auto 0;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #ffffff;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(7, 24, 13, 0.22);
  font-size: 18px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .quotes-page {
    padding: 22px 14px 28px;
  }

  .quotes-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quotes-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quotes-filters .wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .quotes-page {
    padding: 18px 10px 24px;
  }

  .quotes-header-actions,
  .quotes-header button,
  .quotes-actions button {
    width: 100%;
  }

  .quotes-filters {
    grid-template-columns: 1fr;
  }

  .quotes-filters .wide {
    grid-column: auto;
  }

  .quotes-actions,
  .quotes-actions > div {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-new-grid {
    grid-template-columns: 1fr;
  }

  .quote-new-footer {
    flex-direction: column;
  }

  .quote-product-add-row {
    grid-template-columns: 1fr;
  }

  .quote-product-results {
    position: static;
  }

  .quote-product-results button {
    grid-template-columns: 1fr;
  }
}
