/* ============================================================
   Padelnomics Business Plan PDF — Precision Finance Aesthetic
   Rendered by WeasyPrint (A4, CSS3, no JavaScript)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --navy:      #0F2651;
  --navy-deep: #091a3a;
  --gold:      #C9922C;
  --gold-lt:   #EDD48A;
  --text:      #1C2333;
  --muted:     #5E6E8A;
  --border:    #DDE3EE;
  --bg-light:  #F6F8FC;
  --white:     #FFFFFF;
  --green:     #166534;
  --green-bg:  #DCFCE7;
  --red:       #991B1B;
  --red-bg:    #FEE2E2;
}

/* ---------- Page setup ---------- */
@page {
  size: A4;
  margin: 22mm 20mm 22mm 20mm;

  @top-left {
    content: string(doc-company);
    font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;
    font-size: 7.5pt;
    color: var(--muted);
    letter-spacing: 0.04em;
  }
  @top-right {
    content: string(doc-confidential);
    font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;
    font-size: 7.5pt;
    color: var(--muted);
    font-style: italic;
    letter-spacing: 0.04em;
  }
  @bottom-center {
    content: counter(page);
    font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;
    font-size: 8pt;
    color: var(--muted);
  }
  @bottom-right {
    content: "padelnomics.io";
    font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;
    font-size: 7pt;
    color: var(--border);
    letter-spacing: 0.05em;
  }
}

/* Cover page: no running headers/footers, no margins */
@page cover {
  size: A4;
  margin: 0;
  @top-left   { content: none; }
  @top-right  { content: none; }
  @bottom-center { content: none; }
  @bottom-right  { content: none; }
}

/* TOC page: suppress page counter display */
@page toc {
  @bottom-center { content: none; }
}

/* ---------- Named strings for headers ---------- */
.doc-company-anchor    { string-set: doc-company content(); }
.doc-confidential-anchor { string-set: doc-confidential content(); }

/* ---------- Base typography ---------- */
body {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 9.5pt;
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
}

p { margin: 0 0 6pt; }

/* ---------- Cover page ---------- */
.cover {
  page: cover;
  page-break-after: always;
  width: 210mm;
  height: 297mm;
  display: flex;
  box-sizing: border-box;
  position: relative;
}

.cover__sidebar {
  width: 68mm;
  background: var(--navy);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18mm 10mm 14mm 14mm;
}

.cover__logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17pt;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.cover__logo-dot {
  color: var(--gold);
}

.cover__tagline {
  font-size: 7.5pt;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 5pt;
}

.cover__sidebar-footer {
  font-size: 7pt;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
}

.cover__sidebar-footer a {
  color: var(--gold);
  text-decoration: none;
}

.cover__main {
  flex: 1;
  padding: 18mm 14mm 14mm 14mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover__type-label {
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10pt;
}

.cover__title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28pt;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 16pt;
  letter-spacing: -0.02em;
}

.cover__subtitle {
  font-size: 11pt;
  color: var(--muted);
  margin-bottom: 4pt;
}

.cover__scenario {
  font-size: 9.5pt;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2pt;
}

.cover__divider {
  width: 40pt;
  height: 2.5pt;
  background: var(--gold);
  margin: 14pt 0;
}

.cover__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10pt 14pt;
}

.cover__meta-item {}
.cover__meta-label {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2pt;
}
.cover__meta-value {
  font-size: 9.5pt;
  font-weight: 600;
  color: var(--text);
}

