/* ==========================================================================
   TERUMA — identité visuelle de l'administration
   « Teruma » : l'offrande mise à part. Le registre est une pile de talons de
   reçu : le montant à gauche, la personne à droite, une perforation entre
   les deux et une encoche de couleur qui dit où en est la vérification.
   Toutes les règles sont scopées sous .tr pour cohabiter avec Bootstrap.
   ========================================================================== */

:root {
    --tr-ink: #071b37;        /* bleu nuit officiel TERUMA : titres, panneau, boutons */
    --tr-ink-2: #174568;
    --tr-paper: #fdfbf6;      /* ivoire officiel TERUMA */
    --tr-surface: #ffffff;
    --tr-line: #ede4d8;
    --tr-muted: #5b6479;
    --tr-brass: #946721;      /* or TERUMA foncé (lisible en texte) : ce qui attend une décision */
    --tr-brass-soft: #f5ead2;
    --tr-ok: #2b7154;
    --tr-ok-soft: #dcefe5;
    --tr-no: #a63f2e;
    --tr-no-soft: #f6dfd9;

    --tr-font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --tr-r-sm: 6px;
    --tr-r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.tr {
    margin: 0;
    background: var(--tr-paper);
    font-family: var(--tr-font);
    color: var(--tr-ink);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
.tr h1, .tr h2, .tr h3, .tr p { margin-top: 0; }
.tr a { color: var(--tr-ink-2); }
.tr img { max-width: 100%; }
.tr button, .tr input, .tr select, .tr textarea { font: inherit; }

.tr *:focus-visible {
    outline: 3px solid var(--tr-brass);
    outline-offset: 2px;
}

.tr .tr-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    letter-spacing: -0.01em;
}
.tr-muted { color: var(--tr-muted); }
.tr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tr-skip {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--tr-ink); color: #fff !important; padding: 8px 12px; border-radius: var(--tr-r-sm);
}
.tr-skip:focus { top: 12px; }

/* ---------- Coquille : menu latéral + contenu -------------------------- */
:root { --tr-side: 248px; }

