/* Styles globaux extraits de base.html (light mode, mobile-first) */

/* Optimisations PWA Mobile */
:root {
    --app-bg: #f3f6fb;
    --app-surface: #ffffff;
    --app-border: #dbe4ee;
    --app-text: #142236;
    --app-muted: #64748b;
    --app-accent: #2fa55a;
    --app-accent-strong: #228446;
    --app-font: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);
}

/* Style global pour mobile */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #f9fcff 0%, var(--app-bg) 55%);
    color: var(--app-text);
    font-family: var(--app-font);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Mode PWA standalone - Interface immersive */
@media screen and (display-mode: standalone) {
    body {
        padding-top: var(--safe-area-inset-top);
        padding-bottom: var(--safe-area-inset-bottom);
        padding-left: var(--safe-area-inset-left);
        padding-right: var(--safe-area-inset-right);
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }
    html { background-color: #ffffff; }
    .container { padding-top: 0; margin-top: 0; }
}

/* Détection iOS spécifique */
@supports (-webkit-touch-callout: none) {
    @media screen and (display-mode: standalone) {
        body { background: #ffffff; padding-top: 0; }
        .container { padding-top: 10px; }
    }
}

/* Container principal optimisé mobile */
.container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

/* Optimisations pour petits écrans */
@media (max-width: 576px) {
    .container { padding-left: 10px !important; padding-right: 10px !important; }
    h1 { font-size: 1.5rem !important; margin-bottom: 1rem !important; }
    h2 { font-size: 1.3rem !important; }
    .btn { padding: 12px 20px; font-size: 16px; border-radius: 8px; }
    .card { border-radius: 12px; margin-bottom: 1rem; }
    .card-body { padding: 1rem; }
    .table-responsive { border: none; }
    .table { font-size: 0.9rem; }
}

/* Améliorer les interactions tactiles */
.btn, .card {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Style glassmorphisme amélioré pour mobile */
.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

/* Optimiser les inputs pour mobile */
input, textarea, select {
    font-size: 16px !important; /* Évite le zoom automatique iOS */
    border-radius: 8px;
}

/* Navigation mobile */
@media (max-width: 768px) {
    .navbar-nav { text-align: center; }
    .navbar-nav .nav-link { padding: 12px 20px; font-size: 16px; }
}

/* Navbar accueil unifiée (référence globale V2) */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
}

/* Shell navigation */
.app-menu-btn {
    border: 1px solid rgba(62, 182, 90, 0.25);
    color: #2a9040;
    background: rgba(62, 182, 90, 0.08);
}

.app-menu-btn:hover {
    background: rgba(62, 182, 90, 0.15);
    color: #2a9040;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1035;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.98) 100%);
    border-right: 1px solid var(--app-border);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.06);
    padding: 0.85rem 0.85rem 0.75rem;
    flex-direction: column;
}

.app-sidebar-header {
    padding: 0.25rem 0.45rem 0.85rem;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 0.75rem;
}

.app-sidebar-nav {
    display: grid;
    gap: 0.45rem;
    overflow-y: auto;
    padding-right: 0.2rem;
    flex: 1 1 auto;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--app-text);
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.app-nav-link i {
    width: 16px;
    text-align: center;
}

.app-nav-link:hover {
    background: rgba(47, 165, 90, 0.1);
    color: var(--app-accent-strong);
}

.app-nav-link.active {
    background: var(--app-accent);
    color: #fff;
    border-color: var(--app-accent);
    box-shadow: 0 8px 18px rgba(47, 165, 90, 0.22);
}

.app-nav-group {
    border: 1px solid rgba(219, 228, 238, 0.65);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.app-nav-group summary {
    cursor: pointer;
    list-style: none;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    color: var(--app-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.app-nav-group summary::-webkit-details-marker {
    display: none;
}

.app-nav-group > summary::marker {
    display: none;
    content: "";
}

.app-nav-group > summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    font-size: 0.72rem;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
}

.app-nav-group[open] > summary::after {
    transform: rotate(180deg);
}

.app-nav-group:hover,
.app-nav-group[open],
.app-nav-group.is-active {
    border-color: rgba(47, 165, 90, 0.35);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.app-nav-group:hover summary,
.app-nav-group[open] summary,
.app-nav-group.is-active summary {
    color: var(--app-accent-strong);
}

.app-nav-group:hover > summary::after,
.app-nav-group[open] > summary::after,
.app-nav-group.is-active > summary::after {
    color: var(--app-accent-strong);
}

.app-nav-submenu {
    display: grid;
    gap: 0.25rem;
    padding: 0.05rem 0.55rem 0.55rem 2rem;
}

.app-nav-submenu a {
    text-decoration: none;
    color: var(--app-muted);
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    font-size: 0.89rem;
    font-weight: 600;
}

.app-nav-submenu a:hover {
    background: rgba(47, 165, 90, 0.1);
    color: var(--app-accent-strong);
}

.app-nav-submenu a.active {
    background: rgba(47, 165, 90, 0.13);
    color: var(--app-accent-strong);
}

.app-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid #edf2f7;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.app-logout-link {
    margin-left: auto;
    font-size: 0.9rem;
    white-space: nowrap;
}

.app-mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    min-height: 62px;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-mobile-brand {
    display: inline-flex;
    align-items: center;
}

.app-icon-btn {
    border: 1px solid rgba(62, 182, 90, 0.2);
    background: #fff;
    color: #2a9040;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-mobile-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1039;
    background: #ffffff;
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
    padding: 0.2rem 0.2rem calc(0.2rem + var(--safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 64px;
}

.app-mobile-bottomnav a,
.app-mobile-bottomnav .app-mobile-bottomnav-btn {
    text-decoration: none;
    color: #6b7280;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.22rem 0.05rem;
    border: 0;
    background: transparent;
    appearance: none;
    font-family: inherit;
    line-height: 1.1;
    min-width: 0;
}

.app-mobile-bottomnav a i,
.app-mobile-bottomnav .app-mobile-bottomnav-btn i {
    font-size: 1rem;
}

.app-mobile-bottomnav a span,
.app-mobile-bottomnav .app-mobile-bottomnav-btn span {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.app-mobile-bottomnav a.active,
.app-mobile-bottomnav .app-mobile-bottomnav-btn.active {
    color: var(--app-accent);
    font-weight: 600;
}

.navbar-glass .navbar-brand {
    padding: 0;
}

.navbar-glass .nav-link {
    color: #333;
    margin: 0 3px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    font-size: 0.95rem;
}

.navbar-glass .nav-link i {
    margin-right: 8px;
    font-size: 1rem;
    opacity: 0.8;
}

.navbar-glass .nav-link:hover {
    background-color: rgba(62, 182, 90, 0.08);
    transform: translateY(-1px);
}

.navbar-glass .nav-link.active {
    background-color: #3eb65a;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(62, 182, 90, 0.2);
}

.navbar-glass .nav-link.active i {
    opacity: 1;
}

.nav-eye {
    background: #ffffff;
    border: 1px solid rgba(62, 182, 90, 0.2);
    color: #2a9040;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.nav-eye:hover {
    background: rgba(62, 182, 90, 0.15);
    color: #2a9040;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(47, 165, 90, 0.15);
}

.nav-eye.active {
    background-color: #3eb65a;
    color: white;
}

#notificationsBadge {
    font-size: 0.6rem;
    min-width: 1rem;
    height: 1rem;
    line-height: 1rem;
    padding: 0;
}

.app-content-with-navbar {
    margin-top: 0;
    margin-left: 280px;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 1.2rem 1.2rem 1rem;
    box-sizing: border-box;
}

.app-main-shell {
    min-width: 0;
}

.app-desktop-shell {
    display: flex;
}

.app-mobile-shell {
    display: none;
}

@media (max-width: 991.98px) {
    .app-desktop-shell {
        display: none;
    }

    .app-mobile-shell {
        display: block !important;
    }

    .app-content-with-navbar {
        margin-top: 0;
        margin-left: 0;
        width: auto;
        max-width: none;
        min-width: 0;
        padding: 0.8rem 0 5rem;
        box-sizing: border-box;
    }
}

/* PWA App-like behavior - Force global pour iOS */
html {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overscroll-behavior: none; /* Empêche le bounce scroll */
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body.app-shell {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Permettre la sélection sur les inputs */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

* {
    -webkit-tap-highlight-color: transparent; /* Supprime le highlight au tap */
    -webkit-touch-callout: none; /* Désactive le menu contextuel iOS */
}

/* Force touch-action sur TOUS les éléments interactifs */
button, a, .btn, .clickable, input, select, textarea {
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Empêcher le zoom automatique sur TOUS les inputs */
input[type="text"], 
input[type="number"], 
input[type="email"], 
input[type="password"], 
input[type="tel"],
input[type="url"],
input[type="search"],
textarea, 
select {
    font-size: 16px !important; /* Force 16px pour éviter le zoom iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Styles PWA spécifiques */
.pwa-mode {
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.pwa-mode .container {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   NAV V2 (mobile-first)
   ========================= */
:root {
    --nav2-primary: #22C55E;
    --nav2-primary-dark: #16A34A;
    --nav2-primary-light: #DCFCE7;
    --nav2-primary-surface: #F0FDF4;
    --nav2-neutral-900: #111827;
    --nav2-neutral-700: #374151;
    --nav2-neutral-500: #6B7280;
    --nav2-neutral-300: #D1D5DB;
    --nav2-neutral-100: #F3F4F6;
    --nav2-neutral-50: #F9FAFB;
    --nav2-white: #FFFFFF;
    --nav2-danger: #EF4444;
    --nav2-font: "DM Sans", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --sidebar-width: 0px;
}

body {
    font-family: var(--nav2-font);
}

.nav2-sidebar {
    display: none;
}

.nav2-mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    height: 64px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--nav2-white);
    border-top: 1px solid var(--nav2-neutral-100);
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.nav2-mobile-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--nav2-neutral-500);
    text-decoration: none;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
}

.nav2-mobile-item .nav2-mobile-icon-wrap {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav2-mobile-item i {
    font-size: 18px;
}

.nav2-mobile-item.active {
    color: var(--nav2-primary-dark);
    font-weight: 600;
}

.nav2-mobile-item.active .nav2-mobile-icon-wrap {
    background: var(--nav2-primary-light);
}

.nav2-mobile-item:focus-visible,
.nav2-sheet-item:focus-visible,
.nav2-sheet-child:focus-visible,
.nav2-subsheet-item:focus-visible,
.nav2-item:focus-visible,
.nav2-collapse-btn:focus-visible {
    outline: 2px solid var(--nav2-primary);
    outline-offset: 2px;
    border-radius: 10px;
}

.nav2-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav2-sheet-backdrop.is-open {
    opacity: 1;
}

.nav2-mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1051;
    background: var(--nav2-white);
    border-radius: 20px 20px 0 0;
    padding: 10px 16px 16px;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav2-mobile-sheet.is-open {
    transform: translateY(0);
}

.nav2-sheet-handle {
    width: 44px;
    height: 4px;
    border-radius: 99px;
    background: var(--nav2-neutral-300);
    margin: 0 auto 12px;
}

.nav2-sheet-list {
    display: grid;
    gap: 6px;
}

.nav2-sheet-item {
    appearance: none;
    border: 0;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: var(--nav2-neutral-700);
    background: transparent;
    border-radius: 12px;
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
}

.nav2-sheet-item:hover {
    background: var(--nav2-neutral-50);
}

.nav2-sheet-item.active {
    background: var(--nav2-primary-surface);
    color: var(--nav2-primary-dark);
    font-weight: 600;
}

.nav2-sheet-item-danger {
    color: var(--nav2-danger);
}

.nav2-sheet-group {
    border-radius: 12px;
    margin: 0;
    transition: background 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}

.nav2-sheet-group.is-open {
    background: #F9FAFB;
    margin: 0 8px;
    padding: 4px 0;
}

.nav2-sheet-parent {
    justify-content: space-between;
    gap: 8px;
}

.nav2-sheet-parent-main {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.nav2-sheet-chevron {
    font-size: 13px;
    color: var(--nav2-neutral-500);
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.nav2-sheet-group.is-open .nav2-sheet-chevron {
    transform: rotate(0deg);
}

.nav2-sheet-children {
    overflow: hidden;
    max-height: 0;
    padding-left: 36px;
    transition: max-height 0.3s ease;
}

.nav2-sheet-group.is-open .nav2-sheet-children {
    max-height: 500px;
}

.nav2-sheet-child {
    display: flex;
    align-items: center;
    min-height: 40px;
    text-decoration: none;
    color: var(--nav2-neutral-500);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav2-sheet-child:hover {
    background: var(--nav2-neutral-50);
}

.nav2-sheet-child.active {
    color: var(--nav2-primary-dark);
    font-weight: 600;
    background: var(--nav2-primary-surface);
}

.nav2-subsheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav2-subsheet-backdrop.is-open {
    opacity: 1;
}

.nav2-mobile-subsheet {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom) + 8px);
    z-index: 1046;
    background: var(--nav2-white);
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.nav2-mobile-subsheet.is-open {
    transform: translateY(0);
    opacity: 1;
}

.nav2-subsheet-title {
    margin: 0;
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9CA3AF;
}

.nav2-subsheet-list {
    display: grid;
    gap: 2px;
}

.nav2-subsheet-item {
    border: 0;
    width: 100%;
    background: transparent;
    color: var(--nav2-neutral-700);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav2-subsheet-item:hover {
    background: var(--nav2-neutral-50);
}

.nav2-subsheet-item.active {
    color: var(--nav2-primary-dark);
    font-weight: 600;
    background: var(--nav2-primary-surface);
}

.nav2-subsheet-item-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    flex-shrink: 0;
}

.nav2-subsheet-item-icon i {
    font-size: 8px;
}

.nav2-subsheet-item.active .nav2-subsheet-item-icon {
    color: var(--nav2-primary);
}

body.nav2-sheet-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .nav2-mobile-bar,
    .nav2-mobile-sheet,
    .nav2-sheet-backdrop,
    .nav2-mobile-subsheet,
    .nav2-subsheet-backdrop {
        display: none !important;
    }

    .nav2-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
        width: var(--sidebar-width);
        background: var(--nav2-white);
        border-right: 1px solid var(--nav2-neutral-100);
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: visible;
        padding: 8px 10px 16px;
        transition: width 0.3s ease;
    }

    .app-shell-expanded {
        --sidebar-width: 256px;
    }

    .app-shell-collapsed {
        --sidebar-width: 72px;
    }

    .nav2-header {
        height: 72px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        justify-content: space-between;
        gap: 8px;
        overflow: visible;
    }

    .nav2-logo-link {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        height: 56px;
        padding: 0 12px;
        overflow: visible;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav2-logo-crop {
        width: 140px;
        height: 40px;
        overflow: hidden;
        display: flex;
        align-items: center;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav2-logo-full {
        width: 140px;
        height: auto;
        flex-shrink: 0;
        transition: opacity 0.2s ease;
    }

    .app-shell-collapsed .nav2-logo-link {
        justify-content: center;
        padding: 0;
        flex: 0 0 auto;
        height: auto;
    }

    .app-shell-collapsed .nav2-logo-crop {
        width: 34px;
        height: 34px;
    }

    .app-shell-collapsed .nav2-logo-full {
        opacity: 1;
        height: 34px;
        width: auto;
        object-fit: contain;
    }

    .nav2-collapse-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        border: 0;
        background: var(--nav2-neutral-50);
        color: var(--nav2-neutral-500);
        margin: 0;
        flex-shrink: 0;
        align-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .app-shell-collapsed .nav2-header {
        height: 96px;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
    }

    .app-shell-collapsed .nav2-collapse-btn i {
        transform: rotate(180deg);
    }

    .nav2-scroll {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        display: grid;
        gap: 24px;
        padding: 2px;
    }

    .nav2-scroll::-webkit-scrollbar {
        display: none;
    }

    .nav2-section {
        display: grid;
        gap: 4px;
    }

    .nav2-section-bottom {
        margin-top: 0;
    }

    .app-shell-expanded .nav2-section-bottom {
        margin-top: auto;
    }

    .nav2-section-label {
        margin: 0 0 6px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--nav2-neutral-500);
        padding: 0 12px;
    }

    .nav2-item,
    .nav2-group summary {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 40px;
        border-radius: 10px;
        padding: 0 12px;
        font-size: 14px;
        font-weight: 500;
        color: var(--nav2-neutral-700);
        text-decoration: none;
        border: 0;
        background: transparent;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav2-item:hover,
    .nav2-group summary:hover {
        background: var(--nav2-neutral-50);
    }

    .nav2-item.active,
    .nav2-group summary.active {
        background: var(--nav2-primary-surface);
        color: var(--nav2-primary-dark);
        font-weight: 600;
    }

    .nav2-item i,
    .nav2-group summary i:first-child {
        width: 20px;
        font-size: 18px;
        text-align: center;
        color: inherit;
    }

    .nav2-group {
        border: 0;
    }

    .nav2-group summary {
        list-style: none;
    }

    .nav2-group summary::-webkit-details-marker {
        display: none;
    }

    .nav2-chevron {
        margin-left: auto;
        font-size: 13px;
        color: var(--nav2-neutral-500);
        transition: transform 0.2s ease;
    }

    .nav2-group[open] .nav2-chevron {
        transform: rotate(180deg);
    }

    .nav2-submenu {
        margin-left: 32px;
        border-left: 1px solid #E5E7EB;
        padding: 4px 0 4px 10px;
        display: grid;
        gap: 4px;
    }

    .nav2-submenu a {
        height: 36px;
        border-radius: 8px;
        text-decoration: none;
        color: var(--nav2-neutral-500);
        display: flex;
        align-items: center;
        padding: 0 12px;
        font-size: 13px;
        font-weight: 500;
    }

    .nav2-submenu a:hover {
        background: var(--nav2-neutral-50);
    }

    .nav2-submenu a.active {
        background: var(--nav2-primary-surface);
        color: var(--nav2-primary-dark);
    }

    .app-shell-collapsed .nav2-section-label,
    .app-shell-collapsed .nav2-item span,
    .app-shell-collapsed .nav2-group summary span,
    .app-shell-collapsed .nav2-chevron,
    .app-shell-collapsed .nav2-submenu,
    .app-shell-collapsed .nav2-user-meta,
    .app-shell-collapsed .nav2-userbar > a.app-icon-btn,
    .app-shell-collapsed .nav2-userbar .badge {
        display: none;
    }

    .app-shell-collapsed .nav2-scroll {
        gap: 12px;
    }

    .app-shell-collapsed .nav2-section + .nav2-section::before {
        content: "";
        width: 24px;
        height: 1px;
        border-radius: 1px;
        background: #E5E7EB;
        margin: 6px auto;
    }

    .app-shell-collapsed .nav2-item,
    .app-shell-collapsed .nav2-group summary {
        justify-content: center;
        width: 44px;
        min-height: 44px;
        margin: 2px auto;
        border-radius: 12px;
        padding: 0;
    }

    .app-shell-collapsed .nav2-item,
    .app-shell-collapsed .nav2-group summary {
        position: relative;
    }

    .app-shell-collapsed .nav2-item:hover::after,
    .app-shell-collapsed .nav2-group summary:hover::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--nav2-neutral-900);
        color: #fff;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 60;
    }

    .nav2-userbar {
        margin-top: auto;
        border-top: 1px solid var(--nav2-neutral-100);
        padding: 12px 8px 0;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        position: relative;
        overflow: visible;
        min-width: 0;
    }

    .nav2-avatar-btn {
        display: inline-flex;
        width: 36px;
        height: 36px;
        border-radius: 999px;
        border: 0;
        background: var(--nav2-primary-light);
        color: var(--nav2-primary-dark);
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .nav2-user-meta {
        min-width: 0;
        flex: 1 1 auto;
    }

    .nav2-user-meta-name {
        margin: 0;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        color: var(--nav2-neutral-900);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav2-user-meta-role {
        margin: 1px 0 0;
        font-size: 11px;
        color: var(--nav2-neutral-500);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav2-avatar-initial {
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
    }

    .app-shell-collapsed .nav2-userbar {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        padding: 12px 0 0;
    }

    .app-shell-collapsed .nav2-avatar-btn {
        display: inline-flex;
        margin: 0 auto;
    }

    .app-shell-collapsed .nav2-collapse-btn {
        margin: 0 auto;
        align-self: center;
    }

    .nav2-user-popover {
        position: absolute;
        left: calc(100% + 8px);
        bottom: 8px;
        min-width: 200px;
        background: #fff;
        border: 1px solid #F3F4F6;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        padding: 8px;
        z-index: 1100;
    }

    .nav2-user-popover-header {
        padding: 12px 12px 8px;
        border-bottom: 1px solid #F3F4F6;
        margin-bottom: 4px;
    }

    .nav2-user-name {
        margin: 0;
        font-size: 13px;
        font-weight: 600;
        color: var(--nav2-neutral-900);
    }

    .nav2-user-role {
        margin: 2px 0 0;
        font-size: 11px;
        color: var(--nav2-neutral-500);
    }

    .nav2-user-popover-item {
        border: 0;
        background: transparent;
        width: 100%;
        text-align: left;
        font-family: inherit;
        cursor: pointer;
        height: 40px;
        padding: 0 12px;
        border-radius: 8px;
        color: var(--nav2-neutral-700);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
    }

    .nav2-user-popover-item:hover {
        background: #F9FAFB;
    }

    .nav2-user-popover-item-danger {
        color: #EF4444;
    }

    .nav2-popover-badge {
        margin-left: auto;
        min-width: 18px;
        height: 18px;
        border-radius: 10px;
        background: #FEE2E2;
        color: #DC2626;
        font-size: 10px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 5px;
    }

    .app-content-with-navbar {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100% - var(--sidebar-width));
        min-width: 0;
        padding: 24px;
        overflow-x: hidden;
        box-sizing: border-box;
        transition: margin-left 0.3s ease, padding 0.3s ease;
    }

    .app-content-with-navbar > .container,
.app-content-with-navbar > .container-fluid {
    max-width: 100%;
}
}

@media (min-width: 768px) and (max-width: 1023px) {
    .app-shell-expanded {
        --sidebar-width: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
