/* Plan My Project — print & PDF export layout */
@page {
  size: A4;
  margin: 10mm;
}

.tev-print-body {
  font-family: Poppins, 'Segoe UI', system-ui, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  font-size: 11pt;
}

.tev-print-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1e3a8a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.tev-print-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tev-print-toolbar button,
.tev-print-toolbar-btn {
  background: #fff;
  color: #1e3a8a;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.tev-print-toolbar-btn--back {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.tev-print-toolbar button:hover,
.tev-print-toolbar-btn:hover {
  background: #eff6ff;
}

.tev-print-toolbar-btn--back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tev-print-toolbar-hint {
  font-size: 0.75rem;
  opacity: 0.9;
}

.tev-print-report {
  max-width: 210mm;
  margin: 1rem auto 2rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background: #fff;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  border-radius: 4px;
}

.tev-print-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid #2563eb;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.tev-print-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tev-print-header__brand h1 {
  margin: 0;
  font-size: 1.15rem;
  color: #1e3a8a;
}

.tev-print-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}

.tev-print-header__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.25rem;
  font-size: 0.78rem;
}

.tev-print-header__meta span {
  display: block;
  color: #64748b;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tev-print-ai-note {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #334155;
  margin: 0 0 1rem;
}

.tev-print-section {
  margin: 1.1rem 0;
  page-break-inside: avoid;
}

.tev-print-section h2 {
  font-size: 0.95rem;
  color: #1e40af;
  margin: 0 0 0.6rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
}

.tev-print-section h3 {
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
  color: #334155;
}

.tev-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.tev-print-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.tev-print-card span {
  display: block;
  font-size: 0.62rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.tev-print-card strong {
  font-size: 0.88rem;
}

.tev-print-summary {
  font-size: 0.85rem;
  color: #334155;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 0.4rem 0 0.75rem;
}

th,
td {
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eff6ff;
  font-weight: 700;
  color: #1e40af;
}

.tev-print-total {
  font-size: 1rem;
  font-weight: 800;
  color: #1d4ed8;
  margin: 0.5rem 0;
}

.tev-print-muted {
  font-size: 0.72rem;
  color: #64748b;
}

.tev-print-disclaimer {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  page-break-inside: avoid;
}

.tev-print-disclaimer h2 {
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
  color: #0f172a;
}

.tev-print-disclaimer__body {
  font-size: 0.68rem;
  color: #475569;
  line-height: 1.55;
}

.tev-print-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 2px solid #e2e8f0;
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
}

ul {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.2rem;
}

@media print {
  .no-print,
  .tev-print-toolbar {
    display: none !important;
  }

  .tev-print-body {
    background: #fff;
    padding: 0;
  }

  .tev-print-report {
    margin: 0;
    padding: 0;
    box-shadow: none;
    max-width: none;
  }

  .tev-print-section {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .page-break-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tev-print-footer {
    position: static;
    margin-top: 1.25rem;
  }

  .page {
    width: 210mm;
    min-height: 297mm;
    page-break-after: always;
    break-after: page;
  }

  .page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

@media screen and (max-width: 768px) {
  .tev-print-body {
    max-width: 100%;
    padding: 12px;
    font-size: 13px;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .tev-print-report {
    margin: 0;
    padding: 12px;
    max-width: 100%;
    box-shadow: none;
    border-radius: 12px;
  }

  .tev-print-toolbar {
    margin: -12px -12px 12px;
    border-radius: 0;
  }

  .tev-print-toolbar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tev-print-toolbar button,
  .tev-print-toolbar-btn {
    width: 100%;
    text-align: center;
  }

  .tev-consultant-print-body {
    padding: 12px;
    overflow-x: hidden;
  }

  .tev-consultant-print {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .tev-consultant-print .tev-proposal-report .page {
    width: auto;
    min-height: auto;
    max-height: none;
    box-shadow: none;
    border-radius: 12px;
    overflow: visible;
    page-break-after: auto;
    break-after: auto;
  }
}

@media (max-width: 640px) {
  .tev-print-header {
    flex-direction: column;
  }
}

/* Consultant proposal v2 — customer-facing 2–3 page layout */
.tev-consultant-print-body {
  background: #e2e8f0;
}

.tev-consultant-print {
  max-width: none;
  font-size: 10pt;
  line-height: 1.45;
}

.tev-consultant-print .tev-proposal-report {
  margin: 0 auto;
  padding: 0;
  background: transparent;
}

.tev-consultant-print .tev-proposal-report .page {
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.tev-consultant-report__logo-wrap {
  text-align: center;
  margin-bottom: 0.5rem;
}

.tev-consultant-report__logo-wrap .tev-print-logo {
  width: 52px;
  height: 52px;
}

.tev-consultant-report {
  color: #0f172a;
}

.tev-consultant-report__head {
  text-align: center;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.tev-consultant-report__head h1 {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  color: #1e3a8a;
  letter-spacing: 0.02em;
}

.tev-consultant-report__head h2 {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.tev-consultant-report__logo {
  font-size: 1.75rem;
  line-height: 1;
}

.tev-consultant-section {
  margin-bottom: 0.85rem;
  page-break-inside: avoid;
}

.tev-consultant-section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: #1e3a8a;
  border-left: 3px solid #2563eb;
  padding-left: 0.45rem;
}

.tev-consultant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 0.35rem 0 0.5rem;
}

.tev-consultant-table th,
.tev-consultant-table td {
  border: 1px solid #cbd5e1;
  padding: 0.3rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.tev-consultant-table th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}

.tev-consultant-table tr:nth-child(even) td {
  background: #f8fafc;
}

.tev-consultant-section ul {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.1rem;
}

.tev-consultant-section p {
  margin: 0.25rem 0 0.45rem;
}

.tev-consultant-note {
  font-size: 0.75rem;
  color: #64748b;
}

.tev-consultant-disclaimer {
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.5;
}

.tev-consultant-footer {
  margin-top: 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid #cbd5e1;
  text-align: center;
  font-size: 0.72rem;
  color: #475569;
}

.tev-consultant-engineering {
  margin-top: 1rem;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
}

.tev-consultant-engineering summary {
  cursor: pointer;
  font-weight: 700;
  color: #1e3a8a;
  font-size: 0.82rem;
}

.tev-consultant-engineering__body {
  margin-top: 0.65rem;
}

.tev-consultant-print-meta {
  text-align: center;
  margin-top: 0.75rem;
}

.tev-consultant-report-wrap .tev-consultant-report {
  margin-bottom: 0.5rem;
}

@media print {
  .tev-consultant-print-body {
    background: #fff;
  }

  .tev-consultant-print {
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .tev-consultant-section {
    page-break-inside: avoid;
  }

  .tev-consultant-engineering {
    page-break-before: auto;
  }

  .no-print,
  .tev-print-toolbar {
    display: none !important;
  }
}
