/* Distribution — OlympicRibs / brand catalog, quotes, sold vessels */

.distribution-module {
  --dist-navy: #0b2545;
  --dist-sea: #1f6f8b;
  --dist-sand: #f4f7fb;
  --dist-line: #d9e2ec;
  --dist-accent: #c45c26;
}

.distribution-module .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.distribution-module .page-header h2 {
  margin: 0;
  color: var(--dist-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.distribution-module .dist-hint {
  margin: 0.35rem 0 0;
  color: #627d98;
  font-size: 0.92rem;
}

.dist-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.dist-metric {
  background: linear-gradient(165deg, #fff 0%, var(--dist-sand) 100%);
  border: 1px solid var(--dist-line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  min-width: 0;
}

.dist-metric strong,
.dist-metric .value {
  display: block;
  font-size: 1.45rem;
  color: var(--dist-navy);
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dist-metric span,
.dist-metric .label {
  color: #627d98;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

@media (max-width: 768px) {
  .dist-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .dist-metric { padding: 0.85rem 0.9rem; }
  .dist-metric strong,
  .dist-metric .value { font-size: 1.2rem; }
  .dist-metric span,
  .dist-metric .label { font-size: 0.75rem; }
  .dist-card-header {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .dist-card-header h3,
  .dist-card-header h2 {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.dist-card {
  background: #fff;
  border: 1px solid var(--dist-line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
}

.dist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dist-card-header h3 {
  margin: 0;
  color: var(--dist-navy);
  font-size: 1.05rem;
}

.dist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dist-table th,
.dist-table td {
  border-bottom: 1px solid var(--dist-line);
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.dist-table th {
  color: #627d98;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dist-list {
  display: grid;
  gap: 0.65rem;
}

.dist-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  background: linear-gradient(165deg, #fff 0%, var(--dist-sand) 100%);
}

.dist-list-item .meta {
  color: #627d98;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.dist-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.dist-filters label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #334e68;
  font-weight: 600;
}

.dist-filters select {
  min-width: 180px;
  border: 1px solid var(--dist-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.dist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.dist-price {
  font-weight: 700;
  color: var(--dist-navy);
  white-space: nowrap;
}

.dist-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

@media (max-width: 960px) {
  .dist-split { grid-template-columns: 1fr; }
}

.dist-opt-group {
  margin-bottom: 1rem;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0.75rem 0.9rem;
}

.dist-opt-subgroup-block {
  margin-bottom: 0.75rem;
}

.dist-opt-subgroup-label {
  font-weight: 700;
  font-size: 0.8rem;
  margin: 0.4rem 0;
  color: var(--dist-sea, #1f6f8b);
}

.dist-options-table {
  table-layout: fixed;
  width: 100%;
}

.dist-options-table col.dist-col-option { width: auto; }
.dist-options-table col.dist-col-price { width: 9.5rem; }
.dist-options-table col.dist-col-actions { width: 10.5rem; }

.dist-options-table th,
.dist-options-table td {
  vertical-align: middle;
}

.dist-options-table th.dist-col-price,
.dist-options-table td.dist-col-price {
  text-align: right;
  padding-right: 0.85rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dist-options-table th.dist-col-actions,
.dist-options-table td.dist-col-actions {
  text-align: right;
  width: 10.5rem;
}

.dist-options-table .dist-opt-name {
  font-weight: 600;
  color: var(--dist-navy);
  line-height: 1.3;
}

.dist-options-table .dist-opt-notes {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #627d98;
  line-height: 1.3;
}

.dist-options-table .dist-price {
  font-size: 0.95rem;
  display: block;
  text-align: right;
}

.dist-options-table .dist-opt-row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.4rem;
}

.dist-options-table .dist-opt-row-actions .btn {
  min-width: 4.6rem;
  justify-content: center;
}

@media (max-width: 720px) {
  .dist-options-table col.dist-col-price,
  .dist-options-table col.dist-col-actions {
    width: auto;
  }
  .dist-options-table .dist-opt-row-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.dist-opt-group-title {
  font-weight: 700;
  color: var(--dist-navy);
  margin-bottom: 0.55rem;
  letter-spacing: 0.02em;
}

.dist-field {
  display: grid;
  gap: 0.3rem;
}

.dist-field label {
  font-size: 0.86rem;
  color: #334e68;
  font-weight: 600;
}

.dist-field input,
.dist-field select,
.dist-field textarea {
  width: 100%;
  border: 1px solid var(--dist-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.dist-quote-lines input {
  width: 100%;
  min-width: 70px;
  border: 1px solid var(--dist-line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
}

.dist-totals .row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.35rem 0;
}

.dist-totals .row.grand {
  background: #fff8e7;
  border: 1px solid #f0d78c;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-weight: 800;
  color: var(--dist-navy);
}

.dist-badge.draft { background: #f1f5f9; color: #475569; }
.dist-badge.sent { background: #ecfdf5; color: #047857; }
.dist-badge.accepted { background: #eff6ff; color: #1d4ed8; }
.dist-badge.rejected { background: #fef2f2; color: #b91c1c; }
.dist-badge.converted { background: #fff7ed; color: #c2410c; }
.dist-badge.lead { background: #f1f5f9; color: #475569; }
.dist-badge.contacted { background: #e0f2fe; color: #0369a1; }
.dist-badge.quoted { background: #eff6ff; color: #1d4ed8; }
.dist-badge.negotiating { background: #fff7ed; color: #c2410c; }
.dist-badge.won { background: #ecfdf5; color: #047857; }
.dist-badge.lost { background: #fef2f2; color: #b91c1c; }

.distribution-module .search-input {
  border: 1px solid var(--dist-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.dist-section-panel { display: none; }
.dist-section-panel.active { display: block; }

.dist-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dist-toolbar .search-input,
.dist-toolbar select {
  min-width: 160px;
  flex-shrink: 0;
}

.dist-toolbar > * { flex-shrink: 0; }

.dist-import-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #cfe0ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #f3f8fc 0%, #eef5fb 100%);
  color: #334e68;
  font-size: 0.86rem;
  line-height: 1.35;
}

.dist-import-banner strong {
  color: #0b2545;
  font-weight: 700;
}

.dist-panel {
  background: #fff;
  border: 1px solid var(--dist-line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
}

.dist-panel h3 {
  margin: 0 0 0.85rem;
  color: var(--dist-navy);
  font-size: 1.05rem;
}

.dist-grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

@media (max-width: 960px) {
  .dist-grid-2 { grid-template-columns: 1fr; }
}

.dist-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.dist-form-grid label,
.dist-form-stack label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #334e68;
  font-weight: 600;
}

.dist-form-grid .full,
.dist-field.full,
.dist-span-2 { grid-column: 1 / -1; }

.dist-form-grid input,
.dist-form-grid select,
.dist-form-grid textarea,
.dist-form-stack input,
.dist-form-stack select,
.dist-form-stack textarea {
  width: 100%;
  border: 1px solid var(--dist-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.dist-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.dist-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.dist-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef4f8;
  border: 1px solid var(--dist-line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
}

.dist-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #9b1c1c;
  font-weight: 700;
}

.dist-option-group {
  margin-bottom: 1rem;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  overflow: hidden;
}

.dist-option-group-head {
  background: linear-gradient(90deg, #0b2545 0%, #1f6f8b 100%);
  color: #fff;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dist-option-subgroup {
  background: #edf2f7;
  color: var(--dist-navy);
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  font-size: 0.86rem;
  border-top: 1px solid var(--dist-line);
}

.dist-quote-table input[type="number"],
.dist-quote-table input[type="text"] {
  width: 100%;
  min-width: 70px;
  border: 1px solid var(--dist-line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
}

.dist-totals {
  margin-top: 1rem;
  display: grid;
  justify-content: end;
  gap: 0.35rem;
  min-width: 280px;
  margin-left: auto;
}

.dist-totals div {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.35rem 0;
}

.dist-totals .dist-grand {
  background: #fff8e7;
  border: 1px solid #f0d78c;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-weight: 800;
  color: var(--dist-navy);
}

.dist-empty {
  color: #829ab1;
  padding: 1rem 0;
}

.dist-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e6f0ff;
  color: #1d4ed8;
}

.dist-badge--draft { background: #f1f5f9; color: #475569; }
.dist-badge--sent { background: #ecfdf5; color: #047857; }
.dist-badge--converted { background: #fff7ed; color: #c2410c; }

.dist-quote-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(31, 111, 139, 0.28), transparent 55%),
    rgba(11, 37, 69, 0.72);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.dist-quote-sheet.hidden { display: none; }

.dist-quote-toolbar {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dist-quote-toolbar-hint {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
}

.dist-quote-toolbar .dist-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.dist-quote-toolbar .btn {
  color: #fff;
}

.dist-quote-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dist-quote-doc,
.dist-quote-doc--portrait {
  position: relative;
  width: min(100%, 210mm);
  max-width: 210mm;
  flex: 0 0 auto;
  background: #fff;
  color: #12263a;
  padding: 0 0 1rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 28px 70px rgba(7, 20, 38, 0.35);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  overflow: visible;
}

.dist-quote-doc--compact {
  font-size: 0.92rem;
}

.dist-photo-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 0.85rem;
  align-items: start;
}

.dist-photo-preview {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  background: linear-gradient(165deg, #fff 0%, var(--dist-sand) 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #627d98;
  font-size: 0.85rem;
}

.dist-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dist-detail-photos-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.dist-detail-photo-slot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dist-detail-photo-slot-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dist-navy, #0b2545);
}

.dist-detail-photo-slot .dist-photo-preview {
  aspect-ratio: 4 / 3;
}

.dist-detail-photo-slot input[type="url"],
.dist-detail-photo-slot input[type="file"] {
  width: 100%;
  font-size: 0.82rem;
}

.dist-modal--sister-photos {
  width: min(100%, 820px);
}

.dist-sister-picker {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dist-sister-picker .dist-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dist-sister-picker .dist-field span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dist-navy, #0b2545);
}

.dist-sister-picker select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--dist-line);
  border-radius: 10px;
  font-size: 0.92rem;
  background: #fff;
}

.dist-sister-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.dist-sister-slot {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.35rem 0.55rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  background: linear-gradient(165deg, #fff 0%, var(--dist-sand, #f6f1e8) 100%);
  cursor: pointer;
}

.dist-sister-slot.is-empty {
  opacity: 0.55;
  cursor: not-allowed;
}

.dist-sister-slot input[type="checkbox"] {
  grid-row: 1 / span 2;
  margin-top: 0.35rem;
  width: 1rem;
  height: 1rem;
}

.dist-sister-slot-preview {
  grid-column: 2;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--dist-line);
  display: grid;
  place-items: center;
  color: #627d98;
  font-size: 0.78rem;
}

.dist-sister-slot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dist-sister-slot-meta {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dist-sister-slot-meta strong {
  font-size: 0.85rem;
  color: var(--dist-navy, #0b2545);
}

.dist-sister-slot-meta small {
  color: #627d98;
  font-size: 0.75rem;
}

.dist-sister-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.dist-sister-slot--map {
  grid-template-columns: 1fr;
  cursor: default;
}

.dist-sister-slot--map .dist-sister-slot-preview {
  grid-column: 1;
}

.dist-sister-slot--map .dist-sister-slot-meta {
  grid-column: 1;
}

.dist-sister-map-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #627d98;
}

.dist-sister-map-label select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--dist-line);
  border-radius: 8px;
  font-size: 0.82rem;
  background: #fff;
  color: var(--dist-navy, #0b2545);
}

.dist-quote-detail-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.dist-quote-detail-photo {
  margin: 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.dist-quote-detail-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid #d9e6ef;
  background: #f7fafc;
}

.dist-quote-detail-photo figcaption {
  margin-top: 0.28rem;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #627d98;
  text-align: center;
}

.dist-quote-accent {
  height: 5px;
  background: linear-gradient(90deg, #0b2545 0%, #1f6f8b 55%, #c45c26 100%);
}

.dist-quote-top {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem 0.7rem;
  background:
    linear-gradient(180deg, #f7fafc 0%, #ffffff 70%);
  border-bottom: 1px solid #e3ebf2;
}

.dist-quote-brand {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.dist-quote-logos {
  /* Shared box so company + brand logos render at the same width. */
  --dist-quote-logo-width: 130px;
  --dist-quote-logo-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  flex-shrink: 0;
  width: var(--dist-quote-logo-width);
}

.dist-quote-logos .dist-quote-logo,
.dist-quote-logos .dist-quote-logo--company,
.dist-quote-logos .dist-quote-logo--brand {
  display: block;
  box-sizing: border-box;
  width: var(--dist-quote-logo-width) !important;
  max-width: var(--dist-quote-logo-width) !important;
  height: var(--dist-quote-logo-height) !important;
  max-height: var(--dist-quote-logo-height) !important;
  object-fit: contain;
  object-position: center center;
}

.dist-quote-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  max-width: 120px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b2545, #1f6f8b);
  color: #fff;
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.dist-quote-company {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  color: #0b2545;
  line-height: 1.15;
}

.dist-quote-brand-sub {
  margin-top: 0.1rem;
  color: #1f6f8b;
  font-weight: 650;
  font-size: 0.8rem;
}

.dist-quote-company-details {
  margin-top: 0.25rem;
  color: #627d98;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: pre-line;
  max-width: 28rem;
}

.dist-quote-titleblock {
  text-align: right;
}

.dist-quote-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1f6f8b;
  font-weight: 700;
}

.dist-quote-title {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #0b2545;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 0.1rem;
}

.dist-quote-number {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #0b2545;
  color: #fff;
  font-weight: 750;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.dist-quote-olr {
  display: inline-block;
  margin-top: 0.1rem;
  font-weight: 700;
  color: #0b2545;
}

.dist-quote-title-meta {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.08rem;
  color: #627d98;
  font-size: 0.74rem;
}

.dist-quote-parties,
.dist-quote-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  padding: 0.65rem 1.1rem 0.15rem;
}

.dist-quote-intro.has-photo {
  grid-template-columns: 1fr 1fr 0.95fr;
  align-items: stretch;
}

.dist-quote-vessel-photo {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d9e6ef;
  background: #0b2545;
  min-height: 0;
  height: 100%;
  max-height: 140px;
}

.dist-quote-vessel-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 110px;
  max-height: 140px;
  object-fit: cover;
  object-position: center;
}

.dist-quote-card {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: linear-gradient(165deg, #ffffff 0%, #f4f8fb 100%);
}

.dist-quote-card--model {
  background: linear-gradient(165deg, #0b2545 0%, #163a5f 100%);
  border-color: #0b2545;
  color: #fff;
}

.dist-quote-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 750;
  color: #1f6f8b;
  margin-bottom: 0.2rem;
}

.dist-quote-card--model .dist-quote-card-label {
  color: #9fd0df;
}

.dist-quote-card-name {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 0.98rem;
  font-weight: 750;
  color: #0b2545;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.dist-quote-card--model .dist-quote-card-name {
  color: #fff;
}

.dist-quote-card-line {
  color: #486581;
  font-size: 0.78rem;
  line-height: 1.35;
}

.dist-quote-card--model .dist-quote-card-line {
  color: rgba(255, 255, 255, 0.82);
}

.dist-quote-card--model .dist-quote-card-final {
  margin-top: 0.25rem;
  font-weight: 750;
  color: #fff;
  font-size: 0.88rem;
}

.dist-quote-section {
  padding: 0.55rem 1.1rem 0.1rem;
}

.dist-quote-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  border-bottom: 1.5px solid #0b2545;
  padding-bottom: 0.25rem;
}

.dist-quote-section-head h2 {
  margin: 0;
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b2545;
}

.dist-quote-section-head span {
  color: #829ab1;
  font-size: 0.72rem;
}

.dist-quote-terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.dist-quote-spec-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.dist-quote-spec {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: #f8fbfd;
}

.dist-quote-spec-label {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #627d98;
  font-weight: 700;
  line-height: 1.2;
}

.dist-quote-spec-value {
  margin-top: 0.1rem;
  font-weight: 750;
  color: #0b2545;
  font-size: 0.78rem;
  line-height: 1.2;
}

.dist-quote-std-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
}

.dist-quote-std-group {
  border-left: 2px solid #1f6f8b;
  padding-left: 0.45rem;
}

.dist-quote-std-title {
  font-weight: 750;
  color: #0b2545;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
}

.dist-quote-std-group ul,
.dist-quote-std-items {
  margin: 0;
  padding-left: 0;
  color: #486581;
  font-size: 0.68rem;
  line-height: 1.3;
}

.dist-quote-std-group ul {
  padding-left: 0.85rem;
}

.dist-quote-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem 0.85rem;
}

.dist-quote-color {
  padding: 0.55rem 0.65rem 0.6rem;
  border-top: 2px solid var(--dist-accent, #1f6f8b);
  background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
}

.dist-quote-color-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #627d98;
  margin-bottom: 0.2rem;
}

.dist-quote-color-value {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--dist-navy, #0b2545);
  line-height: 1.25;
}

.dist-quote-colors input[type="text"] {
  width: 100%;
  min-width: 140px;
}

.dist-quote-doc table.dist-quote-lines-print {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  overflow: hidden;
}

.dist-quote-lines-print thead th {
  background: #0b2545;
  color: #fff;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.4rem 0.45rem;
  border: 0;
}

.dist-quote-lines-print td {
  padding: 0.38rem 0.45rem;
  border-bottom: 1px solid #e6eef5;
  vertical-align: top;
  color: #243b53;
}

.dist-quote-lines-print tbody tr:nth-child(even) {
  background: #f8fbfd;
}

.dist-quote-lines-print tbody tr.is-engine {
  background: #eef7fa;
}

.dist-quote-lines-print .desc { width: 52%; }
.dist-quote-lines-print .num,
.dist-quote-lines-print th.num { text-align: right; white-space: nowrap; }

.dist-quote-line-name {
  font-weight: 650;
  color: #0b2545;
  line-height: 1.25;
}

.dist-quote-line-tag {
  margin-top: 0.1rem;
  font-size: 0.66rem;
  color: #1f6f8b;
}

.dist-quote-line-amount {
  font-weight: 750;
  color: #0b2545;
}

.dist-quote-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.dist-quote-totals-print {
  width: min(100%, 280px);
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.dist-quote-totals-print .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0.65rem;
  color: #486581;
  border-bottom: 1px solid #eef2f6;
  font-size: 0.78rem;
}

.dist-quote-totals-print .row.grand {
  border-bottom: 0;
  background: linear-gradient(135deg, #0b2545 0%, #1f6f8b 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.55rem 0.65rem;
}

.dist-quote-notes,
.dist-quote-payment-terms {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: #f8fbfd;
  color: #334e68;
  white-space: pre-wrap;
  line-height: 1.35;
  font-size: 0.76rem;
}

.dist-quote-doc-footer {
  margin: 0.65rem 1.1rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid #d9e6ef;
  color: #627d98;
  font-size: 0.72rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.dist-quote-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.dist-quote-footer-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 750;
  color: #0b2545;
  margin-bottom: 0.15rem;
}

.dist-quote-footer-note {
  line-height: 1.35;
  margin-bottom: 0;
}

.dist-quote-signoff {
  width: min(100%, 180px);
  margin-left: auto;
  padding-top: 0.25rem;
}

.dist-quote-sign-line {
  border-bottom: 1px solid #94a3b8;
  height: 1.4rem;
}

.dist-quote-sign-caption {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  color: #829ab1;
  text-align: center;
}

/* Screen-only: keep print on the same desktop layout as the on-screen preview. */
@media screen and (max-width: 800px) {
  .dist-quote-top,
  .dist-quote-parties,
  .dist-quote-intro,
  .dist-quote-intro.has-photo,
  .dist-quote-std-grid,
  .dist-quote-terms-grid,
  .dist-quote-footer-grid,
  .dist-quote-doc-footer,
  .dist-photo-row {
    grid-template-columns: 1fr;
  }
  .dist-quote-titleblock { text-align: left; }
  .dist-quote-spec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dist-quote-detail-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dist-quote-vessel-photo,
  .dist-quote-vessel-photo img {
    max-height: 160px;
  }
}

body.dist-quote-open { overflow: hidden; }

body.dist-modal-open { overflow: hidden; }

.dist-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.dist-modal {
  width: min(100%, 760px);
  max-height: min(90vh, 860px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dist-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--dist-line);
}

.dist-modal-header h3 {
  margin: 0 0 0.35rem;
  color: var(--dist-navy);
}

.dist-modal-body {
  padding: 1rem 1.25rem;
  overflow: auto;
  flex: 1;
}

.dist-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--dist-line);
  background: #f8fafc;
}

.dist-opt-check-list {
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem 0.65rem 0.65rem;
}

.dist-opt-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: #fff;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.dist-opt-check:hover {
  background: #f1f5f9;
}

.dist-opt-check.is-selected {
  background: #e8f4f8;
  border-color: #7fb3c4;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 139, 0.15);
}

.dist-opt-check input {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--dist-sea);
  cursor: pointer;
}

.dist-opt-check-mark {
  display: none;
}

.dist-opt-check-text {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.dist-opt-check-name {
  color: #0f172a;
  font-size: 0.92rem;
}

.dist-opt-check-price {
  color: var(--dist-navy);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
}

.dist-opt-selected-count {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e8f4f8;
  color: var(--dist-navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.dist-selected-summary {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--dist-line);
  border-radius: 12px;
  background: linear-gradient(165deg, #fff 0%, #f4f7fb 100%);
}

.dist-selected-summary--empty {
  color: #627d98;
  font-size: 0.88rem;
}

.dist-selected-summary-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #627d98;
  margin-bottom: 0.45rem;
}

.dist-chip--engine {
  background: #e8f4f8;
  border-color: #7fb3c4;
  color: var(--dist-navy);
  font-weight: 600;
}

.dist-quote-lines tr.dist-line-engine {
  background: #f3fafc;
}

.distribution-module .dist-hint {
  margin: 0.35rem 0 0;
  color: #627d98;
  font-size: 0.86rem;
}

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

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

  body.dist-quote-open {
    background: #fff !important;
  }

  /* Hide the rest of the app while printing a quotation. */
  body.dist-quote-open > *:not(.dist-quote-sheet) {
    display: none !important;
    visibility: hidden !important;
  }

  /*
   * Force quote content visible. Other modules (LMS/Accounting) use global
   * print visibility:hidden rules that would otherwise produce blank pages.
   */
  body.dist-quote-open .dist-quote-sheet,
  body.dist-quote-open .dist-quote-sheet * {
    visibility: visible !important;
  }

  body.dist-quote-open .dist-quote-sheet {
    position: static !important;
    inset: auto !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    display: block !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 0 !important;
  }

  body.dist-quote-open .dist-quote-toolbar,
  body.dist-quote-open .dist-quote-toolbar *,
  body.dist-quote-open .no-print,
  body.dist-quote-open .no-print * {
    display: none !important;
    visibility: hidden !important;
  }

  body.dist-quote-open .dist-quote-scroll {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Keep the printed document the same layout/size as the on-screen preview. */
  body.dist-quote-open .dist-quote-doc,
  body.dist-quote-open .dist-quote-doc--portrait {
    box-shadow: none !important;
    width: 210mm !important;
    max-width: 210mm !important;
    padding: 0 0 1rem !important;
    margin: 0 auto !important;
    overflow: visible !important;
    color: #12263a !important;
    background: #fff !important;
    font-size: 0.92rem !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.dist-quote-open .dist-quote-doc *,
  body.dist-quote-open .dist-quote-doc--portrait * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Explicitly keep desktop grids (do not collapse like mobile). */
  body.dist-quote-open .dist-quote-top {
    grid-template-columns: 1.2fr 0.8fr !important;
  }
  body.dist-quote-open .dist-quote-intro {
    grid-template-columns: 1fr 1fr !important;
  }
  body.dist-quote-open .dist-quote-intro.has-photo {
    grid-template-columns: 1fr 1fr 0.95fr !important;
  }
  body.dist-quote-open .dist-quote-terms-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  body.dist-quote-open .dist-quote-spec-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
  body.dist-quote-open .dist-quote-detail-photos {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  body.dist-quote-open .dist-quote-std-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  body.dist-quote-open .dist-quote-doc-footer {
    grid-template-columns: 1fr auto !important;
  }
  body.dist-quote-open .dist-quote-titleblock {
    text-align: right !important;
  }

  /* Same photo sizing as the preview card. */
  body.dist-quote-open .dist-quote-vessel-photo {
    max-height: 140px !important;
  }
  body.dist-quote-open .dist-quote-vessel-photo img {
    max-height: 140px !important;
    min-height: 110px !important;
    height: 100% !important;
  }

  body.dist-quote-open .dist-quote-intro,
  body.dist-quote-open .dist-quote-top,
  body.dist-quote-open .dist-quote-totals-print,
  body.dist-quote-open .dist-quote-terms-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Page 1: header, prepared for, tech specs, standard equipment, colors.
     Then photos (detail + sister vessel together) on their own page, then pricing / terms. */
  body.dist-quote-open .dist-quote-section--detail-photos,
  body.dist-quote-open .dist-quote-section--sister-photos,
  body.dist-quote-open .dist-quote-section--pricing {
    break-before: page;
    page-break-before: always;
  }

  /* Keep Sister Vessel on the same page as Detail photos when both exist. */
  body.dist-quote-open .dist-quote-section--detail-photos + .dist-quote-section--sister-photos {
    break-before: avoid;
    page-break-before: avoid;
  }

  body.dist-quote-open .dist-quote-section--detail-photos,
  body.dist-quote-open .dist-quote-section--sister-photos {
    break-inside: auto;
    page-break-inside: auto;
  }

  body.dist-quote-open .dist-quote-section--detail-photos + .dist-quote-section--sister-photos .dist-quote-section-head {
    margin-top: 0.75rem;
  }

  body.dist-quote-open .dist-quote-section--std,
  body.dist-quote-open .dist-quote-std-grid,
  body.dist-quote-open .dist-quote-section--specs {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.dist-quote-open .dist-quote-lines-print thead {
    display: table-header-group;
  }

  body.dist-quote-open .dist-quote-lines-print tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.dist-quote-open .dist-quote-doc-footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
