:root {
    --green: #1f6f3f;
    --green-dark: #15532d;
    --green-light: #e8f3ec;
    --sidebar-bg: #1a2c24;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active: #1f6f3f;
    --bg: #f5f7fa;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06);
     --topbar-height: 64px;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    margin: 0;
}

/* ====== LAYOUT ====== */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 100%;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: .75rem 2rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: #fff;
}

/* ====== SIDEBAR ====== */
.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #cbd5d0;
    display: none;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

@media (min-width: 992px) {
    .app-sidebar { display: flex; }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.25rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green), #2a8f55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.brand-text strong { display: block; font-size: 1rem; letter-spacing: .5px; }
.brand-text small { color: rgba(255,255,255,.5); font-size: .72rem; }

.sidebar-nav { flex: 1; padding: 1rem .75rem; }

.sidebar-section { margin-bottom: 1.5rem; }

.sidebar-section-label {
    display: block;
    padding: 0 .75rem .5rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.35);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: #b8c5bf;
    text-decoration: none;
    font-size: .875rem;
    transition: all .15s;
    margin-bottom: 2px;
}

.sidebar-link i { font-size: 1.05rem; opacity: .8; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 500;
}
.sidebar-link.active i { opacity: 1; }

.sidebar-badge {
    margin-left: auto;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #2a8f55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.user-avatar-sm { width: 32px; height: 32px; font-size: .75rem; }

.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: .82rem; color: #fff; }
.user-info small { display: block; font-size: .7rem; color: rgba(255,255,255,.5); }

.user-logout {
    color: rgba(255,255,255,.4);
    font-size: 1.1rem;
    transition: color .15s;
}
.user-logout:hover { color: #ff6b6b; }

/* Sidebar mobile */
.sidebar-mobile { background: var(--sidebar-bg) !important; }
.sidebar-mobile .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.08); }

/* ====== TOPBAR ====== */
.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 2rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-spacer { flex: 1; }

.topbar-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .4rem .75rem;
    min-width: 320px;
    transition: all .15s;
}

.topbar-search:focus-within {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31,111,63,.1);
}

.topbar-search i { color: var(--text-muted); font-size: .9rem; }
.topbar-search input {
    border: 0;
    background: transparent;
    outline: 0;
    width: 100%;
    font-size: .875rem;
    color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all .15s;
}

.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon i { font-size: 1.15rem; }

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border: 0;
    padding: .3rem .5rem;
    border-radius: 8px;
    color: var(--text);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user strong { font-size: .85rem; }

/* ====== DASHBOARD ====== */
.dashboard { max-width: 1400px; margin: 0 auto; }

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--text);
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0;
}

.dashboard-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ====== KPI ====== */
.kpi {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform .15s, box-shadow .15s;
    height: 100%;
}

