:root {
  --brand-blue: #11538c;
  --brand-orange: #f27127;
  --white: #ffffff;
  --text: #11538c;
  --muted: rgba(17, 83, 140, 0.7);
  --border: rgba(17, 83, 140, 0.18);
  --surface: rgba(17, 83, 140, 0.04);
  --shadow: rgba(17, 83, 140, 0.12);
  --danger: #f27127;
  --ok: #3c8c3a;
  --radius-md: 9px;
  --radius-sm: 5px;
  --quote-width: 980px;
  --quote-inner-pad: 33px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", "Inter", sans-serif;
  color: var(--text);
  background: var(--white);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.controls-left,
.controls-right {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.controls-right {
  margin-left: auto;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.field input,
.field select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white);
}

.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px var(--shadow);
}

.btn-primary {
  background: var(--brand-blue);
  color: var(--white);
  border-color: var(--brand-blue);
}

.btn-outline {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--white);
}

.status {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--danger);
}

.status.is-ok {
  color: var(--ok);
}

.quote-stage {
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.quote {
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 20px 40px var(--shadow);
  width: var(--quote-width);
  max-width: var(--quote-width);
  margin: 0 auto;
}

.quote-table-wrap {
  overflow-x: auto;
  padding: 12px var(--quote-inner-pad) 18px;
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--quote-inner-pad);
  background: var(--brand-blue);
  border-bottom: 0;
  gap: 12px;
}

.quote-recipient {
  display: flex;
  justify-content: space-between;
  padding: 10px var(--quote-inner-pad);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 0;
  background: var(--white);
}

.recipient-label {
  font-weight: 600;
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 70px;
  width: auto;
  max-width: 308px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 7px;
  margin: 5px;
}

.quote-center {
  flex: 1;
  text-align: center;
}

.quote-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--white);
  font-family: "Inter", "Roboto", sans-serif;
  white-space: nowrap;
}

.quote-number {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

.quote-meta {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.meta-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.quote-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  table-layout: auto;
  font-variant-numeric: tabular-nums;
}

.quote-table th:nth-child(1),
.quote-table td:nth-child(1) {
  width: 52px;
}

.quote-table th:nth-child(2),
.quote-table td:nth-child(2) {
  width: 120px;
}

.quote-table th:nth-child(4),
.quote-table td:nth-child(4) {
  width: 80px;
}

.quote-table th:nth-child(5),
.quote-table td:nth-child(5) {
  width: 80px;
}

.quote-table th:nth-child(6),
.quote-table td:nth-child(6) {
  width: 80px;
}

.quote-table thead th {
  background: var(--brand-blue);
  color: var(--white);
  padding: 12px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.quote-table thead th:last-child {
  border-right: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.quote-table thead th:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}


.quote-table tbody td {
  padding: 14px 12px;
  border-bottom: none;
  vertical-align: middle;
  font-size: 20px;
  background: var(--white);
}

.col-qty input {
  width: 56px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  background: transparent;
  text-align: right;
}

.qty-text {
  display: none;
  font-weight: 700;
  background: transparent;
  color: #000000;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
}

.exporting .qty-text {
  display: inline-block;
}

.price-input {
  width: 92px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-align: right;
  font-weight: 600;
  color: #000000;
}

.price-text {
  display: none;
  font-weight: 700;
  font-size: 15px;
  color: #000000;
}

.exporting .price-text {
  display: inline-block;
}

.col-total {
  font-weight: 800;
  font-size: 30px;
  text-align: right;
}

.col-img img {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  border: none;
  border-radius: 3px;
  background: transparent;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  display: block;
}

.col-img {
  text-align: center;
  vertical-align: middle;
  padding: 1px;
  background: rgba(17, 83, 140, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.desc-name {
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  color: rgba(0, 0, 0, 0.85);
  font-size: 15px;
}

.desc-models {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.35;
  white-space: pre-wrap;
  margin-top: 6px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.row-action {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.row-action-danger {
  border-color: rgba(242, 113, 39, 0.5);
  color: var(--brand-orange);
}

.edit-product-input {
  display: none;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.edit-actions {
  display: none;
}

.quote-row.is-editing .desc-name,
.quote-row.is-editing .desc-models,
.quote-row.is-editing .row-actions {
  display: none;
}

.quote-row.is-editing .edit-product-input {
  display: block;
}

.quote-row.is-editing .edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.quote-total {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  align-items: center;
  padding: 16px 28px;
  background: var(--brand-blue);
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}

.quote-total span:last-child {
  min-width: 120px;
  text-align: right;
  font-size: 22px;
  font-weight: 800;
}

.quote-footer {
  padding: 10px 24px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--white);
  background: var(--brand-blue);
  border-top: 2px solid var(--white);
  letter-spacing: 0.08em;
}

.empty-row td {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.quote-table tbody tr {
  background: var(--white);
  box-shadow: 0 4px 8px var(--shadow);
  filter: drop-shadow(0 4px 8px var(--shadow));
}

.quote-table tbody tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.quote-table tbody tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.quote-table tbody td:nth-child(4) {
  text-align: center;
}

.quote-table tbody td:nth-child(5),
.quote-table tbody td:nth-child(6) {
  text-align: right;
}

.quote-table tbody td:nth-child(1),
.quote-table tbody td:nth-child(2) {
  text-align: center;
}

.quote-table tbody td:nth-child(3) {
  text-align: left;
}

.col-desc {
  vertical-align: top;
}

.quote-table tbody td:nth-child(1),
.quote-table tbody td:nth-child(4),
.quote-table tbody td:nth-child(5) {
  color: #000000;
  font-size: 15px;
}

.price-text::before,
.col-total::before,
#quote-total::before {
  content: "Bs.";
  font-size: 0.7em;
  margin-right: 4px;
  opacity: 1;
}

.exporting .quote-table-wrap {
  overflow: visible;
}

@media (max-width: 900px) {
  :root {
    --quote-inner-pad: 14px;
  }

  .page {
    padding: 16px;
  }

  .controls {
    align-items: stretch;
  }

  .controls-right {
    margin-left: 0;
  }

  .field {
    min-width: 100%;
  }

  .quote-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
  }

  .quote-total {
    flex-direction: row;
    align-items: center;
  }

  .quote-recipient {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  .brand-logo {
    height: 72px;
  }

  .quote-title {
    font-size: 18px;
    letter-spacing: 0.2em;
  }

  .quote-table-wrap {
    padding: 10px 14px 16px;
  }
}