/* Thème institutionnel — couleurs du drapeau de la RDC */
:root {
    --flag-blue: #007fff;
    --flag-blue-deep: #0066c7;
    --flag-yellow: #f7d116;
    --flag-red: #ce1020;
    --primary-color: #0066c7;
    --secondary-color: #004a94;
    --accent-gold: #f7d116;
    --success-color: #1b7a3d;
    --warning-color: #c9a227;
    --danger-color: #ce1020;
    --dark-color: #003366;
    --navbar-color: #004a94;
    --navbar-gradient: #0066c7;
    --page-bg: #eef3f8;
    --text-official: #12263a;
}

.rdc-flag-stripe {
    height: 8px;
    background:
        linear-gradient(
            90deg,
            #007fff 0%,
            #007fff 38%,
            #f7d116 38%,
            #f7d116 42%,
            #ce1020 42%,
            #ce1020 58%,
            #f7d116 58%,
            #f7d116 62%,
            #007fff 62%,
            #007fff 100%
        );
}

.rdc-star {
    color: #f7d116;
    font-size: 1.05rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.institution-footer {
    background: #004a94;
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    border-top: 3px solid #f7d116;
    position: sticky;
    bottom: 0;
    z-index: 1020;
    width: 100%;
    margin-top: auto;
}

.btn-primary {
    background-color: #0066c7;
    border-color: #0066c7;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #004a94;
    border-color: #004a94;
    color: #fff;
}

.btn-danger {
    background-color: #ce1020;
    border-color: #ce1020;
}

.form-control:focus,
.form-select:focus {
    border-color: #0066c7;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 199, 0.2);
}

.table thead {
    background: #0066c7;
    color: #fff;
}

.badge.bg-secondary {
    background-color: #004a94 !important;
}

.btn-connexion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f7d116;
    color: #003366 !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.62rem 1.2rem 0.62rem 1rem;
    text-decoration: none;
    border: none;
    border-radius: 0;
    border-left: 4px solid #ce1020;
    box-shadow: 0 2px 0 #c9a80a;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-connexion i {
    font-size: 1.05rem;
    color: #ce1020;
}

.btn-connexion:hover,
.btn-connexion:focus {
    background: #ffe36b;
    color: #003366 !important;
    box-shadow: 0 3px 0 #ce1020;
    transform: translateY(-1px);
}

.btn-connexion:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-connexion--nav {
    padding: 0.42rem 0.9rem 0.42rem 0.75rem;
    font-size: 0.72rem;
    box-shadow: none;
    align-self: center;
}

.btn-connexion--nav:hover,
.btn-connexion--nav:focus {
    box-shadow: none;
    transform: none;
    background: #fff0a0;
}

.btn-connexion--block {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 0.85rem;
}

