/* ════════════════════════════════════════════════
   App Shell — Layout "Obsidian Command"
   Technique : data-bs-theme="dark" sur <aside>
   → Bootstrap fournit toutes les variables couleur,
     zéro valeur codée en dur.
   ════════════════════════════════════════════════ */

/* ── Typographie globale ────────────────────── */
body {
    font-family: 'Outfit', sans-serif;
}

/* ── Body lock quand app-shell présent ─────── */
body:has(.app-shell) {
    overflow: hidden;
    height: 100vh;       /* fallback navigateurs anciens */
    height: 100dvh;      /* override moderne — respecte la barre d'adresse mobile */
}

/* ── Shell ──────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ── Sidebar (base) ─────────────────────────── */
.app-sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Desktop : largeur fixe + fond opaque
   (offcanvas-lg force background:transparent sur ≥992px) */
@media (min-width: 992px) {
    .app-sidebar {
        width: 240px !important;
        background-color: var(--bs-body-bg) !important;
        border-right: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
    }
}

/* ── Brand ──────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem 1rem;
    flex-shrink: 0;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--bs-primary);
}

.sidebar-brand-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(var(--bs-body-color-rgb), 0.9);
    letter-spacing: -0.01em;
}

/* ── Icônes sidebar ─────────────────────────── */
.sidebar-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Navigation ─────────────────────────────── */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem;
    gap: 0.125rem;
}

.sidebar-section-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(var(--bs-body-color-rgb), 0.3);
    padding: 1rem 0.5rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.625rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 450;
    color: rgba(var(--bs-body-color-rgb), 0.65);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sidebar-link:hover {
    color: rgba(var(--bs-body-color-rgb), 1);
    background-color: rgba(var(--bs-body-color-rgb), 0.05);
}

.sidebar-link.active {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    font-weight: 500;
}

.sidebar-link--danger {
    color: rgba(var(--bs-danger-rgb), 0.7) !important;
}

.sidebar-link--danger:hover {
    color: var(--bs-danger) !important;
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

/* ── Footer utilisateur ─────────────────────── */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.125rem;
    border-top: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
    margin-top: auto;
}

.sidebar-user-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(var(--bs-body-color-rgb), 0.9);
    padding: 0.25rem 0.625rem 0.375rem;
}

/* ── Bouton hamburger mobile ─────────────────── */
.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(var(--bs-body-color-rgb), 0.15);
    border-radius: 6px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0;
}

.mobile-menu-btn:hover {
    background-color: rgba(var(--bs-body-color-rgb), 0.07);
}

/* ── Contenu principal ──────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 2rem;
}

@media (max-width: 991.98px) {
    .main-content {
        padding: 1rem 1rem 1rem 1rem;
        padding-top: 4rem; /* espace pour le hamburger fixe */
    }
}

/* ── Brand header (layout externe / login) ─── */
.brand-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.75rem; }
.brand-horse-icon { width: 36px; height: 36px; color: var(--bs-primary); }
.brand-header-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--bs-body-color); }

/* ── Layout externe — dvh fix mobile ──────── */
@supports (min-height: 100dvh) {
    .min-vh-100 {
        min-height: 100dvh !important;
    }
}
