/* ── Quotation page ── */

.quote-page {
  background: var(--light);
}

.quote-intro {
  max-width: 680px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  line-height: 1.6;
}

.quote-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.quote-builder {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.quote-builder__head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.quote-builder__head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.quote-builder__head p {
  font-size: 0.88rem;
  color: var(--gray);
  margin: 0;
}

.quote-category {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.quote-category:last-child {
  border-bottom: none;
}

.quote-category__title {
  padding: 14px 24px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  background: #f8fafc;
}

.quote-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.04);
  transition: background 0.2s ease;
}

.quote-item:hover {
  background: rgba(132, 204, 22, 0.03);
}

.quote-item.is-selected {
  background: rgba(132, 204, 22, 0.06);
}

.quote-item__check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--lime-dark);
  cursor: pointer;
}

.quote-item__info h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.quote-item__info p {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.5;
  margin: 0 0 6px;
}

.quote-item__price-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

.quote-item__qty {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.quote-item.is-selected .quote-item__qty {
  display: flex;
}

.quote-item__qty label {
  font-size: 0.78rem;
  color: var(--slate);
  font-weight: 500;
}

.quote-item__qty input {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
}

.quote-item__line-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  padding-top: 2px;
}

.quote-item:not(.is-selected) .quote-item__line-total {
  opacity: 0.35;
}

/* Summary panel */
.quote-summary {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.quote-summary__head {
  padding: 20px 22px;
  background: linear-gradient(135deg, #0f172a 0%, #14532d 100%);
  color: #fff;
}

.quote-summary__head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.quote-summary__ref {
  font-size: 0.75rem;
  opacity: 0.75;
}

.quote-summary__body {
  padding: 20px 22px;
}

.quote-client-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.quote-client-fields input,
.quote-client-fields textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
}

.quote-client-fields textarea {
  min-height: 72px;
  resize: vertical;
}

.quote-lines {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 14px;
  margin-bottom: 14px;
  min-height: 80px;
}

.quote-lines-empty {
  font-size: 0.85rem;
  color: var(--gray);
  text-align: center;
  padding: 16px 0;
}

.quote-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
}

.quote-line span:first-child {
  color: var(--slate);
  flex: 1;
}

.quote-line span:last-child {
  font-weight: 600;
  color: var(--navy);
}

.quote-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 2px solid var(--green);
  margin-bottom: 8px;
}

.quote-total__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
}

.quote-total__amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}

.quote-disclaimer {
  font-size: 0.72rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 16px;
}

.quote-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-actions .btn {
  width: 100%;
  justify-content: center;
}

.quote-status {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--gray);
  min-height: 1.2em;
}

.quote-status.is-error {
  color: #dc2626;
}

.quote-status.is-success {
  color: var(--green);
}

/* Custom quote request */
.quote-request-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.quote-request-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.quote-request-info h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 12px;
}

.quote-request-info p {
  color: var(--gray);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.quote-request-list {
  list-style: none;
  padding: 0;
}

.quote-request-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--slate);
}

.quote-request-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
}

.quote-request-form {
  background: #fff;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow);
}

