:root {
  --primary: #ffc700;
  --primary-dark: #d4a800;
  --accent: #e50073;
  --black: #000000;
  --gray-20: #f6f7fb;
  --gray-30: #f9faff;
  --gray-60: #e2e5f1;
  --gray-200: #b7bdd4;
  --gray-500: #6b6f86;
  --gray-800: #1f2432;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--gray-20);
  color: var(--gray-800);
  margin: 0;
}

main.layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(420px, 0.9fr);
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-panel {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 30px 60px rgba(15, 22, 58, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-header .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
  justify-content: flex-end;
}

.card-header .actions .btn {
  flex: 1 1 210px;
}

.card-link {
  color: var(--gray-800);
  font-weight: 600;
  text-decoration: underline;
}

.card-link:hover {
  color: var(--primary-dark);
}

.text-muted {
  color: var(--gray-500);
  font-style: italic;
}

@media (max-width: 640px) {
  .card-header .actions .btn {
    flex-basis: 100%;
  }
}

.hero {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
}

h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #e50073;
}

h3 {
  margin: 1.2rem 0 0.8rem;
  font-size: 1.05rem;
  color: var(--gray-500);
}

p {
  margin: 0;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.manual-site-fields {
  grid-column: 1 / -1;              /* occupe toute la largeur de la grille parente */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
}

.manual-site-fields .form-group.col-span-2,
.manual-site-fields textarea {
  grid-column: 1 / -1;              /* l’adresse s’étend sur toute la ligne */
}
input,
select,
textarea {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--gray-30);
}

textarea {
  resize: vertical;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid-full {
  grid-column: 1 / -1;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn.primary {
  background: var(--primary);
  color: var(--black);
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
}


.helper-text {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.points-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.point-item {
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
  cursor: grab;
}

.point-item:active {
  cursor: grabbing;
}

.point-title {
  font-weight: 600;
  margin: 0;
}

.point-meta {
  color: var(--gray-500);
}

.point-desc {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.point-actions {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

.icon-btn {
  border: none;
  background: var(--gray-30);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  border: 1px solid var(--gray-200);
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-btn.danger {
  color: #d64545;
  border-color: #f0c1c1;
}

.preview {
  background: #fff;
  padding: 24px;
}

.preview-card h3,
.preview-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  color: #6b6f86;
}

.a4-sheet {
  width: 100%;
  max-width: 210mm;
  margin: 0 auto;
}

/* Entête preview */
.preview-head {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--gray-60);
  margin-bottom: 1.2rem;
}

.head-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.head-brand img {
  display: block;
  width: auto;
  height: auto;
  max-width: 140px;
  max-height: 85px;
  object-fit: contain;
}

.head-brand h2 {
  margin: 0;
  font-size: 1.9rem;
  color: var(--black);
}

.head-brand p {
  color: var(--gray-500);
}

.head-infos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.head-infos > div {
  background: #f6f7fb;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  border: none;
}

.head-infos strong {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  color: #6b6f86;
}

.head-infos span {
  display: block;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.head-lieu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.head-lieu.col-span {
  grid-column: span 2;
}

.hybrid-lieu {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #eef1ff;
  border: 1px solid #cbd4ff;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

/* Bureau & modalité */
.preview-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.preview-modalite {
  margin: 1rem 0 1.5rem;
  display: grid;
  gap: 1rem;
}

.preview-columns {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--gray-800);
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: background 0.2s ease, transform 0.15s ease;
  margin-bottom: 10px;
}

.link-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.text-muted {
  color: var(--gray-500);
  font-style: italic;
}

.helper-text {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.35;
}

.preview-card.full-width {
  width: 100%;
  grid-column: 1 / -1;
}

.hybrid-presentiel-full h3 {
  margin-top: 0;
}

.hybrid-distanciel-grid .preview-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.hybrid-distanciel-grid {
  width: 100%;
}

.distanciel-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 900px) {
  .distanciel-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}
.equipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.equipe-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #475569;
}

.equipe-list li {
  margin-bottom: 0.25rem;
}
.preview-card {
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: #f8faff;
  border: none;
}

.preview-card.full-width {
  grid-column: 1 / -1;
  width: 100%;
}

.preview-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.distanciel-only {
  display: grid;
  gap: 1rem;
}

.hybrid-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hybrid-columns {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1.2rem;
  align-items: start;
}

.hybrid-presentiel {
  height: 100%;
}

.hybrid-distanciel {
  display: grid;
  gap: 1rem;
}

.preview-description p {
  margin: 0.4rem 0 0;
}

/* Table preview */
.preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  table-layout: fixed;
}

.preview-table thead th {
  background: var(--gray-30);
  padding: 0.7rem;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-60);
}

.preview-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--gray-60);
  vertical-align: top;
}

.preview-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.012);
}

.preview-table .pause-row td {
  background: #fff1eb !important;
  color: var(--primary-dark);
  font-weight: 600;
  text-align: center;
  border-bottom: 0;
}

