/* =====================================================
   SHARED COMPONENTS — LogisticsMonitor
   Footer, Checkbox, Links, Bandeau, Toasts, Dialogs
   ===================================================== */

/* =====================================================
   LIENS
   ===================================================== */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--timing-fast) var(--ease-standard);
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* =====================================================
   NAVBAR PARTAGÉE
   ===================================================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg, 24px);
    height: 64px;
    display: flex;
    align-items: center;
    gap: var(--space-lg, 24px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
    flex-shrink: 0;
    text-decoration: none;
}

.nav-brand:hover { text-decoration: none; }

.nav-brand-icon-wrap {
    width: 36px;
    height: 36px;
    background: var(--color-accent-primary, #1976d2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-brand-icon { width: 20px; height: 20px; color: white; }

.nav-brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.nav-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.nav-brand-tagline {
    font-size: 11px;
    color: var(--color-text-tertiary);
    font-weight: 400;
}

/* Stats pills (peuplées dynamiquement par shared-nav.js) */
.nav-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md, 16px);
    flex: 1;
    justify-content: center;
}

.nav-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-primary);
    white-space: nowrap;
}

.nav-stat-success { border-color: rgba(26,127,55,0.2);  background: rgba(26,127,55,0.05); }
.nav-stat-warning { border-color: rgba(191,135,0,0.2);  background: rgba(191,135,0,0.05); }
.nav-stat-danger  { border-color: rgba(207,34,46,0.2);  background: rgba(207,34,46,0.05); }

.nav-stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-stat-dot-success { background: var(--color-status-operational, #1a7f37); }
.nav-stat-dot-warning { background: var(--color-status-degraded, #bf8700); animation: pulse-warning 2s infinite; }
.nav-stat-dot-danger  { background: var(--color-status-down, #cf222e);      animation: pulse-danger  2s infinite; }

.nav-stat-value { font-size: 15px; font-weight: 700; color: var(--color-text-primary); min-width: 16px; text-align: center; }
.nav-stat-label { font-size: 12px; color: var(--color-text-secondary); font-weight: 500; }
.nav-stat-divider { width: 1px; height: 20px; background: var(--color-border); flex-shrink: 0; }

/* Zone droite : lastUpdate + hamburger */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md, 16px);
    flex-shrink: 0;
}

.nav-last-update {
    font-size: var(--font-size-sm, 13px);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Bouton hamburger */
.nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-elevated);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background 150ms, color 150ms, border-color 150ms;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    background: var(--color-accent-primary);
    color: white;
    border-color: transparent;
}

.nav-hamburger svg { width: 18px; height: 18px; pointer-events: none; }

/* Drawer menu */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100%;
    background: var(--color-bg-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 240ms cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
}

.nav-drawer.open { transform: translateX(0); }

.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.32);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms;
}

.nav-drawer-overlay.open { opacity: 1; pointer-events: all; }

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.nav-drawer-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 6px;
    transition: background 150ms, color 150ms;
}

.nav-drawer-close:hover { background: var(--color-bg-primary); color: var(--color-text-primary); }
.nav-drawer-close svg { width: 16px; height: 16px; }

.nav-drawer-body { padding: 12px; flex: 1; }

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 150ms, color 150ms;
    margin-bottom: 2px;
}

.nav-drawer-link:hover {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    text-decoration: none;
}

.nav-drawer-link.active {
    background: rgba(79,110,247,0.08);
    color: var(--color-accent-primary);
}

.nav-drawer-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Stats mini dans le drawer (mobile) */
.nav-drawer-stats {
    padding: 12px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    flex-shrink: 0;
}

.nav-drawer-stats-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: 10px;
    padding: 0 4px;
}

.nav-drawer-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 13px;
}

.nav-drawer-stat-row .nav-stat-dot { width: 9px; height: 9px; }
.nav-drawer-stat-label { color: var(--color-text-secondary); flex: 1; }
.nav-drawer-stat-value { font-weight: 700; color: var(--color-text-primary); min-width: 20px; text-align: right; }

/* =====================================================
   FOOTER PARTAGÉ
   ===================================================== */
.site-footer {
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
    padding: 20px 24px;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 150ms;
}

.footer-links a:hover {
    color: var(--color-accent-primary);
    text-decoration: none;
}

.footer-separator { color: var(--color-border); user-select: none; }

.footer-text { color: var(--color-text-tertiary); font-size: 13px; padding: 4px 0; }

