/* PlaniBulle — Styles impression
 *
 * Chargé via <link media="print"> dans App.razor, donc :
 *   - les règles ne s'appliquent qu'à l'impression (pas besoin de wrapper @media print)
 *   - le navigateur déprioritise le téléchargement au premier paint
 *
 * Layout cible : HTML pur Excel-like, indépendant de MudBlazor. Vues couvertes :
 *   - PlanningPrintView (équipe Excel-like A4 paysage)
 *   - CompteursPrintView, CompteursHeuresPrintView (matrices A4 paysage)
 *   - PlanningPresenceEnfantsPrintView (présence enfants A4 paysage)
 *   - .pb-presence-table (rendu print du composant écran)
 */

@page { size: A4 landscape; margin: 8mm; }

* {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

html, body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, Helvetica, sans-serif;
}

/* Masquer toute la chrome MudBlazor + éléments marqués no-print */
.mud-appbar,
.mud-drawer,
.mud-drawer-overlay,
.no-print,
#blazor-error-ui {
    display: none !important;
}

.mud-main-content,
.mud-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.planning-equipe-page { background: #FFFFFF !important; }

.print-only { display: block !important; }

/* ─── Tableaux Excel-like (vue impression équipe) ─────────────────── */
.print-equipe {
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}
.print-structure-block { page-break-after: always; }
.print-structure-block:last-child { page-break-after: auto; }

.print-structure-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1pt solid #000;
    padding-bottom: 2mm;
    margin-bottom: 3mm;
}
.print-structure-nom { font-size: 13pt; font-weight: 700; }
.print-structure-meta { font-size: 9pt; color: #555; }

.print-week-wrapper {
    page-break-inside: avoid;
    margin-bottom: 3mm;
}
.print-week-title {
    font-size: 9pt;
    font-weight: 700;
    margin: 0 0 1mm;
}

.print-week-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 8pt;
    font-variant-numeric: tabular-nums;
}
.print-week-table th,
.print-week-table td {
    border: 0.5pt solid #000;
    padding: 0.8mm 1mm;
    text-align: center;
    vertical-align: middle;
    line-height: 1.15;
}
/* N&B : pas de fond gris/coloré, pas de couleur d'accent — un simple cadre noir.
   L'objectif : un PDF lisible sur n'importe quelle imprimante (y compris N&B
   économique sans gestion fine des nuances). */
.print-week-table thead th {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
}
.print-week-table .col-prenom {
    text-align: left;
    width: 24mm;
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
    padding-left: 2mm;
}
.print-week-table .col-jour-h { font-size: 8pt; }
.print-week-table .col-h {
    font-size: 7pt;
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 600;
}
.print-week-table .col-total {
    width: 14mm;
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
}
.print-week-table .row-creneau td.cell-h {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 600;
}
.print-week-table .row-reunion td.cell-h {
    background: #FFFFFF !important;
    color: #000 !important;
    font-style: italic;
}
.print-week-table .cell-empty { color: transparent; }
.print-week-table .cell-absence {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
    letter-spacing: 0.05em;
}
/* Jour férié mergé sur toute la colonne (rowspan = 2 × nb salariées). */
.print-week-table .cell-ferie {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    letter-spacing: 0.08em;
}
/* Marqueur "(HT)" pour signaler une saisie HorsTerrain dans la cellule. Pas de zébrage
   en N&B : un simple suffixe texte est plus lisible. */
.print-week-table .cell-ht-marker {
    font-size: 6pt;
    font-weight: 700;
    font-style: normal;
}
.print-empty {
    font-size: 9pt;
    color: #888;
    margin: 4mm 0;
}

/* ─── Compteurs d'absence ──────────────────────────────────────────── */
/* Format A4 paysage : on remplit l'espace utile (~280×195mm) avec une typo
   confortable. Le tableau s'étire sur 100% de la largeur, la hauteur des
   lignes est calibrée pour qu'une équipe ~12 salariées tienne sur 1 page. */
