/* =================================================================
   Demandes de Messe — Thème "Bordeaux & Or" (solennité romaine)
   Design : sérif Playfair Display pour les titres, Inter pour le texte.
   ================================================================= */

/* ---------- Palette ---------- */
:root {
    --bordeaux:       #6b1b1b;
    --bordeaux-dark:  #4a1212;
    --bordeaux-light: #8a2e2e;
    --or:             #c9a24b;
    --or-light:       #e0c47b;
    --or-dark:        #a3833b;
    --ivoire:         #fdfaf3;
    --creme:          #f7f1e3;
    --parchemin:      #faf6ec;
    --gris-doux:      #f0ece4;
    --gris-moyen:     #7a7368;
    --noir-liturgique:#1c1712;

    --shadow-sm:  0 1px 3px rgba(28, 23, 18, .08);
    --shadow-md:  0 4px 12px rgba(28, 23, 18, .10);
    --shadow-lg:  0 10px 28px rgba(28, 23, 18, .14);

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

    --font-serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
    --font-sans:  'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--parchemin);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(201, 162, 75, .05) 0, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(107, 27, 27, .04) 0, transparent 40%);
    color: #2a231b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--bordeaux-dark);
    letter-spacing: -0.01em;
}

a { color: var(--bordeaux); text-decoration: none; transition: color .15s; }
a:hover { color: var(--bordeaux-dark); text-decoration: underline; }

/* ---------- Couleurs utilitaires ---------- */
.text-bordeaux { color: var(--bordeaux) !important; }
.text-or       { color: var(--or) !important; }
.bg-bordeaux   { background: var(--bordeaux) !important; color: #fff !important; }
.bg-or         { background: var(--or) !important; color: var(--bordeaux-dark) !important; }
.bg-creme      { background: var(--creme) !important; }

/* ---------- Boutons ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all .15s ease;
    padding: .5rem 1.1rem;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary, .btn-bordeaux {
    background: var(--bordeaux);
    border-color: var(--bordeaux);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-bordeaux:hover, .btn-bordeaux:focus {
    background: var(--bordeaux-dark);
    border-color: var(--bordeaux-dark);
    color: #fff;
}

.btn-or {
    background: var(--or);
    border-color: var(--or);
    color: var(--bordeaux-dark);
    font-weight: 600;
}
.btn-or:hover { background: var(--or-dark); border-color: var(--or-dark); }

.btn-outline-dark { color: var(--bordeaux-dark); border-color: var(--bordeaux-dark); }
.btn-outline-dark:hover { background: var(--bordeaux-dark); color: #fff; }

.btn-outline-primary { color: var(--bordeaux); border-color: var(--bordeaux); }
.btn-outline-primary:hover { background: var(--bordeaux); color: #fff; }

/* ---------- Navbar ---------- */
.navbar {
    background: linear-gradient(135deg, var(--bordeaux) 0%, var(--bordeaux-dark) 100%) !important;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--or);
}
.navbar-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: .01em;
}
.navbar-brand .bi { color: var(--or); }
.navbar .nav-link {
    transition: color .15s;
    position: relative;
}
.navbar .nav-link:hover { color: var(--or-light) !important; }
.navbar .nav-link .bi { color: var(--or); margin-right: 3px; }

.dropdown-menu { border: none; box-shadow: var(--shadow-lg); border-radius: var(--radius-md); }
.dropdown-menu .dropdown-item:hover { background: var(--creme); color: var(--bordeaux); }

/* ---------- Bannière hero ---------- */
.hero-banner {
    background:
        linear-gradient(135deg, rgba(107,27,27,.9) 0%, rgba(74,18,18,.95) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' opacity='.08'><path d='M50 5 L50 95 M30 25 L70 25' stroke='white' stroke-width='.5' fill='none'/></svg>");
    background-size: cover, 60px;
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--or);
}
.hero-banner::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 100%, rgba(201,162,75,.25) 0, transparent 70%);
    pointer-events: none;
}
.hero-banner h1 {
    color: #fff;
    font-size: 2.8rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
    margin-bottom: .5rem;
}
.hero-banner .lead { color: rgba(255,255,255,.9); font-size: 1.15rem; }