/* Printable quotation document */
.quote-print-doc {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 10mm 38mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.quote-printing > *:not(#quote-print-doc) {
    display: none !important;
  }

  body.quote-printing #quote-print-doc {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    color: #0f172a;
    font-family: Inter, system-ui, sans-serif;
    font-size: 8.5pt;
    line-height: 1.3;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #quote-print-doc,
  #quote-print-doc * {
    box-sizing: border-box;
  }

  #quote-print-doc img {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
  }

  .quote-print-sheet {
    width: 100%;
  }

  /* Layout table — thead repeats header on every page */
  .quote-print-layout {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
  }

  .quote-print-layout thead {
    display: table-header-group;
  }

  .quote-print-layout thead td,
  .quote-print-layout tbody td {
    border: none;
    padding: 0;
    vertical-align: top;
    background: #fff;
  }

  .quote-print-layout thead td {
    padding-bottom: 10px;
  }

  /* Fixed page footer — terms sit at the bottom of every printed page */
  .quote-print-page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    padding: 5px 10mm 0;
    border-top: 1px solid #cbd5e1;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quote-print-header {
    border-bottom: 1.5px solid #14532d;
    padding-bottom: 8px;
  }

  .quote-print-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px !important;
    padding: 0 !important;
  }

  .quote-print-brand {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .quote-print-logo {
    width: auto;
    height: 46px;
    max-width: 175px;
    object-fit: contain;
    object-position: left center;
  }

  .quote-print-title-block {
    text-align: right;
    flex-shrink: 0;
  }

  .quote-print-title-block h1 {
    margin: 0 0 3px !important;
    font-size: 14pt;
    font-weight: 800;
    color: #14532d;
    line-height: 1.05;
  }

  .quote-print-title-block dl {
    margin: 0 !important;
    display: grid;
    gap: 2px;
  }

  .quote-print-title-block dl div {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    justify-content: end;
    font-size: 7pt;
    line-height: 1.2;
  }

  .quote-print-title-block dt {
    margin: 0;
    color: #64748b;
    font-weight: 500;
  }

  .quote-print-title-block dd {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
  }

  .quote-print-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
  }

  .quote-print-party {
    padding: 6px 10px !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
  }

  .quote-print-party h2 {
    margin: 0 0 3px !important;
    font-size: 6.5pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #14532d;
    font-weight: 700;
    line-height: 1.15;
  }

  .quote-print-party p {
    margin: 0 !important;
    font-size: 7.5pt;
    color: #334155;
    line-height: 1.25;
  }

  .quote-print-content-cell {
    padding: 10px 0 0 !important;
  }

  .quote-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 !important;
  }

  .quote-print-table thead {
    display: table-header-group;
  }

  .quote-print-table tbody tr {
    break-inside: avoid;
  }

  .quote-print-table th,
  .quote-print-table td {
    padding: 4px 6px !important;
    border: 1px solid #e2e8f0;
    vertical-align: top;
    font-size: 7.5pt;
    line-height: 1.25;
  }

  .quote-print-table th {
    background: #14532d;
    color: #fff;
    font-weight: 600;
    text-align: left;
    font-size: 6.5pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  .quote-print-table .col-num { width: 4%; text-align: center; }
  .quote-print-table .col-qty { width: 5%; text-align: center; }
  .quote-print-table .col-unit { width: 10%; }
  .quote-print-table .col-price { width: 10%; text-align: right; }
  .quote-print-table .col-total { width: 11%; text-align: right; font-weight: 700; }

  .quote-print-table .col-desc strong {
    display: block;
    font-size: 7.5pt;
    color: #0f172a;
    line-height: 1.2;
  }

  .quote-print-table .col-desc span {
    display: block;
    font-size: 6.5pt;
    color: #64748b;
    line-height: 1.2;
  }

  .quote-print-notes {
    margin: 8px 0 0 !important;
    padding: 0 !important;
  }

  .quote-print-notes h2 {
    margin: 0 0 3px !important;
    font-size: 7pt;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #14532d;
  }

  .quote-print-notes p {
    margin: 0 !important;
    font-size: 7pt;
    color: #475569;
    line-height: 1.25;
  }

  .quote-print-summary {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    break-inside: avoid;
  }

  .quote-print-summary-box {
    width: 58mm;
    border: 1px solid #14532d;
    border-radius: 4px;
    overflow: hidden;
  }

  .quote-print-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px !important;
    font-size: 7.5pt;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.2;
  }

  .quote-print-summary-row--total {
    background: #14532d;
    color: #fff;
    font-weight: 800;
    font-size: 8pt;
    border-bottom: none;
  }

  .quote-print-terms {
    margin: 0 0 4px !important;
    padding: 0 !important;
  }

  .quote-print-terms h2 {
    margin: 0 0 3px !important;
    font-size: 7pt;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #14532d;
    line-height: 1.1;
  }

  .quote-print-terms ul {
    margin: 0 !important;
    padding-left: 12px !important;
    columns: 3;
    column-gap: 10px;
  }

  .quote-print-terms li {
    font-size: 6.5pt;
    color: #475569;
    margin: 0 !important;
    line-height: 1.25;
  }

  .quote-print-footer-meta {
    padding: 3px 0 0 !important;
    border-top: 1px solid #e2e8f0;
    text-align: center;
  }

  .quote-print-footer-meta p {
    margin: 0 !important;
    font-size: 6.5pt;
    color: #64748b;
    line-height: 1.25;
  }

  .quote-print-footer-note {
    font-style: italic;
    margin-top: 2px !important;
  }
}

@media (max-width: 1024px) {
  .quote-layout {
    grid-template-columns: 1fr;
  }

  .quote-summary {
    position: static;
  }

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

@media (max-width: 640px) {
  .quote-item {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .quote-item__line-total {
    grid-column: 2;
    padding-top: 0;
  }
}