.cover__footer-strip {
  border-top: 1pt solid var(--border);
  padding-top: 10pt;
  font-size: 7.5pt;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ---------- Table of Contents ---------- */
.toc-page {
  page: toc;
  page-break-after: always;
}

.toc-heading {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16pt;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 20pt;
  padding-bottom: 10pt;
  border-bottom: 2pt solid var(--navy);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 5pt 0;
  border-bottom: 0.5pt dotted var(--border);
  font-size: 9pt;
}

.toc-item--heading {
  font-weight: 700;
  color: var(--text);
  padding-top: 10pt;
  border-bottom: none;
  font-size: 9.5pt;
  color: var(--navy);
  padding-bottom: 3pt;
}

.toc-num {
  font-size: 8pt;
  color: var(--gold);
  font-weight: 700;
  width: 22pt;
  flex-shrink: 0;
}

.toc-text {
  flex: 1;
  color: var(--text);
}

.toc-dots {
  flex: 1;
  border-bottom: 1pt dotted var(--border);
  margin: 0 6pt 2pt;
  min-width: 20pt;
}

.toc-section-badge {
  font-size: 7pt;
  background: var(--bg-light);
  color: var(--muted);
  padding: 1pt 6pt;
  border-radius: 3pt;
  white-space: nowrap;
}

/* ---------- Section headings ---------- */
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20pt;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6pt;
  letter-spacing: -0.02em;
}

h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13.5pt;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10pt;
  padding: 8pt 0 8pt 12pt;
  border-left: 3.5pt solid var(--gold);
  page-break-after: avoid;
  break-after: avoid;
}

h3 {
  font-size: 8.5pt;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14pt 0 5pt;
  page-break-after: avoid;
}

.section {
  margin-top: 22pt;
  page-break-inside: avoid;
}

.section--break {
  page-break-before: always;
  break-before: page;
  margin-top: 0;
  padding-top: 6pt;
}

/* ---------- Executive summary cards ---------- */
.exec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8pt;
  margin: 10pt 0 14pt;
}

.exec-card {
  border: 1pt solid var(--border);
  border-top: 3pt solid var(--navy);
  border-radius: 0 0 5pt 5pt;
  padding: 10pt 10pt 8pt;
  background: var(--bg-light);
  page-break-inside: avoid;
}

.exec-card--accent {
  border-top-color: var(--gold);
}

.exec-label {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4pt;
}

.exec-value {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16pt;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.exec-value--gold { color: var(--gold); }

.exec-paragraph {
  font-size: 9pt;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-light);
  border-left: 3pt solid var(--border);
  padding: 8pt 10pt;
  margin: 0 0 6pt;
}

/* ---------- Narrative text blocks ---------- */
.narrative-block {
  font-size: 9pt;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 8pt;
  white-space: pre-wrap;
}

.placeholder-block {
  font-size: 8.5pt;
  color: var(--muted);
  font-style: italic;
  background: var(--bg-light);
  border: 1pt dashed var(--border);
  border-radius: 4pt;
  padding: 8pt 10pt;
  margin-bottom: 8pt;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 6pt 0 12pt;
  font-size: 8.5pt;
  page-break-inside: auto;
}

thead th {
  background: var(--navy);
  color: var(--white);
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5.5pt 8pt;
  text-align: left;
  border: none;
}

thead th:first-child { border-radius: 0; }

tbody tr:nth-child(even) { background: var(--bg-light); }
tbody tr:nth-child(odd)  { background: var(--white); }

tbody td {
  padding: 5pt 8pt;
  border-bottom: 0.5pt solid var(--border);
  color: var(--text);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }

.total-row td {
  font-weight: 700;
  color: var(--navy);
  background: #E8EDF5 !important;
  border-top: 1.5pt solid var(--navy);
  border-bottom: none;
}

.highlight-row td {
  background: #FEF9EE !important;
  font-weight: 700;
  color: var(--navy);
  border-top: 1pt solid var(--gold);
  border-bottom: 1pt solid var(--gold);
}

.positive-cell { color: var(--green); font-weight: 600; }
.negative-cell { color: var(--red); font-weight: 600; }

td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }

.note-cell {
  font-size: 7.5pt;
  color: var(--muted);
}

