/* =============================================================
   PDF — A4 page styles. Same styles drive both on-screen preview
   and print output. The .pdf-page is a 210x297mm canvas.
   ============================================================= */

.pdf-page {
  width: 210mm;
  min-height: 297mm;
  height: 297mm;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: 10.5pt;
  line-height: 1.45;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 30, 25, 0.04),
              0 18px 60px rgba(20, 30, 25, 0.12);
  transform-origin: top center;
}

.pdf-page * {
  box-sizing: border-box;
}

.pdf-page__inner {
  padding: 18mm 16mm 16mm;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---- Header ------------------------------------------------- */
.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10pt;
  border-bottom: 0.5pt solid var(--neutral-20);
  margin-bottom: 14pt;
  color: var(--ink-secondary);
  font-size: 8pt;
}

.pdf-header__brand {
  display: flex;
  align-items: center;
  gap: 8pt;
}

.pdf-header__brand img {
  height: 11pt;
  width: auto;
}

.pdf-header__brand-text {
  display: flex;
  flex-direction: column;
  gap: 1pt;
  line-height: 1.1;
}

.pdf-header__brand-text .name {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 9pt;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.pdf-header__brand-text .sub {
  font-size: 7pt;
  color: var(--ink-secondary);
}

.pdf-header__meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1pt;
  font-size: 7.5pt;
  line-height: 1.3;
}

