/* ============================================================
   MIVOATSA — Feuille de style principale
   Design system : variables, reset, layout, composants
   Dark mode natif via data-theme="dark" sur <html>
   ============================================================ */

/* ── 1. VARIABLES (light mode) ─────────────────────────── */
:root {
    --color-primary:       #6366f1;
    --color-primary-dark:  #4f46e5;
    --color-primary-light: #e0e7ff;
    --color-secondary:     #8b5cf6;
    --color-accent:        #06b6d4;

    --bg:          #ffffff;
    --bg-alt:      #f8fafc;
    --bg-card:     #ffffff;
    --bg-nav:      rgba(255,255,255,0.95);
    --bg-input:    #ffffff;

    --text:        #0f172a;
    --text-muted:  #64748b;
    --text-light:  #94a3b8;
    --text-invert: #ffffff;

    --border:      #e2e8f0;
    --border-focus:#6366f1;

    --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg:   0 10px 30px rgba(0,0,0,.1);

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;

    --nav-height:  64px;
    --transition:  0.2s ease;

    /* Statuts */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger:  #ef4444;
    --color-info:    #3b82f6;

    --color-success-bg: #d1fae5;
    --color-warning-bg: #fef3c7;
    --color-danger-bg:  #fee2e2;
    --color-info-bg:    #dbeafe;

    --color-success-text: #065f46;
    --color-warning-text: #92400e;
    --color-danger-text:  #991b1b;
    --color-info-text:    #1e40af;
}

/* ── 2. DARK MODE ───────────────────────────────────────── */
[data-theme="dark"] {
    --bg:          #0f172a;
    --bg-alt:      #1e293b;
    --bg-card:     #1e293b;
    --bg-nav:      rgba(15,23,42,0.95);
    --bg-input:    #1e293b;

    --text:        #f1f5f9;
    --text-muted:  #94a3b8;
    --text-light:  #64748b;
    --text-invert: #0f172a;

    --border:      #334155;
    --border-focus:#818cf8;

    --shadow-sm:   0 1px 3px rgba(0,0,0,.3);
    --shadow-md:   0 4px 12px rgba(0,0,0,.3);
    --shadow-lg:   0 10px 30px rgba(0,0,0,.4);

    --color-primary:       #818cf8;
    --color-primary-dark:  #6366f1;
    --color-primary-light: #1e1b4b;

    --color-success-bg: #064e3b;
    --color-warning-bg: #451a03;
    --color-danger-bg:  #450a0a;
    --color-info-bg:    #1e3a5f;

    --color-success-text: #6ee7b7;
    --color-warning-text: #fcd34d;
    --color-danger-text:  #fca5a5;
    --color-info-text:    #93c5fd;
}

/* ── 3. RESET ET BASE ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-alt);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 4. NAVIGATION ──────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo { height: 36px; width: auto; }

.nav-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -.02em;
}

/* Recherche nav */
.nav-search {
    flex: 1;
    max-width: 360px;
    display: flex;
    align-items: center;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 .75rem;
    gap: .5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.nav-search:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.nav-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: .45rem 0;
    font-size: .9rem;
    color: var(--text);
    outline: none;
}

.nav-search-input::placeholder { color: var(--text-light); }

.nav-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: .25rem;
}

/* Liens de navigation */
.nav-links {
    display: flex;
    list-style: none;
    gap: .25rem;
    align-items: center;
}

.nav-link {
    padding: .4rem .75rem;
    border-radius: var(--radius-md);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-link:hover  { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-link.active { color: var(--color-primary); background: var(--color-primary-light); }
.nav-link-admin  { color: var(--color-warning) !important; }
.nav-link-admin:hover { background: var(--color-warning-bg) !important; }

/* Actions droite */
.nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Sélecteur langue */
.lang-selector { display: flex; gap: .2rem; }

.lang-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .25rem .45rem;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

.lang-btn:hover, .lang-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Toggle thème */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .4rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-alt); color: var(--text); }
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }

/* Avatar utilisateur + dropdown */
.nav-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    padding: .35rem .6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: background var(--transition);
    user-select: none;
}
.nav-user:hover, .nav-user.open { background: var(--bg-alt); }

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

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

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: .5rem;
    z-index: 200;
}
.nav-user.open .nav-dropdown { display: block; }