.footer-icon { width: 13px; height: 13px; flex-shrink: 0; }

/* =====================================================
   CHECKBOX CUSTOM — SYSTÈME GLOBAL
   ===================================================== */

/* ── Checkbox custom partagée ─────────────────────────────
   Utilisée seule (.checkbox-field) ou dans une card (.checkbox-card)
   ──────────────────────────────────────────────────────── */

/* Boîte de la checkbox */
input[type="checkbox"].cb,
.checkbox-field  input[type="checkbox"],
.checkbox-card   input[type="checkbox"],
.form-check      input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid var(--color-border-hover);
    border-radius: 5px;
    background: var(--color-bg-surface);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition:
        border-color 150ms ease,
        background   150ms ease,
        box-shadow   150ms ease;
}

/* Hover */
input[type="checkbox"].cb:hover,
.checkbox-field  input[type="checkbox"]:hover,
.checkbox-card   input[type="checkbox"]:hover,
.form-check      input[type="checkbox"]:hover {
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.10);
}

/* Coché */
input[type="checkbox"].cb:checked,
.checkbox-field  input[type="checkbox"]:checked,
.checkbox-card   input[type="checkbox"]:checked,
.form-check      input[type="checkbox"]:checked {
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    box-shadow: 0 1px 4px rgba(9, 105, 218, 0.30);
}

/* Coche SVG animée via clip-path */
input[type="checkbox"].cb::after,
.checkbox-field  input[type="checkbox"]::after,
.checkbox-card   input[type="checkbox"]::after,
.form-check      input[type="checkbox"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpolyline points='3.5,9 7.5,13 14.5,5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 120ms ease, transform 150ms ease;
}

input[type="checkbox"].cb:checked::after,
.checkbox-field  input[type="checkbox"]:checked::after,
.checkbox-card   input[type="checkbox"]:checked::after,
.form-check      input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: scale(1);
}

/* Focus clavier */
input[type="checkbox"].cb:focus-visible,
.checkbox-field  input[type="checkbox"]:focus-visible,
.checkbox-card   input[type="checkbox"]:focus-visible,
.form-check      input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(9, 105, 218, 0.18);
}

/* ── Conteneur inline ──────────────────────────────────── */
.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

.checkbox-label strong {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.checkbox-label span,
.checkbox-label small {
    font-size: 12px;
    color: var(--color-text-tertiary);
    line-height: 1.45;
}

/* ── Version card (fond encadré) ──────────────────────── */
.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    background: var(--color-bg-primary);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition:
        border-color 160ms ease,
        background   160ms ease,
        box-shadow   160ms ease;
}

.checkbox-card:hover {
    border-color: var(--color-accent-primary);
    background: rgba(9, 105, 218, 0.03);
    box-shadow: 0 2px 8px rgba(9, 105, 218, 0.07);
}

/* Card cochée : fond teinté + bordure bleue */
.checkbox-card:has(input[type="checkbox"]:checked) {
    border-color: var(--color-accent-primary);
    background: rgba(9, 105, 218, 0.06);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.10);
}

/* Alignement vertical de la checkbox dans la card */
.checkbox-card input[type="checkbox"] {
    margin-top: 1px;
}

/* =====================================================
   POPUP D'ANNONCE — animations décoratives optionnelles
   Le popup utilise .toast-new-content (dashboard.css) pour
   tout le reste (position, taille, couleurs, dark mode).
   Les classes sont préfixées announcement- pour ne pas
   interférer avec les animations du toast de rafraîchissement.
   ===================================================== */

@keyframes announcement-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.72; }
}
@keyframes announcement-glow {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06); }
    50%       { box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06), 0 0 24px rgba(79,110,247,0.4); }
}
@keyframes announcement-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    35%       { transform: translateX(-50%) translateY(-6px); }
    65%       { transform: translateX(-50%) translateY(-2px); }
}
@keyframes announcement-shake {
    0%, 100% { transform: translateX(-50%); }
    15%       { transform: translateX(calc(-50% - 5px)); }
    30%       { transform: translateX(calc(-50% + 5px)); }
    45%       { transform: translateX(calc(-50% - 3px)); }
    60%       { transform: translateX(calc(-50% + 3px)); }
    75%       { transform: translateX(calc(-50% - 1px)); }
}
@keyframes announcement-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes announcement-blink {
    0%, 100% { border-right-color: currentColor; }
    50%       { border-right-color: transparent; }
}