.pdf-header__meta .processo {
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* ---- Footer ------------------------------------------------- */
.pdf-footer {
  margin-top: auto;
  padding-top: 8pt;
  border-top: 0.5pt solid var(--neutral-20);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7pt;
  color: var(--ink-secondary);
  font-weight: var(--fw-light);
}

.pdf-footer__brand {
  font-family: var(--font-brand);
  font-size: 7pt;
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
}

.pdf-footer__page {
  font-family: var(--font-brand);
  font-size: 7pt;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---- Cover page --------------------------------------------- */
.cover {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.cover__top {
  padding: 22mm 18mm 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.cover__brand {
  display: flex;
  align-items: center;
  gap: 10pt;
}

.cover__brand img {
  height: 16pt;
}

.cover__brand-meta {
  display: flex;
  flex-direction: column;
  gap: 1pt;
}

.cover__brand-meta .name {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 11pt;
  letter-spacing: -0.01em;
}

.cover__brand-meta .sub {
  font-size: 8pt;
  color: var(--ink-secondary);
}

.cover__doc-id {
  text-align: right;
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  text-transform: uppercase;
}

.cover__doc-id .num {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 14pt;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 2pt;
  text-transform: none;
}

.cover__hero {
  flex: 1;
  padding: 0 18mm;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.cover__eyebrow {
  font-family: var(--font-brand);
  font-size: 9pt;
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 12pt;
}

.cover__title {
  font-family: var(--font-display);
  font-weight: var(--fw-thin);
  font-size: 56pt;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  max-width: 140mm;
}

.cover__title em {
  font-style: italic;
  font-weight: var(--fw-xlight);
  color: var(--forest);
}

.cover__intro {
  margin-top: 18pt;
  font-size: 10pt;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 110mm;
  font-weight: var(--fw-light);
}

.cover__blob {
  position: absolute;
  right: -40mm;
  bottom: 18mm;
  width: 110mm;
  height: 110mm;
  pointer-events: none;
  opacity: 0.85;
  z-index: 0;
}

.cover__blob svg {
  width: 100%;
  height: 100%;
}

.cover__patient {
  padding: 14mm 18mm 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12pt;
  position: relative;
  z-index: 1;
}

.cover__patient-cell {
  display: flex;
  flex-direction: column;
  gap: 3pt;
  border-top: 0.5pt solid var(--ink);
  padding-top: 6pt;
}

.cover__patient-cell .label {
  font-family: var(--font-brand);
  font-size: 7.5pt;
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.cover__patient-cell .value {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 13pt;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}

.cover__patient-cell .value-sm {
  font-size: 10pt;
  font-weight: var(--fw-light);
  font-family: var(--font-sans);
}

.cover__signature {
  padding: 16mm 18mm 18mm;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.cover__doctor {
  display: flex;
  flex-direction: column;
  gap: 2pt;
}

.cover__doctor .label {
  font-family: var(--font-brand);
  font-size: 7.5pt;
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 3pt;
}

.cover__doctor .name {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 12pt;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cover__doctor .spec {
  font-size: 8.5pt;
  color: var(--ink-secondary);
  margin-top: 1pt;
}

.cover__date {
  text-align: right;
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.cover__date .val {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 13pt;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 2pt;
  text-transform: none;
}

/* ---- Section opener ----------------------------------------- */
.pdf-section {
  margin-bottom: 14pt;
}

.pdf-section__head {
  display: flex;
  align-items: baseline;
  gap: 10pt;
  margin-bottom: 8pt;
  padding-bottom: 6pt;
  border-bottom: 0.5pt solid var(--ink);
}

.pdf-section__num {
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  min-width: 22pt;
}

.pdf-section__title {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 17pt;
  letter-spacing: -0.015em;
  color: var(--ink);
  flex: 1;
  margin: 0;
}

.pdf-section__sub {
  font-size: 8pt;
  color: var(--ink-secondary);
  font-family: var(--font-brand);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdf-section__body {
  font-size: 10pt;
  line-height: 1.5;
  color: var(--ink);
}

/* ---- Bulleted list ------------------------------------------ */
.pdf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5pt;
}

.pdf-list li {
  position: relative;
  padding-left: 14pt;
  font-size: 9.5pt;
  line-height: 1.5;
  color: var(--ink);
}

.pdf-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4pt;
  height: 4pt;
  border-radius: 50%;
  background: var(--forest);
}

/* ---- Sub-section card (suplementos by group) ---------------- */
.pdf-subcard {
  background: var(--paper);
  border: 0.5pt solid var(--neutral-20);
  border-radius: 6pt;
  padding: 9pt 10pt 8pt;
  margin-bottom: 6pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-subcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6pt;
  padding-bottom: 4pt;
  border-bottom: 0.5pt solid var(--neutral-10);
}

.pdf-subcard__title {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 11.5pt;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6pt;
}

.pdf-subcard__icon {
  width: 14pt;
  height: 14pt;
  border-radius: 50%;
  background: var(--success-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  flex-shrink: 0;
}

.pdf-subcard__icon svg {
  width: 9pt;
  height: 9pt;
}

.pdf-subcard__count {
  font-family: var(--font-brand);
  font-size: 7pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

/* ---- Table -------------------------------------------------- */
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}

.pdf-table th {
  text-align: left;
  font-family: var(--font-brand);
  font-size: 7pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  padding: 4pt 6pt 4pt 0;
  border-bottom: 0.5pt solid var(--neutral-20);
  vertical-align: bottom;
}

.pdf-table td {
  padding: 5pt 6pt 5pt 0;
  border-bottom: 0.4pt solid var(--neutral-10);
  font-size: 9pt;
  line-height: 1.35;
  vertical-align: top;
}

.pdf-table tr:last-child td {
  border-bottom: 0;
}

.pdf-table .col-name {
  width: 45%;
  font-weight: var(--fw-light);
  color: var(--ink);
}

.pdf-table .col-dose {
  width: 20%;
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  color: var(--ink);
}

.pdf-table .col-freq {
  width: 22%;
  color: var(--ink-secondary);
  font-size: 8.5pt;
}

/* ---- Followups ---------------------------------------------- */
.pdf-followup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12pt;
  padding: 8pt 0;
  border-bottom: 0.4pt solid var(--neutral-10);
  align-items: baseline;
}

.pdf-followup:last-child { border-bottom: 0; }

.pdf-followup__title {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 11pt;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.pdf-followup__notes {
  font-size: 8.5pt;
  color: var(--ink-secondary);
  margin-top: 2pt;
}

.pdf-followup__date {
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--forest);
  white-space: nowrap;
}

/* ---- Patient strip ------------------------------------------ */
.pdf-patient-strip {
  background: var(--forest);
  color: var(--paper);
  border-radius: 6pt;
  padding: 10pt 12pt;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10pt;
  margin-bottom: 14pt;
}

.pdf-patient-strip__cell {
  display: flex;
  flex-direction: column;
  gap: 2pt;
}

.pdf-patient-strip__cell .label {
  font-family: var(--font-brand);
  font-size: 6.5pt;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-inverse-70);
}

.pdf-patient-strip__cell .value {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 11pt;
  letter-spacing: -0.01em;
  color: var(--paper);
}

/* ---- Importante box ----------------------------------------- */
.pdf-importante {
  margin-top: auto;
  background: var(--paper-2);
  border-radius: 4pt;
  padding: 8pt 10pt;
  font-size: 7pt;
  line-height: 1.45;
  color: var(--ink-secondary);
  border-left: 1pt solid var(--neutral-30);
}

.pdf-importante strong {
  font-weight: var(--fw-regular);
  color: var(--ink);
}

/* ---- Objetivos card ----------------------------------------- */
.pdf-objectives {
  background: var(--success-tint);
  border-radius: 8pt;
  padding: 12pt 14pt;
  margin-bottom: 10pt;
}

.pdf-objectives__head {
  display: flex;
  align-items: center;
  gap: 6pt;
  margin-bottom: 8pt;
}

.pdf-objectives__icon {
  width: 16pt;
  height: 16pt;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdf-objectives__icon svg {
  width: 9pt;
  height: 9pt;
}

.pdf-objectives__title {
  font-family: var(--font-brand);
  font-size: 8pt;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.pdf-objectives__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4pt;
  counter-reset: obj;
}

.pdf-objectives__list li {
  font-family: var(--font-display);
  font-weight: var(--fw-xlight);
  font-size: 12pt;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
  padding-left: 16pt;
  position: relative;
}

.pdf-objectives__list li::before {
  content: counter(obj, decimal-leading-zero);
  counter-increment: obj;
  position: absolute;
  left: 0;
  top: 0.2em;
  font-family: var(--font-brand);
  font-size: 7pt;
  font-weight: 500;
  color: var(--forest);
  letter-spacing: 0.04em;
}

/* ---- Cover variants ----------------------------------------- */
.pdf-page--cover-forest {
  background: var(--forest);
  color: var(--paper);
}

.pdf-page--cover-forest .cover__brand-meta .name,
.pdf-page--cover-forest .cover__title,
.pdf-page--cover-forest .cover__patient-cell .value,
.pdf-page--cover-forest .cover__doctor .name,
.pdf-page--cover-forest .cover__date .val {
  color: var(--paper);
}

.pdf-page--cover-forest .cover__title em {
  color: var(--sage);
}

.pdf-page--cover-forest .cover__eyebrow,
.pdf-page--cover-forest .cover__brand-meta .sub,
.pdf-page--cover-forest .cover__intro,
.pdf-page--cover-forest .cover__patient-cell .label,
.pdf-page--cover-forest .cover__doc-id,
.pdf-page--cover-forest .cover__doctor .label,
.pdf-page--cover-forest .cover__doctor .spec,
.pdf-page--cover-forest .cover__date {
  color: var(--on-inverse-70);
}

.pdf-page--cover-forest .cover__doc-id .num {
  color: var(--paper);
}

.pdf-page--cover-forest .cover__patient-cell {
  border-top-color: var(--on-inverse-50);
}

.pdf-page--cover-bold .cover__hero {
  justify-content: flex-end;
  padding-bottom: 12mm;
}

.pdf-page--cover-bold .cover__title {
  font-size: 76pt;
  line-height: 0.92;
  letter-spacing: -0.03em;
}