.print-compteurs {
    color: #000;
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    height: 100%;
}
.print-compteurs-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1.5pt solid #263238;
    padding-bottom: 3mm;
    margin-bottom: 5mm;
}
.print-compteurs-nom {
    font-size: 18pt;
    font-weight: 800;
    color: #263238;
    letter-spacing: -0.01em;
}
.print-compteurs-meta {
    font-size: 10pt;
    color: #607D8B;
    display: flex;
    align-items: center;
    gap: 8pt;
}
.print-compteurs-cloture {
    display: inline-block;
    background: #546E7A; color: #fff; padding: 2pt 8pt;
    font-size: 9pt; font-weight: 700; border-radius: 3pt; letter-spacing: 0.03em;
}
.print-compteurs-empty { font-size: 10pt; color: #888; margin: 6mm 0; font-style: italic; }
.print-compteurs-cloture-line { font-size: 9pt; color: #888; margin: 3mm 0 0; }
.print-compteurs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11pt;
    font-variant-numeric: tabular-nums;
}
.print-compteurs-table th,
.print-compteurs-table td {
    border-right: 0.5pt solid #CFD8DC;
    border-bottom: 0.5pt solid #CFD8DC;
    padding: 4pt 6pt;
    text-align: right;
    vertical-align: middle;
}
.print-compteurs-table thead th {
    border-top: 0.75pt solid #455A64;
}
.print-compteurs-table tr th:first-child,
.print-compteurs-table tr td:first-child { border-left: 0.5pt solid #CFD8DC; }
.print-compteurs-table th {
    background: #ECEFF1 !important;
    font-weight: 700;
    text-align: center;
}
.print-compteurs-table th.col-type {
    color: #fff;
    font-size: 12pt;
    padding: 6pt 4pt;
    letter-spacing: 0.02em;
    border-right: 0.75pt solid #fff;
}
.print-compteurs-table tr.sous-en-tete th {
    font-size: 9pt;
    font-weight: 700;
    background: #F5F5F5 !important;
    color: #455A64;
    padding: 3pt 4pt;
    letter-spacing: 0.01em;
}
.print-compteurs-table tbody tr:nth-child(even) td { background: #FAFAFA; }
.print-compteurs-table tbody tr:hover td { background: inherit; }
.print-compteurs-table .col-nom {
    text-align: left;
    font-weight: 700;
    font-size: 11pt;
    color: #263238;
    padding-left: 8pt;
}
.print-compteurs-table th.col-nom { text-align: left; padding-left: 8pt; font-size: 10pt; }
.print-compteurs-table .col-total {
    background: #ECEFF1 !important;
    font-weight: 800;
    font-size: 12pt;
}
.print-compteurs-table .report { color: #1565C0; font-weight: 600; }
.print-compteurs-table .valides { color: #455A64; }
.print-compteurs-table .attente { color: #E65100; font-style: italic; font-weight: 600; }
.print-compteurs-table .projete { color: #90A4AE; font-style: italic; font-size: 9.5pt; }
.print-compteurs-table .solde {
    font-weight: 800;
    font-size: 12pt;
    background: #FAFBFC;
}
.print-compteurs-table tbody tr:nth-child(even) td.solde { background: #F0F4F7; }
.print-compteurs-table .solde.neg { color: #B71C1C; }
.print-compteurs-table .solde.alerte { color: #E65100; }
.print-compteurs-table .solde.ok { color: #2E7D32; }
.print-compteurs-table .vide {
    background: #FAFAFA !important;
    color: #CFD8DC;
    text-align: center;
    font-size: 9pt;
}
.print-compteurs-table tr.total-row td {
    background: #455A64 !important;
    color: #FFFFFF !important;
    font-weight: 800;
    font-size: 11pt;
    border-top: 1pt solid #263238;
    padding: 5pt 6pt;
}
.print-compteurs-table tr.total-row td.col-nom { color: #FFFFFF !important; }
.print-compteurs-table tr.total-row td.col-total {
    background: #263238 !important;
    font-size: 13pt;
}
.print-compteurs-table tr.total-row td.projete {
    color: #FFFFFF !important;
    font-style: normal;
    font-weight: 700;
}

/* ─── Compteur d'heures équipe matrice (print A4 paysage) ────────── */
.print-heures-matrice {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11pt;
    font-variant-numeric: tabular-nums;
}
.print-heures-matrice th,
.print-heures-matrice td {
    border-right: 0.5pt solid #CFD8DC;
    border-bottom: 0.5pt solid #CFD8DC;
    padding: 5pt 8pt;
    text-align: right;
}
.print-heures-matrice tr th:first-child,
.print-heures-matrice tr td:first-child { border-left: 0.5pt solid #CFD8DC; }
.print-heures-matrice thead th {
    background: #ECEFF1 !important;
    border-top: 0.75pt solid #455A64;
    font-weight: 700;
    font-size: 10pt;
    color: #455A64;
    padding: 6pt 6pt;
}
.print-heures-matrice thead th.h-courant {
    background: #455A64 !important;
    color: #FFFFFF !important;
}
.print-heures-matrice thead th.h-futur {
    background: #F5F5F5 !important;
    color: #757575;
    font-style: italic;
}
.print-heures-matrice .col-nom {
    text-align: left;
    font-weight: 700;
    padding-left: 10pt;
    color: #263238;
    min-width: 32mm;
}
.print-heures-matrice thead th.col-nom { text-align: left; padding-left: 10pt; }
.print-heures-matrice tbody tr:nth-child(even) td { background: #FAFAFA; }
.print-heures-matrice td.h-courant {
    font-weight: 700;
    background: #ECEFF1 !important;
}
.print-heures-matrice td.h-courant.h-alerte {
    background: #FFF3E0 !important;
    color: #E65100;
    font-weight: 800;
}
.print-heures-matrice td.h-futur {
    color: #757575;
    background: #FAFAFA !important;
    font-style: italic;
}
.print-heures-matrice td.vide { color: #BDBDBD; font-style: normal; }
.print-heures-matrice tr.total-row td {
    background: #455A64 !important;
    color: #FFFFFF !important;
    font-weight: 800;
    font-size: 11pt;
    border-top: 1pt solid #263238;
    padding: 6pt 8pt;
}
.print-heures-matrice tr.total-row td.col-nom { color: #FFFFFF !important; }
.print-heures-matrice tr.total-row td.h-courant { background: #263238 !important; }

/* ─── Planning présence enfants (impression A4 paysage) ───────────────── */
.pb-presence-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 9pt;
    border: 0.5pt solid #000;
    border-radius: 0;
}
.pb-presence-table thead th {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
    font-size: 9pt;
    border: 0.5pt solid #000;
    padding: 1.5mm 1mm;
}
.pb-presence-table thead th .jour-count {
    background: #FFFFFF !important;
    color: #000 !important;
    font-weight: 700;
    margin-left: 4pt;
}
.pb-presence-table thead th.depasse .jour-count {
    background: #FFFFFF !important;
    color: #000 !important;
    text-decoration: underline;
}
.pb-presence-table tbody td {
    border: 0.5pt solid #000;
    padding: 0.8mm 1mm;
    height: auto;
    font-size: 9pt;
    line-height: 1.2;
}
.pb-presence-table .cell-vide { background: #FFFFFF !important; }
.pb-presence-table .cell-enfant {
    color: #000 !important;
    font-weight: 500;
    border-radius: 0;
}
.pb-presence-titre {
    font-size: 13pt;
    font-weight: 700;
    margin: 0 0 4mm;
}

/* ─── Vue impression dédiée — PlanningPresenceEnfantsPrintView ───── */
.print-presence {
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}
.print-presence-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1pt solid #000;
    padding-bottom: 2mm;
    margin-bottom: 3mm;
}
.print-presence-nom { font-size: 13pt; font-weight: 700; }
.print-presence-meta { font-size: 9pt; color: #555; }
.print-presence-empty { font-size: 10pt; color: #555; }

.print-presence-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 9pt;
}
.print-presence-table th,
.print-presence-table td {
    border: 0.5pt solid #000;
    padding: 1mm 1.5mm;
    text-align: center;
    vertical-align: middle;
}
.print-presence-table thead th {
    background: #ECEFF1;
    font-weight: 700;
}
.print-presence-table thead th.depasse {
    text-decoration: underline;
}
.print-presence-table thead th .jour-count {
    margin-left: 4px;
    font-weight: 400;
}
.print-presence-table .col-nom {
    text-align: left;
    font-weight: 600;
    width: 32%;
}
.print-presence-table .cell-vide { background: #FFFFFF; }
.print-presence-table .cell-enfant { background: #FFFFFF; font-weight: 500; }
.print-presence-table .cell-enfant.absent { color: #999; font-style: italic; font-size: 8pt; }
.print-presence-table .cell-absent-tag { font-weight: 500; }
.print-presence-table tr.has-allergie .col-nom { background: #FFEBEE; }
.print-presence-table .allergie-mark { margin-left: 4px; color: #B71C1C; }

.print-presence-allergies {
    margin-top: 4mm;
    padding-top: 2mm;
    border-top: 0.5pt solid #999;
    font-size: 9pt;
}
.print-presence-allergies-titre { font-weight: 700; margin-bottom: 1mm; }
.print-presence-allergies ul { margin: 0; padding-left: 4mm; }
.print-presence-allergies li { margin-bottom: 0.5mm; }