#announcementBanner.announcement-pulse  { animation: toast-in 0.3s var(--ease-standard) both, announcement-pulse  2.8s ease-in-out 0.3s infinite; }
#announcementBanner.announcement-glow   { animation: toast-in 0.3s var(--ease-standard) both, announcement-glow   2.5s ease-in-out 0.3s infinite; }
#announcementBanner.announcement-bounce { animation: toast-in 0.3s var(--ease-standard) both, announcement-bounce 2s   ease-in-out 0.5s infinite; }
#announcementBanner.announcement-shake  { animation: toast-in 0.3s var(--ease-standard) both, announcement-shake  0.6s ease-in-out 0.4s 2; }
#announcementBanner.announcement-spin .toast-icon svg { animation: announcement-spin 2s linear infinite; }
#announcementBanner.announcement-typewriter .toast-title {
    border-right: 2px solid currentColor;
    animation: announcement-blink 0.8s step-end infinite;
    padding-right: 3px;
}

/* Animations sur la carte annonce (bounce/shake sans translateX car la carte est en flux normal) */
@keyframes announcement-card-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes announcement-card-shake  { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

#announcementCard.announcement-pulse  { animation: announcement-pulse  2.8s ease-in-out infinite; }
#announcementCard.announcement-glow   { animation: announcement-glow   2.5s ease-in-out infinite; }
#announcementCard.announcement-bounce { animation: announcement-card-bounce 2s ease-in-out infinite; }
#announcementCard.announcement-shake  { animation: announcement-card-shake  0.6s ease-in-out 2; }
#announcementCard.announcement-spin .announcement-card-icon svg { animation: announcement-spin 2s linear infinite; }

@media (prefers-reduced-motion: reduce) {
    #announcementBanner { animation: none !important; }
    #announcementBanner .toast-icon svg { animation: none !important; }
    #announcementBanner .toast-title { animation: none !important; border-right: none !important; }
    #announcementCard { animation: none !important; }
    #announcementCard .announcement-card-icon svg { animation: none !important; }
}

/* =====================================================
   TOAST NOTIFICATIONS — SYSTÈME ADMIN
   ===================================================== */
@keyframes notif-slide-in  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes notif-slide-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 340px;
    width: 100%;
}

.notifications-container > * { pointer-events: all; }

/* Toast item */
.notif-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    animation: notif-slide-in 0.28s var(--ease-standard);
    min-width: 260px;
}

.notif-toast.hiding { animation: notif-slide-out 0.22s ease forwards; }

.notif-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
}

.notif-icon-wrap svg { width: 15px; height: 15px; }

.notif-toast.type-success .notif-icon-wrap { background: rgba(26,127,55,0.1); color: #166534; }
.notif-toast.type-error   .notif-icon-wrap { background: rgba(207,34,46,0.1); color: #991b1b; }
.notif-toast.type-warning .notif-icon-wrap { background: rgba(191,135,0,0.1); color: #854d0e; }
.notif-toast.type-info    .notif-icon-wrap { background: rgba(9,105,218,0.1); color: var(--color-accent-primary); }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); line-height: 1.35; }
.notif-msg   { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; line-height: 1.4; }

.notif-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: background var(--timing-fast), color var(--timing-fast);
    flex-shrink: 0;
}

.notif-close:hover { background: var(--color-bg-primary); color: var(--color-text-primary); }

/* =====================================================
   CUSTOM DIALOGS — ALERT / CONFIRM / PROMPT
   ===================================================== */