.badge {
  background: rgba(255, 199, 0, 0.25);
  color: var(--black);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Modaux distanciel/presentiel */
.modalite-bloc[hidden] {
  display: none !important;
}

.modalite-bloc {
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.modalite-titre {
  display: none;
  grid-column: 1 / -1;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a237e;
}

.hybride-card {
  border: 1px solid rgba(76, 99, 210, 0.3);
  border-radius: 10px;
  padding: 16px;
  background: #fbfdff;
}

.hybride-card .modalite-titre {
  display: block;
}

.distanciel-group {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  background: #f9fbff;
}

.distanciel-group legend {
  font-weight: 600;
  color: #1a237e;
  padding: 0 8px;
}

.odj-table {
  width: 100%;
  border-collapse: collapse;
}

.odj-table col.col-heure { width: 14%; }
.odj-table col.col-numero { width: 8%; text-align: center; }
.odj-table col.col-point { width: 52%; }
.odj-table col.col-porteur { width: 26%; }

.odj-table th,
.odj-table td {
  border: 1px solid #e2e5f1;
  padding: 8px 10px;
  vertical-align: top;
  font-size: 0.92rem;
}
.odj-table th {
  background: #ffc700;
}

.odj-table .descr {
  color: #6b6f86;
  font-size: 0.88rem;
}

.odj-table .duree {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #4b5563;
  font-style: italic;
}

.odj-table .badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.badge-point { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.badge-divers { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.badge-pause  { background: rgba(248, 180, 0, 0.2); color: #b45309; }

.pause-row td {
  background: #fff8e5;
  font-weight: 600;
  text-align: center;
}

.odj-table .intro-row td {
  background: #f1f5f9;
  font-weight: 600;
text-transform: uppercase;
}


/* Résponsive */
@media (max-width: 1080px) {
  main.layout {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
}


/* Impression (Ctrl+P si besoin) */
/* Marges impression */
@page {
  size: A4;
  margin: 5mm;
}

@media print {
  /* … */
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    background: #fff;
  }



  /* Casser les layouts grid/flex */
  main.layout,
  .panel,
  .preview-panel,
  .card,
  .preview {
    display: block !important;
    width: 100% !important;
  }

  main.layout {
    padding: 0;
    grid-template-columns: none;
  }

  /* Masquer la colonne formulaires */
  .panel:first-of-type {
    display: none !important;
  }

  /* Masquer l’en-tête de la carte preview */
  .card-header {
    display: none !important;
  }

  /* Garder uniquement la prévisualisation */
  body * {
    visibility: hidden;
  }
  .preview-panel,
  .preview-panel * {
    visibility: visible;
  }
  .preview-panel {
    position: static !important;
    margin: 0 !important;
  }

  /* Nettoyage visuel */
  .preview-panel,
  .card,
  .preview {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    background: transparent;
  }

  .preview {
    border-radius: 12px;
    padding: 1.2rem;
    background: #fff;
  }

  .preview-wrapper,
  .preview-section {
    overflow: visible !important;
    height: auto !important;
  }

  /* -------- TABLEAU ODJ -------- */
  .odj-table {
    width: 100%;
    border-collapse: collapse;
    display: table !important;
    page-break-after: auto;
  }

  .odj-table thead {
    display: table-header-group !important;
  }

  .odj-table tbody {
    display: table-row-group !important;
  }

	.odj-table .intro-row td {
		background: #f1f5f9 !important;
		font-weight: 600 !important;
		text-transform: uppercase;
	  }

  .odj-table tr {
    display: table-row !important;
    page-break-inside: avoid;
    break-inside: avoid;
    -moz-break-inside: avoid;
  }

  .odj-table th,
  .odj-table td {
    display: table-cell !important;
    border: 1px solid var(--gray-60) !important;
    background: #fff !important;
    padding: 0.45rem 0.55rem;
    vertical-align: top;
    page-break-inside: avoid;
    break-inside: avoid;
    -moz-break-inside: avoid;
  }

  .odj-table thead th {
    background: var(--primary) !important;
    color: var(--black) !important;
  }

  .odj-table .pause-row td {
    background: #fff6cc !important;
  }

  tfoot {
    display: table-footer-group;
  }

  .duree {
    color: #6b7280 !important;
    font-style: italic;
  }
 .card-link {
    color: #0000c0;
    text-decoration: underline;
  }

  .card-link::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
    color: #000;

}





/* ----------  PAGES PDF PERSONNALISÉES  ---------- */
.pdf-export-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.pdf-export-container {
  width: 210mm;
}

.pdf-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  padding: 18mm 16mm 16mm;
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--gray-800);
}

.pdf-page:not(:last-child) {
  page-break-after: always;
}

.pdf-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.pdf-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.pdf-header h1 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--black);
}

.pdf-header p {
  margin: 0.1rem 0 0.6rem;
  color: var(--gray-500);
}

.pdf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pdf-meta span {
  display: block;
  color: var(--gray-500);
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
}

.pdf-meta strong {
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--gray-800);
}

.pdf-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pdf-card {
  border: 1px solid #e2e5f1;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f9fbff;
}

.pdf-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6f86;
}

.pdf-card p {
  margin: 0.15rem 0;
  font-size: 0.92rem;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.pdf-table thead th {
  background: #eef0fb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #6b6f86;
  padding: 6px;
}

.pdf-table td {
  border-bottom: 1px solid #e2e5f1;
  padding: 6px;
  vertical-align: top;
}

.pdf-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

.pdf-table .pause-row td {
  background: #fff4d6;
  font-weight: 600;
  text-align: center;
  border-bottom: none;
}

.pdf-footer {
  text-align: right;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b6f86;
}

.is-hidden {
  display: none !important;
}