/* ==========================================================================
   PHOENIX MARKET — thème orange & blanc doux
   Recolore Bootstrap 5.3 via ses variables : toutes les pages existantes
   adoptent automatiquement la nouvelle identité.
   ========================================================================== */
:root {
    --px-orange: #F97316;
    --px-orange-600: #EA580C;
    --px-orange-700: #C2410C;
    --px-orange-100: #FFEDD5;
    --px-orange-50: #FFF7ED;
    --px-gold: #D4A017;
    --px-gold-400: #F5B301;
    --px-gold-300: #FAD25A;
    --px-gold-100: #FEF3C7;
    --px-gold-grad: linear-gradient(90deg, #F97316 0%, #F59E0B 52%, #D4A017 100%);
    --px-cream: #FFFBF7;
    --px-ink: #1F2430;
    --px-muted: #6B7280;
    --px-line: #F1E7DC;
    --px-radius: 16px;
    --px-shadow: 0 1px 2px rgba(124, 45, 18, .05), 0 8px 24px rgba(124, 45, 18, .07);
    --px-shadow-lg: 0 2px 4px rgba(124, 45, 18, .06), 0 18px 44px rgba(124, 45, 18, .14);
    --px-ease: cubic-bezier(.22, .8, .3, 1);

    --bs-primary: #F97316;
    --bs-primary-rgb: 249, 115, 22;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-link-color: #EA580C;
    --bs-link-color-rgb: 234, 88, 12;
    --bs-link-hover-color: #C2410C;
    --bs-link-hover-color-rgb: 194, 65, 12;
    --bs-body-color: #1F2430;
    --bs-body-bg: #FFFBF7;
    --bs-border-color: #F1E7DC;
    --bs-border-radius: .7rem;
    --bs-border-radius-lg: 1rem;
    --bs-focus-ring-color: rgba(249, 115, 22, .25);
    --bs-font-sans-serif: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--bs-font-sans-serif);
    color: var(--px-ink);
    background:
        radial-gradient(900px 480px at 100% -10%, rgba(249, 115, 22, .10), transparent 60%),
        radial-gradient(700px 420px at -10% 0%, rgba(251, 191, 36, .10), transparent 55%),
        var(--px-cream);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.text-muted { color: var(--px-muted) !important; }
.bg-light { background-color: transparent !important; }

/* ---------- Boutons ---------- */
.btn { border-radius: .75rem; font-weight: 600; transition: transform .18s var(--px-ease), box-shadow .18s var(--px-ease), background-color .18s, color .18s, border-color .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
    --bs-btn-bg: var(--px-orange); --bs-btn-border-color: var(--px-orange); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--px-orange-600); --bs-btn-hover-border-color: var(--px-orange-600); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--px-orange-700); --bs-btn-active-border-color: var(--px-orange-700); --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--px-orange); --bs-btn-disabled-border-color: var(--px-orange);
    --bs-btn-focus-shadow-rgb: 249, 115, 22;
    background-image: linear-gradient(135deg, #FB923C, #F97316 55%, #EA580C);
    box-shadow: 0 6px 16px rgba(249, 115, 22, .28);
}
.btn-primary:hover { box-shadow: 0 10px 22px rgba(249, 115, 22, .36); }
.btn-outline-primary {
    --bs-btn-color: var(--px-orange-600); --bs-btn-border-color: #FDBA74;
    --bs-btn-hover-bg: var(--px-orange); --bs-btn-hover-border-color: var(--px-orange); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--px-orange-600); --bs-btn-active-border-color: var(--px-orange-600); --bs-btn-active-color: #fff;
}
.btn-warning { --bs-btn-bg: #FBBF24; --bs-btn-border-color: #FBBF24; --bs-btn-color: #422006; --bs-btn-hover-bg: #F59E0B; --bs-btn-hover-border-color: #F59E0B; --bs-btn-hover-color: #422006; }
/* contraste du bouton « warning » en version contour */
.btn-outline-warning { --bs-btn-color: #B45309; --bs-btn-border-color: #FCD34D; --bs-btn-hover-bg: #FBBF24; --bs-btn-hover-border-color: #FBBF24; --bs-btn-hover-color: #422006; --bs-btn-active-bg: #F59E0B; --bs-btn-active-color: #422006; }
.btn-check:checked + .btn-outline-warning { background: #FBBF24; border-color: #FBBF24; color: #422006; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--px-line); }

.bg-primary { background-color: var(--px-orange) !important; }
.text-primary { color: var(--px-orange-600) !important; }
.border-primary { border-color: var(--px-orange) !important; }
.bg-primary-subtle { background-color: var(--px-orange-100) !important; }
.text-primary-emphasis { color: var(--px-orange-700) !important; }
.border-primary-subtle { border-color: #FED7AA !important; }
.badge.bg-primary { background-image: linear-gradient(135deg, #FB923C, #EA580C); }
.link-primary { color: var(--px-orange-600) !important; }
.alert-primary, .alert-info { --bs-alert-bg: #FFF1E0; --bs-alert-border-color: #FED7AA; --bs-alert-color: #7C2D12; }
.table-primary { --bs-table-bg: var(--px-orange-100); --bs-table-color: var(--px-ink); }
.progress-bar { background-color: var(--px-orange); }

.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: var(--px-orange); color: #fff; }
.nav-pills .nav-link { color: var(--px-orange-700); border-radius: .7rem; }
.nav-tabs .nav-link.active { color: var(--px-orange-700); border-bottom-color: var(--px-orange); }
.page-link { color: var(--px-orange-700); border-radius: .6rem !important; margin: 0 2px; border-color: var(--px-line); }
.page-item.active .page-link { background: var(--px-orange); border-color: var(--px-orange); color: #fff; }
.form-check-input:checked { background-color: var(--px-orange); border-color: var(--px-orange); }
.form-control:focus, .form-select:focus { border-color: #FDBA74; box-shadow: 0 0 0 .22rem rgba(249, 115, 22, .18); }
.form-control, .form-select { border-color: #EBDDCF; background-color: #fff; }
.form-label { font-weight: 600; font-size: .85rem; color: #4B5563; }
.dropdown-item:active, .dropdown-item.active { background-color: var(--px-orange); }
.dropdown-item { border-radius: .6rem; }
.dropdown-menu { border: 1px solid var(--px-line); border-radius: 1rem; box-shadow: var(--px-shadow-lg); animation: pxPop .18s var(--px-ease); }

/* ---------- Cartes & tableaux ---------- */
.card { border: 1px solid var(--px-line); border-radius: var(--px-radius); box-shadow: var(--px-shadow); background: #fff; transition: transform .25s var(--px-ease), box-shadow .25s var(--px-ease); }
.card.px-hover:hover { transform: translateY(-3px); box-shadow: var(--px-shadow-lg); }
.card-header { background: transparent; border-bottom: 1px solid var(--px-line); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--px-ink); --bs-table-hover-bg: #FFF4E8; --bs-table-border-color: var(--px-line); }
.table thead th, .table > :not(caption) > * > th { background: var(--px-orange-50); color: #7C2D12; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid #FED7AA; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr { transition: background-color .15s; }
.modal-content { border: 0; border-radius: 1.2rem; box-shadow: var(--px-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--px-line); }
.modal-footer { border-top: 1px solid var(--px-line); }
.badge { font-weight: 600; border-radius: .55rem; }
.rounded-4 { border-radius: 1.1rem !important; }

/* ---------- Barre de navigation ---------- */
.px-header { background: rgba(255, 251, 247, .82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--px-line); }
.px-brand { white-space: nowrap; display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: .02em; color: var(--px-ink) !important; text-decoration: none; }
.px-brand .logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; background: linear-gradient(135deg, #FDBA74, #F97316 55%, #C2410C); box-shadow: 0 6px 14px rgba(249, 115, 22, .35); transition: transform .3s var(--px-ease); }
.px-brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.px-brand .word b { color: var(--px-orange-600); }
.px-header .nav-link { color: #4B5563; font-weight: 600; font-size: .86rem; white-space: nowrap; border-radius: .7rem; padding: .5rem .6rem !important; transition: background-color .15s, color .15s; }
.px-header .nav-link:hover { background: var(--px-orange-100); color: var(--px-orange-700); }
.px-header .nav-link.active { background: var(--px-orange-100); color: var(--px-orange-700); }
.px-bell { position: relative; border: 0; background: transparent; width: 42px; height: 42px; border-radius: 12px; color: #4B5563; font-size: 1.15rem; transition: background-color .15s; }
.px-bell:hover { background: var(--px-orange-100); color: var(--px-orange-700); }
.px-bell .dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #DC2626; color: #fff; font-size: .68rem; font-weight: 700; display: none; align-items: center; justify-content: center; border: 2px solid #fff; }
.px-bell.has-alert .dot { display: inline-flex; animation: pxPulse 2s infinite; }
.px-bell.has-alert i { animation: pxRing 2.4s infinite; transform-origin: 50% 0; }
.px-alert-menu { width: min(380px, 94vw); padding: 0; overflow: hidden; }
.px-alert-menu .head { padding: .8rem 1rem; background: var(--px-orange-50); border-bottom: 1px solid var(--px-line); font-weight: 700; }
@media (max-width: 575.98px) {
    /* téléphone : la liste des rappels reste toujours entièrement visible */
    .px-alert-menu.show { position: fixed !important; left: 8px !important; right: 8px !important; top: 62px !important; width: auto !important; transform: none !important; inset: 62px 8px auto 8px !important; max-height: 75vh; overflow-y: auto; }
}
.px-alert-item { display: flex; gap: .7rem; padding: .7rem 1rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--px-line); }
.px-alert-item:hover { background: #FFF4E8; color: inherit; }
.px-alert-item .ico { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.ico-late { background: #FEE2E2; color: #B91C1C; }
.ico-soon { background: #FEF3C7; color: #B45309; }

/* Bandeau de rappel à l'écran */
.px-reminder { position: fixed; z-index: 1070; left: 50%; bottom: 20px; transform: translate(-50%, 140%); width: min(560px, calc(100vw - 24px)); background: #fff; border: 1px solid #FDBA74; border-left: 6px solid var(--px-orange); border-radius: 1rem; box-shadow: var(--px-shadow-lg); padding: .9rem 1rem; display: flex; gap: .8rem; align-items: center; transition: transform .5s var(--px-ease); }
.px-reminder.show { transform: translate(-50%, 0); }

/* ---------- Composants du tableau de bord ---------- */
.px-hero { position: relative; overflow: hidden; border-radius: 1.4rem; padding: 1.6rem 1.7rem; color: #fff; background: linear-gradient(125deg, #FB923C 0%, #F97316 40%, #C2410C 100%); box-shadow: 0 18px 40px rgba(194, 65, 12, .28); }
.px-hero::before, .px-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.px-hero::before { width: 260px; height: 260px; right: -70px; top: -110px; }
.px-hero::after { width: 160px; height: 160px; right: 110px; bottom: -100px; background: rgba(255, 255, 255, .09); }
.px-hero > * { position: relative; z-index: 1; }
.px-hero .btn-light { color: var(--px-orange-700); font-weight: 700; border: 0; }
.px-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: .78rem; font-weight: 600; }
.px-stat { padding: 1.1rem 1.2rem; display: flex; gap: .9rem; align-items: center; }
.px-stat .ico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; }
.px-stat .label { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--px-muted); font-weight: 600; }
.px-stat .value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ico-orange { background: var(--px-orange-100); color: var(--px-orange-600); }
.ico-green { background: #DCFCE7; color: #15803D; }
.ico-red { background: #FEE2E2; color: #B91C1C; }
.ico-blue { background: #E0F2FE; color: #0369A1; }
.ico-amber { background: #FEF3C7; color: #B45309; }
.ico-violet { background: #EDE9FE; color: #6D28D9; }
.px-quick { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem .5rem; text-decoration: none; color: var(--px-ink); font-weight: 600; font-size: .85rem; border-radius: 1rem; border: 1px solid var(--px-line); background: #fff; transition: all .22s var(--px-ease); }
.px-quick i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--px-orange-100); color: var(--px-orange-600); transition: all .22s var(--px-ease); }
.px-quick:hover { transform: translateY(-4px); box-shadow: var(--px-shadow-lg); color: var(--px-orange-700); border-color: #FDBA74; }
.px-quick:hover i { background: var(--px-orange); color: #fff; transform: scale(1.08) rotate(-4deg); }
.px-section-title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.px-section-title::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: linear-gradient(var(--px-orange), #FBBF24); }

/* ---------- Animations ---------- */
.animate-fade-in { animation: pxFade .45s var(--px-ease) backwards; }
.px-stagger > * { animation: pxFade .5s var(--px-ease) backwards; }
.px-stagger > *:nth-child(2) { animation-delay: .05s; }
.px-stagger > *:nth-child(3) { animation-delay: .1s; }
.px-stagger > *:nth-child(4) { animation-delay: .15s; }
.px-stagger > *:nth-child(5) { animation-delay: .2s; }
.px-stagger > *:nth-child(6) { animation-delay: .25s; }
@keyframes pxFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pxPop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pxPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); } }
@keyframes pxRing { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(14deg); } 76% { transform: rotate(-12deg); } 84% { transform: rotate(8deg); } 92% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Alertes flash ---------- */
#alert-container { position: fixed; top: 76px; right: 16px; left: 16px; max-width: 420px; margin-left: auto; z-index: 1080; pointer-events: none; }
#alert-container .alert { pointer-events: auto; border-radius: 1rem; border: 1px solid transparent; animation: pxPop .3s var(--px-ease); }

.px-footer { border-top: 1px solid var(--px-line); background: rgba(255, 255, 255, .7); }

/* ---------- Mobile ---------- */
@media (max-width: 1199.98px) {
    .px-header .navbar-collapse { padding: .8rem 0; max-height: 78vh; overflow-y: auto; }
    .dropdown-menu { box-shadow: none; border: 0; background: var(--px-orange-50); }
    .px-hero { padding: 1.2rem; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
}

/* ---------- Impression (hors ticket) ---------- */
@media print {
    body { background: #fff !important; }
    .px-header, .px-footer, #alert-container, .px-reminder, .btn, nav { display: none !important; }
    .card { box-shadow: none !important; }
}

/* Barre de navigation : tient sur un écran 1200-1400 px sans déborder */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .px-header .nav-link i { display: none; }
    .px-header .nav-link { padding: .5rem .5rem !important; font-size: .84rem; }
    .px-header .px-user-label { max-width: 90px !important; }
}
.px-header .navbar-nav { flex-wrap: nowrap; }
html, body { max-width: 100%; overflow-x: clip; }

/* Modales avec <form> enveloppant en-tête/corps/pied : le corps défile, le bouton reste atteignable */
.modal-dialog-scrollable .modal-content > form {
    display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-dialog-scrollable .modal-content > form > .modal-footer { flex-shrink: 0; background: #fff; }
.modal-dialog-scrollable .modal-content > form > .modal-header { flex-shrink: 0; }
.modal-dialog-scrollable .modal-content { max-height: 100%; }
@media (max-width: 575.98px) { .modal-dialog-scrollable { height: calc(100% - 1rem); } .modal-dialog-scrollable .modal-content { max-height: 100%; } }

/* Équivalent en euros affiché à côté des prix FCFA */
.px-eur { color: var(--bs-secondary-color, #6c757d); font-weight: 500; font-size: .72rem; white-space: nowrap; margin-left: .25rem; }
.px-stat .value .px-eur { margin-left: 0; font-size: .7rem; }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }

/* Équivalent dans la devise choisie : masqué quand la devise est « FCFA seul » */
.px-cur:empty { display: none; }
.px-lang-select, .px-cur-select { max-width: 11rem; }


/* ---------- GOLD BRIDGE MARKET : touches d'or mêlées à l'orange ---------- */
.px-header { position: sticky; border-bottom: 0; box-shadow: 0 1px 0 var(--px-line); }
.px-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--px-gold-grad); }
.px-brand .logo { background: linear-gradient(135deg, #FFE58A, #F5B301 55%, #B8860B); color: #4A2F00; box-shadow: 0 6px 14px rgba(212, 160, 23, .38); }
.px-brand .logo svg { width: 24px; height: 24px; }
.px-brand .word b { background: var(--px-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.btn-primary { background-image: linear-gradient(135deg, #F97316 0%, #F59E0B 130%); }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(245, 158, 11, .38); }
.card { position: relative; }
.card.px-hover::before, .px-stat::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 2px; background: var(--px-gold-grad); opacity: .85; }
.px-hero { background: linear-gradient(125deg, #FB923C 0%, #F97316 38%, #E58A0B 72%, #C98A0E 100%); box-shadow: 0 18px 40px rgba(201, 138, 14, .28); }
.px-hero::before { background: rgba(250, 210, 90, .22); }
.px-hero::after { background: rgba(250, 210, 90, .16); }
.px-footer { border-top: 0; position: relative; }
.px-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--px-gold-grad); }
.modal-header { border-bottom: 1px solid var(--px-gold-100); }
.px-header .nav-link:hover, .px-header .nav-link.active { background: linear-gradient(90deg, var(--px-orange-100), var(--px-gold-100)); }
h3.text-primary, h4.text-primary { position: relative; }
@media (max-width: 575.98px) {
    .px-brand { font-size: .98rem !important; gap: .45rem; }
    .px-brand .logo { width: 32px; height: 32px; border-radius: 10px; }
    .px-brand .logo svg { width: 21px; height: 21px; }
}
@media (max-width: 359.98px) { .px-brand { font-size: .84rem !important; } }

/* ---- Touches d'argent : l'or reste la couleur principale, l'argent l'accompagne en reflets discrets ---- */
:root {
    --px-silver: #9AA3AF;
    --px-silver-300: #CBD2DA;
    --px-silver-100: #EEF1F4;
    --px-silver-50: #F7F8FA;
    --px-silver-grad: linear-gradient(90deg, #F1F3F6 0%, #B9C0C9 45%, #8E97A3 100%);
    --px-gold-silver-grad: linear-gradient(90deg, #F97316 0%, #F59E0B 38%, #D4A017 58%, #B9C0C9 82%, #8E97A3 100%);
}
.px-header::after { background: var(--px-gold-silver-grad); }
.px-brand .logo { box-shadow: 0 6px 14px rgba(212, 160, 23, .38), 0 0 0 2px #fff, 0 0 0 3.5px var(--px-silver-300); }
.px-section-title::before { background: linear-gradient(#F5B301, #B9C0C9); }
.table thead th, .table > :not(caption) > * > th { background: linear-gradient(180deg, #FFF7ED, var(--px-silver-100)); border-bottom-color: var(--px-silver-300); }
.card { border-color: #ECE6DF; box-shadow: 0 1px 2px rgba(71, 85, 105, .06), 0 8px 24px rgba(124, 45, 18, .06); }
.card-header, .modal-header, .modal-footer { border-color: var(--px-silver-100); }
.px-footer { border-top: 0; position: relative; }
.px-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--px-gold-silver-grad); }
.btn-outline-secondary, .btn-light { --bs-btn-border-color: var(--px-silver-300); }
.btn-outline-secondary:hover { background: var(--px-silver-grad); border-color: var(--px-silver); color: #1F2430; }
.px-quick { border-color: var(--px-silver-100); }
.px-quick:hover { border-color: var(--px-silver-300); }
.px-hero { background: linear-gradient(125deg, #FB923C 0%, #F97316 38%, #C2410C 100%); }
.px-hero::before { background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(203,210,218,.16)); }
.px-hero::after { background: rgba(203, 210, 218, .16); }
.badge.bg-secondary { background: linear-gradient(135deg, #B9C0C9, #8E97A3) !important; color: #fff; }

/* ---- Argent renforcé ---- */
:root { --px-silver-metal: linear-gradient(135deg, #F8FAFC 0%, #CBD2DA 30%, #9AA3AF 55%, #DDE2E8 78%, #AEB6C1 100%); }
body { background-image: linear-gradient(180deg, #F3F5F8 0, rgba(255, 251, 247, 0) 360px); background-attachment: scroll; }
.px-header { background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(235, 239, 243, .9)); }
.px-header::after { height: 3px; }
.px-brand .logo { box-shadow: 0 6px 14px rgba(212, 160, 23, .38), 0 0 0 2px #fff, 0 0 0 4px #AEB6C1; }
.nav-link.active, .px-header .nav-link:hover { background-image: linear-gradient(135deg, #FEF3C7, #E6EAEF); }
.card { background: linear-gradient(180deg, #fff 0%, #fff 70%, #F6F8FA 100%); border-color: #DDE2E8; background-clip: padding-box; }
.card::before { content: none; }
.px-section-title::before { width: 6px; background: linear-gradient(#F5B301 0%, #CBD2DA 55%, #8E97A3 100%); }
.table thead th, .table > :not(caption) > * > th { background: linear-gradient(180deg, #EEF1F4, #DCE1E7); color: #3B4252; border-bottom: 2px solid #AEB6C1; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #F1F4F7; }
.px-hero { box-shadow: 0 18px 40px rgba(194, 65, 12, .24), 0 0 0 1px rgba(203, 210, 218, .7); border-bottom: 6px solid #B9C0C9; }
.px-hero::before { background: linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(203, 210, 218, .26)); }
.px-hero::after { background: rgba(226, 232, 240, .24); }
.px-hero .btn-light { background: var(--px-silver-metal); color: #1F2430; }
.btn-outline-secondary, .btn-light { --bs-btn-border-color: #AEB6C1; }
.btn-outline-dark { --bs-btn-border-color: #9AA3AF; }
.px-quick { background: linear-gradient(180deg, #fff, #F1F4F7); border-color: #CBD2DA; }
.px-quick:hover { background: linear-gradient(180deg, #FEF3C7, #E6EAEF); border-color: #9AA3AF; }
.px-footer { background: linear-gradient(180deg, #EEF1F4, #DDE2E8); }
.px-footer::before { height: 4px; }
.form-control:focus, .form-select:focus { border-color: #F5B301; box-shadow: 0 0 0 .22rem rgba(154, 163, 175, .35); }
.dropdown-menu { border-color: #CBD2DA; }
.badge.bg-secondary { background: var(--px-silver-metal) !important; color: #1F2430; }

/* ===== Mobile : les tableaux deviennent des cartes (lisibles, boutons faciles à toucher) ===== */
@media screen and (max-width: 767.98px) {
    table.px-cards, table.px-cards tbody { display: block; width: 100%; }
    table.px-cards thead { display: none; }
    table.px-cards tfoot { display: none; }
    table.px-cards tbody tr {
        display: block; margin: 0 0 .75rem; padding: .35rem .75rem;
        background: #fff; border: 1px solid var(--px-line, #e5e7eb); border-radius: 14px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    }
    table.px-cards tbody td {
        display: flex; align-items: center; justify-content: space-between; gap: .75rem;
        padding: .45rem 0 !important; border: 0 !important; border-bottom: 1px dashed var(--px-line, #e5e7eb) !important;
        text-align: right !important; background: transparent !important; width: auto !important;
    }
    table.px-cards tbody td:last-child { border-bottom: 0 !important; }
    table.px-cards tbody td[data-label]::before {
        content: attr(data-label); flex: 0 0 38%; max-width: 38%; text-align: left;
        font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--px-muted, #6b7280);
    }
    table.px-cards tbody td.px-cell-actions { justify-content: flex-end; flex-wrap: wrap; gap: .5rem; padding-top: .7rem !important; }
    table.px-cards tbody td.px-cell-actions::before { display: none; }
    table.px-cards tbody td.px-cell-actions .btn,
    table.px-cards tbody td.px-cell-actions button,
    table.px-cards tbody td.px-cell-actions a.btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: .4rem .9rem; font-size: .95rem; }
    table.px-cards tbody td.px-cell-actions .btn { border: 1px solid var(--px-line, #e5e7eb) !important; background: #f8fafc !important; min-width: 48px; min-height: 48px; font-size: 1.1rem; border-radius: 12px; }
    table.px-cards tbody td[colspan] { display: block; text-align: center !important; border: 0 !important; }
    table.px-cards tbody td[colspan]::before { display: none; }
    table.px-cards tbody td.d-none, table.px-cards tbody td.d-md-table-cell, table.px-cards tbody td.d-lg-table-cell, table.px-cards tbody td.d-xl-table-cell { display: flex !important; }
    table.px-cards tbody td:empty { display: none !important; }
}

/* Lisibilité : pastilles du bandeau (texte blanc sur fond sombre translucide) et badges de taux */
.px-hero .px-chip { background: rgba(60, 20, 0, .45); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.badge.bg-success-subtle { background-color: #D1FADF !important; color: #05603A !important; }
.badge.bg-warning-subtle { background-color: #FEF0C7 !important; color: #7A2E0E !important; }
.badge.bg-danger-subtle { background-color: #FEE4E2 !important; color: #912018 !important; }

/* ---------- Thème sombre (activé par le bouton lune/soleil, choix gardé sur l'appareil) ---------- */
.px-theme-btn { border: 0; background: transparent; width: 42px; height: 42px; border-radius: 12px; color: #4B5563; font-size: 1.1rem; transition: background-color .15s; }
.px-theme-btn:hover { background: var(--px-orange-100); color: var(--px-orange-700); }
.px-theme-btn .bi-sun-fill { display: none; }

[data-bs-theme="dark"] {
    color-scheme: dark;
    --px-ink: #E8EAF0;
    --px-muted: #A3ABBA;
    --px-line: #333A4A;
    --px-cream: #12151C;
    --px-orange-50: #2A2018;
    --px-orange-100: #3A2A1B;
    --px-gold-100: #3A3016;
    --px-silver-100: #2A303C;
    --px-silver-300: #4A5263;
    --px-silver-50: #1B1F29;
    --px-shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --px-shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.5);
    --bs-body-color: #E8EAF0;
    --bs-body-bg: #12151C;
    --bs-border-color: #333A4A;
    --bs-link-color: #FDA45A;
    --bs-link-hover-color: #FDBA74;
    --bs-secondary-color: #A3ABBA;
}
[data-bs-theme="dark"] body {
    background:
        radial-gradient(900px 480px at 100% -10%, rgba(249, 115, 22, .10), transparent 60%),
        radial-gradient(700px 420px at -10% 0%, rgba(251, 191, 36, .06), transparent 55%),
        #12151C;
    background-attachment: fixed;
    color: var(--px-ink);
}
[data-bs-theme="dark"] .px-header { background: rgba(24, 28, 38, .88); }
[data-bs-theme="dark"] .px-brand { color: #F3F4F6 !important; }
[data-bs-theme="dark"] .px-header .nav-link,
[data-bs-theme="dark"] .px-bell,
[data-bs-theme="dark"] .px-theme-btn { color: #CBD2DA; }
[data-bs-theme="dark"] .px-header .nav-link:hover,
[data-bs-theme="dark"] .px-header .nav-link.active,
[data-bs-theme="dark"] .px-bell:hover,
[data-bs-theme="dark"] .px-theme-btn:hover { background: linear-gradient(90deg, #3A2A1B, #3A3016); color: #FDBA74; }
[data-bs-theme="dark"] .px-theme-btn .bi-moon-stars-fill { display: none; }
[data-bs-theme="dark"] .px-theme-btn .bi-sun-fill { display: inline; }
[data-bs-theme="dark"] .px-bell .dot { border-color: #181C26; }
[data-bs-theme="dark"] .navbar-toggler-icon { filter: invert(1); }

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .px-reminder,
[data-bs-theme="dark"] .accordion-item { background-color: #1B202B; border-color: #333A4A; color: var(--px-ink); }
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer { background: transparent; border-color: #333A4A; }
[data-bs-theme="dark"] .modal-dialog-scrollable .modal-content > form > .modal-footer { background: #1B202B; }
[data-bs-theme="dark"] .px-footer { background: rgba(24, 28, 38, .8); border-color: #333A4A; }
[data-bs-theme="dark"] .px-quick { background: #1B202B; border-color: #333A4A; color: var(--px-ink); }
[data-bs-theme="dark"] .px-alert-menu .head { background: #232937; border-color: #333A4A; }
[data-bs-theme="dark"] .px-alert-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus { background: #2A303C; color: #fff; }
[data-bs-theme="dark"] .dropdown-item { color: var(--px-ink); }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-link-color: #E8EAF0; --bs-dropdown-divider-bg: #333A4A; }
@media (max-width: 1199.98px) { [data-bs-theme="dark"] .dropdown-menu { background: #232937; } }

/* Tableaux */
[data-bs-theme="dark"] .table { --bs-table-color: var(--px-ink); --bs-table-hover-bg: #262C3A; --bs-table-hover-color: #fff; --bs-table-border-color: #333A4A; --bs-table-striped-bg: #1F2430; --bs-table-striped-color: var(--px-ink); }
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table > :not(caption) > * > th { background: linear-gradient(180deg, #2A2018, #2A303C); color: #FDBA74; border-bottom-color: #4A5263; }
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td { --bs-table-bg: #2A303C; --bs-table-color: var(--px-ink); }

/* Formulaires */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text { background-color: #12151C; border-color: #3A4152; color: var(--px-ink); }
[data-bs-theme="dark"] .form-control::placeholder { color: #7B8496; }
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] { background-color: #232937; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus { background-color: #161A23; border-color: #F97316; color: #fff; }
[data-bs-theme="dark"] .form-label { color: #CBD2DA; }
[data-bs-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd2da' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }

/* Couleurs « claires » codées en dur dans les pages */
[data-bs-theme="dark"] .bg-white { background-color: #1B202B !important; }
[data-bs-theme="dark"] .text-dark { color: #E8EAF0 !important; }
[data-bs-theme="dark"] .text-black { color: #F3F4F6 !important; }
[data-bs-theme="dark"] .text-secondary { color: #A3ABBA !important; }
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top { border-color: #333A4A !important; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #232937; --bs-btn-color: #E8EAF0; --bs-btn-border-color: #3A4152; --bs-btn-hover-bg: #2E3546; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #4A5263; }
[data-bs-theme="dark"] .px-hero .btn-light { --bs-btn-bg: #fff; --bs-btn-color: var(--px-orange-700); --bs-btn-hover-bg: #FFF1E0; --bs-btn-hover-color: var(--px-orange-700); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #CBD2DA; --bs-btn-border-color: #4A5263; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #2E3546; }
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #E8EAF0; --bs-btn-border-color: #5B6475; --bs-btn-hover-bg: #E8EAF0; --bs-btn-hover-color: #12151C; --bs-btn-active-bg: #E8EAF0; --bs-btn-active-color: #12151C; }
[data-bs-theme="dark"] .btn-dark { --bs-btn-bg: #F3F4F6; --bs-btn-color: #12151C; --bs-btn-border-color: #F3F4F6; --bs-btn-hover-bg: #fff; --bs-btn-hover-color: #12151C; --bs-btn-active-bg: #fff; --bs-btn-active-color: #12151C; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .page-link { background: #1B202B; border-color: #333A4A; color: #FDBA74; }
[data-bs-theme="dark"] .page-item.disabled .page-link { background: #161A23; color: #6B7280; }
[data-bs-theme="dark"] .page-item.active .page-link { background: var(--px-orange); color: #fff; }
[data-bs-theme="dark"] .nav-tabs { border-color: #333A4A; }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: #CBD2DA; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background: #1B202B; border-color: #333A4A #333A4A #1B202B; color: #FDBA74; }
[data-bs-theme="dark"] .nav-pills .nav-link { color: #FDBA74; }
[data-bs-theme="dark"] hr { border-color: #4A5263; opacity: .6; }

/* Pastilles et alertes (fonds pastel → fonds sombres teintés) */
[data-bs-theme="dark"] .alert-primary, [data-bs-theme="dark"] .alert-info { --bs-alert-bg: #2A2018; --bs-alert-border-color: #5A3A1B; --bs-alert-color: #FDBA74; }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: #12261B; --bs-alert-border-color: #1E5A3A; --bs-alert-color: #86EFAC; }
[data-bs-theme="dark"] .alert-warning { --bs-alert-bg: #2E2410; --bs-alert-border-color: #6B5214; --bs-alert-color: #FCD34D; }
[data-bs-theme="dark"] .alert-danger { --bs-alert-bg: #2E1517; --bs-alert-border-color: #7A2A2E; --bs-alert-color: #FCA5A5; }
[data-bs-theme="dark"] .ico-green { background: #12261B; color: #4ADE80; }
[data-bs-theme="dark"] .ico-red, [data-bs-theme="dark"] .ico-late { background: #2E1517; color: #F87171; }
[data-bs-theme="dark"] .ico-blue { background: #11263A; color: #38BDF8; }
[data-bs-theme="dark"] .ico-amber, [data-bs-theme="dark"] .ico-soon { background: #2E2410; color: #FBBF24; }
[data-bs-theme="dark"] .ico-violet { background: #231C3A; color: #A78BFA; }
[data-bs-theme="dark"] .badge.bg-success-subtle { background-color: #12261B !important; color: #86EFAC !important; }
[data-bs-theme="dark"] .badge.bg-warning-subtle { background-color: #2E2410 !important; color: #FCD34D !important; }
[data-bs-theme="dark"] .badge.bg-danger-subtle { background-color: #2E1517 !important; color: #FCA5A5 !important; }
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge.bg-light { background-color: #2A303C !important; color: #CBD2DA !important; border-color: #4A5263 !important; }
[data-bs-theme="dark"] .bg-primary-subtle { background-color: #3A2A1B !important; }
[data-bs-theme="dark"] .bg-success-subtle { background-color: #12261B !important; }
[data-bs-theme="dark"] .bg-warning-subtle { background-color: #2E2410 !important; }
[data-bs-theme="dark"] .bg-danger-subtle { background-color: #2E1517 !important; }
[data-bs-theme="dark"] .bg-info-subtle { background-color: #11263A !important; }
[data-bs-theme="dark"] .text-success-emphasis { color: #86EFAC !important; }
[data-bs-theme="dark"] .text-warning-emphasis { color: #FCD34D !important; }
[data-bs-theme="dark"] .text-danger-emphasis { color: #FCA5A5 !important; }
[data-bs-theme="dark"] .text-primary-emphasis { color: #FDBA74 !important; }
[data-bs-theme="dark"] .text-primary { color: #FDA45A !important; }

/* Bouton des sons : haut-parleur / haut-parleur barré */
.px-theme-btn .bi-volume-mute-fill { display: none; }
[data-px-sound="off"] .px-theme-btn .bi-volume-up-fill { display: none; }
[data-px-sound="off"] .px-theme-btn .bi-volume-mute-fill { display: inline; }
[data-bs-theme="dark"] .px-theme-btn .bi-moon-stars-fill { display: none; }