@keyframes dialog-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-scale-in   { from { transform: scale(0.93) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes dialog-out         { from { opacity: 1; } to { opacity: 0; } }

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: dialog-overlay-in 0.18s ease;
    padding: 16px;
}

.dialog-overlay.closing { animation: dialog-out 0.18s ease forwards; }

.dialog-box {
    background: var(--color-bg-surface);
    border-radius: 16px;
    padding: 26px 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    border: 1px solid var(--color-border);
    animation: dialog-scale-in 0.22s var(--ease-standard);
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
}

.dialog-icon svg { width: 17px; height: 17px; }

.dialog-icon.type-success { background: rgba(26,127,55,0.1); color: #166534; }
.dialog-icon.type-error   { background: rgba(207,34,46,0.1); color: #991b1b; }
.dialog-icon.type-warning { background: rgba(191,135,0,0.1); color: #854d0e; }
.dialog-icon.type-info    { background: rgba(9,105,218,0.1); color: var(--color-accent-primary); }
.dialog-icon.type-confirm { background: rgba(9,105,218,0.08); color: var(--color-accent-primary); }
.dialog-icon.type-danger  { background: rgba(207,34,46,0.1); color: #991b1b; }
.dialog-icon.type-prompt  { background: rgba(9,105,218,0.08); color: var(--color-accent-primary); }

.dialog-title {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.dialog-message {
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.dialog-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 13px;
    box-sizing: border-box;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    transition: border-color var(--timing-fast), box-shadow var(--timing-fast);
}

.dialog-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background var(--timing-fast), transform var(--timing-fast), box-shadow var(--timing-fast);
    font-family: var(--font-family);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dialog-btn:active { transform: scale(0.97); }
.dialog-btn:hover  { transform: translateY(-1px); }

.dialog-btn-primary {
    background: var(--color-accent-primary);
    color: white;
    border-color: var(--color-accent-primary);
}
.dialog-btn-primary:hover { background: var(--color-accent-primary-hover); box-shadow: var(--shadow-sm); }

.dialog-btn-secondary {
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}
.dialog-btn-secondary:hover { background: var(--color-bg-elevated); color: var(--color-text-primary); box-shadow: var(--shadow-xs); }

.dialog-btn-danger {
    background: var(--color-accent-danger);
    color: white;
    border-color: var(--color-accent-danger);
}
.dialog-btn-danger:hover { background: var(--color-accent-danger-hover); box-shadow: var(--shadow-sm); }

.dialog-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* =====================================================
   DARK MODE
   ===================================================== */
@media (prefers-color-scheme: dark) {
    .site-footer { background: var(--color-bg-surface); border-color: var(--color-border); }
    .footer-links a:hover { background: var(--color-bg-elevated); }

    .checkbox-field input[type="checkbox"],
    .checkbox-card  input[type="checkbox"],
    .form-check     input[type="checkbox"] {
        background: var(--color-bg-elevated);
        border-color: var(--color-border-hover);
    }

    .notif-toast { background: var(--color-bg-surface); border-color: var(--color-border); }

    .dialog-box { background: var(--color-bg-surface); border-color: var(--color-border); }
    .dialog-input { background: var(--color-bg-primary); color: var(--color-text-primary); border-color: var(--color-border); }

    .dialog-btn-secondary { background: var(--color-bg-elevated); border-color: var(--color-border); }
}

/* =====================================================
   BUG REPORT — Bouton flottant + Modal
   ===================================================== */
.bug-report-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 40px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: background var(--timing-fast) var(--ease-standard),
                color var(--timing-fast) var(--ease-standard),
                box-shadow var(--timing-fast) var(--ease-standard),
                transform var(--timing-fast) var(--ease-standard);
}

.bug-report-fab:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    box-shadow: 0 6px 20px rgba(0,0,0,0.16);
    transform: translateY(-2px);
}

.bug-report-fab svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.bug-report-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 24px 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-standard);
}

.bug-report-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.bug-report-modal {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 24px;
    transform: translateY(16px);
    transition: transform 0.2s var(--ease-standard);
}

.bug-report-modal-overlay.open .bug-report-modal {
    transform: translateY(0);
}

.bug-report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bug-report-modal-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bug-report-modal-title svg {
    width: 18px;
    height: 18px;
    color: var(--color-accent-primary);
}

.bug-report-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: color var(--timing-fast), background var(--timing-fast);
}

.bug-report-modal-close:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
}

.bug-report-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bug-report-field label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bug-report-field input,
.bug-report-field textarea,
.bug-report-field select {
    width: 100%;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    padding: 8px 12px;
    box-sizing: border-box;
    transition: border-color var(--timing-fast);
    outline: none;
}

.bug-report-field input:focus,
.bug-report-field textarea:focus,
.bug-report-field select:focus {
    border-color: var(--color-accent-primary);
}

.bug-report-field textarea {
    resize: vertical;
    min-height: 90px;
    max-height: 200px;
}

.bug-report-page-badge {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bug-report-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background var(--timing-fast), transform var(--timing-fast);
    margin-top: 4px;
}

.bug-report-submit:hover:not(:disabled) {
    background: var(--color-accent-primary-hover);
    transform: translateY(-1px);
}

.bug-report-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bug-report-success {
    text-align: center;
    padding: 16px 0 4px;
    color: var(--color-success);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
    .notifications-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .dialog-box { padding: 20px; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-btn { width: 100%; justify-content: center; }
}
