/* ── Simulateur de salaire net Omamori ──
   v1.44 — colonne paramètres large / colonne résultats compacte,
   tableaux de résultats alignés à droite, sous-totaux CNPS / impôts.
*/

:root { --oma-teal: #008c82; }

.sim-hero { background: linear-gradient(135deg, #f0fafa 0%, #e6f7f7 100%); }
.sim-hero .wrap { padding-top: 18px; padding-bottom: 14px; }
.sim-hero-title { margin: 0 0 4px; color: #0c2b2a; font-size: 1.45rem; }
.sim-hero-sub { margin: 0; color: #3a5a58; max-width: 780px; font-size: .86rem; }

/* ===== Mise en page : paramètres 40 % / résultats 60 % =====
   (largeur de page alignée sur .wrap = var(--maxw) du thème) */
.sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 28px;
    align-items: start;
    padding: 18px 0 40px;
}
@media (max-width: 980px) {
    .sim-layout { grid-template-columns: 1fr; }
}

/* ===== Cartes ===== */
.sim-card {
    background: #fff;
    border: 1px solid #e0f0f0;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,140,130,.06);
}
.sim-card-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--oma-teal);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sim-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--oma-teal);
    margin: 0 0 16px;
}
.sim-section-sep {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e6efee;
}

/* ===== Champs ===== */
.sim-field { margin-bottom: 18px; }
.sim-field label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 5px;
    color: #1a2c2b;
}
.sim-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8e6e4;
    border-radius: 8px;
    font-size: 1rem;
    color: #1a2c2b;
    background: #f8fdfd;
    box-sizing: border-box;
}
.sim-input:focus {
    outline: none;
    border-color: var(--oma-teal);
    box-shadow: 0 0 0 3px rgba(0,140,130,.15);
}
.sim-hint {
    display: block;
    font-size: .8rem;
    color: #6b8a89;
    margin-top: 4px;
}
.sim-sal-cat-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    font-size: .9rem;
    color: #2e7d32;
}

/* ===== Tableau des primes (saisie) ===== */
.sim-primes-tbl {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: .92rem;
}
.sim-primes-tbl th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid #e0efee;
    font-weight: 600;
    color: #557;
    white-space: nowrap;
}
.sim-primes-tbl td { padding: 5px 6px; vertical-align: middle; }
.sim-th-amount { width: 150px; }
.sim-th-del    { width: 40px; }
.sim-prime-elem   { width: 100%; min-width: 0; }
.sim-prime-amount { width: 100%; text-align: right; }
.sim-prime-del {
    background: none;
    border: 1px solid #e0b0b0;
    color: #c05050;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}
.sim-prime-del:hover { background: #c05050; color: #fff; }

.sim-btn-add {
    margin-top: 4px;
    background: none;
    border: 1px dashed var(--oma-teal);
    color: var(--oma-teal);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: .9rem;
    cursor: pointer;
}
.sim-btn-add:hover { background: #f0fafa; }

.sim-actions { margin-top: 8px; }
.sim-btn-calc { width: 100%; }

.sim-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff0f0;
    border: 1px solid #f0c0c0;
    border-radius: 8px;
    color: #c03030;
    font-size: .9rem;
}

/* ===== Résultats — cartes Net à payer & Coût (compactes, 1 ligne) ===== */
.sim-card-net, .sim-card-cout {
    padding: 12px 18px;
    text-align: center;
}
.sim-card-net {
    background: linear-gradient(135deg, var(--oma-teal), #006b63);
    border-color: transparent;
    color: #fff;
}
.sim-net-label, .sim-cout-label {
    display: block;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 2px;
}
.sim-net-label { opacity: .9; }
.sim-net-line, .sim-cout-line {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sim-net-value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; }
.sim-net-unit, .sim-cout-unit { font-size: .8rem; opacity: .85; }
.sim-net-sub { font-size: .85rem; opacity: .85; }

/* ===== Résultats — tableaux (alignés à droite) ===== */
.sim-res-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.sim-res-tbl thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b8a89;
    font-weight: 700;
    padding: 0 0 8px;
    border-bottom: 2px solid #e6efee;
}
.sim-res-tbl .res-lbl { text-align: left; }
.sim-res-tbl .res-num { text-align: right; }
.sim-res-tbl tbody td {
    padding: 5px 0;
    border-bottom: 1px solid #f0f5f4;
    color: #2a3c3b;
}
.sim-res-tbl tbody td.res-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    padding-left: 12px;
}
.sim-res-tbl .res-row-total td {
    border-top: 2px solid #d6e6e4;
    border-bottom: none;
    padding-top: 9px;
    font-weight: 700;
    color: #0c2b2a;
}

/* ===== Résultats — Retenues & Charges côte à côte ===== */
.sim-res-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.sim-res-2col .sim-card { margin-bottom: 0; }
@media (max-width: 620px) {
    .sim-res-2col { grid-template-columns: 1fr; }
    .sim-res-2col .sim-card { margin-bottom: 12px; }
}

/* ===== Résultats — versements (sous-totaux organismes) ===== */
.sim-card-versements { background: #fbfdfd; }
.sim-card-versements .res-row-cnps td,
.sim-card-versements .res-row-impots td {
    font-weight: 600;
    border-bottom: 1px solid #eef4f3;
}
.sim-card-versements .res-num { color: var(--oma-teal); }
.sim-versements-hint {
    margin: 12px 0 0;
    font-size: .78rem;
    color: #6b8a89;
    line-height: 1.5;
}

/* ===== Résultats — coût employeur ===== */
.sim-card-cout {
    background: #f5fffe;
    border-color: var(--oma-teal);
}
.sim-cout-label { color: var(--oma-teal); }
.sim-cout-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--oma-teal);
    line-height: 1.1;
}
.sim-cout-unit { color: var(--oma-teal); }

/* ===== Bouton PDF ===== */
.sim-print-row { text-align: center; margin: 4px 0 16px; }
.sim-btn-print {
    background: #455a64;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-size: .95rem;
    cursor: pointer;
}
.sim-btn-print:hover { background: #263238; }
.sim-btn-print:disabled { opacity: .6; cursor: default; }

/* ===== Teaser DIPE ===== */
.sim-dipe-teaser {
    background: #f1f8e9;
    border: 1px solid #c5e1a5;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: .88rem;
    color: #33691e;
    line-height: 1.6;
}
.sim-dipe-teaser a {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .sim-net-value { font-size: 1.9rem; }
    .sim-th-amount { width: 120px; }
}

/* ============================================================
   Impression / PDF navigateur (fallback Ctrl+P)
   ============================================================ */
@media print {
    header, nav, .navbar, footer,
    .sim-hero, .sim-form-col,
    .sim-print-row, .sim-dipe-teaser,
    #sim-error {
        display: none !important;
    }
    .sim-layout { display: block !important; }
    .sim-result-col { display: block !important; width: 100% !important; }
    .sim-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
        margin-bottom: 12px;
    }
    body { font-size: 11pt; }
    a[href]::after { content: "" !important; }
}
