/* audit_moncodir – feuille de style globale */

:root {
    --primary:    #2563eb;
    --primary-dk: #1d4ed8;
    --primary-lt: #dbeafe;
    --accent:     #f59e0b;
    --bg:         #f1f5f9;
    --surface:    #ffffff;
    --border:     #e2e8f0;
    --text:       #0f172a;
    --text-muted: #64748b;
    --success:    #16a34a;
    --warning:    #d97706;
    --danger:     #dc2626;
    --nav-bg:     #0f172a;
    --radius:     8px;
    --radius-lg:  12px;
    --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:        #0f172a;
        --surface:   #1e293b;
        --border:    #334155;
        --text:      #e2e8f0;
        --text-muted:#94a3b8;
        --primary:   #60a5fa;
        --primary-dk:#3b82f6;
        --primary-lt:#1e3a5f;
        --nav-bg:    #020617;
    }
}
:root[data-theme="dark"] {
    --bg:        #0f172a;
    --surface:   #1e293b;
    --border:    #334155;
    --text:      #e2e8f0;
    --text-muted:#94a3b8;
    --primary:   #60a5fa;
    --primary-dk:#3b82f6;
    --primary-lt:#1e3a5f;
    --nav-bg:    #020617;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Arial, sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- Navigation ---- */
nav {
    background: var(--nav-bg);
    color: #fff;
    padding: 0 1.5rem;
    display: flex;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
}
nav .brand {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 0 1.25rem 0 0;
    margin-right: .75rem;
    border-right: 1px solid rgba(255,255,255,.1);
    position: relative;
}
nav .brand::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}
nav a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .84rem;
    padding: 0 .65rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
nav a:hover { color: rgba(255,255,255,.92); }
nav a.nav-active {
    color: #fff;
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ---- Layout ---- */
.container { max-width: 980px; margin: 1.75rem auto; padding: 0 1.25rem; }

/* ---- Titre de page ---- */
.page-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: .87rem; color: var(--text-muted); margin-top: .2rem; }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}
.card h2 {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .85rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dk);
    box-shadow: 0 1px 2px rgba(37,99,235,.25);
}
.btn-primary:hover {
    background: var(--primary-dk);
    box-shadow: 0 2px 6px rgba(37,99,235,.35);
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.btn-secondary:hover {
    background: var(--bg);
    border-color: #cbd5e1;
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left;
    padding: .55rem .75rem;
    border-bottom: 2px solid var(--border);
}
td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(37,99,235,.025); }

/* ---- Badges niveau ---- */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-standard   { background: #dbeafe; color: #1e40af; }
.badge-approfondi { background: #fef3c7; color: #92400e; }
.badge-na         { background: #f1f5f9; color: #64748b; }

/* ---- Forms ---- */
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .875rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="search"], select, textarea {
    width: 100%; padding: .45rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .9rem; background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group { margin-bottom: 1rem; }
.required::after { content: " *"; color: var(--danger); }

/* ---- Alerts ---- */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: .75rem;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    border: 1px solid transparent;
}
.alert-body { flex: 1; }
.alert-close {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; line-height: 1; opacity: .5; padding: 0 .1rem;
    color: inherit; flex-shrink: 0; margin-top: .05rem;
}
.alert-close:hover { opacity: 1; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---- Utilitaires ---- */
.text-muted { color: var(--text-muted); font-size: .875rem; }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger sur les enfants directs du container (titres, cartes, alertes) */
.container > * {
    animation: fadeInUp .38s ease both;
}
.container > *:nth-child(2) { animation-delay: .06s; }
.container > *:nth-child(3) { animation-delay: .12s; }
.container > *:nth-child(4) { animation-delay: .18s; }
.container > *:nth-child(5) { animation-delay: .24s; }
.container > *:nth-child(n+6) { animation-delay: .28s; }

/* Glow sur le radar */
#radar-actuelle {
    filter: drop-shadow(0 0 8px rgba(59,130,246,.4));
}

/* Hero stats (page accueil) */
.stats-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    border: none;
    padding: .85rem 1.5rem;
}
.stats-hero .kpi-val {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
}
.stats-hero .kpi-lbl {
    font-size: .78rem;
    color: #94a3b8;
    margin-top: .25rem;
}
.stats-hero .divider {
    width: 1px;
    background: #334155;
    height: 44px;
    align-self: center;
}

/* ── Portal cards (homepage) ─────────────────────────────────────────────── */
.portal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid #94a3b8;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: .65rem;
    transition: box-shadow .18s, transform .18s;
}
.portal-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.portal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}
.portal-role {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.portal-desc {
    font-size: .86rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}
.portal-stat {
    font-size: .8rem;
    color: var(--text-muted);
}
.kpi-lbl-dark {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .25rem;
}