.nav-dropdown a {
    display: block;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
}
.nav-dropdown a:hover { background: var(--bg-alt); text-decoration: none; }
.nav-dropdown a.text-danger { color: var(--color-danger); }
.nav-dropdown hr { border: none; border-top: 1px solid var(--border); margin: .4rem 0; }

/* Hamburger mobile */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ── 5. BANDEAU D'ANNONCE ───────────────────────────────── */
.announcement-bar {
    background: linear-gradient(135deg, var(--color-danger) 0%, #dc2626 100%);
    color: white;
    padding: .6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .875rem;
}
.announcement-content { display: flex; align-items: center; gap: .5rem; }
.announcement-icon    { font-size: 1rem; flex-shrink: 0; }
.announcement-close   { background: none; border: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 1rem; padding: .25rem; flex-shrink: 0; }
.announcement-close:hover { color: white; }

/* ── 6. FLASH MESSAGES ──────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.5rem;
    gap: 1rem;
    font-size: .9rem;
    font-weight: 500;
    transition: opacity .3s ease;
}
.flash-content { display: flex; align-items: center; gap: .5rem; }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 1rem; padding: .25rem; opacity: .7; }
.flash-close:hover { opacity: 1; }

.flash-success { background: var(--color-success-bg); color: var(--color-success-text); border-bottom: 2px solid var(--color-success); }
.flash-error   { background: var(--color-danger-bg);  color: var(--color-danger-text);  border-bottom: 2px solid var(--color-danger); }
.flash-info    { background: var(--color-info-bg);    color: var(--color-info-text);    border-bottom: 2px solid var(--color-info); }
.flash-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-bottom: 2px solid var(--color-warning); }

/* ── 7. LAYOUT PRINCIPAL ────────────────────────────────── */
.main-content {
    min-height: calc(100vh - var(--nav-height) - 80px);
    padding-bottom: 3rem;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── 8. FOOTER ──────────────────────────────────────────── */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}
.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--text-muted); }
.footer-brand strong { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--color-primary); }
.footer-meta { font-size: .8rem; color: var(--text-light); }

