/* ======================================================================
   BHD Tuning Files — V5 — Styles globaux
   Se charge APRÈS Tailwind CDN pour overrider/enrichir.
   ====================================================================== */

:root {
    --bhd-primary:      #3b82f6;
    --bhd-primary-dark: #2563eb;
    --bhd-success:      #10b981;
    --bhd-warn:         #f59e0b;
    --bhd-danger:       #ef4444;
    --bhd-purple:       #8b5cf6;
    --bhd-darkbg:       #0f172a;
    --bhd-card:         #1e293b;
    --bhd-card-hover:   #263549;
    --bhd-border:       #334155;
    --bhd-border-soft:  #1e293b;
    --bhd-text:         #e2e8f0;
    --bhd-text-dim:     #94a3b8;
    --bhd-text-mute:    #64748b;

    --bhd-radius-sm: 0.5rem;
    --bhd-radius:    0.75rem;
    --bhd-radius-lg: 1rem;

    --bhd-shadow-sm: 0 1px 2px rgba(0,0,0,.25);
    --bhd-shadow:    0 4px 12px rgba(0,0,0,.35);
    --bhd-shadow-lg: 0 10px 30px rgba(0,0,0,.4);

    --bhd-t-fast: 120ms;
    --bhd-t:      200ms;
    --bhd-t-slow: 350ms;
}

/* --- Scrollbar custom --- */
.custom-scrollbar::-webkit-scrollbar,
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.02); }
*::-webkit-scrollbar-thumb { background: #334155; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Focus ring accessibilité --- */
:where(button, a, input, textarea, select):focus-visible {
    outline: 2px solid var(--bhd-primary);
    outline-offset: 2px;
}

/* --- Skeleton loading --- */
.bhd-skeleton {
    background: linear-gradient(90deg, #1e293b 0%, #263549 50%, #1e293b 100%);
    background-size: 200% 100%;
    animation: bhd-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--bhd-radius-sm);
}
@keyframes bhd-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Card hover --- */
.bhd-card { background: var(--bhd-card); border: 1px solid var(--bhd-border); border-radius: var(--bhd-radius); transition: border-color var(--bhd-t), background var(--bhd-t); }
.bhd-card:hover { border-color: var(--bhd-primary); }

/* --- Badge status --- */
.bhd-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; border: 1px solid transparent; }
.bhd-badge--ok     { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.3); }
.bhd-badge--warn   { background: rgba(245,158,11,.15); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.bhd-badge--danger { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.bhd-badge--info   { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.bhd-badge--purple { background: rgba(139,92,246,.15); color: #c4b5fd; border-color: rgba(139,92,246,.3); }

/* --- Toast container (alimenté par toast.js) --- */
#bhd-toast-container {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}
.bhd-toast {
    pointer-events: auto;
    min-width: 280px; max-width: 380px;
    padding: 0.875rem 1rem;
    border-radius: var(--bhd-radius);
    background: var(--bhd-card);
    border: 1px solid var(--bhd-border);
    color: var(--bhd-text);
    box-shadow: var(--bhd-shadow-lg);
    display: flex; align-items: flex-start; gap: 0.625rem;
    opacity: 0; transform: translateX(24px);
    transition: all var(--bhd-t) cubic-bezier(.2,.9,.3,1.3);
    font-size: 0.9rem;
}
.bhd-toast.is-visible { opacity: 1; transform: translateX(0); }
.bhd-toast.is-leaving { opacity: 0; transform: translateX(24px); }
.bhd-toast__icon { flex: 0 0 auto; font-size: 1.05rem; margin-top: 0.125rem; }
.bhd-toast__body { flex: 1; }
.bhd-toast__title { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.15rem; }
.bhd-toast__message { font-size: 0.8125rem; color: var(--bhd-text-dim); line-height: 1.4; }
.bhd-toast__close { flex: 0 0 auto; background: none; border: 0; color: var(--bhd-text-mute); cursor: pointer; font-size: 0.9rem; padding: 2px 4px; }
.bhd-toast__close:hover { color: var(--bhd-text); }
.bhd-toast--success { border-left: 3px solid var(--bhd-success); }
.bhd-toast--success .bhd-toast__icon { color: var(--bhd-success); }
.bhd-toast--error { border-left: 3px solid var(--bhd-danger); }
.bhd-toast--error .bhd-toast__icon { color: var(--bhd-danger); }
.bhd-toast--warn { border-left: 3px solid var(--bhd-warn); }
.bhd-toast--warn .bhd-toast__icon { color: var(--bhd-warn); }
.bhd-toast--info { border-left: 3px solid var(--bhd-primary); }
.bhd-toast--info .bhd-toast__icon { color: var(--bhd-primary); }

/* --- Admin bottom nav — MOBILE UNIQUEMENT --- */
/* Cachée par défaut, affichée seulement en < 768px (mobile) */
#bhd-admin-bottom-nav {
    display: none !important; /* caché par défaut desktop */
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 60;
    justify-content: space-around; align-items: center;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--bhd-border);
    padding: 0.5rem 0.25rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}
#bhd-admin-bottom-nav a {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 0.15rem;
    color: var(--bhd-text-dim);
    font-size: 0.65rem; font-weight: 600;
    padding: 0.5rem 0.25rem;
    border-radius: var(--bhd-radius-sm);
    transition: color var(--bhd-t), background var(--bhd-t);
    min-height: 50px;
    text-decoration: none;
}
#bhd-admin-bottom-nav a:hover,
#bhd-admin-bottom-nav a.is-active { color: var(--bhd-primary); }
#bhd-admin-bottom-nav a.is-active { background: rgba(59, 130, 246, 0.1); }
#bhd-admin-bottom-nav i { font-size: 1.1rem; }
/* Affichage uniquement sur mobile */
@media (max-width: 767.98px) {
    #bhd-admin-bottom-nav { display: flex !important; }
}

/* --- Buttons helper --- */
.bhd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1rem; border-radius: var(--bhd-radius); font-weight: 700; font-size: 0.875rem; transition: all var(--bhd-t); cursor: pointer; border: 0; }
.bhd-btn--primary { background: var(--bhd-primary); color: #fff; }
.bhd-btn--primary:hover { background: var(--bhd-primary-dark); }
.bhd-btn--danger  { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.bhd-btn--danger:hover { background: var(--bhd-danger); color: #fff; }

/* --- Utilitaire no-click pendant loading --- */
.bhd-is-loading { pointer-events: none; opacity: 0.6; }
