/* ============================================
   PREMIUM BANKER DOSSIER  AutoWash Nancy
   Modern French Business Dossier Styling
   Print-ready A4 format
   ============================================ */

/* ============================================
   1. ROOT & RESET
   ============================================ */

   :root {
    /* Brand colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --accent: #f59e0b;
  
    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
  
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
  
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    font-size: 16px;
    line-height: 1.6;
  }
  
  body {
    font-family: var(--font-sans);
    color: var(--gray-900);
    background: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* ============================================
     2. PAGE LAYOUT & PRINT SETTINGS
     ============================================ */
  
  @page {
    size: A4;
    margin: 20mm;
  }
  
  .page {
    max-width: 210mm;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: white;
  }
  
  @media print {
    .page {
      max-width: 100%;
      padding: 0;
      margin: 0;
    }
  
    .page-break {
      page-break-before: always;
    }
  
    .no-print {
      display: none;
    }
  
    a {
      color: inherit;
      text-decoration: none;
    }
  }
  
  /* ============================================
     3. TYPOGRAPHY
     ============================================ */
  
  h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
  }
  
  h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
  }
  
  h2 {
    font-size: 1.875rem;
    letter-spacing: -0.01em;
    color: var(--primary-dark);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 3px solid var(--primary);
  }
  
  h3 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
  }
  
  h4 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
  }
  
  p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
  }
  
  strong {
    font-weight: 600;
    color: var(--gray-900);
  }
  
  em {
    font-style: italic;
    color: var(--gray-700);
  }
  
  a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
  }
  
  a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
  }
  
  /* ============================================
     4. COVER PAGE
     ============================================ */
  
  .cover-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: var(--spacing-xl) 0;
    text-align: center;
  }
  
  .cover-header {
    padding-top: var(--spacing-xl);
  }
  
  .cover-logo {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
  }
  
  .cover-subtitle {
    font-size: 1.25rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-bottom: var(--spacing-xl);
  }
  
  .cover-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: var(--spacing-xl) 0;
    line-height: 1.1;
  }
  
  .cover-description {
    font-size: 1.5rem;
    color: var(--gray-700);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.4;
  }
  
  .cover-meta {
    display: grid;
    gap: var(--spacing-md);
    max-width: 500px;
    margin: var(--spacing-xl) auto;
    text-align: left;
  }
  
  .cover-meta-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gray-50);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
  }
  
  .cover-meta-label {
    font-weight: 600;
    color: var(--gray-700);
  }
  
  .cover-meta-value {
    font-weight: 700;
    color: var(--gray-900);
  }
  
  .cover-footer {
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.875rem;
  }
  
  /* ============================================
     5. TABLE OF CONTENTS
     ============================================ */
  
  .toc-container {
    margin: var(--spacing-xl) 0;
  }
  
  .toc-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-lg);
    text-align: center;
  }
  
  .toc-list {
    list-style: none;
    counter-reset: toc-counter;
  }
  
  .toc-item {
    counter-increment: toc-counter;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: 8px;
    transition: background 0.2s;
  }
  
  .toc-item:hover {
    background: var(--gray-100);
  }
  
  .toc-item::before {
    content: counter(toc-counter, decimal-leading-zero);
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-right: var(--spacing-md);
    vertical-align: middle;
  }
  
  .toc-link {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    display: inline-block;
    vertical-align: middle;
  }
  
  .toc-description {
    margin-top: var(--spacing-xs);
    margin-left: 56px;
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  /* ============================================
     6. SECTION CARDS
     ============================================ */
  
  .section {
    margin: var(--spacing-xl) 0;
  }
  
  .section-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
  }
  
  .section-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  
  .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
  }
  
  /* ============================================
     7. KPI BLOCKS
     ============================================ */
  
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
  }
  
  .kpi-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: var(--spacing-md);
    border-radius: 12px;
    text-align: center;
  }
  
  .kpi-card.secondary {
    background: linear-gradient(135deg, var(--secondary), #059669);
  }
  
  .kpi-card.accent {
    background: linear-gradient(135deg, var(--accent), #d97706);
  }
  
  .kpi-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  
  .kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
  }
  
  .kpi-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
  }
  
  /* ============================================
     8. TABLES
     ============================================ */
  
  .table-wrapper {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
  }
  
  thead {
    background: var(--primary);
    color: white;
  }
  
  th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
  }
  
  td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
  }
  
  tbody tr:hover {
    background: var(--gray-50);
  }
  
  tbody tr:last-child td {
    border-bottom: none;
  }
  
  td[align="right"],
  th[align="right"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  
  td[align="center"],
  th[align="center"] {
    text-align: center;
  }
  
  /* Totals and highlights */
  tr.total,
  tr.highlight {
    font-weight: 700;
    background: var(--gray-100);
  }
  
  tr.total td {
    border-top: 2px solid var(--gray-300);
    border-bottom: 2px solid var(--gray-300);
  }
  
  /* ============================================
     9. CALLOUT BOXES
     ============================================ */
  
  .callout {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid;
  }
  
  .callout-info {
    background: #dbeafe;
    border-color: var(--primary);
    color: #1e3a8a;
  }
  
  .callout-success {
    background: #d1fae5;
    border-color: var(--secondary);
    color: #065f46;
  }
  
  .callout-warning {
    background: #fef3c7;
    border-color: var(--accent);
    color: #92400e;
  }
  
  .callout-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
  }
  
  .callout-title::before {
    content: "�";
    font-weight: 800;
  }
  
  .callout p:last-child {
    margin-bottom: 0;
  }
  
  /* ============================================
     10. LISTS
     ============================================ */
  
  ul, ol {
    margin: var(--spacing-sm) 0 var(--spacing-md) var(--spacing-lg);
    padding-left: var(--spacing-md);
  }
  
  li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
  }
  
  ul li::marker {
    color: var(--primary);
  }
  
  ol li::marker {
    color: var(--primary);
    font-weight: 700;
  }
  
  /* Custom styled lists */
  .check-list {
    list-style: none;
    padding-left: 0;
  }
  
  .check-list li {
    padding-left: var(--spacing-lg);
    position: relative;
    margin-bottom: var(--spacing-sm);
  }
  
  .check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.25rem;
  }
  
  /* ============================================
     11. FINANCIAL TABLES
     ============================================ */
  
  .financial-table {
    margin: var(--spacing-lg) 0;
  }
  
  .financial-table .table-wrapper {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  
  .financial-table thead {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  }
  
  .financial-table .category-header {
    background: var(--gray-100);
    font-weight: 700;
    color: var(--gray-900);
  }
  
  .financial-table .subtotal {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
  }
  
  .financial-table .total {
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1.0625rem;
  }
  
  /* ============================================
     12. UTILITY CLASSES
     ============================================ */
  
  .text-center {
    text-align: center;
  }
  
  .text-right {
    text-align: right;
  }
  
  .font-mono {
    font-family: var(--font-mono);
  }
  
  .font-bold {
    font-weight: 700;
  }
  
  .text-primary {
    color: var(--primary);
  }
  
  .text-secondary {
    color: var(--secondary);
  }
  
  .text-muted {
    color: var(--gray-500);
  }
  
  .text-small {
    font-size: 0.875rem;
  }
  
  .mt-0 { margin-top: 0; }
  .mt-1 { margin-top: var(--spacing-sm); }
  .mt-2 { margin-top: var(--spacing-md); }
  .mt-3 { margin-top: var(--spacing-lg); }
  
  .mb-0 { margin-bottom: 0; }
  .mb-1 { margin-bottom: var(--spacing-sm); }
  .mb-2 { margin-bottom: var(--spacing-md); }
  .mb-3 { margin-bottom: var(--spacing-lg); }
  
  .p-0 { padding: 0; }
  .p-1 { padding: var(--spacing-sm); }
  .p-2 { padding: var(--spacing-md); }
  .p-3 { padding: var(--spacing-lg); }
  
  /* ============================================
     13. RESPONSIVE
     ============================================ */
  
  @media screen and (max-width: 768px) {
    :root {
      font-size: 14px;
    }
  
    .kpi-grid {
      grid-template-columns: 1fr;
    }
  
    .cover-title {
      font-size: 2.5rem;
    }
  
    .cover-description {
      font-size: 1.25rem;
    }
  
    .page {
      padding: var(--spacing-md);
    }
  }
  
  /* ============================================
     14. PRINT OPTIMIZATIONS
     ============================================ */
  
  @media print {
    body {
      font-size: 11pt;
    }
  
    h1 {
      font-size: 24pt;
    }
  
    h2 {
      font-size: 18pt;
      page-break-after: avoid;
    }
  
    h3 {
      font-size: 14pt;
      page-break-after: avoid;
    }
  
    .section-card,
    .callout,
    .table-wrapper {
      page-break-inside: avoid;
    }
  
    .kpi-card {
      break-inside: avoid;
    }
  
    .cover-page {
      page-break-after: always;
    }
  
    /* Ensure colored backgrounds print */
    * {
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }
  }
  
  
  

/* ============================================================
   ProNeXus final clean layout pass
   ============================================================ */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

.page,
.cover-page {
  width: min(100%, 210mm);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page {
  padding-left: clamp(1rem, 4vw, 3rem);
  padding-right: clamp(1rem, 4vw, 3rem);
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.kpi-card {
  min-width: 0;
  overflow: hidden;
}

.kpi-value {
  display: block;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
  font-size: clamp(1.9rem, 3.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: visible;
}

table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

th,
td {
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: normal;
  vertical-align: top;
  min-width: 0 !important;
}

th {
  font-size: clamp(0.66rem, 0.9vw, 0.8125rem);
  padding: 0.7rem 0.55rem;
}

td {
  font-size: clamp(0.72rem, 0.95vw, 0.9375rem);
  padding: 0.72rem 0.55rem;
}

.financial-table th,
.financial-table td,
.projection-table th,
.projection-table td,
#financial-projections th,
#financial-projections td,
#projection-financiere th,
#projection-financiere td {
  font-size: clamp(0.58rem, 0.72vw, 0.78rem);
  padding: 0.48rem 0.34rem;
  line-height: 1.25;
  text-align: center;
}

.financial-table td:first-child,
.projection-table td:first-child,
#financial-projections td:first-child,
#projection-financiere td:first-child {
  font-weight: 700;
}

.cover-meta-value,
.kpi-subtitle {
  font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 768px) {
  .page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .financial-table table,
  .projection-table table,
  #financial-projections table,
  #projection-financiere table {
    min-width: 760px !important;
    table-layout: auto !important;
  }
}

@media print {
  html,
  body {
    overflow: visible !important;
    background: #fff;
  }

  .page,
  .cover-page {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    overflow: visible !important;
  }

  .table-wrapper {
    overflow: visible !important;
  }

  table,
  .financial-table table,
  .projection-table table,
  #financial-projections table,
  #projection-financiere table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  th,
  td {
    font-size: 7.2pt !important;
    line-height: 1.18 !important;
    padding: 3.5pt 3pt !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .kpi-value {
    font-size: 21pt !important;
    white-space: nowrap !important;
  }
}