.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon.tone-primary  { background: #e0f2fe; color: #0369a1; }
.kpi-icon.tone-success  { background: #dcfce7; color: #15803d; }
.kpi-icon.tone-warning  { background: #fef3c7; color: #b45309; }
.kpi-icon.tone-danger   { background: #fee2e2; color: #b91c1c; }
.kpi-icon.tone-secondary{ background: #e5e7eb; color: #4b5563; }

.kpi-body { flex: 1; min-width: 0; }

.kpi-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .35rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    margin-bottom: .5rem;
}

.kpi-trend {
    font-size: .75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .15rem;
}
.kpi-trend.trend-up { color: #15803d; }
.kpi-trend.trend-down { color: #b91c1c; }

/* ====== CARDS PANELS ====== */
.card-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.panel-subtitle {
    font-size: .78rem;
    color: var(--text-muted);
    margin: .15rem 0 0;
}

.panel-body { padding: 1.5rem; }

/* ====== ALERTS ====== */
.alert-list { padding: .5rem 0; max-height: 380px; overflow-y: auto; }

.alert-item {
    display: flex;
    gap: .75rem;
    padding: .85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: var(--bg); }

.alert-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}

.alert-icon.tone-danger  { background: #fee2e2; color: #b91c1c; }
.alert-icon.tone-warning { background: #fef3c7; color: #b45309; }
.alert-icon.tone-success { background: #dcfce7; color: #15803d; }
.alert-icon.tone-info    { background: #dbeafe; color: #1e40af; }

.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: .85rem; font-weight: 600; margin-bottom: .15rem; }
.alert-text { font-size: .78rem; color: var(--text-muted); margin-bottom: .2rem; }
.alert-time { font-size: .7rem; color: var(--text-muted); }

/* ====== TABLE ====== */
.app-table { font-size: .875rem; }
.app-table thead th {
    background: var(--bg);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    white-space: nowrap;
}

.app-table tbody td {
    padding: .85rem 1.5rem;
    vertical-align: middle;
    border-color: var(--border);
}

.app-table tbody tr:hover { background: var(--bg); }

.matricule {
    background: var(--green-light);
    color: var(--green-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 500;
}

.badge-type {
    background: var(--bg);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 500;
}

/* ====== BOUTONS ====== */
.btn { font-size: .875rem; font-weight: 500; border-radius: 8px; padding: .5rem 1rem; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-success:hover { background: var(--green-dark); border-color: var(--green-dark); }

/* ====== MOBILE ====== */
@media (max-width: 991.98px) {
    .app-content { padding: 1rem; }
    .app-topbar { padding: .65rem 1rem; }
    .app-footer { padding: .5rem 1rem; }
    .dashboard-title { font-size: 1.25rem; }
    .kpi { padding: 1rem; gap: .75rem; }
    .kpi-icon { width: 38px; height: 38px; font-size: 1rem; }
    .kpi-value { font-size: 1.4rem; }
    .panel-header { padding: 1rem 1.15rem; }
    .panel-body { padding: 1.15rem; }
    .alert-item { padding: .75rem 1.15rem; }
    .app-table thead th, .app-table tbody td { padding: .65rem 1rem; }
}

@media (max-width: 575.98px) {
    .form-control, .form-select, .btn { min-height: 42px; font-size: 16px; }
    .dashboard-actions { width: 100%; }
    .dashboard-actions .btn { flex: 1; }
}

/* ===== QUICK ACTIONS (agent dashboard) ===== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

@media (min-width: 768px) {
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
}

.quick-action {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all .15s;
    box-shadow: var(--shadow-sm);
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--green);
    color: var(--text);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.quick-action-icon.tone-primary  { background: #e0f2fe; color: #0369a1; }
.quick-action-icon.tone-info     { background: #dbeafe; color: #1e40af; }
.quick-action-icon.tone-warning  { background: #fef3c7; color: #b45309; }

.quick-action-body { flex: 1; min-width: 0; }
.quick-action-body strong { display: block; font-size: .9rem; line-height: 1.2; }
.quick-action-body span   { font-size: .78rem; color: var(--text-muted); }

.quick-action-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform .15s, color .15s;
    flex-shrink: 0;
}

.quick-action:hover .quick-action-arrow {
    transform: translateX(3px);
    color: var(--green);
}

/* ===== KPI ACTION / PROGRESS ===== */
.kpi-action {
    font-size: .75rem;
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-top: .35rem;
}

.kpi-action:hover { color: var(--green-dark); }

.kpi-progress { margin-top: .35rem; }

.kpi-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: .3rem;
}

.kpi-progress-bar > div {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width .4s ease;
}

/* ===== PANNEAU URGENT ===== */
.panel-urgent { border-color: #fca5a5; }
.panel-urgent .panel-header {
    border-bottom-color: #fee2e2;
    background: #fef2f2;
}

/* ===== ALERTES — actions ===== */
.alert-item .btn {
    flex-shrink: 0;
    align-self: center;
    font-size: .75rem;
    padding: .3rem .65rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    opacity: .35;
    display: block;
    margin-bottom: .5rem;
}

.empty-state p {
    margin: 0;
    font-size: .85rem;
}

/* ===== FILTRES PILL ===== */
.filter-pill {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: .25rem .75rem;
    font-size: .78rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--green);
    color: var(--green);
}

.filter-pill.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* ===== MOBILE ===== */
@media (max-width: 575.98px) {
    .quick-action { padding: .85rem 1rem; gap: .65rem; }
    .quick-action-icon { width: 38px; height: 38px; font-size: 1rem; }
    .quick-action-body strong { font-size: .85rem; }
    .quick-action-body span   { font-size: .72rem; }
    .alert-item .btn { font-size: .72rem; padding: .25rem .55rem; }
}


/* ===== WIZARD ===== */
.wizard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* Header sticky */
.wizard-header {
    position: sticky;
    top: var(--topbar-height, 64px);
    z-index: 90;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.wizard-header-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.wizard-back {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .15s;
}

.wizard-back:hover { background: var(--bg); color: var(--text); }

.wizard-header-center {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.wizard-step-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
}

.wizard-step-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wizard-percent {
    font-size: .8rem;
    font-weight: 600;
    color: var(--green);
    min-width: 40px;
    text-align: right;
}

.wizard-progress {
    height: 3px;
    background: var(--border);
    overflow: hidden;
}

.wizard-progress-bar {
    height: 100%;
    background: var(--green);
    transition: width .3s ease;
}

/* Body */
.wizard-body {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem 6rem;
}

.wizard-step-header { margin-bottom: 1.5rem; }

.wizard-step-h {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 .25rem;
}

.wizard-step-sub {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Footer sticky */
.wizard-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: .75rem 1rem;
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -2px 8px rgba(0,0,0,.04);
}

.wizard-footer-spacer { flex: 1; }

.wizard-footer .btn {
    padding: .6rem 1.1rem;
    font-weight: 500;
    border-radius: 8px;
}

/* Récap */
.recap-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.recap-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}

.recap-item:last-child { border-bottom: 0; }

.recap-label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.recap-value {
    font-weight: 600;
    text-align: right;
    color: var(--text);
    word-break: break-word;
}

/* Mobile */
@media (max-width: 575.98px) {
    .wizard-body { padding: 1rem .85rem 5.5rem; }
    .wizard-step-h { font-size: 1rem; }
    .wizard-footer .btn { padding: .55rem .9rem; font-size: .875rem; }
}

/* ===== Choice cards (radios/checkboxes ergonomiques) ===== */
.choice-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .choice-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .choice-grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

.choice-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}

.choice-card:hover {
    border-color: #a3c9b1;
    background: #f9fdfb;
}

.choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-content {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 1;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
}

.choice-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color .15s;
}

.choice-check {
    color: transparent;
    font-size: 1.1rem;
    transition: color .15s;
}

.choice-input:checked ~ .choice-content .choice-icon { color: var(--green); }
.choice-input:checked ~ .choice-check { color: var(--green); }

.choice-card:has(.choice-input:checked) {
    border-color: var(--green);
    background: var(--green-light);
    box-shadow: 0 0 0 3px rgba(31,111,63,.1);
}

/* ===== Cascade location ===== */
.input-with-add {
    display: flex;
    gap: .4rem;
    align-items: stretch;
}

.input-with-add .form-select { flex: 1; }

.btn-add-inline {
    width: 44px;
    min-width: 44px;
    background: var(--green-light);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--green);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-add-inline:hover {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

/* ===== Conditional blocks ===== */
.conditional-block {
    background: #f9fdfb;
    border-left: 3px solid var(--green);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    margin-top: .5rem;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Divider label ===== */
.divider-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.5rem 0 1rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
}

.divider-label::before,
.divider-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== Step header with icon ===== */
.wizard-step-header {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.step-icon {
    font-size: 1.5rem;
    color: var(--green);
    background: var(--green-light);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== Consent block ===== */
.consent-block {
    background: #f9fdfb;
    border: 1px solid #d6e8dc;
    border-radius: 8px;
    padding: .85rem 1rem;
}

.consent-block .form-check { margin: 0; }
.consent-block .form-check-label { font-size: .85rem; line-height: 1.5; }

/* ===== Inputs plus généreux (non-informaticien) ===== */
.wizard-body .form-label {
    font-weight: 500;
    font-size: .85rem;
    color: var(--text);
    margin-bottom: .4rem;
}

.wizard-body .form-control,
.wizard-body .form-select {
    padding: .65rem .85rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: .925rem;
    transition: all .15s;
}

.wizard-body .form-control:focus,
.wizard-body .form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31,111,63,.1);
}

.wizard-body .form-check-input:checked {
    background-color: var(--green);
    border-color: var(--green);
}

@media (max-width: 575.98px) {
    .wizard-body .form-control,
    .wizard-body .form-select {
        font-size: 16px;
        min-height: 46px;
    }
    .choice-card { padding: .75rem .85rem; }
    .step-icon { width: 42px; height: 42px; font-size: 1.25rem; }
}


/* ===== GPS status ===== */
.gps-status {
    margin-top: .4rem;
    font-size: .8rem;
}

[data-gps-block] .btn[data-gps-locate] {
    font-size: .78rem;
    padding: .3rem .7rem;
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

[data-gps-block] .btn[data-gps-locate]:disabled {
    opacity: .7;
}

/* ===== Activité principale ===== */
[data-activite-principale-section] {
    animation: slideDown .2s ease;
}

[data-activite-principale-section][hidden] {
    display: none !important;
}


/* ===== NIN input ===== */
.text-uppercase {
    text-transform: uppercase;
}

input[name="numeroPiece"] {
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: .05em;
    font-weight: 500;
}

input[name="numeroPiece"]::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
    font-weight: 400;
}

/* ===== NIN ===== */
.text-uppercase { text-transform: uppercase; }

input[name="numeroPiece"] {
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: .05em;
    font-weight: 500;
}

input[name="numeroPiece"]::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
    font-weight: 400;
}

/* ===== Photo capture ===== */
.photo-capture { position: relative; }

.photo-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 240px;
    background: #f9fafb;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all .15s;
}

.photo-preview:hover { border-color: var(--green); background: #f9fdfb; }

.photo-capture.has-photo .photo-preview {
    border-style: solid;
    border-color: var(--green);
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    color: var(--text-muted);
    font-size: .85rem;
}

.photo-placeholder i { font-size: 2rem; opacity: .4; }

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background .15s;
}

.photo-remove:hover { background: #dc2626; }

.photo-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-top: .65rem;
}

.btn-photo-camera,
.btn-photo-choose {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
}

.btn-photo-camera {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.btn-photo-camera:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-photo-choose:hover { border-color: var(--green); color: var(--green); }

.btn-photo-camera i,
.btn-photo-choose i { font-size: 1rem; }

.photo-capture.is-invalid .photo-preview {
    border-color: #dc2626;
    background: #fef2f2;
}

.photo-capture .invalid-feedback { display: none; }
.photo-capture.is-invalid .invalid-feedback { display: block; }

@media (max-width: 575.98px) {
    .photo-actions { grid-template-columns: 1fr; }
}

/* ===== Aperçu nom complet ===== */
.nom-complet-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, #f9fdfb, #e8f3ec);
    border: 1.5px dashed #a3c9b1;
    border-radius: 10px;
    font-size: .9rem;
}

.nom-complet-label {
    color: var(--text-muted);
    font-size: .82rem;
}

.nom-complet-value {
    color: var(--green-dark);
    font-size: 1rem;
    letter-spacing: .02em;
    transition: all .2s;
}

.nom-complet-value.is-complete {
    color: var(--green);
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .nom-complet-preview {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }
}

/* ===== Tableau langues ===== */
.langues-table {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.langues-header,
.langues-row {
    display: grid;
    grid-template-columns: 1fr 70px 70px;
    align-items: center;
    padding: .65rem 1rem;
}

.langues-header {
    background: #f9fafb;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.langues-header span:not(:first-child),
.langues-row .langue-check {
    text-align: center;
}

.langues-row {
    border-top: 1px solid var(--border);
}

.langues-row:first-of-type {
    border-top: 0;
}

.langues-name {
    font-weight: 500;
    font-size: .9rem;
    color: var(--text);
}

.langue-check {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: .25rem;
}

.langue-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.langue-box {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    background: #fff;
}

.langue-check:hover .langue-box {
    border-color: var(--green);
    background: #f9fdfb;
}

.langue-check input:checked + .langue-box {
    background: var(--green);
    border-color: var(--green);
}

.langue-check input:checked + .langue-box::after {
    content: '✓';
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .langues-header,
    .langues-row {
        grid-template-columns: 1fr 60px 60px;
        padding: .55rem .75rem;
    }
    .langues-name { font-size: .85rem; }
    .langue-box { width: 22px; height: 22px; }
}

/* ===== Téléphone comorien ===== */
.phone-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}

.phone-input:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31,111,63,.1);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 .85rem;
    background: #f3f6f4;
    color: var(--green-dark);
    font-weight: 600;
    font-size: .925rem;
    border-right: 1.5px solid var(--border);
    letter-spacing: .02em;
    flex-shrink: 0;
}

.phone-number {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: .1em;
    font-size: .95rem;
    padding: .65rem .85rem;
}

.phone-number:focus {
    box-shadow: none !important;
}

.phone-number::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
    color: #c0c4c8;
}

.phone-input:has(.phone-number.is-invalid) {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.phone-input:has(.phone-number.is-invalid) .phone-prefix {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 575.98px) {
    .phone-prefix {
        padding: 0 .65rem;
        font-size: .85rem;
    }
    .phone-number {
        font-size: 16px;
        min-height: 44px;
    }
}

/* ===== Organes dirigeants (tableau) ===== */
.organes-table {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-top: 1rem;
}

.organes-header,
.organes-row {
    display: grid;
    grid-template-columns: 180px 1fr 140px 140px;
    gap: .5rem;
    align-items: center;
    padding: .5rem .75rem;
}

.organes-header {
    background: #f9fafb;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.organes-row {
    border-top: 1px solid var(--border);
}

.organes-row:first-of-type { border-top: 0; }

.organes-fonction {
    font-weight: 500;
    font-size: .85rem;
    color: var(--text);
}

/* ===== Membres liste nominative ===== */
.membres-table-wrapper {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.membres-header,
.membres-row {
    display: grid;
    grid-template-columns: 40px 1.5fr 60px 130px 130px 90px 110px 40px;
    gap: .4rem;
    align-items: center;
    padding: .5rem .75rem;
}

.membres-header {
    background: #f9fafb;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.membres-row {
    border-top: 1px solid var(--border);
}

.membres-row:first-child { border-top: 0; }

.membres-num {
    font-size: .8rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

.membres-remove {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}

.membres-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

.btn-add-membre {
    width: 100%;
    padding: .65rem;
    background: #f9fafb;
    border: 0;
    border-top: 1.5px dashed var(--border);
    color: var(--green);
    font-weight: 500;
    font-size: .85rem;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.btn-add-membre:hover {
    background: var(--green-light);
}

/* ===== Mobile : organes et membres empilés ===== */
@media (max-width: 767.98px) {
    .organes-header { display: none; }
    .organes-row {
        grid-template-columns: 1fr;
        gap: .35rem;
        padding: .75rem;
    }
    .organes-fonction {
        font-weight: 600;
        color: var(--text);
        font-size: .8rem;
        margin-bottom: .2rem;
    }

    .membres-header { display: none; }
    .membres-row {
        grid-template-columns: 1fr 1fr;
        gap: .35rem;
        padding: .75rem;
    }
    .membres-num {
        grid-column: 1 / -1;
        text-align: left;
        padding: .2rem 0;
        font-size: .75rem;
    }
    .membres-remove {
        grid-column: 1 / -1;
        justify-self: flex-end;
        background: #fef2f2;
        color: #dc2626;
    }
}





/* ===== Sidebar repliable ===== */
:root {
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 72px;
}

.app-sidebar {
    width: var(--sidebar-width);
    transition: width .2s ease;
    overflow-x: hidden;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed);
}

/* Cache les textes quand replié */
.app-shell.sidebar-collapsed .sidebar-brand .brand-text,
.app-shell.sidebar-collapsed .sidebar-section-label,
.app-shell.sidebar-collapsed .sidebar-link span:not(.sidebar-badge),
.app-shell.sidebar-collapsed .sidebar-badge,
.app-shell.sidebar-collapsed .user-info,
.app-shell.sidebar-collapsed .user-logout {
    display: none;
}

/* Centre les icônes */
.app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.25rem .5rem;
}

.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: .65rem;
}

.app-shell.sidebar-collapsed .sidebar-section-label {
    padding: 0;
    height: 0;
    overflow: hidden;
}

.app-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: .5rem;
}

.app-shell.sidebar-collapsed .sidebar-section {
    margin-bottom: .75rem;
}

/* Bouton toggle dans la topbar */
.sidebar-toggle-btn {
    color: var(--text-muted);
    transition: color .15s;
}

.sidebar-toggle-btn:hover {
    color: var(--text);
    background: var(--bg);
}

/* Tooltips pour les liens quand replié */
.app-shell.sidebar-collapsed .sidebar-link {
    position: relative;
}

.app-shell.sidebar-collapsed .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: #fff;
    padding: .35rem .65rem;
    border-radius: 6px;
    font-size: .78rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.app-shell.sidebar-collapsed .sidebar-link:hover::after {
    opacity: 1;
}

/* Transition douce du contenu quand sidebar repliée */
.app-main {
    transition: flex-basis .2s ease;
}

/* ===== Page Mes fiches — filtres ===== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-search {
    flex: 1 1 260px;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: .45rem .75rem;
    transition: all .15s;
}

.filter-search:focus-within {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31,111,63,.1);
}

.filter-search i {
    color: var(--text-muted);
    font-size: .9rem;
}

.filter-search input {
    border: 0;
    background: transparent;
    outline: 0;
    width: 100%;
    font-size: .875rem;
    color: var(--text);
}

.filters-bar .form-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 160px;
}

/* ===== Onglets filtres ===== */
.filters-tabs {
    display: flex;
    gap: .25rem;
    padding: .5rem 1.25rem 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all .15s;
}

.filter-tab:hover {
    color: var(--text);
}

.filter-tab.active {
    color: var(--green);
    border-bottom-color: var(--green);
}

.filter-tab-count {
    background: var(--bg);
    color: var(--text-muted);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 600;
}

.filter-tab.active .filter-tab-count {
    background: var(--green-light);
    color: var(--green-dark);
}

/* ===== Actions de ligne ===== */
.row-actions {
    display: inline-flex;
    gap: .25rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .15s;
    font-size: .9rem;
}

.btn-action:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

.btn-action-warning:hover {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

@media (max-width: 575.98px) {
    .filters-bar {
        padding: .75rem 1rem;
    }
    .filters-bar .form-select {
        min-width: 0;
        flex: 1 1 100%;
    }
    .filters-bar .btn {
        flex: 1;
    }
    .filters-tabs {
        padding: .5rem .75rem 0;
    }
    .filter-tab {
        padding: .5rem .75rem;
        font-size: .8rem;
    }
    .btn-action {
        width: 36px;
        height: 36px;
    }
}




/* ===== Fiche show — header ===== */
.fiche-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.fiche-header-main {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
}

.fiche-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #2a8f55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.fiche-avatar-org {
    border-radius: 12px;
    font-size: 1.35rem;
}

.fiche-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--text);
}

.fiche-subtitle {
    font-size: .85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}

.fiche-subtitle .dot {
    opacity: .4;
}

.fiche-header-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Sections ===== */
.fiche-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.show-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.show-section-admin {
    border-color: #c7d2fe;
    background: #f8faff;
}

.show-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.show-section-title i {
    color: var(--green);
    font-size: 1.1rem;
}

.show-subsection-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 1.25rem 0 .75rem;
}

/* ===== DL ===== */
.show-dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem .75rem;
    margin: 0;
}