/* Ornement style vitrail */
.hero-divider {
    display: block;
    text-align: center;
    margin: 1.5rem auto;
    color: var(--or);
    font-size: 1.5rem;
    letter-spacing: 1rem;
}
.hero-divider::before,
.hero-divider::after {
    content: '';
    display: inline-block;
    width: 80px;
    height: 1px;
    background: var(--or);
    vertical-align: middle;
    margin: 0 1rem;
}

/* ---------- Cartes ---------- */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: var(--creme);
    border-bottom: 2px solid var(--or);
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--bordeaux-dark);
}

.card-ornamental {
    border: 1px solid var(--or-light);
    background: linear-gradient(180deg, #fff 0%, var(--parchemin) 100%);
    position: relative;
}
.card-ornamental::before {
    content: '✠';
    position: absolute;
    top: -14px; left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: var(--or);
    padding: 0 10px;
    font-size: 1.2rem;
}

/* ---------- Formulaires ---------- */
.form-control, .form-select {
    border: 1px solid #d6cfbf;
    border-radius: var(--radius-sm);
    padding: .55rem .85rem;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: var(--or);
    box-shadow: 0 0 0 3px rgba(201, 162, 75, .2);
}
.form-label { font-weight: 500; color: var(--bordeaux-dark); margin-bottom: .3rem; }
.form-text, .text-muted { color: var(--gris-moyen) !important; }

.form-check-input:checked {
    background-color: var(--bordeaux);
    border-color: var(--bordeaux);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 27, 27, .2);
}

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

