:root {
    --un-blue: #0086cd;
    --un-blue-dark: #0072a3;
    --un-blue-deeper: #004e6a;
    --un-blue-light: #e6f5fc;
    --un-blue-pale: #f0f9fd;
    --un-gold: #d4a843;
    --un-gold-light: #f5ecd4;
    --text-primary: #1a1a2e;
    --text-secondary: #3d3d5c;
    --text-muted: #6b6b8d;
    --border-light: #d6dce4;
    --border-medium: #b0bec5;
    --bg-white: #ffffff;
    --bg-cream: #fafbfc;
    --bg-section: #f5f7fa;
    --chart-red: #e74c3c;
    --chart-orange: #f39c12;
    --chart-green: #27ae60;
    --chart-purple: #8e44ad;
    --chart-teal: #1abc9c;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { font-size: 16px; scroll-behavior: smooth; }

  body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: #e8ecf1;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
  }

  .document-wrapper { max-width: 920px; margin: 0 auto; background: var(--bg-white); box-shadow: 0 0 60px rgba(0,0,0,0.08); }

  /* === TITLE PAGE === */
  .title-page {
    position: relative;
    background: linear-gradient(160deg, var(--un-blue) 100%);
    color: #fff; padding: 60px 60px 50px; overflow: hidden;
  }

  .un-emblem { text-align: center; margin-bottom: 12px; position: relative; z-index: 1; }
  .un-org-name { text-align: center; font-size: 1.1rem; font-weight: 300; letter-spacing: 6px; text-transform: uppercase; margin-bottom: 40px; opacity: 0.9; position: relative; z-index: 1; }

  .header-meta { display: flex; justify-content: space-between; font-size: 0.82rem; opacity: 0.8; margin-bottom: 6px; position: relative; z-index: 1; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 20px; }
  .header-meta-left { text-align: left; line-height: 1.6; }
  .header-meta-right { text-align: right; line-height: 1.6; }
  .print-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: inherit;
    font-family: inherit;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 6px;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
  }
  .print-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
  }
  @media print {
    .print-btn { display: none; }
  }

  .organs-row { display: flex; gap: 40px; margin: 20px 0 10px; position: relative; z-index: 1; }
  .organ-block { font-size: 0.82rem; line-height: 1.6; opacity: 0.85; }
  .organ-block strong { font-weight: 600; }

  .doc-reference { display: inline-block; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); padding: 4px 16px; border-radius: 4px; font-family: 'Merriweather', Georgia, serif; font-size: 0.95rem; font-weight: 700; letter-spacing: 1px; margin: 20px 0 30px; position: relative; z-index: 1; }

  .title-page h1 { font-family: 'Merriweather', Georgia, serif; font-size: 1.75rem; font-weight: 700; line-height: 1.35; margin-bottom: 12px; position: relative; z-index: 1; }
  .title-page .subtitle { font-size: 1.05rem; font-weight: 300; opacity: 0.9; font-style: italic; position: relative; z-index: 1; }
  .title-decorative-line { width: 80px; height: 3px; background: var(--un-gold); margin: 24px 0; position: relative; z-index: 1; }

  /* === EXECUTIVE SUMMARY === */
  .executive-summary { background: var(--un-blue-pale); border-left: 4px solid var(--un-blue); margin: 40px 60px; padding: 32px 36px; position: relative; }
  .executive-summary::before { content: 'EXECUTIVE SUMMARY'; display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 3px; color: var(--un-blue-dark); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,158,219,0.2); }
  .executive-summary p { font-size: 0.92rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 14px; text-align: justify; }
  .executive-summary p:last-child { margin-bottom: 0; }

  /* === TABLE OF CONTENTS === */
  .toc-section { margin: 0 60px 30px; padding: 36px 0; border-top: 2px solid var(--un-blue); border-bottom: 1px solid var(--border-light); }
  .toc-title { font-family: 'Merriweather', Georgia, serif; font-size: 1.15rem; font-weight: 700; color: var(--un-blue-dark); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 24px; }
  .toc-list { list-style: none; }
  .toc-list > li { margin-bottom: 6px; }
  .toc-list > li > a { display: flex; align-items: baseline; text-decoration: none; color: var(--text-primary); font-weight: 600; font-size: 0.92rem; padding: 6px 0; transition: color 0.2s; }
  .toc-list > li > a:hover { color: var(--un-blue); }
  .toc-list > li > a .toc-num { color: var(--un-blue-dark); font-weight: 700; min-width: 40px; }
  .toc-list > li > a .toc-dots { flex: 1; border-bottom: 1px dotted var(--border-medium); margin: 0 8px; min-height: 1px; position: relative; top: -4px; }
  .toc-sub { list-style: none; padding-left: 40px; }
  .toc-sub li a { display: flex; align-items: baseline; text-decoration: none; color: var(--text-secondary); font-size: 0.85rem; padding: 3px 0; transition: color 0.2s; }
  .toc-sub li a:hover { color: var(--un-blue); }
  .toc-sub .toc-dots { flex: 1; border-bottom: 1px dotted #ccc; margin: 0 8px; min-height: 1px; position: relative; top: -4px; }
  .toc-sub-sub { list-style: none; padding-left: 24px; }
  .toc-sub-sub li a { font-size: 0.82rem; color: var(--text-muted); padding: 2px 0; }

  /* === MAIN CONTENT === */
  .content-body { padding: 0 60px 40px; }

  .chapter { margin-top: 50px; padding-top: 40px; border-top: 2px solid var(--un-blue); position: relative; }
  .chapter:first-child { margin-top: 20px; border-top: none; padding-top: 0; }

  .chapter-number { display: inline-block; background: var(--un-blue); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; padding: 4px 14px; border-radius: 2px; margin-bottom: 14px; text-transform: uppercase; }

  .content-body h2 { font-family: 'Merriweather', Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--un-blue-deeper); line-height: 1.35; margin-bottom: 24px; }
  .content-body h3 { font-family: 'Inter', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--un-blue-dark); margin-top: 34px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
  .content-body h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-top: 26px; margin-bottom: 10px; }
  .content-body p { font-size: 0.93rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 16px; text-align: justify; hyphens: auto; }
  .content-body strong { color: var(--text-primary); font-weight: 600; }
  .content-body ol { margin: 16px 0 16px 24px; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.8; }
  .content-body ol li { margin-bottom: 10px; padding-left: 4px; }
  .content-body ol li strong { color: var(--un-blue-dark); }
  .chapter-intro { font-size: 0.96rem; line-height: 1.85; color: var(--text-primary); font-weight: 400; margin-bottom: 20px; }

  .recommendations-box { background: var(--bg-section); border: 1px solid var(--border-light); border-radius: 4px; padding: 28px 32px; margin: 24px 0; }
  .recommendations-box ol li { margin-bottom: 14px; }

  /* === DATA VISUALIZATION STYLES === */
  .viz-container {
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 28px 24px;
    margin: 28px 0;
    position: relative;
  }
  .viz-container::before {
    content: attr(data-figure);
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--un-blue-dark);
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .viz-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--un-blue-deeper);
    margin-bottom: 6px;
  }
  .viz-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    font-style: italic;
  }
  .viz-source {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-style: italic;
  }
  .chart-wrapper {
    position: relative;
    width: 100%;
    max-height: 400px;
  }
  .chart-wrapper canvas {
    width: 100% !important;
  }

  /* === DATA TABLES === */
  .data-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
  }
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
  }
  .data-table thead th {
    background: var(--un-blue-deeper);
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--un-blue-dark);
  }
  .data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
  }
  .data-table tbody tr:nth-child(even) { background: var(--un-blue-pale); }
  .data-table tbody tr:hover { background: var(--un-blue-light); }
  .data-table .num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
  .data-table .highlight-cell { color: var(--chart-red); font-weight: 700; }
  .data-table .success-cell { color: var(--chart-green); font-weight: 600; }

  /* === STAT CALLOUT === */
  .stat-callout {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
  }
  .stat-card {
    flex: 1 1 140px;
    background: var(--un-blue-pale);
    border: 1px solid rgba(0,158,219,0.2);
    border-top: 3px solid var(--un-blue);
    border-radius: 4px;
    padding: 18px 16px;
    text-align: center;
    min-width: 130px;
  }
  .stat-card .stat-number {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--un-blue-deeper);
    line-height: 1.2;
  }
  .stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* === CRISIS CASE STUDY BOX === */
  .case-study-box {
    background: #fff8f0;
    border-left: 4px solid var(--chart-orange);
    padding: 20px 24px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
  }
  .case-study-box h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 8px;
  }
  .case-study-box p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-align: left;
  }

  /* === TIMELINE === */
  .timeline {
    position: relative;
    padding-left: 32px;
    margin: 24px 0;
  }
  .timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--un-blue);
    border-radius: 2px;
  }
  .timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: 4px;
  }
  .timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 18px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--un-blue);
    border: 3px solid var(--bg-white);
  }
  .timeline-item.failure::before { background: var(--chart-red); }
  .timeline-item.partial::before { background: var(--chart-orange); }
  .timeline-item.success::before { background: var(--chart-green); }
  .timeline-year {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--un-blue-dark);
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .timeline-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0;
  }
  .timeline-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
  }
  .timeline-status {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .timeline-status.failed { background: #fde8e8; color: #c0392b; }
  .timeline-status.ongoing { background: #fef3cd; color: #856404; }
  .timeline-status.mixed { background: #e8f5e9; color: #2e7d32; }

  /* === NEW CHALLENGES SECTION === */
  .emerging-challenge {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-section);
    border-radius: 4px;
    border: 1px solid var(--border-light);
  }
  .emerging-challenge .ec-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--un-blue-pale);
    border-radius: 50%;
  }
  .emerging-challenge .ec-content h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--un-blue-dark);
    margin-bottom: 4px;
  }
  .emerging-challenge .ec-content p {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin: 0;
    text-align: left;
    line-height: 1.6;
  }

  /* === REFERENCES SECTION === */
  .references-section { background: var(--bg-cream); border-top: 2px solid var(--border-light); padding: 36px 60px 40px; }
  .references-section h2 { font-family: 'Merriweather', Georgia, serif; font-size: 1.15rem; font-weight: 700; color: var(--un-blue-deeper); margin-bottom: 20px; letter-spacing: 1px; }
  .references-list { list-style: none; counter-reset: ref-counter; }
  .references-list li { counter-increment: ref-counter; font-size: 0.82rem; line-height: 1.65; color: var(--text-muted); padding: 5px 0 5px 36px; position: relative; border-bottom: 1px solid rgba(0,0,0,0.04); }
  .references-list li::before { content: '[' counter(ref-counter) ']'; position: absolute; left: 0; font-weight: 600; color: var(--un-blue-dark); font-size: 0.78rem; }
  .references-list li a { color: var(--un-blue-dark); text-decoration: none; word-break: break-all; }
  .references-list li a:hover { text-decoration: underline; }

  /* === FOOTER === */
  .document-footer { background: var(--un-blue-deeper); color: rgba(255,255,255,0.7); padding: 30px 60px; display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; }
  .footer-left { line-height: 1.7; }
  .footer-right { text-align: right; font-style: italic; opacity: 0.7; }
  .footer-ref { font-weight: 600; color: rgba(255,255,255,0.9); letter-spacing: 1px; }

  /* === PRINT === */
  @media print {
    body { background: #fff; }
    .document-wrapper { box-shadow: none; max-width: 100%; margin: 0; }
    .title-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 40px; }
    .executive-summary { -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-after: always; }
    .chapter { page-break-before: always; margin-top: 0; border-top: none; }
    .chapter:first-of-type { page-break-before: auto; }
    .toc-section { page-break-after: always; }
    a { color: inherit !important; text-decoration: none !important; }
    .document-footer { -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-inside: avoid; }
    .viz-container, .case-study-box, .recommendations-box { page-break-inside: avoid; border: 1px solid #ddd; }
    .data-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #000 !important; }
    .stat-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
    /* Hide decorative elements */
    .title-page::before, .title-page::after { display: none; }
  }

  /* === RESPONSIVE === */
  @media (max-width: 768px) {
    .title-page, .executive-summary, .content-body, .references-section, .document-footer { padding-left: 24px; padding-right: 24px; }
    .toc-section { margin-left: 24px; margin-right: 24px; }
    .executive-summary { margin-left: 24px; margin-right: 24px; }
    .title-page h1 { font-size: 1.35rem; }
    .header-meta { flex-direction: column; gap: 8px; }
    .organs-row { flex-direction: column; gap: 12px; }
    .document-footer { flex-direction: column; gap: 12px; text-align: center; }
    .footer-right { text-align: center; }
    .stat-callout { flex-direction: column; }
    .stat-card { min-width: 100%; }
  }


  [id] { scroll-margin-top: 20px; }

  /* === BACK TO TOP BUTTON === */
  #backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--un-blue);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    z-index: 1000;
  }
  #backToTop.visible {
    opacity: 1;
    pointer-events: auto;
  }
  #backToTop:hover {
    background: var(--un-blue-dark);
    transform: translateY(-2px);
  }
  @media print {
    #backToTop { display: none; }
  }