.show-dl dt {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.show-dl dd {
    font-size: .9rem;
    color: var(--text);
    margin: 0 0 .5rem;
    word-break: break-word;
}

@media (min-width: 768px) {
    .show-dl {
        grid-template-columns: 220px 1fr;
    }
    .show-dl dt {
        padding-top: .1rem;
    }
}

/* ===== Pièces jointes ===== */
.pieces-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}

@media (min-width: 576px) {
    .pieces-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.piece-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
}

.piece-ok {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.piece-missing {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ===== Stat grid (membres) ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

@media (min-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: .75rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .25rem;
}

.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

/* ===== Timeline ===== */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 36px;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--green-light);
}

.timeline-content {
    background: #f9fafb;
    border-radius: 8px;
    padding: .75rem 1rem;
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .35rem;
}

.timeline-date {
    font-size: .75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.timeline-note {
    font-size: .85rem;
    color: var(--text);
}

.timeline-author {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* ===== Mobile ===== */
@media (max-width: 575.98px) {
    .fiche-header {
        padding: 1rem;
    }
    .fiche-title {
        font-size: 1.1rem;
    }
    .fiche-avatar {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    .show-section {
        padding: 1rem;
    }
    .timeline-marker {
        left: 2px;
        width: 14px;
        height: 14px;
    }
    .timeline::before {
        left: 9px;
    }
    .timeline-item {
        padding-left: 30px;
    }
}

/* =========================================================
   AUTH — login, 2FA, mot de passe oublié / réinitialisation
   ========================================================= */
.auth-body { background: var(--bg); min-height: 100vh; }

.auth-page {
    display: flex;
    min-height: 100vh;
}

/* ---------- Panneau latéral ---------- */
.auth-aside {
    flex: 0 0 42%;
    max-width: 560px;
    background:
        radial-gradient(circle at 15% 85%, rgba(42,143,85,.35), transparent 55%),
        var(--sidebar-bg);
    color: #fff;
    display: flex;
}

.auth-aside-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem 3rem;
    width: 100%;
}

.auth-aside-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.auth-aside-content p { color: rgba(255,255,255,.7); margin-bottom: 1.75rem; }

.auth-aside-list { list-style: none; padding: 0; margin: 0; }
.auth-aside-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    color: rgba(255,255,255,.85);
}
.auth-aside-list i {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #8fd3a8;
}

.auth-aside-footer { color: rgba(255,255,255,.45); font-size: .75rem; }

/* ---------- Marque ---------- */
.auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
}
.auth-brand-light { color: #fff; }
.auth-brand-mobile { display: none; color: var(--text); margin-bottom: 1.75rem; }
.auth-brand-mobile .brand-text small { color: var(--text-muted); }

/* ---------- Zone formulaire ---------- */
.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.25rem 2rem;
}

