.spope-compta-app{font-family:Arial,sans-serif;color:#222;background:#fff;padding:18px;max-width:1600px}.spope-compta-header{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #4c7098;padding-bottom:12px}.spope-compta-header h1{color:#4c7098;margin:0 0 4px}.spope-compta-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px 0}.spope-compta-cards>div{border:1px solid #ddd;border-radius:6px;padding:14px;background:#f8f8f8}.spope-compta-cards span{display:block;color:#666;font-size:13px}.spope-compta-cards strong{display:block;margin-top:5px;font-size:20px}.spope-compta-tabs{display:flex;gap:5px;border-bottom:1px solid #ddd;margin-bottom:15px}.spope-compta-tabs button{border:0;background:#eee;padding:10px 15px;cursor:pointer}.spope-compta-tabs button.active{background:#4c7098;color:#fff}.spope-tab{display:none}.spope-tab.active{display:block}.spope-toolbar{display:flex;gap:8px;align-items:center;margin:10px 0 15px}.spope-table-wrap{overflow:auto}.spope-journal,.spope-simple{border-collapse:collapse;width:100%;font-size:13px}.spope-journal th,.spope-journal td,.spope-simple th,.spope-simple td{border:1px solid #ddd;padding:6px;vertical-align:middle}.spope-journal th,.spope-simple th{background:#f1f1f1;text-align:left}.spope-journal input,.spope-journal select,.spope-simple input,.spope-simple select{max-width:100%;box-sizing:border-box;padding:5px}.spope-journal input[type=text]{min-width:105px}.ec-amount{width:100px}.ec-sense{width:80px;margin-top:3px}.spope-source{font-size:11px;color:#4c7098}.button-link.delete{color:#b32d2e}.spope-result-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.spope-result-total{margin-top:18px;padding:16px;background:#f1f1f1;font-size:18px}.spope-settings{max-width:500px;display:flex;flex-direction:column;gap:12px}.spope-settings label{display:flex;justify-content:space-between;gap:15px}.spope-settings input{padding:7px}.spope-modal{position:fixed;z-index:99999;inset:0;background:rgba(0,0,0,.65);display:flex;align-items:center;justify-content:center}.spope-modal-inner{background:#fff;width:min(900px,90vw);height:min(800px,90vh);padding:15px;position:relative;overflow:auto}.spope-close{position:absolute;right:10px;top:5px;font-size:28px;border:0;background:transparent;cursor:pointer}.spope-piece-content iframe,.spope-piece-content img{width:100%;height:100%;object-fit:contain}.spope-compta-noaccess{padding:20px;border:1px solid #ddd}.error{color:#b32d2e}@media(max-width:900px){.spope-compta-cards,.spope-result-grid{grid-template-columns:1fr}.spope-compta-header{align-items:flex-start;gap:10px;flex-direction:column}}

/* Journal : alternance par séquence comptable. Toutes les lignes d'une même écriture gardent le même fond. */
.spope-journal tr.spope-seq-white td{background:#fff}
.spope-journal tr.spope-seq-gray td{background:#f5f5f5}
.spope-journal tr.spope-seq-white input,.spope-journal tr.spope-seq-white select,.spope-journal tr.spope-seq-gray input,.spope-journal tr.spope-seq-gray select{background:transparent}
.spope-journal td[rowspan]{vertical-align:middle;text-align:center;font-weight:600}
.spope-journal .ec-delete{white-space:nowrap}

/* Largeur lisible des montants et des tableaux : compatible avec 9 999 999 Ar. */
.spope-journal{min-width:1900px;table-layout:auto}
.spope-journal th:nth-child(1),.spope-journal td:nth-child(1){min-width:125px}
.spope-journal th:nth-child(2),.spope-journal td:nth-child(2){min-width:155px}
.spope-journal th:nth-child(3),.spope-journal td:nth-child(3){min-width:210px}
.spope-journal th:nth-child(4),.spope-journal td:nth-child(4){min-width:180px}
.spope-journal th:nth-child(5),.spope-journal td:nth-child(5){min-width:210px}
.spope-journal th:nth-child(6),.spope-journal td:nth-child(6){min-width:125px}
.spope-journal th:nth-child(7),.spope-journal td:nth-child(7),.spope-journal th:nth-child(8),.spope-journal td:nth-child(8),.spope-journal th:nth-child(9),.spope-journal td:nth-child(9),.spope-journal th:nth-child(10),.spope-journal td:nth-child(10){min-width:125px;white-space:nowrap}
.spope-journal th:nth-child(11),.spope-journal td:nth-child(11){min-width:90px}
.spope-journal th:nth-child(12),.spope-journal td:nth-child(12){min-width:190px;white-space:nowrap}
.spope-simple{min-width:720px}
.spope-simple th:last-child,.spope-simple td:last-child{min-width:130px;white-space:nowrap}
.spope-simple th:first-child,.spope-simple td:first-child{min-width:100px}
.spope-simple th:nth-child(2),.spope-simple td:nth-child(2){min-width:220px}

/* 1.0.12 — Alignement des montants et largeur pleine fenêtre. */
.spope-journal td.ec-total,
.spope-journal td.ec-credit,
.spope-journal td.ec-debit,
.spope-journal td.ec-balance,
.spope-journal input.ec-amount,
.spope-journal td:nth-child(7),
.spope-journal td:nth-child(8),
.spope-journal td:nth-child(9),
.spope-journal td:nth-child(10),
.spope-simple td:last-child,
.spope-result-total,
.spope-compta-cards strong {
    text-align:left !important;
}

/* Les cellules fusionnées financières doivent également rester alignées à gauche. */
.spope-journal td[rowspan].ec-total,
.spope-journal td[rowspan].ec-credit,
.spope-journal td[rowspan].ec-debit,
.spope-journal td[rowspan].ec-balance {
    text-align:left !important;
}

/* Le conteneur web occupe toute la largeur de la fenêtre. */
.spope-compta-app {
    width:100vw;
    max-width:none;
    box-sizing:border-box;
    margin-left:calc(50% - 50vw);
    margin-right:0;
}

/* Dans le back-office, utiliser toute la largeur disponible après le menu WordPress. */
#wpcontent .spope-compta-app,
#wpbody-content .spope-compta-app,
.wrap .spope-compta-app {
    width:100%;
    max-width:none;
    margin-left:0;
    margin-right:0;
}

/* Le journal conserve toutes ses 12 colonnes et ne les masque jamais. */
.spope-table-wrap {
    width:100%;
    max-width:none;
    overflow-x:auto;
    overflow-y:visible;
}
.spope-journal {
    width:100%;
    min-width:1900px;
    table-layout:auto;
}

/* Largeurs minimales suffisantes pour les montants jusqu'à 9 999 999. */
.spope-journal th:nth-child(7), .spope-journal td:nth-child(7),
.spope-journal th:nth-child(8), .spope-journal td:nth-child(8),
.spope-journal th:nth-child(9), .spope-journal td:nth-child(9),
.spope-journal th:nth-child(10), .spope-journal td:nth-child(10) {
    min-width:135px;
    width:135px;
    white-space:nowrap;
}
.spope-journal th:nth-child(6), .spope-journal td:nth-child(6) {
    min-width:135px;
}
.spope-journal input.ec-amount {
    width:120px;
    min-width:120px;
}

/* Même principe pour les autres tableaux du plugin : largeur exploitable maximale. */
.spope-simple {
    width:100%;
    max-width:none;
}

/* 1.0.22 — Popups d'export et de pièces : masqués par défaut et réouvrables indéfiniment. */
.spope-modal[aria-hidden="true"]{display:none !important}
.spope-export-modal{display:none;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}
.spope-export-modal.is-open{display:flex !important}
.spope-export-modal-inner{width:min(560px,calc(100vw - 40px));height:auto;max-height:calc(100vh - 40px);overflow:auto;border-radius:6px;box-sizing:border-box}
.spope-export-modal-content{padding:18px 12px 12px}
.spope-export-form{display:flex;gap:18px;flex-wrap:wrap;margin:18px 0}
.spope-export-form label{display:flex;flex-direction:column;gap:6px;font-weight:600;min-width:190px}
.spope-export-form input{padding:8px}
.spope-export-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.spope-export-actions a.disabled{opacity:.45;pointer-events:none}
.spope-export-modal .spope-close{z-index:2}

/* Pièce : la fenêtre et son contenu occupent tout l'espace disponible. */
.spope-piece-modal{display:flex !important;padding:12px;box-sizing:border-box}
.spope-piece-modal-inner{width:calc(100vw - 24px);height:calc(100vh - 24px);max-width:none;max-height:none;padding:0;overflow:hidden;box-sizing:border-box;background:#fff}
.spope-piece-modal-inner .spope-close{z-index:10;right:8px;top:4px;background:rgba(255,255,255,.92);border-radius:50%;width:38px;height:38px;line-height:32px}
.spope-piece-content{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff}
.spope-piece-content img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
.spope-piece-content iframe{display:block;width:100%;height:100%;border:0}
.spope-piece-content p{padding:20px}

/* 1.0.29 — Lisibilité renforcée du journal et bouton de ligne associée. */
.spope-journal{font-size:14px}
.spope-journal th,.spope-journal td{padding:8px 7px;line-height:1.4}
.spope-journal input,.spope-journal select{font-size:14px;min-height:32px}
.spope-journal .button-link{font-size:13px;line-height:1.45;white-space:nowrap}
.spope-journal .ec-add-associated{display:inline-block;color:#1d5b8f;font-weight:600;margin:0 4px 4px 0}
@media(max-width:700px){.spope-journal{font-size:14px}.spope-journal th,.spope-journal td{padding:7px}}
