:root { --irf: #0b5d4b; --irf-2: #0e7a62; --irf-pale: #e8f3ef; }
body { background: #f4f6f5; font-size: .95rem; }
.app-nav { background: var(--irf); }
.app-nav .nav-link { color: rgba(255,255,255,.82); }
.app-nav .nav-link.active, .app-nav .nav-link:hover { color: #fff; }
.app-nav .nav-link.active { border-bottom: 2px solid #fff; }
.ar, [lang="ar"] { font-family: "Sakkal Majalla", "Traditional Arabic", "Amiri", "Segoe UI", Tahoma, sans-serif; font-size: 1.12em; }
td.ar, th.ar, .ar-block { direction: rtl; text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; font-weight: 600; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.card-header { background: #fff; font-weight: 600; }
.kpi { border-left: 4px solid var(--irf-2); }
.kpi .val { font-size: 1.6rem; font-weight: 700; color: var(--irf); line-height: 1.1; }
.kpi .lbl { color: #6c757d; font-size: .85rem; }
.table thead th { background: var(--irf-pale); font-weight: 600; white-space: nowrap; }
.table-total td { font-weight: 700; background: #eef1f0; }
.btn-irf { background: var(--irf); color: #fff; }
.btn-irf:hover { background: var(--irf-2); color: #fff; }
.carte-valide { border: 2px solid #198754; }
.carte-devalidee { opacity: .7; }
.filters .form-select, .filters .form-control { min-width: 140px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--irf), #083d32); }
@media print { .app-nav, .no-print, form.filters { display: none !important; } body { background: #fff; } }
.app-nav .nav-link { white-space: nowrap; padding-left: .55rem !important; padding-right: .55rem !important; }
.table-rtl-scroll { direction: rtl; }
.table-rtl-scroll td, .table-rtl-scroll th { white-space: nowrap; }

/* ---- Pastilles de couleur (types d'opération / de bénéficiaire) ---- */
.pastille { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .55rem; border-radius: 999px;
    font-size: .85rem; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.pastille small { font-size: .75rem; opacity: .8; }
.pastille .ar { font-size: 1.02rem; }
/* Types d'opération : 1 Création, 2 Dotation, 3 Renouvellement, 4 Restitution, 5 Suppression */
.to-1 { background: #e3eefc; color: #1d4f91; border-color: #c4dbf8; }
.to-2 { background: #dff3e8; color: #13623f; border-color: #bfe5cf; }
.to-3 { background: #fdf0d5; color: #8a5a00; border-color: #f6dca3; }
.to-4 { background: #efe5fb; color: #5b2d91; border-color: #dccbf4; }
.to-5 { background: #fbe2e2; color: #9b1c1c; border-color: #f4c3c3; }
/* Types de bénéficiaire : 1 Invalide, 2 Veuve, 3 Test, autres */
.tb-1 { background: #ddf2f4; color: #0f5e66; border-color: #bce4e8; }
.tb-2 { background: #fbe4ef; color: #8c1d55; border-color: #f4c6dc; }
.tb-3 { background: #ececec; color: #555; border-color: #d6d6d6; }
[class*="tb-"]:not(.tb-1):not(.tb-2):not(.tb-3).pastille { background: #f1efe6; color: #5c5640; }

/* ---- Graphiques du tableau de bord : repliables et redimensionnables ---- */
.chart-box { position: relative; height: 320px; min-height: 160px; max-height: 1000px; resize: vertical; overflow: hidden; }
.chart-box::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; pointer-events: none;
    background: linear-gradient(135deg, transparent 50%, #adb5bd 50%, #adb5bd 60%, transparent 60%, transparent 75%, #adb5bd 75%, #adb5bd 85%, transparent 85%); }
.panneau .card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.panneau .outils .btn { padding: .1rem .4rem; line-height: 1; }
.panneau.replie .card-header { border-bottom: 0; }