.auth-header { margin-bottom: 1.5rem; }

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--green-light);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.auth-icon.tone-success { background: #dcfce7; color: #15803d; }

.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: .35rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 0; }

.auth-form .form-label { font-weight: 500; font-size: .875rem; }

.auth-input { position: relative; }
.auth-input > i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.auth-input .form-control {
    padding: .65rem .85rem .65rem 2.4rem;
    border-radius: 10px;
    border-color: var(--border);
}
.auth-input .form-control:focus,
.otp-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31,111,63,.12);
}
.auth-input:has(.auth-toggle-pwd) .form-control { padding-right: 2.6rem; }
.auth-input .form-control.is-invalid,
.auth-input .form-control.is-valid { background-image: none; }
.auth-input:has(.is-invalid) + .invalid-feedback { display: block; }

.auth-toggle-pwd {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: .35rem .5rem;
    border-radius: 6px;
    line-height: 1;
}
.auth-toggle-pwd:hover { color: var(--text); background: var(--bg); }

.auth-form .form-check-input:checked { background-color: var(--green); border-color: var(--green); }

.auth-submit { padding: .7rem 1rem; border-radius: 10px; font-weight: 600; }

.auth-link { color: var(--green); text-decoration: none; font-weight: 500; }
.auth-link:hover { color: var(--green-dark); text-decoration: underline; }

.auth-alert {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    border-radius: 10px;
    font-size: .875rem;
    padding: .75rem 1rem;
}

.auth-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    text-align: center;
}
.auth-footer:empty { display: none; }

.auth-copyright { color: var(--text-muted); font-size: .75rem; margin: 1.5rem 0 0; text-align: center; }

/* ---------- Code 2FA ---------- */
.otp-group {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 1rem;
    border: 0;
    padding: 0;
}
.otp-input {
    width: 100%;
    max-width: 52px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Consolas', monospace;
    border-radius: 10px;
    border-color: var(--border);
    padding: 0;
}
.otp-input.is-filled { border-color: var(--green); background: var(--green-light); }

