:root {
    --vert: #3d6b35;
    --vert-clair: #eaf3e6;
    --terre: #8a4b2a;
    --bs-primary: #3d6b35;
    --bs-primary-rgb: 61, 107, 53;
    --bs-link-color: #2f5a28;
    --bs-link-hover-color: #1e3d19;
}
body { background: #f4f6f2; font-size: .925rem; }
.btn-primary { --bs-btn-bg: var(--vert); --bs-btn-border-color: var(--vert); --bs-btn-hover-bg: #2f5a28; --bs-btn-hover-border-color: #2f5a28; --bs-btn-active-bg: #264a20; }
.btn-outline-primary { --bs-btn-color: var(--vert); --bs-btn-border-color: var(--vert); --bs-btn-hover-bg: var(--vert); --bs-btn-hover-border-color: var(--vert); --bs-btn-active-bg: var(--vert); --bs-btn-active-border-color: var(--vert); }
.form-check-input:checked { background-color: var(--vert); border-color: var(--vert); }
.text-bg-primary { background-color: var(--vert) !important; }

.app-shell { min-height: 100vh; }
.sidebar { width: 250px; flex-shrink: 0; background: #23361f; color: #dfe9da; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-bottom: 2rem; }
.sidebar .brand { display: flex; gap: .6rem; align-items: center; padding: 1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { width: 52px; height: 36px; object-fit: cover; border-radius: 6px; background: #fff; }
.sidebar .brand small { display: block; color: #a9c2a1; font-size: .75rem; }
.sidebar .nav-title { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #8fae86; padding: 1rem 1rem .3rem; }
.sidebar .nav-link { color: #dfe9da; padding: .45rem 1rem; border-inline-start: 3px solid transparent; }
.sidebar .nav-link i { width: 1.4rem; display: inline-block; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.1); border-inline-start-color: #9fd18b; color: #fff; font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; gap: .75rem; align-items: center; background: #fff; padding: .6rem 1.25rem; border-bottom: 1px solid #e3e7df; position: sticky; top: 0; z-index: 10; }
@media (max-width: 991px) {
    .sidebar { position: fixed; inset-inline-start: -260px; z-index: 1050; transition: inset-inline-start .2s; }
    .sidebar.open { inset-inline-start: 0; }
}

.card { border: 1px solid #e3e7df; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; font-weight: 600; }
.kpi { border-inline-start: 4px solid var(--vert); }
.kpi .valeur { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi .libelle { color: #6c757d; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi.terre { border-inline-start-color: var(--terre); }
.kpi.rouge { border-inline-start-color: #c0392b; }
.kpi.bleu { border-inline-start-color: #2471a3; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table thead th { background: var(--vert-clair); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #3b4a37; white-space: nowrap; }
.montant { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
dl.fiche dt { color: #6c757d; font-weight: 500; font-size: .85rem; }
dl.fiche dd { margin-bottom: .6rem; }
.form-label { font-weight: 500; font-size: .875rem; }
.required::after { content: " *"; color: #c0392b; }
.section-form { border-inline-start: 3px solid var(--vert); padding-inline-start: .9rem; margin-bottom: 1.25rem; }
.section-form > h6 { color: var(--vert); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }
.calcul-box { background: var(--vert-clair); border: 1px dashed var(--vert); border-radius: .5rem; padding: 1rem; }
.calcul-box .montant-calcule { font-size: 2rem; font-weight: 700; color: var(--vert); }
.ar { unicode-bidi: isolate; font-family: 'Amiri', 'Traditional Arabic', serif; direction: rtl; }

/* ---- Interface en arabe (RTL) ---- */
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Amiri", system-ui, sans-serif; font-size: .95rem; }
[dir="rtl"] .kpi .libelle, [dir="rtl"] .table thead th, [dir="rtl"] .sidebar .nav-title, [dir="rtl"] .section-form > h6 { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .bi-arrow-left::before { transform: scaleX(-1); display: inline-block; }