/* ---------- Key metrics grid ---------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6pt;
  margin: 8pt 0 12pt;
}

.metric-box {
  border: 1pt solid var(--border);
  border-radius: 5pt;
  padding: 8pt 8pt 6pt;
  text-align: center;
  background: var(--white);
  page-break-inside: avoid;
}

.metric-label {
  font-size: 6.5pt;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4pt;
}

.metric-value {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14pt;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

/* ---------- Financing bar ---------- */
.fin-wrap {
  margin: 8pt 0 12pt;
}

.fin-bar {
  height: 14pt;
  border-radius: 4pt;
  display: flex;
  overflow: hidden;
  margin-bottom: 6pt;
}

.fin-bar__equity {
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 0 6pt;
}

.fin-bar__loan {
  background: var(--gold);
  display: flex;
  align-items: center;
  padding: 0 6pt;
}

.fin-bar__label {
  font-size: 6.5pt;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
}

.fin-legend {
  display: flex;
  gap: 14pt;
  font-size: 8pt;
}

.fin-legend-item {
  display: flex;
  align-items: center;
  gap: 5pt;
}

.fin-legend-dot {
  width: 8pt;
  height: 8pt;
  border-radius: 2pt;
  flex-shrink: 0;
}

/* ---------- Balance sheet 2-column ---------- */
.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10pt;
  margin: 6pt 0 12pt;
}

.balance-side {
  border: 1pt solid var(--border);
  border-radius: 5pt;
  overflow: hidden;
}

.balance-side__header {
  background: var(--navy);
  color: var(--white);
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 5pt 8pt;
}

.balance-side table {
  margin: 0;
}

.balance-side tbody td {
  border-bottom: 0.5pt solid var(--border);
}

.balance-total td {
  font-weight: 700;
  color: var(--navy);
  background: #E8EDF5 !important;
  border-top: 1.5pt solid var(--navy) !important;
}

/* ---------- Charts ---------- */
.chart-wrap {
  margin: 8pt 0 14pt;
  text-align: center;
  page-break-inside: avoid;
}

.chart-wrap svg {
  max-width: 100%;
  height: auto;
}

.chart-caption {
  font-size: 7.5pt;
  color: var(--muted);
  text-align: center;
  margin-top: 3pt;
  font-style: italic;
}

/* ---------- Market data callout ---------- */
.market-callout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8pt;
  margin: 8pt 0 12pt;
}

.market-stat {
  background: var(--bg-light);
  border: 1pt solid var(--border);
  border-radius: 5pt;
  padding: 8pt 10pt;
  text-align: center;
}

.market-stat-value {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14pt;
  font-weight: 700;
  color: var(--navy);
}

.market-stat-label {
  font-size: 7pt;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2pt;
}

/* ---------- Risk register ---------- */
.risk-item {
  display: flex;
  gap: 8pt;
  padding: 6pt 0;
  border-bottom: 0.5pt solid var(--border);
  font-size: 8.5pt;
  page-break-inside: avoid;
}

.risk-badge {
  font-size: 6.5pt;
  font-weight: 700;
  padding: 2pt 6pt;
  border-radius: 3pt;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1pt;
}

.risk-badge--high   { background: #FEE2E2; color: #991B1B; }
.risk-badge--medium { background: #FEF3C7; color: #92400E; }
.risk-badge--low    { background: var(--green-bg); color: var(--green); }

.risk-text strong {
  display: block;
  color: var(--navy);
  font-size: 8.5pt;
  margin-bottom: 2pt;
}

/* ---------- Two-column layout helper ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12pt;
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  font-size: 7pt;
  color: var(--muted);
  line-height: 1.5;
  padding-top: 10pt;
  border-top: 0.5pt solid var(--border);
  margin-top: 20pt;
}

/* ---------- Stat row (financing detail) ---------- */
.stat-table tbody tr:nth-child(even) { background: var(--bg-light); }
.stat-table tbody tr:nth-child(odd)  { background: var(--white); }