/* ---------- Force du mot de passe ---------- */
.pwd-meter {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .6rem;
}
.pwd-meter-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.pwd-meter-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--text-muted);
    transition: width .2s ease, background-color .2s ease;
}
.pwd-meter-label { font-size: .75rem; color: var(--text-muted); min-width: 70px; text-align: right; }
.pwd-meter.is-weak .pwd-meter-bar span { background: #dc2626; }
.pwd-meter.is-weak .pwd-meter-label { color: #dc2626; }
.pwd-meter.is-medium .pwd-meter-bar span { background: #d97706; }
.pwd-meter.is-medium .pwd-meter-label { color: #d97706; }
.pwd-meter.is-strong .pwd-meter-bar span { background: var(--green); }
.pwd-meter.is-strong .pwd-meter-label { color: var(--green); }

.pwd-rules {
    list-style: none;
    padding: 0;
    margin: .6rem 0 0;
    font-size: .78rem;
    color: var(--text-muted);
}
.pwd-rules li { display: flex; align-items: center; gap: .4rem; padding: .1rem 0; }
.pwd-rules li.is-ok { color: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .auth-aside { display: none; }
    .auth-brand-mobile { display: flex; }
}

@media (max-width: 575.98px) {
    .auth-main { justify-content: flex-start; padding: 1.5rem 1rem; }
    .auth-card { padding: 1.5rem 1.25rem; box-shadow: var(--shadow-sm); }
    .otp-group { gap: .35rem; }
    .otp-input { height: 52px; font-size: 1.3rem; }
}

/* =========================================================
   COMPLÉMENTS — dashboards, validation, cartes, admin,
   observatoire, public, erreurs
   ========================================================= */

/* ---------- Utilitaires ---------- */
.tabular { font-variant-numeric: tabular-nums; }
.big-number { font-size: 2.25rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.kpi-icon.tone-info { background: #dbeafe; color: #1e40af; }
.alert-icon.tone-secondary { background: #e5e7eb; color: #4b5563; }
.panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}
.form-section-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin: 0 0 .85rem;
}
.empty-state-compact { padding: 1.5rem 1rem; }
.row-inactive td { opacity: .55; }
.user-avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }

/* ---------- Flash ---------- */
.app-flash {
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.app-flash > i { font-size: 1.1rem; }

/* ---------- Listes cliquables (dashboards) ---------- */
.alert-item-link { color: inherit; text-decoration: none; transition: background .15s; }
.alert-item-link:hover { background: #f9fafb; color: inherit; }

/* ---------- Jauge horizontale ---------- */
.meter { display: flex; align-items: center; gap: .6rem; }
.meter-bar { flex: 1; height: 8px; background: #eef0f2; border-radius: 4px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.meter-value { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 2.75rem; text-align: right; }

/* ---------- Graphiques ---------- */
.chart-box { position: relative; width: 100%; }
.chart-table { margin-top: .75rem; }
.chart-table summary {
    cursor: pointer;
    font-size: .8rem;
    color: var(--text-muted);
    list-style: none;
    display: inline-flex;
    gap: .35rem;
    align-items: center;
}
.chart-table summary::-webkit-details-marker { display: none; }
.chart-table summary:hover { color: var(--green); }
.chart-table table { margin-top: .5rem; font-size: .82rem; }
.chart-table td, .chart-table th { padding: .3rem .5rem; }

/* ---------- Dashboard admin ---------- */
.role-summary { list-style: none; margin: 0; padding: .5rem 0; }
.role-summary a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.5rem;
    color: inherit;
    text-decoration: none;
}
.role-summary a:hover { background: #f9fafb; }
.role-summary i { color: var(--green); font-size: 1.1rem; }
.role-summary span { flex: 1; }

.activity-feed { list-style: none; margin: 0; padding: .5rem 0; }
.activity-feed li {
    display: flex;
    gap: 1rem;
    padding: .55rem 1.5rem;
    font-size: .85rem;
    border-bottom: 1px solid #f3f4f6;
}
.activity-feed li:last-child { border-bottom: 0; }
.activity-time { color: var(--text-muted); white-space: nowrap; font-size: .78rem; padding-top: .1rem; min-width: 70px; }
.activity-feed-compact { padding: 0 0 .5rem; }
.activity-feed-compact li { padding: .45rem 0; }

/* ---------- Édition fiche ---------- */
.edit-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    background: var(--green-light);
    border: 1px solid #cfe5d7;
    border-radius: var(--radius);
}
.edit-banner-main { display: flex; gap: .85rem; align-items: center; }
.edit-banner-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #fff;
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.edit-banner-title { font-weight: 600; }
.edit-banner-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.photo-capture.has-existing .photo-placeholder { color: var(--green); background: var(--green-light); }
.photo-capture.has-existing .photo-placeholder span { text-align: center; padding: 0 .5rem; }

/* ---------- File de validation ---------- */
.queue-summary { display: flex; flex-wrap: wrap; gap: .5rem; }
.queue-summary-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .85rem;
}
.wait-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 6px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: .8rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wait-chip.is-warn { background: #fef3c7; color: #92400e; }
.wait-chip.is-late { background: #fee2e2; color: #991b1b; }

/* ---------- Revue d'une fiche ---------- */
.review-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}
@media (min-width: 992px) {
    .review-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .review-sticky { position: sticky; top: calc(var(--topbar-height) + 1rem); }
}
.review-main .show-section:first-child { margin-top: 0; }
.review-duplicate { border-radius: var(--radius); }
.duplicate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .6rem .75rem;
    margin-top: .5rem;
    background: rgba(255,255,255,.6);
    border-radius: 8px;
}
.duplicate-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: .2rem .5rem;
    border-radius: 6px;
    background: #fff;
    color: #991b1b;
}
.review-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.review-doc { margin: 0; }
.review-doc-frame {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    color: var(--text-muted);
    font-size: .78rem;
}
.review-doc-frame i { font-size: 2rem; color: var(--green); }
.review-doc.is-missing .review-doc-frame { background: #fef2f2; border: 1px dashed #fca5a5; color: #b91c1c; }
.review-doc.is-missing .review-doc-frame i { color: #dc2626; }
.review-doc figcaption { font-size: .82rem; font-weight: 500; margin-top: .4rem; }

.check-list { list-style: none; margin: 0; padding: .5rem 0; }
.check-item {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .55rem 1.25rem;
}
.check-item > i { font-size: 1.05rem; margin-top: .05rem; }
.check-item.is-ok > i { color: #15803d; }
.check-item.is-ko > i { color: #dc2626; }
.check-item.is-na > i { color: #9ca3af; }
.check-item.is-ko .check-label { color: #991b1b; }
.check-label { font-size: .85rem; font-weight: 500; }
.check-detail { font-size: .78rem; color: var(--text-muted); }
.manual-check {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    padding: .55rem .7rem;
    margin: 0 0 .4rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
}
.manual-check .form-check-input { margin: .15rem 0 0; flex-shrink: 0; }
.manual-check:has(input:checked) { border-color: #86efac; background: #f0fdf4; }
.manual-check .form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.next-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
}
.next-link:hover .fw-semibold { color: var(--green); }

.timeline-item.is-current .timeline-marker { box-shadow: 0 0 0 4px rgba(31,111,63,.18); }

/* ---------- Modal de rejet ---------- */
.reject-reasons { display: grid; gap: .4rem; }
.reject-reason {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
}
.reject-reason .form-check-input { margin: 0; flex-shrink: 0; }
.reject-reason:has(input:checked) { border-color: #fca5a5; background: #fef2f2; }
.reject-reason .form-check-input:checked { background-color: #dc2626; border-color: #dc2626; }
[data-comment-block] .required-mark { display: none; }
[data-comment-block].is-required .required-mark { display: inline; }

/* ---------- Modal de confirmation ---------- */
.confirm-modal-icon {
    width: 56px; height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.confirm-modal-icon.tone-success { background: #dcfce7; color: #15803d; }
.confirm-modal-icon.tone-danger  { background: #fee2e2; color: #b91c1c; }
.confirm-modal-icon.tone-warning { background: #fef3c7; color: #b45309; }
.confirm-modal-icon.tone-primary { background: #dbeafe; color: #1e40af; }

/* ---------- QR ---------- */
.qr-display { margin: 0; display: inline-flex; flex-direction: column; align-items: center; gap: .35rem; }
.qr-display svg, .qr-display img { display: block; width: var(--qr-size); height: var(--qr-size); background: #fff; }
.qr-caption { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .7rem; color: var(--text-muted); max-width: 220px; text-align: center; word-break: break-all; }
.qr-demo-tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; background: #fef3c7; color: #92400e; padding: .05rem .4rem; border-radius: 4px; }

/* ---------- Carte professionnelle (format ID-1 85,6 × 54 mm) ----------
   Unités en cqw (1 cqw = 1 % de la largeur de la carte) : la carte garde ses proportions à toutes les tailles.
   Couches : guilloché + filigrane du ministère (fond) → bandeau, contenu, pied (au-dessus). */
.pro-card {
    --carte: var(--sidebar-bg);
    --carte-2: #2f8a52;
    --carte-soft: #eef7f1;
    --carte-ink: var(--green-dark);
    --carte-texte: #fff;
    container-type: inline-size;
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 428px;
    aspect-ratio: 85.6 / 54;
    border-radius: 3.6cqw;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d7dde3;
    box-shadow: 0 10px 28px -8px rgba(16, 40, 28, .28), 0 2px 6px rgba(16, 40, 28, .08);
    color: #10231a;
    font-size: 3cqw;
    display: flex;
    flex-direction: column;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.pro-card > * { position: relative; z-index: 1; }
.pro-card-recto { background: linear-gradient(160deg, #ffffff 52%, var(--carte-soft) 100%); }
.pro-card-verso { background: linear-gradient(200deg, #ffffff 50%, var(--carte-soft) 100%); }

/* Fond : guilloché et filigrane (logo du ministère), discrets */
.pro-card > .pro-card-guilloche {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.pro-card > .pro-card-filigrane {
    position: absolute; z-index: 0;
    width: 40cqw; height: 40cqw;
    right: 2cqw; top: 19cqw;
    object-fit: contain;
    opacity: .085;
    filter: saturate(.6);
    pointer-events: none;
}
.pro-card-verso > .pro-card-filigrane { width: 46cqw; height: 46cqw; right: auto; left: 50%; top: 8cqw; transform: translateX(-50%); opacity: .07; }

/* Bandeau : emblème national, titre, logos UCAEP et C.I.A.E.P */
.pro-card-band {
    display: flex;
    align-items: center;
    gap: 2.2cqw;
    padding: 2.2cqw 3cqw;
    background: linear-gradient(120deg, var(--carte) 0%, var(--carte-2) 100%);
    color: var(--carte-texte);
}
.pro-card-seal {
    width: 13cqw; height: 13cqw;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    padding: .5cqw;
    box-shadow: 0 0 0 .35cqw rgba(255, 255, 255, .35), 0 1cqw 2cqw -1cqw rgba(0, 0, 0, .45);
}
.pro-card-seal img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pro-card-issuer { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1; }
.pro-card-issuer strong { font-size: 2.9cqw; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .92; }
/* « Ministère de l'Agriculture » : juste sous le logo du gouvernement, c'est la ligne dominante */
.pro-card-issuer b { font-size: 3.9cqw; font-weight: 800; letter-spacing: .01em; margin-top: .35cqw; }
.pro-card-issuer span { font-size: 2.35cqw; font-weight: 500; opacity: .9; margin-top: .45cqw; }
.pro-card-logos { display: flex; gap: 1.2cqw; flex-shrink: 0; }
.pro-card-logo {
    height: 11.5cqw; width: 10cqw;
    border-radius: 1.6cqw;
    background: #fff;
    padding: .6cqw;
    display: grid; place-items: center;
    box-shadow: 0 1cqw 2cqw -1cqw rgba(0, 0, 0, .45);
}
.pro-card-logo.is-wide { width: 14cqw; padding: .9cqw; }
.pro-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Liseré aux couleurs du drapeau comorien */
.pro-card-flagline { display: flex; height: .95cqw; flex-shrink: 0; }
.pro-card-flagline i { flex: 1; }
.pro-card-flagline i:nth-child(1) { background: #3d8e33; flex: 1.3; }
.pro-card-flagline i:nth-child(2) { background: #ffd100; }
.pro-card-flagline i:nth-child(3) { background: #f4f4f4; }
.pro-card-flagline i:nth-child(4) { background: #ce1126; }
.pro-card-flagline i:nth-child(5) { background: #3a75c4; }

/* Corps : photo + identité */
.pro-card-body { flex: 1; display: flex; gap: 3.5cqw; padding: 2.8cqw 3.5cqw 1.2cqw; min-height: 0; }
.pro-card-photo {
    width: 21cqw;
    aspect-ratio: 3 / 4;
    align-self: flex-start;
    border-radius: 1.6cqw;
    background: #e5ece8;
    border: .5cqw solid #fff;
    box-shadow: 0 0 0 .3cqw color-mix(in srgb, var(--carte) 45%, #cfdcd4), 0 1.2cqw 2.4cqw -1.2cqw rgba(0, 0, 0, .35);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #9fb3a8;
    font-size: 11cqw;
}
.pro-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.pro-card-fields { min-width: 0; flex: 1; padding-top: .3cqw; }
.pro-card-name { font-size: 5cqw; font-weight: 800; text-transform: uppercase; line-height: 1.05; letter-spacing: .02em; overflow-wrap: anywhere; color: #0d1f16; }
.pro-card-firstname { font-size: 3.7cqw; font-weight: 600; margin-bottom: 1.6cqw; color: #24382d; }
.pro-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55cqw 2.2cqw; }
.pro-card dt { font-size: 2.15cqw; text-transform: uppercase; letter-spacing: .06em; color: var(--carte-ink); opacity: .8; font-weight: 700; padding-top: .35cqw; }
.pro-card dd { margin: 0; font-size: 2.9cqw; font-weight: 600; color: #15281e; }

/* Pied : matricule + validité */
.pro-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1.4cqw 3.5cqw 1.8cqw;
    background: rgba(255, 255, 255, .78);
    border-top: .3cqw solid color-mix(in srgb, var(--carte) 30%, #ffffff);
}
.pro-card-matricule-block { display: flex; flex-direction: column; line-height: 1.1; }
.pro-card-matricule-block small { font-size: 1.9cqw; text-transform: uppercase; letter-spacing: .12em; color: #5c7366; font-weight: 700; }
.pro-card-matricule { font-family: 'SF Mono', Consolas, monospace; font-size: 4.4cqw; font-weight: 700; color: var(--carte-ink); letter-spacing: .05em; }
/* Date d'expiration, en pendant du matricule */
.pro-card-expiry-block { display: flex; flex-direction: column; line-height: 1.1; text-align: right; }
.pro-card-expiry-block small { font-size: 1.9cqw; text-transform: uppercase; letter-spacing: .12em; color: #5c7366; font-weight: 700; }
.pro-card-expiry { font-size: 3.5cqw; font-weight: 700; color: #15281e; }
.pro-card-validity { font-size: 2.35cqw; color: #5c7366; text-align: right; }
.pro-card-validity strong { color: #15281e; font-weight: 700; }
.pro-card > .pro-card-watermark {
    position: absolute;
    z-index: 2;
    top: 55%; left: 50%;
    transform: translate(-50%, -50%) rotate(-18deg);
    font-size: 13cqw;
    font-weight: 800;
    color: rgba(206, 17, 38, .13);
    letter-spacing: .1em;
    pointer-events: none;
}

/* Verso */
.pro-card-verso > .pro-card-flagline { border-top: 1.4cqw solid var(--carte); height: 2.35cqw; }
.pro-card-verso-body { flex: 1; display: flex; gap: 4cqw; padding: 3cqw 4cqw 1cqw; min-height: 0; }
/* Le verso porte jusqu'à sept lignes (ville/région, statut, institution, groupe sanguin) : plus serré */
.pro-card-verso dl { gap: .35cqw 2cqw; }
.pro-card-verso dt { font-size: 2cqw; }
.pro-card-verso dd { font-size: 2.6cqw; }
.pro-card-qr {
    flex-shrink: 0;
    width: 28cqw; height: 28cqw;
    padding: 1cqw;
    background: #fff;
    border-radius: 1.6cqw;
    box-shadow: 0 0 0 .3cqw color-mix(in srgb, var(--carte) 30%, #dfe7e2);
}
.pro-card-qr .qr-display, .pro-card-qr svg, .pro-card-qr img { width: 26cqw !important; height: 26cqw !important; }
.pro-card-qr-empty {
    width: 26cqw; height: 26cqw;
    border: .4cqw dashed #b9c6bf;
    border-radius: 1.2cqw;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: 2.4cqw;
    color: #7b8f84;
    padding: 2cqw;
}
.pro-card-verso-text { min-width: 0; flex: 1; }
.pro-card-notice { margin: 1.6cqw 0 0; font-size: 2.1cqw; color: #4f6459; line-height: 1.3; }
/* Mention légale : propriété de l'État, carte non cessible */
.pro-card-notice-property { font-weight: 700; color: #2f4a3a; }
.pro-card-verso-foot { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 4cqw 3cqw; }
.pro-card-minilogos { display: flex; align-items: center; gap: 1.6cqw; }
.pro-card-minilogos img { height: 6.5cqw; width: auto; display: block; }
.pro-card-minilogos img.is-wide { height: 4.4cqw; }
.pro-card-signature { display: flex; flex-direction: column; align-items: center; gap: .6cqw; font-size: 2.2cqw; color: #5c7366; }
.pro-card-sign-line { width: 24cqw; border-bottom: .3cqw solid #9fb3a8; height: 4.5cqw; }

/* Aperçu carte */
.card-preview-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 1.5rem 0 2rem; }
@media (min-width: 992px) { .card-preview-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.card-preview-stage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: repeating-linear-gradient(45deg, #f3f5f7 0 12px, #eef1f4 12px 24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-content: start;
}
.card-preview-side { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.card-preview-side .pro-card { max-width: 400px; }
.card-preview-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); align-self: flex-start; }
.verify-link { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; word-break: break-all; }
.show-dl-compact { grid-template-columns: auto 1fr !important; gap: .35rem 1rem; }
.show-dl-compact dt { padding-top: .1rem; }
.card-thumb { max-width: 340px; margin: 0 auto; }
.card-thumb.is-void { position: relative; }
.card-thumb.is-void::after {
    content: "À INVALIDER";
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.55);
    color: #b91c1c;
    font-weight: 800;
    letter-spacing: .15em;
    border-radius: 12px;
}

/* ---------- Impression carte ---------- */
.print-body { background: #e9edf0; margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.print-toolbar {
    position: sticky; top: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    padding: .75rem 1.25rem;
    background: var(--sidebar-bg);
    color: #fff;
    font-size: .85rem;
    z-index: 10;
}
.print-back { color: #fff; text-decoration: none; }
.print-hint { flex: 1; opacity: .8; min-width: 220px; }
.print-btn {
    border: 0; border-radius: 8px;
    background: var(--green); color: #fff;
    padding: .55rem 1rem; font-weight: 600; cursor: pointer;
}
.print-btn:hover { background: #2a8f55; }
.print-sheet {
    width: 210mm;
    max-width: calc(100% - 2rem);
    min-height: 120mm;
    margin: 1.5rem auto;
    padding: 15mm;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.print-pair { display: flex; flex-wrap: wrap; gap: 10mm; justify-content: center; }
.print-slot { display: flex; flex-direction: column; align-items: center; gap: 2mm; }
.print-slot .pro-card {
    width: 85.6mm;
    max-width: none;
    height: 54mm;
    border-radius: 3mm;
    box-shadow: none;
    outline: 1px dashed #9ca3af;
    outline-offset: 2mm;
}
.print-caption { font-size: 8pt; color: #6b7280; margin-top: 2mm; }
.print-meta { text-align: center; font-size: 8pt; color: #6b7280; margin: 10mm 0 0; }
@page { size: A4; margin: 0; }
@media print {
    .no-print { display: none !important; }
    .print-body { background: #fff; }
    .print-sheet { margin: 0; box-shadow: none; width: 210mm; max-width: none; }
}

/* ---------- Admin ---------- */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.role-card { position: relative; cursor: pointer; margin: 0; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card-body {
    display: flex; flex-direction: column; gap: .3rem;
    height: 100%;
    padding: .9rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: border-color .15s, background .15s;
}
.role-card-body i { font-size: 1.25rem; color: var(--text-muted); }
.role-card-body span { font-size: .78rem; color: var(--text-muted); }
.role-card:hover .role-card-body { border-color: #b7d7c3; }
.role-card input:checked + .role-card-body { border-color: var(--green); background: var(--green-light); }
.role-card input:checked + .role-card-body i { color: var(--green); }
.role-card input:focus-visible + .role-card-body { box-shadow: 0 0 0 3px rgba(31,111,63,.2); }
.role-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; white-space: nowrap; }
.role-chip i { color: var(--green); }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 1.1rem; border-left: 1px dashed var(--border); margin-left: .45rem; }
.tree summary {
    cursor: pointer;
    padding: .3rem .25rem;
    border-radius: 6px;
    font-size: .88rem;
    display: flex; align-items: center; gap: .4rem;
}
.tree summary:hover { background: #f3f4f6; }
.tree summary i { color: var(--green); }
.tree-count { margin-left: auto; font-size: .72rem; color: var(--text-muted); background: #f3f4f6; border-radius: 999px; padding: 0 .45rem; }
.tree-leaves { display: flex; flex-wrap: wrap; gap: .3rem; padding: .35rem 0 .5rem 1.1rem !important; }
.tree-leaves li { font-size: .78rem; padding: .1rem .5rem; background: #f3f4f6; border-radius: 999px; }

.filter-date { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-muted); margin: 0; }
.filter-date input { width: auto; }

/* ---------- Observatoire / exports ---------- */
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; }
.dataset-card { position: relative; margin: 0; cursor: pointer; }
.dataset-card input { position: absolute; opacity: 0; }
.dataset-card-body {
    display: flex; flex-direction: column; gap: .35rem;
    height: 100%;
    padding: 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
}
.dataset-card-head { display: flex; align-items: center; gap: .5rem; }
.dataset-card-head i { color: var(--green); font-size: 1.1rem; }
.dataset-card-text { font-size: .8rem; color: var(--text-muted); }
.dataset-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: auto; font-variant-numeric: tabular-nums; }
.dataset-card input:checked + .dataset-card-body { border-color: var(--green); background: var(--green-light); }
.dataset-card input:focus-visible + .dataset-card-body { box-shadow: 0 0 0 3px rgba(31,111,63,.2); }
.format-pill { margin: 0; cursor: pointer; }
.format-pill input { position: absolute; opacity: 0; }
.format-pill span {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: .88rem;
}
.format-pill small { color: var(--text-muted); }
.format-pill input:checked + span { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }

/* ---------- Pages publiques ---------- */
.public-body { background: #f7f9f8; min-height: 100vh; display: flex; flex-direction: column; }
.public-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.public-header { background: #fff; border-bottom: 1px solid var(--border); }
.public-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.public-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.public-brand .brand-text small { color: var(--text-muted); }
.public-nav { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.public-nav > a:not(.btn) { color: var(--text); text-decoration: none; }
.public-nav > a:not(.btn):hover { color: var(--green); }
.public-main { flex: 1; }
.public-footer { padding: 1.25rem 0; border-top: 1px solid var(--border); background: #fff; font-size: .78rem; color: var(--text-muted); }
.public-footer .public-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.public-hero {
    padding: 3.5rem 0;
    background:
        radial-gradient(circle at 90% 10%, rgba(42,143,85,.12), transparent 45%),
        linear-gradient(180deg, #fff, #f7f9f8);
}
.public-hero-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 992px) { .public-hero-grid { grid-template-columns: 1.2fr 1fr; gap: 3rem; } }
.public-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; line-height: 1.15; margin: .75rem 0 1rem; }
.public-hero .lead { color: var(--text-muted); font-size: 1.05rem; }
.public-eyebrow {
    display: inline-flex; gap: .4rem; align-items: center;
    font-size: .8rem; font-weight: 600;
    color: var(--green-dark); background: var(--green-light);
    padding: .3rem .7rem; border-radius: 999px;
}
.verify-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-md); }
.verify-form { display: flex; gap: .5rem; }
.verify-form .form-control { font-family: 'SF Mono', Consolas, monospace; letter-spacing: .05em; }
.verify-form .form-control::placeholder { letter-spacing: .05em; }
.public-section { padding: 2.5rem 0; }
.public-section-muted { background: #eef4f0; }
.public-h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; }
.public-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 768px) { .public-stats { grid-template-columns: repeat(4, 1fr); } }
.public-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.public-stat i { color: var(--green); font-size: 1.3rem; }
.public-stat strong { font-size: 1.6rem; font-weight: 800; }
.public-stat span { font-size: .82rem; color: var(--text-muted); }
.public-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 1rem; counter-reset: step; }
@media (min-width: 768px) { .public-steps { grid-template-columns: repeat(4, 1fr); } }
.public-steps li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; }
.public-steps li span:last-child { color: var(--text-muted); }
.public-step-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--green-light); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.public-privacy { display: flex; gap: 1rem; align-items: flex-start; font-size: .92rem; }
.public-privacy > i { font-size: 1.5rem; color: var(--green); }

.verify-result { border-radius: var(--radius); border: 1px solid; padding: 1.5rem; background: #fff; }
.verify-result-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.verify-result-head > i { font-size: 2.4rem; line-height: 1; }
.verify-ok { border-color: #86efac; box-shadow: 0 0 0 4px #f0fdf4; }
.verify-ok .verify-result-head > i { color: #15803d; }
.verify-warn { border-color: #fcd34d; box-shadow: 0 0 0 4px #fffbeb; }
.verify-warn .verify-result-head > i { color: #b45309; }
.verify-danger { border-color: #fca5a5; box-shadow: 0 0 0 4px #fef2f2; }
.verify-danger .verify-result-head > i { color: #b91c1c; }
.verify-dl { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1.25rem; margin: 0; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.verify-dl dt { font-size: .8rem; color: var(--text-muted); font-weight: 500; padding-top: .1rem; }
.verify-dl dd { margin: 0; }
.verify-footnote { font-size: .8rem; color: var(--text-muted); margin: 1rem 0 0; }

/* ---------- Erreurs ---------- */
.error-page { padding: 4rem 0; }
.error-icon {
    width: 76px; height: 76px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}
.error-code { font-size: .85rem; font-weight: 700; letter-spacing: .2em; color: var(--text-muted); margin-bottom: .25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    .verify-form { flex-direction: column; }
    .public-nav > a:not(.btn) { display: none; }
    .public-hero { padding: 2rem 0; }
    .panel-footer { padding: .85rem 1rem; }
    .panel-footer .btn { flex: 1; }
    .filter-date { width: 100%; }
    .filter-date input { flex: 1; }
    .activity-feed li { flex-direction: column; gap: .1rem; padding: .55rem 1.15rem; }
    .card-preview-stage { padding: 1rem; }
}

/* ---------- Topbar : recherche & notifications ---------- */
.topbar-search { margin: 0; }
.topbar-kbd {
    font-family: inherit;
    font-size: .7rem;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 .35rem;
    box-shadow: none;
}
.topbar-search:focus-within .topbar-kbd { display: none; }
.notif-menu { width: 360px; max-width: calc(100vw - 2rem); padding: 0; overflow: hidden; }
.notif-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.notif-menu-header .btn-link { font-size: .8rem; color: var(--green); text-decoration: none; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
    display: flex;
    gap: .75rem;
    padding: .75rem 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f9fafb; color: inherit; }
.notif-item.is-unread { background: #f6fbf8; }
.notif-item.is-unread::after {
    content: "";
    position: absolute;
    top: 1rem; right: .9rem;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
}
.notif-item .alert-icon { flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; min-width: 0; padding-right: 1rem; }
.notif-title { font-weight: 600; font-size: .85rem; }
.notif-text { font-size: .8rem; color: var(--text-muted); }
.notif-time { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