/* ---------- Tables ---------- */
.table {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table thead th {
    background: var(--creme);
    color: var(--bordeaux-dark);
    border-bottom: 2px solid var(--or);
    font-weight: 600;
    font-family: var(--font-serif);
    padding: .9rem .75rem;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(201,162,75, .04); }

/* ---------- Badges ---------- */
.badge { font-weight: 500; padding: .4em .7em; letter-spacing: .02em; }
.badge.bg-primary, .badge.bg-bordeaux { background: var(--bordeaux) !important; color: #fff !important; }
.badge.bg-or { background: var(--or) !important; color: var(--bordeaux-dark) !important; }

/* Statuts */
.badge-statut-en_attente { background: var(--gris-moyen); color: #fff; }
.badge-statut-payee      { background: #198754; color: #fff; }
.badge-statut-celebree   { background: var(--or); color: var(--bordeaux-dark); }
.badge-statut-refusee    { background: #a94442; color: #fff; }

/* ---------- Alertes ---------- */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--radius-sm);
    padding: .9rem 1.2rem;
    font-size: .95rem;
}
.alert-success { border-color: #198754; background: #e8f5ed; color: #0f5132; }
.alert-danger  { border-color: #c00;     background: #fbeaea; color: #842029; }
.alert-warning { border-color: var(--or); background: #fdf5e2; color: #664d03; }
.alert-info    { border-color: #0dcaf0;  background: #e9f7fb; color: #055160; }

/* ---------- Footer ---------- */
footer {
    background: linear-gradient(135deg, var(--bordeaux-dark) 0%, #2a0a0a 100%);
    color: rgba(255,255,255,.75);
    padding: 2.5rem 0 1.5rem !important;
    margin-top: 3rem !important;
    border-top: 3px solid var(--or);
    position: relative;
}
footer::before {
    content: '✠';
    display: block;
    color: var(--or);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}
footer a { color: var(--or-light); }
footer a:hover { color: #fff; }

/* ---------- Pastille de notification burger ---------- */
.navbar-toggler { position: relative; border-color: var(--or); }
.notif-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 22px; height: 22px;
    padding: 0 6px;
    background: #dc3545;
    color: #fff;
    border: 2px solid var(--bordeaux);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
    animation: notif-pulse 2s ease-in-out infinite;
}
.notif-badge[data-count="0"], .notif-badge:empty { display: none; }
.nav-notif-badge {
    display: inline-block;
    min-width: 20px; padding: 2px 7px; margin-left: 4px;
    background: #dc3545; color: #fff;
    border-radius: 999px; font-size: 11px; font-weight: 700;
    line-height: 1.2; vertical-align: middle;
}
.nav-notif-badge[data-count="0"], .nav-notif-badge:empty { display: none; }

/* ============================================================
   Cloche 🔔 + dropdown notifications
   ============================================================ */
#notif-bell-wrapper .nav-link { position: relative; padding-right: 1rem; }

.notif-pill-bell {
    position: absolute;
    top: 4px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: #fff;
    border: 2px solid var(--bordeaux-dark);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.notif-pill-bell[data-count="0"], .notif-pill-bell:empty { display: none; }

/* Pastille tri-couleurs à côté du lien "Secrétariat" */
.notif-tri-badges {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    vertical-align: middle;
}
.notif-tri-badges .badge {
    min-width: 20px;
    font-size: 10px;
    padding: 2px 5px;
    line-height: 1.2;
}

/* Dropdown panneau */
.notif-dropdown-panel {
    max-height: 480px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--or-light);
}
/* display: flex UNIQUEMENT quand Bootstrap a ajouté .show (dropdown ouvert).
   Sinon le menu reste visible en permanence car `display: flex` écrase
   le `display: none` par défaut de .dropdown-menu. */
.notif-dropdown-panel.show {
    display: flex;
    flex-direction: column;
}
.notif-dropdown-list {
    max-height: 260px;
    overflow-y: auto;
    background: #fafafa;
}
.notif-dropdown-list .notif-item {
    padding: .6rem 1rem;
    border-bottom: 1px solid #eee;
    font-size: .85rem;
    display: block;
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}
.notif-dropdown-list .notif-item:hover {
    background: var(--creme);
    color: var(--bordeaux);
    text-decoration: none;
}
.notif-dropdown-list .notif-item:last-child { border-bottom: none; }
.notif-dropdown-list .notif-item .notif-icon {
    font-size: 1.1rem;
    margin-right: 6px;
    vertical-align: middle;
}
.notif-dropdown-list .notif-item .notif-date {
    color: #999;
    font-size: .75rem;
    float: right;
}
.notif-dropdown-list .notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #aaa;
    font-style: italic;
}

/* ============================================================
   Collapse / Expand — chevron animé pour cartes notifications
   ============================================================ */
.notif-chevron {
    display: inline-block;
    transition: transform .25s ease;
}
/* Chevron pointé vers le bas par défaut (panneau fermé).
   Quand le toggle est ouvert (aria-expanded="true"), le chevron tourne. */
[aria-expanded="true"] .notif-chevron {
    transform: rotate(180deg);
}

.notif-collapse-card .card-header {
    user-select: none;
    transition: background-color .15s;
}
.notif-collapse-card .card-header:hover {
    background-color: rgba(201, 162, 75, .08);
}

/* Bouton "Voir le détail" dans le dropdown cloche */
.notif-toggle-list {
    background: transparent;
    border: none;
    color: var(--bordeaux);
    font-size: .85rem;
    padding: .5rem 1rem;
    transition: background-color .15s;
}
.notif-toggle-list:hover {
    background-color: var(--creme);
    color: var(--bordeaux-dark);
}
.notif-toggle-list[aria-expanded="true"] .notif-toggle-label-closed { display: none; }
.notif-toggle-list[aria-expanded="true"] .notif-toggle-label-open { display: inline !important; }

@keyframes notif-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

/* ---------- Créneaux de messe (sélection) ---------- */
.messe-slot {
    border: 1.5px solid #d6cfbf;
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    margin-bottom: .5rem;
    background: #fff;
    transition: all .15s;
}
.messe-slot:hover { border-color: var(--or); }
.messe-slot.selected {
    border-color: var(--bordeaux);
    background: linear-gradient(to right, rgba(107,27,27,.05), #fff);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   MODULE PUBLICITÉS
   ============================================================ */

.pub-zone {
    margin: 1rem 0;
}

.pub-zone-sidebar .pub-item {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--or-light);
    box-shadow: var(--shadow-sm);
}

.pub-zone-banniere {
    background: linear-gradient(135deg, var(--creme), #fff);
    border-top: 2px solid var(--or);
    border-bottom: 2px solid var(--or);
    padding: 1rem 0;
}
.pub-zone-banniere .pub-item { max-width: 960px; margin: 0 auto; }

.pub-zone-header {
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.pub-zone-footer {
    background: rgba(255,255,255,.07);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}
.pub-zone-footer .pub-item { color: rgba(255,255,255,.85); }

.pub-image { width: 100%; display: block; }

.pub-texte {
    background: var(--parchemin);
}
.pub-texte h6 {
    font-family: var(--font-serif);
    color: var(--bordeaux);
}

.pub-affiche {
    background: linear-gradient(180deg, #fff 0%, var(--creme) 100%);
}

.pub-video-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pub-caption {
    padding: .5rem 1rem;
}

.pub-carousel .carousel-control-prev,
.pub-carousel .carousel-control-next {
    width: 30px;
    background: rgba(0,0,0,.1);
    opacity: .6;
}
.pub-carousel .carousel-control-prev { left: 5px; border-radius: 4px; height: 100%; }
.pub-carousel .carousel-control-next { right: 5px; border-radius: 4px; height: 100%; }

.pub-zone-preview {
    border: 2px dashed var(--or-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 100px;
    background: var(--parchemin);
}

/* ---------- Dashboards : cartes de stats ---------- */
.dashboard-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid var(--or-light);
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--or), var(--bordeaux));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s;
}
.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.dashboard-card:hover::before { transform: scaleX(1); }
.dashboard-card .display-4 { color: var(--bordeaux); }

/* ---------- Animations discrètes ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
main > .row, main > .card, main > form > .card { animation: fadeInUp .4s ease-out; }

/* =============================================================
   IMPRESSION — Amélioré (module 4)
   =============================================================
   - .no-print : masqué à l'impression
   - .print-only : visible UNIQUEMENT à l'impression
   - .print-fiche : conteneur d'une fiche imprimable (reçu / demande)
   ============================================================= */

/* Par défaut, les éléments .print-only sont cachés à l'écran */
.print-only { display: none !important; }

/* Styles de base pour les fiches imprimables (visibles aussi à l'écran, plus propre) */
.print-fiche {
    background: #fff;
    padding: 2rem;
    margin: 0 auto;
    max-width: 210mm;                   /* A4 */
    border: 1px solid #ddd;
    box-shadow: var(--shadow-sm);
}
.print-header {
    text-align: center;
    padding-bottom: 1rem;
}
.print-header h1 {
    color: var(--bordeaux);
    font-family: 'Playfair Display', serif;
    margin: .5rem 0;
    font-size: 1.6rem;
}
.print-logo {
    font-size: 2.5rem;
    color: var(--or);
    line-height: 1;
}
.print-divider {
    border-top: 2px solid var(--or);
    margin: 1rem 0;
    position: relative;
}
.print-divider::after {
    content: '✠';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 10px;
    color: var(--or);
}
.print-title {
    color: var(--bordeaux);
    text-align: center;
    font-family: 'Playfair Display', serif;
    margin-bottom: .5rem;
}
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.print-table th,
.print-table td {
    padding: .6rem .8rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    text-align: left;
}
.print-table th {
    background: var(--creme);
    font-weight: 600;
    color: var(--bordeaux);
    width: 35%;
}
.print-verse {
    text-align: center;
    margin: 2rem 0 1.5rem;
    padding: 1rem;
    background: var(--creme);
    border-left: 4px solid var(--or);
    border-radius: var(--radius-sm);
    color: var(--bordeaux-dark);
}
.print-footer {
    margin-top: 2rem;
    padding-top: 1rem;
}
.print-signature-box {
    border-bottom: 1px solid #888;
    height: 3.5rem;
    margin-top: .5rem;
}

/* ---------- Règles d'impression ---------- */
@media print {
    /* Masquer tous les éléments de navigation et actions */
    nav, footer, .no-print, .btn, .navbar, .pub-zone,
    .nav-tabs, .alert, .card-header[role="button"] .notif-chevron {
        display: none !important;
    }

    /* Afficher les éléments print-only */
    .print-only { display: block !important; }

    /* Reset de la présentation */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }
    .container, main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Fiche imprimable : sans bordure ni ombre */
    .print-fiche {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Tableaux : pleine largeur + bordures fines */
    .table, .print-table {
        width: 100% !important;
        font-size: 10pt;
        border-collapse: collapse;
    }
    .table td, .table th,
    .print-table td, .print-table th {
        border: 1px solid #888 !important;
        padding: .3rem .5rem;
    }
    .card {
        border: 1px solid #888 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .card-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }

    /* Badges lisibles en noir et blanc */
    .badge {
        border: 1px solid #333 !important;
        color: #000 !important;
        background: #fff !important;
    }

    /* Page A4 avec marges */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    /* Éviter les coupures maladroites */
    h1, h2, h3, h4, table { page-break-after: avoid; }
    tr { page-break-inside: avoid; }

    /* Liens sans couleur */
    a, a:visited { color: #000 !important; text-decoration: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-banner h1 { font-size: 1.9rem; }
    .hero-banner { padding: 2rem 0; }
    .card { border-radius: var(--radius-sm); }
    .table thead { display: none; }
}

/* ============================================================
   Sprint 15 — UX accessible : focus visible + reduced motion
   ============================================================ */
:focus-visible {
    outline: 3px solid var(--or);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Respect du paramètre système "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Cartes dashboard : effet "élévation" subtil au survol */
.dashboard-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}
.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(107, 27, 27, 0.12);
}

/* Listes d'autocomplétion : meilleur visuel */
.list-group-item-action:hover {
    background-color: #fff8dc;
}

/* ============================================================
   SKELETON LOADING
   Shimmer animé pour les contenus en cours de chargement AJAX
   ============================================================ */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e8e0d0 25%, #f5f0e8 50%, #e8e0d0 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
.skeleton-line {
    height: 1em;
    margin-bottom: .5rem;
    border-radius: var(--radius-sm);
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long   { width: 90%; }
.skeleton-card {
    background: #fff;
    border: 1px solid var(--or-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: .5rem;
}

/* ============================================================
   SPINNERS & ÉTATS DE CHARGEMENT
   ============================================================ */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: .8;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
    margin-left: .5em;
    vertical-align: -0.15em;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Spinner inline dans les selects pendant chargement AJAX */
.select-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 50 50'%3E%3Cpath fill='%236b1b1b' d='M25 5A20 20 0 1 0 25 45A20 20 0 1 0 25 5' stroke='%23c9a24b' stroke-width='4' fill='none'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    padding-right: 2.5rem !important;
}

/* ============================================================
   TRANSITIONS DE PAGE & ENTRÉES ANIMÉES
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Animation entrée page */
main > .row    { animation: fadeInUp .4s ease-out both; }
main > .card   { animation: scaleIn .35s ease-out both; }
main > form    { animation: fadeInUp .4s ease-out both; }
.hero-banner   { animation: fadeIn .6s ease-out; }

/* Entrées décalées pour les cartes dans une grille */
main > .row > [class^="col"]:nth-child(1) { animation-delay: .05s; }
main > .row > [class^="col"]:nth-child(2) { animation-delay: .1s; }
main > .row > [class^="col"]:nth-child(3) { animation-delay: .15s; }
main > .row > [class^="col"]:nth-child(4) { animation-delay: .2s; }

/* Les alertes flash apparaissent depuis le haut */
.alert { animation: fadeInDown .3s ease-out; }

/* ============================================================
   MICRO-INTERACTIONS : cartes interactives
   ============================================================ */
.card-ornamental {
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.card-ornamental:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--or);
}

/* Lignes de tableau cliquables */
.table tbody tr.clickable-row {
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s;
}
.table tbody tr.clickable-row:hover {
    background: linear-gradient(to right, rgba(107,27,27,.04), rgba(201,162,75,.04));
    box-shadow: inset 3px 0 0 var(--or);
}

/* Messes slots : animation de sélection */
.messe-slot {
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.messe-slot:hover { border-color: var(--or); transform: translateX(2px); }
.messe-slot.selected {
    border-color: var(--bordeaux);
    background: linear-gradient(to right, rgba(107,27,27,.07), #fff);
    box-shadow: inset 3px 0 0 var(--bordeaux), var(--shadow-sm);
    transform: translateX(3px);
}

/* ============================================================
   FORMULAIRES — Feedback visuel enrichi
   ============================================================ */

/* Champ valide */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23198754' d='M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417L5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}
/* Champ invalide */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    animation: shake .4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    40%       { transform: translateX(4px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

/* Labels flottants visuels (non natifs) — accentuation au focus */
.form-group-focused .form-label {
    color: var(--bordeaux);
    font-weight: 600;
}

/* Input-group amélioré */
.input-group-text {
    background: var(--creme);
    border-color: #d6cfbf;
    color: var(--bordeaux);
}

/* ============================================================
   NAVIGATION — Indicateur de page active
   ============================================================ */
.navbar .nav-link.active {
    color: var(--or-light) !important;
    font-weight: 600;
}
.navbar .nav-link.active::after {
    content: '';
    display: block;
    height: 2px;
    background: var(--or);
    border-radius: 2px;
    margin-top: 2px;
    animation: scaleIn .2s ease;
}

/* ============================================================
   MOBILE — Améliorations responsive
   ============================================================ */
@media (max-width: 576px) {
    .hero-banner h1 { font-size: 1.6rem; }
    .hero-banner .lead { font-size: 1rem; }
    .hero-banner { padding: 1.5rem 0; }

    /* Boutons pleine largeur sur mobile */
    .btn-block-sm { display: block; width: 100%; margin-bottom: .5rem; }

    /* Cards sans coin arrondis */
    .card { border-radius: var(--radius-sm); }

    /* Tables scrollables avec indicateur */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .table-responsive::after {
        content: '← →';
        display: block;
        text-align: center;
        color: var(--gris-moyen);
        font-size: .7rem;
        padding: .2rem;
    }

    /* Supprimer les entêtes et empiler les lignes */
    .table-cards-mobile thead { display: none; }
    .table-cards-mobile tbody tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: var(--radius-sm);
        margin-bottom: .75rem;
        padding: .75rem;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }
    .table-cards-mobile tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: .3rem 0;
        border-bottom: 1px solid #f0ece4;
        font-size: .875rem;
    }
    .table-cards-mobile tbody td:last-child { border-bottom: none; }
    .table-cards-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bordeaux);
        font-size: .8rem;
        min-width: 40%;
    }

    /* Notifications dropdown plein écran */
    .notif-dropdown-panel {
        position: fixed !important;
        top: 60px !important;
        left: 8px !important;
        right: 8px !important;
        min-width: auto !important;
        max-height: calc(100vh - 80px) !important;
        overflow-y: auto;
        z-index: 9999;
    }
}

/* ============================================================
   ACCESSIBILITÉ — Améliorations a11y
   ============================================================ */

/* Skip-to-content (caché jusqu'au focus clavier) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bordeaux);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top .2s;
    text-decoration: none;
    font-weight: 600;
}
.skip-to-content:focus { top: 0; }

/* Indicateurs de chargement pour les screen readers */
[aria-busy="true"] { cursor: wait; }

/* Contraste amélioré pour les badges de statut */
.badge-statut-en_attente { background: #6c757d; color: #fff; }

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
#scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    background: var(--bordeaux);
    color: var(--or);
    border: 2px solid var(--or);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    font-size: 1.1rem;
}
#scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
}
#scroll-top-btn:hover {
    background: var(--bordeaux-dark);
    transform: translateY(-2px);
}

/* ============================================================
   TOAST NOTIFICATIONS (feedback non-bloquant)
   ============================================================ */
.toast-container-custom {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 350px;
}
.toast-custom {
    background: #fff;
    border-left: 4px solid var(--bordeaux);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    animation: fadeInDown .3s ease;
    font-size: .9rem;
}
.toast-custom.success { border-color: #198754; }
.toast-custom.warning { border-color: var(--or); }
.toast-custom.error   { border-color: #dc3545; }

/* ============================================================
   PAGINATION — Style accordé au thème
   ============================================================ */
.pagination .page-link {
    color: var(--bordeaux);
    border-color: #d6cfbf;
    transition: all .15s;
}
.pagination .page-link:hover {
    background: var(--creme);
    color: var(--bordeaux-dark);
    border-color: var(--or);
}
.pagination .page-item.active .page-link {
    background: var(--bordeaux);
    border-color: var(--bordeaux);
    color: #fff;
}

/* ============================================================
   TRANSITIONS SMOOTH SCROLL
   ============================================================ */
html { scroll-behavior: smooth; }