/* Listes compactes */
.list-wrap { padding: 0.65rem 0.9rem 1rem; }
.list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}
.list-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #003366;
}
.list-head .btn { border-radius: 0; font-size: 0.75rem; padding: 0.28rem 0.65rem; font-weight: 600; }
.stats-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}
.stats-strip.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stats-strip.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-strip.cols-5 { grid-template-columns: repeat(5, 1fr); }
.stat-chip {
    background: #004a94;
    color: #fff;
    text-align: center;
    padding: 0.28rem 0.3rem;
    border-left: 3px solid #f7d116;
}
.stat-chip strong { display: block; font-size: 0.95rem; line-height: 1.1; }
.stat-chip span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.stat-chip.inc { background: #ce1020; }
.stat-chip.lib { background: #1b7a3d; }
.stat-chip.tr { background: #c9a227; color: #12263a; }
.stat-chip.ev { background: #5b6b7c; }
.search-bar {
    background: #fff;
    border: 1px solid #d5dee8;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.5rem;
}
.search-bar .row { --bs-gutter-x: 0.4rem; --bs-gutter-y: 0.35rem; }
.search-bar .form-control,
.search-bar .form-select,
.search-bar .btn {
    border-radius: 0;
    height: 2rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.45rem;
}
.data-table-wrap { background: #fff; border: 1px solid #d5dee8; }
.data-table { margin: 0; font-size: 0.8rem; }
.data-table thead th {
    background: #0066c7;
    color: #fff;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.38rem 0.5rem;
    white-space: nowrap;
    border: none;
}
.data-table tbody td {
    padding: 0.28rem 0.5rem;
    vertical-align: middle;
    border-color: #e8eef4;
}
.data-table tbody tr:hover { background: #f4f8fc; }
.data-table .name { font-weight: 700; color: #003366; }
.data-table .mat { color: #5b6b7c; font-size: 0.72rem; }
.photo-sm {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 1px solid #d5dee8;
    background: #0066c7;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.status-badge {
    font-size: 0.65rem;
    padding: 0.12rem 0.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.btn-action {
    padding: 0.12rem 0.32rem;
    font-size: 0.75rem;
    border-radius: 0;
    line-height: 1;
}
.action-buttons { display: flex; gap: 0.2rem; }
.list-wrap .pagination { justify-content: flex-end; margin: 0.4rem 0.5rem 0.45rem; }
.list-wrap .pagination .page-link { border-radius: 0; font-size: 0.75rem; padding: 0.2rem 0.45rem; }
.empty-state { text-align: center; padding: 1.5rem; color: #6c757d; }

/* Fiches compactes */
.fiche { padding: 0.6rem 0.9rem 1rem; }
.fiche-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}
.fiche-toolbar h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #003366;
}
.fiche-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fiche-actions .btn {
    border-radius: 0;
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    font-weight: 600;
}
.id-banner {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 0.85rem;
    align-items: center;
    background: #004a94;
    color: #fff;
    padding: 0.7rem 0.9rem;
    border-bottom: 3px solid #f7d116;
    margin-bottom: 0.55rem;
}
.id-photo {
    width: 88px;
    height: 110px;
    object-fit: cover;
    background: #0066c7;
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
}
img.id-photo { padding: 0; }
.id-banner h1 {
    margin: 0 0 0.15rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.id-meta { font-size: 0.78rem; opacity: 0.9; margin: 0; }
.id-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}
.kpi-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi {
    background: #fff;
    border: 1px solid #d5dee8;
    border-left: 3px solid #0066c7;
    padding: 0.35rem 0.5rem;
}
.kpi span {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5b6b7c;
}
.kpi strong { font-size: 0.88rem; color: #003366; }
.fiche-body { background: #fff; border: 1px solid #d5dee8; }
.fiche-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #0066c7;
    background: #f4f8fc;
}
.fiche-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #004a94;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.85rem;
}
.fiche-tabs .nav-link.active { background: #0066c7; color: #fff; }
.tab-pane { padding: 0.75rem 0.85rem; }
.dl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem 0.85rem;
}
.dl-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dl-item span {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5b6b7c;
    margin-bottom: 0.08rem;
}
.dl-item strong { font-size: 0.85rem; color: #12263a; font-weight: 600; }
.dl-wide { grid-column: 1 / -1; }
@media (max-width: 992px) {
    .stats-strip, .stats-strip.cols-3, .stats-strip.cols-4, .stats-strip.cols-5 { grid-template-columns: repeat(3, 1fr); }
    .id-banner { grid-template-columns: 72px 1fr; }
    .id-status { grid-column: 1 / -1; align-items: flex-start; text-align: left; }
    .kpi-row, .kpi-row.cols-4, .kpi-row.cols-3, .dl-grid, .dl-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
.map-prisons {
    height: 280px;
    width: 100%;
    border-top: 1px solid #d5dee8;
    background: #e8eef4;
}
.map-prisons--sm { height: 220px; }
.map-panel .leaflet-popup-content { font-size: 0.78rem; }
.map-panel .leaflet-popup-content a { color: #004a94; font-weight: 700; }