.tr-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--tr-side);
    background: var(--tr-ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    z-index: 40;
    overflow-y: auto;
}
.tr-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.tr-brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff !important; text-decoration: none;
    font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
}
.tr-mark { flex: 0 0 auto; display: block; }
.tr-church { margin: 10px 6px 18px; font-size: 13px; color: #aeb7cf; }

.tr-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tr-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--tr-r-sm);
    color: #d5dbea !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
}
.tr-nav a i { font-size: 17px; width: 20px; text-align: center; color: #8e99b8; }
.tr-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.tr-nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff !important; font-weight: 700; box-shadow: inset 3px 0 0 var(--tr-brass); }
.tr-nav a[aria-current="page"] i { color: #f1cf86; }
.tr-nav-badge {
    margin-left: auto;
    min-width: 22px; padding: 1px 7px; border-radius: 999px;
    background: var(--tr-brass); color: #fff;
    font-size: 12px; font-weight: 700; text-align: center;
    font-variant-numeric: tabular-nums;
}
.tr-nav-group { margin: 18px 12px 6px; font-size: 12.5px; color: #8e99b8; }

.tr-me {
    display: flex; align-items: center; gap: 6px;
    margin-top: 16px; padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.tr-me form { margin: 0; }
.tr-me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; padding: 6px; border-radius: var(--tr-r-sm); }
.tr-me-link:hover { background: rgba(255, 255, 255, .06); }
.tr-me-text { min-width: 0; }
.tr-me-text strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-me-text span { display: block; color: #aeb7cf; font-size: 12.5px; }
.tr-me .tr-initials { background: rgba(255, 255, 255, .12); color: #fff; }

.tr-iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--tr-r-sm);
    border: 0; background: transparent; color: #d5dbea; cursor: pointer; font-size: 20px;
}
.tr-iconbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.tr-topbar { display: none; }
.tr-scrim { display: none; }
.tr-only-mobile { display: none; }

.tr-main {
    margin-left: var(--tr-side);
    padding: 28px 32px 56px;
    max-width: calc(1080px + var(--tr-side) + 64px);
}

@media (max-width: 991.98px) {
    .tr-topbar {
        display: flex; align-items: center; gap: 6px;
        position: sticky; top: 0; z-index: 30;
        height: 56px; padding: 0 8px;
        background: var(--tr-ink);
    }
    .tr-topbar .tr-brand { font-size: 18px; }
    .tr-topbar .tr-mark { width: 24px; height: 24px; }
    .tr-sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
    .nav-open .tr-sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .tr-scrim { position: fixed; inset: 0; background: rgba(15, 20, 38, .45); z-index: 35; }
    .nav-open .tr-scrim { display: block; }
    .tr-only-mobile { display: inline-flex; }
    .tr-main { margin-left: 0; padding: 18px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) {
    .tr-sidebar { transition: none; }
}

/* ---------- Sections, cartes, listes de définitions -------------------- */
.tr-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-section { margin-top: 28px; }
.tr-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tr-section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.tr-section-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.tr-section-head a:hover { text-decoration: underline; }

.tr-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tr-grid-2 > * { min-width: 0; }
@media (max-width: 767.98px) { .tr-grid-2 { grid-template-columns: 1fr; } }

.tr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tr-kpi {
    display: block; text-decoration: none; color: var(--tr-ink) !important;
    background: var(--tr-surface); border: 1px solid var(--tr-line); border-radius: var(--tr-r);
    padding: 14px 16px;
}
a.tr-kpi:hover { border-color: var(--tr-ink-2); }
.tr-kpi .k { font-size: 13px; color: var(--tr-muted); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.tr-kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 0; }
.tr-kpi .s { font-size: 12.5px; color: var(--tr-muted); margin: 6px 0 0; }
.tr-kpi.attention { border-color: #e6cf9f; background: #fffaf0; }
.tr-kpi.attention .v { color: #8a5f12; }
@media (max-width: 767.98px) { .tr-kpis { grid-template-columns: 1fr 1fr; } }

.tr-rows { list-style: none; margin: 0; padding: 0; background: var(--tr-surface); border: 1px solid var(--tr-line); border-radius: var(--tr-r); }
.tr-rows > li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.tr-rows > li + li { border-top: 1px solid var(--tr-line); }
.tr-rows .grow { flex: 1; min-width: 0; }
.tr-rows .grow strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-rows .grow span { display: block; font-size: 13px; color: var(--tr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-rows .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-rows a.rowlink { color: inherit; text-decoration: none; }
.tr-rows a.rowlink:hover strong { text-decoration: underline; }
.tr-rows .empty { color: var(--tr-muted); justify-content: center; padding: 22px 14px; }

.tr-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.tr-dl dt { color: var(--tr-muted); font-weight: 400; }
.tr-dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.tr-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: #e6eaf3; color: var(--tr-ink-2); white-space: nowrap;
}
.tr-chip.pending { background: var(--tr-brass-soft); color: #7a5512; }
.tr-chip.verified, .tr-chip.ok, .tr-chip.active, .tr-chip.completed { background: var(--tr-ok-soft); color: var(--tr-ok); }
.tr-chip.rejected, .tr-chip.off, .tr-chip.cancelled { background: var(--tr-no-soft); color: var(--tr-no); }

.tr-progress { height: 6px; border-radius: 999px; background: #e6eaf3; overflow: hidden; }
.tr-progress > span { display: block; height: 100%; background: var(--tr-ok); border-radius: 999px; }

/* ---------- Tableaux ---------------------------------------------------- */
.tr-tablewrap { background: var(--tr-surface); border: 1px solid var(--tr-line); border-radius: var(--tr-r); overflow-x: auto; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-table th { text-align: left; font-weight: 600; color: var(--tr-muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--tr-line); white-space: nowrap; background: #fafbfd; }
.tr-table td { padding: 12px 14px; border-bottom: 1px solid var(--tr-line); vertical-align: middle; }
.tr-table tr:last-child td { border-bottom: 0; }
.tr-table td.num, .tr-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-table .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-table .who strong { display: block; font-weight: 600; }
.tr-table .who span { display: block; font-size: 13px; color: var(--tr-muted); }
.tr-table .actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 767.98px) {
    .tr-table.stack thead { display: none; }
    .tr-table.stack, .tr-table.stack tbody, .tr-table.stack tr, .tr-table.stack td { display: block; width: 100%; }
    .tr-table.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--tr-line); }
    .tr-table.stack tr:last-child { border-bottom: 0; }
    .tr-table.stack td { border: 0; padding: 3px 0; }
    .tr-table.stack td[data-label]::before { content: attr(data-label) ' : '; color: var(--tr-muted); font-weight: 400; }
    .tr-table.stack td.num { text-align: left; }
    .tr-table.stack .actions { justify-content: flex-start; margin-top: 6px; }
}

/* ---------- Interrupteur ---------------------------------------------- */
.tr-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.tr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tr-switch .track {
    flex: 0 0 44px; height: 26px; border-radius: 999px; background: #cdd4e3; position: relative; transition: background .15s;
    margin-top: 1px;
}
.tr-switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.tr-switch input:checked + .track { background: var(--tr-ok); }
.tr-switch input:checked + .track::after { transform: translateX(18px); }
.tr-switch input:focus-visible + .track { outline: 3px solid var(--tr-brass); outline-offset: 2px; }
.tr-switch .txt strong { display: block; font-weight: 600; }
.tr-switch .txt span { display: block; font-size: 13px; color: var(--tr-muted); margin-top: 2px; }

.tr-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--tr-line); border-radius: var(--tr-r-sm); cursor: pointer; font-weight: 500; background: var(--tr-surface); }
.tr-check input { width: 16px; height: 16px; accent-color: var(--tr-ink); }

/* ---------- Boîtes de dialogue ---------------------------------------- */
.tr-dialog {
    border: 0; padding: 0; border-radius: var(--tr-r); width: min(520px, calc(100vw - 24px));
    color: var(--tr-ink); box-shadow: 0 20px 60px rgba(15, 20, 38, .3);
}
.tr-dialog::backdrop { background: rgba(15, 20, 38, .5); }
.tr-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.tr-dialog-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.tr-dialog-head .tr-iconbtn { color: var(--tr-muted); }
.tr-dialog-head .tr-iconbtn:hover { background: var(--tr-paper); color: var(--tr-ink); }
.tr-dialog-body { padding: 14px 18px 18px; }
.tr-dialog .tr-form { max-width: none; }

/* ---------- Pagination ------------------------------------------------- */
.tr-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.tr-pager p { margin: 0; color: var(--tr-muted); font-size: 13px; }
.tr-pager ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.tr-pager li a, .tr-pager li span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--tr-line); border-radius: var(--tr-r-sm); background: var(--tr-surface);
    color: var(--tr-ink); text-decoration: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.tr-pager li a:hover { border-color: var(--tr-ink-2); }
.tr-pager li [aria-current="page"] { background: var(--tr-ink); border-color: var(--tr-ink); color: #fff; }
.tr-pager li .disabled { color: #a3abbd; }

/* ---------- En-tête ---------------------------------------------------- */
.tr-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 16px;
}
.tr-head h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
    color: var(--tr-ink);
}
.tr-head p { margin: 6px 0 0; color: var(--tr-muted); font-size: 14px; }

/* ---------- Panneau de synthèse --------------------------------------- */
.tr-ledger {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--tr-ink);
    color: #fff;
    border-radius: var(--tr-r);
    overflow: hidden;
    margin-bottom: 18px;
}
.tr-ledger > div { padding: 14px 16px; }
.tr-ledger > div + div { border-left: 1px dashed rgba(255, 255, 255, .28); }
.tr-ledger .k { font-size: 13px; color: #c3cbe0; margin: 0 0 4px; }
.tr-ledger .v { font-size: 22px; font-weight: 700; line-height: 1.1; margin: 0; }
.tr-ledger .v small { font-size: 12px; font-weight: 500; color: #c3cbe0; margin-left: 3px; }
.tr-ledger .s { font-size: 12.5px; color: #c3cbe0; margin: 4px 0 0; }
.tr-ledger .attention .v { color: #f1cf86; }

/* ---------- Onglets de statut ----------------------------------------- */
.tr-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 12px;
    padding-bottom: 2px;
}
.tr-tabs::-webkit-scrollbar { display: none; }
.tr-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--tr-line);
    background: var(--tr-surface);
    color: var(--tr-ink);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.tr-tab:hover { border-color: var(--tr-ink-2); color: var(--tr-ink); }
.tr-tab .n {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--tr-paper);
    color: var(--tr-muted);
}
.tr-tab[aria-current="page"] { background: var(--tr-ink); border-color: var(--tr-ink); color: #fff; }
.tr-tab[aria-current="page"] .n { background: rgba(255, 255, 255, .16); color: #fff; }
.tr-tab.is-pending .n { background: var(--tr-brass-soft); color: #7a5512; }
.tr-tab.is-pending[aria-current="page"] .n { background: var(--tr-brass); color: #fff; }

/* ---------- Recherche -------------------------------------------------- */
.tr-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.tr-search input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-r-sm);
    padding: 0 12px;
    background: var(--tr-surface);
    color: var(--tr-ink);
    font: inherit;
}
.tr-search input:focus { outline: none; border-color: var(--tr-ink-2); box-shadow: 0 0 0 3px rgba(44, 58, 99, .15); }

/* ---------- Boutons ---------------------------------------------------- */
.tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--tr-r-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    color: var(--tr-ink);
}
.tr-btn[disabled] { opacity: .55; cursor: progress; }
.tr-btn-ink { background: var(--tr-ink); color: #fff; }
.tr-btn-ink:hover { background: var(--tr-ink-2); color: #fff; }
.tr-btn-ok { background: var(--tr-ok); color: #fff; }
.tr-btn-ok:hover { background: #225d45; color: #fff; }
.tr-btn-line { border-color: var(--tr-line); background: var(--tr-surface); }
.tr-btn-line:hover { border-color: var(--tr-ink-2); color: var(--tr-ink); }
.tr-btn-no { color: var(--tr-no); border-color: #e7c3bb; background: var(--tr-surface); }
.tr-btn-no:hover { background: var(--tr-no-soft); color: var(--tr-no); }
.tr-btn-ghost { color: var(--tr-muted); padding: 0 8px; }
.tr-btn-ghost:hover { color: var(--tr-ink); }
.tr-btn-ghost.danger:hover { color: var(--tr-no); }

/* ---------- Talons de dîme -------------------------------------------- */
.tr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.tr-stub {
    position: relative;
    display: grid;
    grid-template-columns: 148px 1fr;
    background: var(--tr-surface);
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-r);
    overflow: hidden;
}
/* encoche de statut */
.tr-stub::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--tr-brass);
}
.tr-stub[data-status="verified"]::before { background: var(--tr-ok); }
.tr-stub[data-status="rejected"]::before { background: var(--tr-no); }

.tr-stub-amount {
    padding: 14px 14px 14px 20px;
    border-right: 2px dashed var(--tr-line);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.tr-stub-amount .v { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.tr-stub-amount .c { font-size: 12px; color: var(--tr-muted); margin-top: 4px; }

.tr-stub-body { padding: 12px 14px; min-width: 0; }
.tr-stub-top { display: flex; align-items: flex-start; gap: 10px; }
.tr-stub-top img {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 36px;
    background: var(--tr-paper);
}
.tr-who { min-width: 0; flex: 1; }
.tr-who strong { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-who span { display: block; font-size: 13px; color: var(--tr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tr-status {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--tr-brass-soft);
    color: #7a5512;
}
.tr-status.verified { background: var(--tr-ok-soft); color: var(--tr-ok); }
.tr-status.rejected { background: var(--tr-no-soft); color: var(--tr-no); }

.tr-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 10px 0 0;
    padding: 0;
    font-size: 13px;
    color: var(--tr-muted);
}
.tr-facts div { display: flex; gap: 5px; }
.tr-facts dt { font-weight: 400; }
.tr-facts dd { margin: 0; color: var(--tr-ink); font-weight: 600; }

.tr-reason {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: var(--tr-r-sm);
    background: var(--tr-no-soft);
    color: #6f2a1f;
    font-size: 13px;
}

.tr-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.tr-actions { justify-content: space-between; }
.tr-actions-aside,
.tr-actions-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tr-noproof { font-size: 13px; color: var(--tr-muted); padding-right: 4px; }
.tr-initials {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e6eaf3; color: var(--tr-ink-2); font-weight: 700; font-size: 13px;
}

/* formulaire de rejet déplié */
.tr-reject {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--tr-r-sm);
    background: var(--tr-paper);
}
.tr-reject[hidden] { display: none; }
.tr-reject label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tr-reject textarea {
    width: 100%;
    min-height: 64px;
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-r-sm);
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    color: var(--tr-ink);
    background: var(--tr-surface);
    resize: vertical;
}
.tr-reject .row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.tr-msg { font-size: 13px; margin-top: 8px; color: var(--tr-no); }
.tr-msg:empty { display: none; }

/* changement d'état après validation / rejet */
.tr-stub.just-changed { animation: tr-flash 900ms ease-out; }
@keyframes tr-flash {
    from { box-shadow: 0 0 0 3px var(--tr-ok-soft); }
    to { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Vide, pagination, alertes --------------------------------- */
.tr-empty {
    text-align: center;
    padding: 36px 16px;
    border: 1px dashed var(--tr-line);
    border-radius: var(--tr-r);
    background: var(--tr-surface);
}
.tr-empty strong { display: block; font-size: 17px; margin-bottom: 4px; }
.tr-empty p { color: var(--tr-muted); margin: 0 0 14px; }

.tr-pages { margin-top: 18px; }
.tr-pages nav p { color: var(--tr-muted); font-size: 13px; }
.tr-pages .pagination { gap: 4px; }
.tr-pages .page-link { border-radius: var(--tr-r-sm) !important; color: var(--tr-ink); border-color: var(--tr-line); }
.tr-pages .page-item.active .page-link { background: var(--tr-ink); border-color: var(--tr-ink); color: #fff; }

.tr-flash {
    max-width: 1080px;
    padding: 10px 14px;
    border-radius: var(--tr-r-sm);
    margin-bottom: 14px;
    font-size: 14px;
    background: var(--tr-ok-soft);
    color: var(--tr-ok);
    font-weight: 600;
}
.tr-flash.error { background: var(--tr-no-soft); color: var(--tr-no); }

/* ---------- Formulaire de modification -------------------------------- */
.tr-back { display: inline-flex; align-items: center; gap: 6px; color: var(--tr-muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.tr-back:hover { color: var(--tr-ink); }

.tr-card {
    background: var(--tr-surface);
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-r);
    padding: 18px;
}
.tr-form { display: grid; gap: 16px; max-width: 560px; }
.tr-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.tr-field .hint { display: block; font-size: 12.5px; color: var(--tr-muted); margin-top: 4px; }
.tr-field input,
.tr-field select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-r-sm);
    padding: 0 12px;
    font: inherit;
    color: var(--tr-ink);
    background: var(--tr-surface);
}
.tr-field input:focus,
.tr-field select:focus { outline: none; border-color: var(--tr-ink-2); box-shadow: 0 0 0 3px rgba(44, 58, 99, .15); }
.tr-field input:disabled,
.tr-field select:disabled { background: var(--tr-paper); color: var(--tr-muted); cursor: not-allowed; }
.tr-field .err { color: var(--tr-no); font-size: 13px; margin-top: 4px; display: block; }
.tr-money { position: relative; }
.tr-money input { padding-right: 64px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-money span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--tr-muted); font-size: 13px; }
.tr-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

.tr-locked {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--tr-r-sm);
    background: var(--tr-brass-soft); color: #5e420e; font-size: 14px; margin-bottom: 16px;
}

/* ---------- Mobile ---------------------------------------------------- */
@media (max-width: 575.98px) {
    .tr-head h1 { font-size: 26px; }
    .tr-ledger { grid-template-columns: 1fr; }
    .tr-ledger > div + div { border-left: 0; border-top: 1px dashed rgba(255, 255, 255, .28); }
    .tr-stub { grid-template-columns: 1fr; }
    .tr-stub-amount {
        border-right: 0;
        border-bottom: 2px dashed var(--tr-line);
        flex-direction: row;
        align-items: baseline;
        justify-content: flex-start;
        gap: 6px;
        padding: 12px 14px 10px 20px;
    }
    .tr-stub-amount .c { margin-top: 0; }
    .tr-stub-body { padding-left: 20px; }
    .tr-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .tr-actions-main { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .tr-stub.just-changed { animation: none; }
}

/* ---------- Tableau de bord ------------------------------------------- */
.tr-yearpick select {
    height: 40px; border: 1px solid var(--tr-line); border-radius: var(--tr-r-sm);
    padding: 0 32px 0 12px; background: var(--tr-surface); color: var(--tr-ink); font-weight: 600;
}
.tr-note {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 10px 14px; margin-bottom: 16px; border-radius: var(--tr-r-sm);
    background: #e8ecf6; color: var(--tr-ink-2); font-size: 14px;
}
.tr-note a { margin-left: auto; font-weight: 600; }

.tr-bars-card { padding: 18px 18px 14px; }
.tr-bars {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end;
    height: 170px;
}
.tr-bars li { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; min-width: 0; }
.tr-bars .bar {
    display: block; height: var(--h); min-height: 2px;
    background: var(--tr-ink-2); border-radius: 4px 4px 0 0;
}
.tr-bars li:hover .bar { background: var(--tr-brass); }
.tr-bars .lbl { font-size: 11.5px; color: var(--tr-muted); text-align: center; margin-top: 6px; white-space: nowrap; overflow: hidden; }
.tr-bars-max { font-size: 13px; margin: 12px 0 0; }
@media (max-width: 575.98px) {
    .tr-bars { gap: 4px; height: 140px; }
    .tr-bars .lbl { font-size: 10px; }
}

@media (max-width: 575.98px) {
    .tr-search { flex-wrap: wrap; }
    .tr-search input[type="search"] { flex: 1 1 100%; }
    .tr-search .tr-select, .tr-search .tr-btn { flex: 1; }
}
.tr-select {
    height: 44px; border: 1px solid var(--tr-line); border-radius: var(--tr-r-sm);
    padding: 0 12px; background: var(--tr-surface); color: var(--tr-ink); font: inherit;
}