/* ── 9. BOUTONS ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.btn:disabled      { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary  { background: var(--color-primary);  color: white; border-color: var(--color-primary);  }
.btn-primary:hover  { background: var(--color-primary-dark); border-color: var(--color-primary-dark); text-decoration: none; color: white; }

.btn-secondary { background: var(--color-secondary); color: white; border-color: var(--color-secondary); }
.btn-secondary:hover { filter: brightness(0.9); text-decoration: none; color: white; }

.btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover  { background: var(--bg-alt); text-decoration: none; }

.btn-danger   { background: var(--color-danger); color: white; border-color: var(--color-danger); }
.btn-danger:hover { filter: brightness(0.9); text-decoration: none; color: white; }

.btn-success  { background: var(--color-success); color: white; border-color: var(--color-success); }
.btn-success:hover { filter: brightness(0.9); text-decoration: none; color: white; }

.btn-ghost    { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover    { background: var(--bg-alt); color: var(--text); text-decoration: none; }

.btn-sm    { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg    { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon  { padding: .5rem; }

/* ── 10. FORMULAIRES ────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-label   { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-label-row { display: flex; align-items: center; justify-content: space-between; }
.form-link    { font-size: .8rem; color: var(--color-primary); }
.form-hint    { font-size: .8rem; color: var(--text-muted); }
.form-error   { font-size: .8rem; color: var(--color-danger); }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .85rem;
    color: var(--text-light);
    pointer-events: none;
    flex-shrink: 0;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: .65rem .9rem .65rem 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .9rem;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    line-height: 1.5;
}

.form-input:not(.input-wrapper .form-input),
.form-select:not(.input-wrapper .form-select),
.form-textarea { padding-left: .9rem; }

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 100px; padding-left: .9rem; }

.input-toggle-pwd {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: .25rem;
    display: flex;
    align-items: center;
}

/* Indicateur force mdp */
.pwd-strength  { margin-top: .5rem; }
.pwd-strength-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: .5rem; }
.pwd-strength-fill { height: 100%; border-radius: 2px; transition: width .3s, background-color .3s; width: 0; }
.pwd-rules { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.pwd-rules li { font-size: .78rem; color: var(--text-light); padding-left: 1.2rem; position: relative; }
.pwd-rules li::before { content: '○'; position: absolute; left: 0; }
.pwd-rules li.rule-ok::before   { content: '✓'; color: var(--color-success); }
.pwd-rules li.rule-fail::before { content: '✗'; color: var(--color-danger); }
.pwd-rules li.rule-ok   { color: var(--color-success); }
.pwd-rules li.rule-fail { color: var(--color-danger); }
.pwd-match-msg { font-size: .8rem; margin-top: .25rem; min-height: 1.2em; }

/* ── 11. PAGE D'AUTHENTIFICATION ────────────────────────── */
.auth-wrapper {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg-alt);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header    { text-align: center; margin-bottom: 2rem; }
.auth-logo      { display: flex; justify-content: center; margin-bottom: 1rem; }
.auth-title     { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.auth-subtitle  { color: var(--text-muted); font-size: .9rem; }
.auth-form      { display: flex; flex-direction: column; }
.auth-footer    { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.auth-footer-text { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ── 12. CARDS ──────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-body    { padding: 1.25rem; }
.card-header  { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-footer  { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg-alt); }
.card-img-top { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* ── 13. BADGES / PILLS ─────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info-text); }
.badge-gray    { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }

/* ── 14. ÉTOILES DE NOTATION ────────────────────────────── */
.stars {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.star {
    font-size: 1rem;
    cursor: pointer;
    color: var(--border);
    transition: color var(--transition);
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}
.star.filled, .star.hover { color: #f59e0b; }
.stars-readonly .star    { cursor: default; }

/* ── 15. PAGINATION ─────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: .875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition);
    padding: 0 .5rem;
}
.page-btn:hover, .page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    text-decoration: none;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 16. TABLES ─────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.table th {
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-alt);
}
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td     { background: var(--bg-alt); }

/* ── 17. GRILLES RESPONSIVE ─────────────────────────────── */
.grid      { display: grid; gap: 1.25rem; }
.grid-2    { grid-template-columns: repeat(2, 1fr); }
.grid-3    { grid-template-columns: repeat(3, 1fr); }
.grid-4    { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── 18. SECTION HÉRO (page accueil) ────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 4rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero-title   { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; }
.hero-desc    { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; line-height: 1.6; }
.hero-stats   { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.hero-stat    { text-align: center; }
.hero-stat-num  { font-size: 2rem; font-weight: 800; display: block; }
.hero-stat-label{ font-size: .85rem; opacity: .8; }

/* ── 19. PAGE D'ERREUR ──────────────────────────────────── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-alt);
}
.error-card    { text-align: center; max-width: 480px; padding: 3rem 2rem; }
.error-icon    { font-size: 4rem; margin-bottom: 1rem; }
.error-code    { font-size: 5rem; font-weight: 800; color: var(--color-primary); line-height: 1; margin-bottom: .5rem; }
.error-title   { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.error-desc    { color: var(--text-muted); margin-bottom: 2rem; }
.error-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── 20. UTILITAIRES ────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: .85rem; }
.text-danger  { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }

.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.flex-1 { flex: 1; }

.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }  .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.p-0  { padding: 0; }
.pt-3 { padding-top: 1.5rem; }
.pb-3 { padding-bottom: 1.5rem; }

.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p  { color: var(--text-muted); margin-top: .3rem; font-size: .9rem; }

/* Loader spinner */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 21. RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .nav-search { max-width: 240px; }
    .grid-4     { grid-template-columns: repeat(2, 1fr); }
    .grid-3     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-nav);
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: .25rem;
        backdrop-filter: blur(8px);
        z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links li   { width: 100%; }
    .nav-link       { display: block; padding: .65rem 1rem; }
    .nav-hamburger  { display: flex; }
    .nav-search     { max-width: 180px; }
    .nav-username   { display: none; }
    .lang-selector  { display: none; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hero-stats  { gap: 1.5rem; }
    .auth-card   { padding: 1.75rem 1.25rem; }
    .footer-container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .nav-search  { display: none; }
    .hero        { padding: 2.5rem 1rem; }
    .hero-title  { font-size: 2rem; }
    .container   { padding: 0 1rem; }
}

/* ── 22. PRINT ──────────────────────────────────────────── */
@media print {
    .navbar, .footer, .flash, .announcement-bar { display: none !important; }
    body { background: white; color: black; }
}
