@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    body { background: white !important; color: #1e293b !important; }
    .page-break { page-break-before: always; }
    .card-print { border: 1px solid #cbd5e1 !important; box-shadow: none !important; margin-bottom: 12px !important; }
}

.print-only { display: none; }

/* Menus dépliants des régimes : flèche native masquée (remplacée par une icône) */
summary::-webkit-details-marker { display: none; }

/* Scrollbar masquée pour fluidité mobile */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   IMPRESSION A4 / PDF (#print-sheet, rempli par triggerPrintClean)
   ============================================================ */
@page {
    size: A4;
    margin: 11mm 10mm;
}

@media print {
    html, body { height: auto !important; overflow: visible !important; }
    body { display: block !important; font-size: 10pt; }
    #print-sheet, #print-sheet * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

#print-sheet {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    color: #1e293b;
}

#print-sheet section,
.pr-dept,
.pr-recipe,
.pr-table tr { break-inside: avoid; page-break-inside: avoid; }

/* En-tête */
.pr-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%, #fff7ed 100%);
    border: 1px solid #d1fae5;
}

.pr-logo { height: 62px; width: auto; }

.pr-header-text { flex: 1; min-width: 0; }

.pr-kicker {
    font-size: 8.5pt;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ea580c;
}

.pr-week {
    font-size: 15pt;
    font-weight: 800;
    color: #064e3b;
    line-height: 1.2;
    margin: 2px 0 6px;
}

.pr-week::first-letter { text-transform: uppercase; }

.pr-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.pr-chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 8pt;
    font-weight: 700;
}

.pr-chip-warn { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }

/* Planning */
.pr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d1fae5;
    border-radius: 14px;
    overflow: hidden;
    font-size: 8.5pt;
    table-layout: fixed;
}

.pr-table th {
    background: #047857;
    color: #ffffff;
    text-align: left;
    padding: 7px 8px;
    font-size: 8.5pt;
    font-weight: 800;
}

.pr-table th.pr-th-day { width: 74px; }

.pr-table td {
    padding: 6px 8px;
    vertical-align: top;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #f1f5f9;
}

.pr-table tbody tr:nth-child(even) td { background: #f8fafc; }

.pr-table td.pr-td-day { background: #ecfdf5 !important; border-left: none; }

.pr-day {
    display: block;
    font-weight: 800;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #065f46;
}

.pr-day-servings {
    display: inline-block;
    margin-top: 3px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 7.5pt;
    font-weight: 800;
}

.pr-dish { font-weight: 700; color: #0f172a; line-height: 1.25; }
.pr-dish-meta { font-size: 7.5pt; color: #64748b; margin-top: 1px; }

.pr-course {
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px dashed #e2e8f0;
    font-size: 7.5pt;
    color: #334155;
}

.pr-course span {
    font-weight: 800;
    font-size: 6.5pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ea580c;
    margin-right: 2px;
}

.pr-fasting {
    color: #6366f1;
    font-weight: 700;
    font-style: italic;
    background: repeating-linear-gradient(135deg, #eef2ff, #eef2ff 6px, #ffffff 6px, #ffffff 12px) !important;
}

.pr-empty { color: #94a3b8; }

.pr-footer {
    margin-top: 8px;
    text-align: center;
    font-size: 8pt;
    color: #64748b;
}

/* Titres de section (courses, recettes) */
.pr-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 6px;
    margin-bottom: 10px;
    border-bottom: 3px solid #047857;
    font-size: 15pt;
    font-weight: 800;
    color: #064e3b;
}

.pr-section-meta { font-size: 8.5pt; font-weight: 600; color: #64748b; }

/* Liste de courses : rayons en cartes sur 3 colonnes */
.pr-groceries { column-count: 3; column-gap: 10px; }

.pr-dept {
    display: inline-block;
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.pr-dept-title {
    padding: 5px 9px;
    background: #ecfdf5;
    border-bottom: 1px solid #d1fae5;
    font-size: 8.5pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #065f46;
}

.pr-dept ul { padding: 5px 9px 7px; }

.pr-dept li {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2.5px 0;
    font-size: 8.5pt;
    border-bottom: 1px dotted #e2e8f0;
}

.pr-dept li:last-child { border-bottom: none; }

.pr-box {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border: 1.5px solid #10b981;
    border-radius: 3px;
    font-size: 7pt;
    line-height: 8px;
    text-align: center;
    color: #047857;
    transform: translateY(1px);
}

.pr-item { flex: 1; min-width: 0; }

.pr-qty { flex-shrink: 0; font-weight: 700; color: #475569; white-space: nowrap; }

.pr-done .pr-item { text-decoration: line-through; color: #94a3b8; }

.pr-notes {
    margin-top: 6px;
    padding: 8px 12px 10px;
    border: 1px dashed #fdba74;
    border-radius: 12px;
    background: #fffbf5;
    break-inside: avoid;
}

.pr-notes-title { font-size: 9pt; font-weight: 800; color: #c2410c; }

.pr-notes-lines {
    height: 90px;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 21px, #fed7aa 21px, #fed7aa 22px);
}

/* Fiches recettes */
.pr-recipe {
    margin-bottom: 12px;
    border: 1px solid #d1fae5;
    border-radius: 14px;
    overflow: hidden;
}

.pr-recipe-head {
    padding: 9px 12px;
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    border-bottom: 1px solid #d1fae5;
}

.pr-recipe-title { font-size: 12.5pt; font-weight: 800; color: #064e3b; margin-bottom: 5px; }

.pr-recipe-body {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 14px;
    padding: 10px 12px 12px;
    font-size: 8.5pt;
}

.pr-recipe-sub {
    font-size: 7.5pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ea580c;
    margin-bottom: 5px;
}

.pr-ingredients li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px dotted #e2e8f0;
}

.pr-steps li { display: flex; gap: 7px; margin-bottom: 5px; line-height: 1.35; }

.pr-step-num {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #047857;
    color: #ffffff;
    font-size: 7.5pt;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}
