:root {
  --app-primary: #1f3a5f;
  --app-primary-dark: #152a45;
  --app-accent: #e07b24;
  --bs-primary: #1f3a5f;
  --bs-primary-rgb: 31, 58, 95;
  --bs-link-color: #1f3a5f;
  --bs-link-color-rgb: 31, 58, 95;
}
body { background: #f3f5f8; }

.app-nav { background: var(--app-primary); }
.app-nav .nav-link.active { color: #fff; box-shadow: inset 0 -2px 0 var(--app-accent); }
/* Bandeau officiel des pages internes : armoirie au-dessus, ministère, cabinet */
.bandeau-officiel { background: #fff; text-align: center; padding: .6rem 1rem .5rem; border-bottom: 3px solid var(--app-accent); }
.bandeau-armoirie { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto .2rem; }
.bandeau-ministere { font-weight: 700; font-size: .95rem; letter-spacing: .04em; color: var(--app-primary); }
.bandeau-cabinet { font-weight: 600; font-size: .78rem; letter-spacing: .12em; color: #444; }
.nav-app-titre { font-size: 1rem; font-weight: 600; }
.app-nav .nav-link { white-space: nowrap; }
@media (max-width: 575.98px) { .bandeau-ministere { font-size: .8rem; } }

.btn-primary { --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark); --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary); --bs-btn-hover-border-color: var(--app-primary); }
.btn-accent { background: var(--app-accent); color: #fff; border: none; }
.btn-accent:hover { background: #c96a17; color: #fff; }

.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; }

/* Cartes indicateurs */
.stat-card { border: none; border-left: 4px solid var(--c, var(--app-primary)); text-decoration: none; color: inherit; transition: transform .1s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .03em; }

.table-diligences td { vertical-align: top; }
.table-diligences .objet { max-width: 340px; }
.ligne-retard { --bs-table-bg: #fff5f5; }
.text-pre { white-space: pre-line; }

/* Grille de cases à cocher des structures */
.structures-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .25rem .75rem;
  max-height: 220px; overflow-y: auto; border: 1px solid #dee2e6; border-radius: .375rem; padding: .6rem .75rem; background: #fff; }
.structures-grid label { font-size: .9rem; cursor: pointer; }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--app-accent); font-weight: 600; margin-bottom: .75rem; }

.timeline { list-style: none; padding-left: 0; }
.timeline li { border-left: 2px solid #dee2e6; padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--app-primary); }

.bar { height: .5rem; background: #e9ecef; border-radius: 1rem; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--app-primary); }

/* En-tête officiel : armoirie au-dessus, ministère, cabinet */
.entete-officiel { text-align: center; margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 3px solid var(--app-accent); }
.entete-officiel .armoirie { width: 104px; height: 104px; object-fit: contain; display: block; margin: 0 auto .4rem; mix-blend-mode: multiply; /* fond blanc de l'image fondu dans la page */ }
.entete-officiel .ministere { font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; color: var(--app-primary); }
.entete-officiel .cabinet { font-weight: 600; font-size: .9rem; letter-spacing: .12em; color: #444; margin-top: .15rem; }
.entete-officiel .titre { font-size: 1.25rem; font-weight: 600; margin: .9rem 0 0; }
@media (max-width: 575.98px) { .entete-officiel .ministere { font-size: .9rem; } }

/* Page de connexion */
.login-page { max-width: 1100px; margin: 0 auto; padding-top: .5rem; }
.login-page .entete-officiel { border-bottom: none; margin-bottom: 1.25rem; }
.login-card { border: none; border-radius: .75rem; overflow: hidden; border-top: 4px solid var(--app-accent); }
.login-card-header { display: flex; align-items: center; gap: .85rem; background: var(--app-primary); color: #fff; padding: 1rem 1.5rem; }
.login-card-header > .bi { font-size: 1.8rem; color: #f3b27a; }
.login-card .input-group-text { background: #f6f8fb; color: var(--app-primary); }
.login-card .form-control:focus { border-color: var(--app-primary); box-shadow: 0 0 0 .2rem rgba(31, 58, 95, .15); }
.btn-oeil { border-color: var(--bs-border-color); color: #6c757d; }
.btn-oeil:hover, .btn-oeil:focus { background: #f6f8fb; color: var(--app-primary); border-color: var(--bs-border-color); }
