/* ==========================================================================
   Panoplie Imprimerie — Cahier des charges — feuille de style
   ========================================================================== */

:root {
  --pp-navy: #0f2540;
  --pp-navy-light: #16345a;
  --pp-orange: #e8621c;
  --pp-orange-light: #ffb27a;
  --pp-paper: #f7f5f0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--pp-paper);
}

.font-serif-title {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ---- Scrollbar léger ---- */
#toc-nav::-webkit-scrollbar {
  width: 6px;
}
#toc-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* ---- Liens du sommaire actifs ---- */
.toc-link {
  display: block;
  transition: all .15s ease;
  border-left: 3px solid transparent;
}
.toc-link.active {
  border-left-color: var(--pp-orange);
  background-color: rgba(232, 98, 28, 0.12);
  color: #fff !important;
}
.toc-sublink.active {
  color: var(--pp-orange-light) !important;
  font-weight: 600;
}

/* ---- Cartes de section ---- */
.doc-section {
  scroll-margin-top: 84px;
}

.callout {
  border-left: 4px solid var(--pp-orange);
  background: #fff7f0;
}

.callout-info {
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}

.callout-warn {
  border-left: 4px solid #d97706;
  background: #fffbeb;
}

table.spec-table {
  border-collapse: collapse;
  width: 100%;
}
table.spec-table th, table.spec-table td {
  border: 1px solid #e2e0d8;
  padding: 0.55rem 0.75rem;
  vertical-align: top;
}
table.spec-table thead th {
  background-color: var(--pp-navy);
  color: #fff;
  text-align: left;
  font-weight: 600;
}
table.spec-table tbody tr:nth-child(even) {
  background-color: #faf9f5;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-gray { background:#e5e7eb; color:#374151; }
.badge-blue { background:#dbeafe; color:#1e40af; }
.badge-amber { background:#fef3c7; color:#92400e; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-red { background:#fee2e2; color:#991b1b; }
.badge-purple { background:#ede9fe; color:#5b21b6; }
.badge-orange { background:#ffe4d1; color:#9a3412; }

.kanban-col {
  min-width: 180px;
}

.module-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ---- Mobile off-canvas sidebar ---- */
#sidebar {
  transition: transform .25s ease;
}
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
    width: 82vw;
    max-width: 320px;
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
  }
  #sidebar-backdrop.open {
    display: block;
  }
}

/* ==========================================================================
   Impression / export PDF
   ========================================================================== */
@media print {
  #topbar, #sidebar, #sidebar-backdrop, #back-to-top, .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 0 !important;
  }
  .doc-section {
    page-break-before: always;
    scroll-margin-top: 0;
  }
  #cover-page {
    page-break-after: always;
  }
  #sommaire-print {
    page-break-after: always;
  }
  table.spec-table thead th {
    background-color: var(--pp-navy) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .callout, .callout-info, .callout-warn {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a[href]:after { content: none !important; }
  .shadow, .shadow-md, .shadow-lg, .shadow-xl { box-shadow: none !important; }
}

#sommaire-print { display: none; }
@media print {
  #sommaire-print { display: block; }
}
