/* ============================================================
   SIMULATION DE PAIE — grille des rubriques et bloc
   masse salariale / charges patronales.
   Partagé par OutilsRH/SimulationPaie et OutilsRH/PaieEnvers.
   ============================================================ */

/* Grille des rubriques — mêmes colonnes que la grille WPF SoftyPaie */
.payslip-table { width:100%; border-collapse:collapse; font-size:12px; margin-bottom:20px; }
.payslip-table th, .payslip-table td { border:1px solid #000; padding:5px 8px; text-align:right; }
.payslip-table th { background:#f0f0f0; text-align:center; font-weight:bold; }

/* ══ Bloc masse salariale / charges patronales ══ */
.masse-card { background:#fff; border:1px solid #e8f4f2; border-top:3px solid #1a9c8c; border-radius:14px; padding:1.4rem 1.5rem; box-shadow:0 4px 18px rgba(26,156,140,.08); }
.masse-title { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1.05rem; color:#0d2d4a; margin-bottom:1rem; }
.masse-title i { color:#1a9c8c; margin-right:.4rem; }
.masse-table { width:100%; border-collapse:collapse; font-size:12px; margin-bottom:1.2rem; }
.masse-table th, .masse-table td { border:1px solid #dbe9e6; padding:6px 9px; text-align:right; }
.masse-table thead th { background:#f4f9f8; color:#0d2d4a; font-weight:700; text-align:center; }
.masse-table tbody td:first-child { text-align:left; }
.masse-table tfoot th { background:#f4f9f8; color:#0d2d4a; }
.masse-synthese { border-top:1px dashed #cfe3df; padding-top:.9rem; }
.masse-item { display:flex; justify-content:space-between; align-items:baseline; gap:1rem; padding:.45rem 0; font-size:.9rem; }
.masse-lbl { color:#3d5166; }
.masse-val { font-family:'Rajdhani',sans-serif; font-weight:700; color:#0d2d4a; font-variant-numeric:tabular-nums; white-space:nowrap; }
.masse-item.masse-total { margin-top:.5rem; padding:.8rem 1rem; border-radius:10px; background:linear-gradient(135deg,#0d2d4a,#1c6057); }
.masse-item.masse-total .masse-lbl { color:rgba(255,255,255,.85); font-weight:600; font-size:.85rem; }
.masse-item.masse-total .masse-val { color:#22c5b1; font-size:1.3rem; }
.masse-note { margin-top:1rem; font-size:.76rem; color:#6b8f8a; line-height:1.5; }
.masse-note i { color:#1a9c8c; }
/* Lignes de la grille : distinction visuelle par nature */
.payslip-table tr.l-total td { background:#f4f9f8; font-weight:700; }
.payslip-table tr.l-patronale td { background:#fbfdfc; color:#4a6b66; font-style:italic; }

/* Badge des rubriques non imposables dans la liste de saisie */
.badge-nonimpo {
    display: inline-block;
    background: rgba(26,156,140,.12);
    color: #14776b;
    border: 1px solid rgba(26,156,140,.3);
    border-radius: 50px;
    padding: 1px 7px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}

/* La designation porte desormais l'identification de la ligne :
   la colonne Code a ete retiree des grilles de resultat. */
.payslip-table td:nth-child(1) { text-align: left; }

/* ============================================================
   EN-TETE D'IMPRESSION — masque a l'ecran, visible au tirage
   ============================================================ */
.print-entete { display: none; }

/* ============================================================
   IMPRESSION DE LA SIMULATION
   Ne sort que le resultat : en-tete, grille des rubriques et
   bloc masse salariale. Tout le reste du site est masque.
   ============================================================ */
@media print {

    @page { size: A4 portrait; margin: 12mm 10mm; }

    /* ── Chrome du site ── */
    nav.navbar, footer.footer, .ns-preloader, .whatsapp-float, .scroll-top,
    .outil-hero, .legal-info-card, .alert-ns-info,
    .btn-reset-ns, .btn-calc-ns, .btn-print-ns,
    #emptyState, .masse-note, .help-text-ns {
        display: none !important;
    }

    /* La colonne de saisie ne s'imprime pas : les parametres retenus
       sont rappeles dans l'en-tete d'impression. */
    .outil-body .row > .col-lg-5 { display: none !important; }

    /* Le resultat prend toute la largeur de la feuille. */
    .outil-body .row > .col-lg-7 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* AOS laisse les elements a opacite 0 tant qu'ils n'ont pas ete
       revelees au defilement : sans cette regle, une partie du
       resultat sortirait blanche sur le papier. */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    body {
        background: #fff !important;
        font-size: 11pt;
    }

    .outil-body { padding: 0 !important; }

    /* ── En-tete du document imprime ── */
    .print-entete {
        display: block !important;
        border-bottom: 2px solid #0d2d4a;
        padding-bottom: 8px;
        margin-bottom: 14px;
    }

    .print-entete h2 {
        font-family: 'Rajdhani', sans-serif;
        font-weight: 700;
        font-size: 16pt;
        color: #0d2d4a;
        margin: 0 0 2px;
    }

    .print-entete .pe-sous { font-size: 9pt; color: #4a6b66; margin: 0; }

    .print-entete .pe-params {
        margin-top: 8px;
        font-size: 9pt;
        color: #1c2e2c;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 22px;
    }

    .print-entete .pe-params span strong { color: #0d2d4a; }

    /* ── Cartes et tableaux ── */
    .calc-card, .masse-card, .payslip-container {
        border: 1px solid #cfe3df !important;
        box-shadow: none !important;
        border-radius: 6px !important;
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .payslip-table, .masse-table { font-size: 9pt; margin-bottom: 10px; }
    .payslip-table th, .payslip-table td,
    .masse-table th, .masse-table td { padding: 3px 6px; }

    table { break-inside: auto; }
    tr    { break-inside: avoid; page-break-inside: avoid; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }

    /* Les aplats de couleur doivent etre conserves au tirage,
       sans quoi le total ressort en blanc sur blanc. */
    .masse-item.masse-total {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #0d2d4a !important;
    }

    .masse-item.masse-total .masse-lbl { color: #fff !important; }
    .masse-item.masse-total .masse-val { color: #22c5b1 !important; }

    .payslip-table tr.l-total td,
    .masse-table thead th,
    .masse-table tfoot th,
    .payslip-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-pied {
        display: block !important;
        margin-top: 10px;
        font-size: 7.5pt;
        color: #6b8f8a;
        border-top: 1px solid #cfe3df;
        padding-top: 5px;
    }
}

/* Pied de page d'impression : masque a l'ecran */
.print-pied { display: none; }

/* Bouton d'impression */
.btn-print-ns {
    background: #fff;
    color: #0d2d4a;
    border: 1.5px solid #cfe3df;
    border-radius: 50px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .04em;
    padding: .62rem 1.5rem;
    margin: 0 .35rem;
    transition: border-color .22s, color .22s, background .22s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-print-ns:hover {
    background: #f4f9f8;
    border-color: #1a9c8c;
    color: #1a9c8c;
}

