/* aw-layout.css — shell ERP sidebar/topnav/main-area (extrait de app.css) */

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   4. APP LAYOUT â€” InApp-inspired sidebar + topbar + content
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
html, body { height: 100%; margin: 0; }

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--aw-canvas, #e8eef5);
}

/* ── Sidebar (aligned with aw-ui / topnav) ── */
.sidebar {
    width: 240px;
    min-width: 240px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: width 0.3s, min-width 0.3s;
}
.sidebar--collapsed {
    width: 60px;
    min-width: 60px;
}

/* Logo area */
.sb-brand {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    background: #0f172a;
    text-decoration: none;
    color: inherit;
}
a.sb-brand:hover { opacity: 0.92; }
.sidebar--collapsed .sb-brand { justify-content: center; padding: 0; }

.sb-brand-icon {
    width: 36px; height: 36px;
    border-radius: 7px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    padding: 3px;
}
.sb-brand-logo {
    width: 100%; height: 100%;
    object-fit: contain;
}
.sb-brand-name { font-size: 14px; font-weight: 650; color: #fff; margin: 0; line-height: 1.2; }
.sb-brand-sub  { font-size: 10px; color: rgba(255, 255, 255, 0.55); margin: 0; line-height: 1.2; }

/* Navigation */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.sb-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    padding: 16px 24px 6px;
    margin: 0;
    white-space: nowrap;
    text-transform: uppercase;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    margin: 1px 12px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.15s, background 0.15s;
}
.sidebar--collapsed .sb-item { justify-content: center; padding: 10px; margin: 1px 6px; }
.sb-item:hover {
    background: rgba(0, 158, 132, 0.16);
    color: #5eead4;
    text-decoration: none;
}
.sb-item--active {
    background: rgba(0, 158, 132, 0.22) !important;
    color: #5eead4 !important;
    box-shadow: inset 3px 0 0 #009e84;
}
.sb-item--active .sb-icon { color: #5eead4 !important; }

.sb-icon,
.sb-icon.rzi {
    font-size: 18px !important;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}
.sb-item:hover .sb-icon { color: #5eead4; }

/* Sidebar footer */
.sb-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}
.sb-footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    width: 100%;
    transition: color 0.15s, background 0.15s;
}
.sidebar--collapsed .sb-footer-btn { justify-content: center; }
.sb-footer-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sb-footer-btn--danger:hover { color: #da4f49; background: rgba(166, 27, 12, 0.15); }

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(1px);
    display: none;
    z-index: 1030;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 1031;
        transition: left 0.3s;
    }
    .sidebar.mobile-show { left: 0; }
    .sidebar--collapsed { width: 240px; min-width: 240px; }
}

/* â”€â”€ Main area â”€â”€ */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* â”€â”€ Topbar (clean white bar) â”€â”€ */
/* ═══════════════════════════════════════════════════════════════
   App chrome — topnav (unified) & topbar
   Aligned with aw-railnav / aw-settings tabs proportions
   ═══════════════════════════════════════════════════════════════ */
.topnav {
    display: flex;
    align-items: stretch;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
}
.topnav--unified {
    height: 48px;
    min-height: 48px;
    padding: 0;
}

.topnav-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1rem;
    gap: 0;
    height: 100%;
}

.topnav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    margin-right: 1rem;
    flex-shrink: 0;
    padding: 0 0.15rem;
}
.topnav-brand:hover { color: #5eead4; }
.topnav-brand-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
}
.topnav-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.topnav-brand-name {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.topnav-links {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.topnav-links::-webkit-scrollbar { display: none; }

.topnav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
    padding: 0 0.7rem;
    margin-bottom: 0;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.topnav-item > i,
.topnav-item > .rzi,
.topnav-item .rzi {
    font-size: 0.9rem;
    opacity: 0.7;
    line-height: 1;
}
.topnav-item:hover {
    color: #fff;
    background: transparent;
}
.topnav-item:hover > i,
.topnav-item:hover > .rzi,
.topnav-item:hover .rzi { opacity: 1; }
.topnav-item--active {
    color: #5eead4;
    background: transparent !important;
    box-shadow: none;
    border-bottom-color: #009e84;
}
.topnav-item--active > i,
.topnav-item--active > .rzi,
.topnav-item--active .rzi {
    opacity: 1;
    color: #5eead4;
}
.topnav-item--danger:hover {
    color: #fca5a5;
    background: transparent;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    height: 100%;
}
.topnav-tool {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.12s ease, background 0.12s ease;
}
.topnav-tool:hover {
    color: #5eead4;
    background: rgba(255, 255, 255, 0.06);
}

/* Account menu (profile) — shared dark/light */
.aw-account {
    position: relative;
    z-index: 1001;
    display: flex;
    align-items: center;
    height: 100%;
}
.aw-account__trigger {
    appearance: none;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 1.85rem;
    padding: 0 0.35rem 0 0.2rem;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: background 0.12s ease;
}
.aw-account__trigger:hover,
.aw-account__trigger--open {
    background: rgba(255, 255, 255, 0.08);
}
.aw-account__avatar {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 6px;
    background: rgba(0, 158, 132, 0.28);
    color: #5eead4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.aw-account__avatar--lg {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.05rem;
    border-radius: 8px;
}
.aw-account__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
}
.aw-account__name {
    font-size: 0.72rem;
    font-weight: 650;
    color: #fff;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aw-account__role {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aw-account__chevron {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    transition: transform 0.15s ease;
}
.aw-account__trigger--open .aw-account__chevron {
    transform: rotate(180deg);
}
.aw-account__menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 15.5rem;
    background: #fff;
    border: 1px solid var(--aw-line, #cbd5e1);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    z-index: var(--aw-z-float, 10510);
    animation: aw-account-in 0.14s ease both;
}
@keyframes aw-account-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.aw-account__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid #e8eef5;
}
.aw-account__head .aw-account__avatar {
    background: rgba(0, 158, 132, 0.14);
    color: #007a68;
}
.aw-account__head-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.aw-account__head-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.aw-account__head-role {
    font-size: 0.7rem;
    color: #64748b;
}
.aw-account__list {
    display: flex;
    flex-direction: column;
    padding: 0.35rem;
    gap: 0.1rem;
}
.aw-account__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 550;
    color: #334155;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.12s ease, color 0.12s ease;
}
.aw-account__item > i {
    font-size: 0.95rem;
    color: #64748b;
    width: 1.1rem;
    text-align: center;
}
.aw-account__item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.aw-account__item:hover > i { color: #009e84; }
.aw-account__footer {
    padding: 0.35rem;
    border-top: 1px solid #e8eef5;
}
.aw-account__item--danger { color: #9a170c; }
.aw-account__item--danger > i { color: #9a170c; }
.aw-account__item--danger:hover {
    background: #fef2f2;
    color: #9a170c;
}

/* Light topbar variant */
.aw-account--light .aw-account__trigger:hover,
.aw-account--light .aw-account__trigger--open {
    background: #f1f5f9;
}
.aw-account--light .aw-account__avatar {
    background: rgba(0, 158, 132, 0.14);
    color: #007a68;
}
.aw-account--light .aw-account__name { color: #0f172a; }
.aw-account--light .aw-account__role { color: #64748b; }
.aw-account--light .aw-account__chevron { color: #94a3b8; }

.topbar-tool {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 1rem;
}
.topbar-tool:hover {
    color: #009e84;
    border-color: #cbd5e1;
    background: #f8fafc;
}

@media (max-width: 992px) {
    .aw-account__meta { display: none; }
}

.dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--aw-z-float-backdrop, 10500);
    background: transparent;
}

/* Bootstrap / Mud — couche flottante au-dessus des tables & cards */
.dropdown-menu.show,
.dropdown-menu[data-bs-popper] {
    z-index: var(--aw-z-float, 10510) !important;
}


.app-layout--topbar .main-area {
    width: 100%;
}

/* GRH — barre module à la place du topnav ERP */
.app-layout--grh .sidebar,
.app-layout--grh .sidebar-overlay {
    display: none !important;
}
.app-layout--grh .main-area {
    width: 100%;
    overflow: visible;
}
.app-layout--grh .main-area > .aw-grh-module-nav {
    flex-shrink: 0;
    margin: 0;
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: var(--aw-z-sticky, 120);
}
.app-layout--grh .main-area > .grh-rz-module-nav,
.app-layout--grh .main-area > .aw-grh-module-nav--software {
    margin-bottom: 0;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 300;
    overflow: visible;
}
/* Laisser les sous-menus (Paramétrage…) dépasser hors de la barre */
.app-layout--grh .main-area > .grh-rz-module-nav .grh-rz-module-nav__inner,
.app-layout--grh .main-area > .grh-rz-module-nav .grh-rz-module-nav__side,
.app-layout--grh .main-area > .grh-rz-module-nav .grh-rz-module-nav__item {
    overflow: visible;
}
.app-layout--grh .page-content {
    padding-top: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 992px) {
    .topnav-inner { padding: 0 0.65rem; }
    .topnav-brand { margin-right: 0.5rem; }
    .topnav-brand-name { display: none; }
    .aw-account__meta { display: none; }
    .topnav-item { padding: 0 0.55rem; font-size: 0.74rem; }
}

/* Topbar (sidebar layout companion) */
.topbar {
    height: 48px;
    min-height: 48px;
    background: #fff;
    border-bottom: 1px solid var(--aw-line, #cbd5e1);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.65rem;
    flex-shrink: 0;
}
.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: #0f172a;
    min-width: auto;
}
.topbar-brand:hover { color: #009e84; }
.topbar-brand-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #009e84;
    color: #fff;
    border-radius: 6px;
}
.topbar-brand-name {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}
.topbar-title { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.topbar-page-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}
.topbar-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    color: #64748b;
}
.topbar-actions { display: flex; align-items: center; gap: 0.35rem; }
.topbar-btn {
    width: 1.85rem;
    height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.topbar-btn:hover { background: #e2e8f0; color: #009e84; border-color: #cbd5e1; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    height: 1.85rem;
    padding: 0 0.45rem;
    border-radius: 6px;
    border-left: 1px solid #e2e8f0;
    margin-left: 0.25rem;
    transition: background 0.12s ease;
}
.topbar-user:hover { background: #f8fafc; }
.topbar-avatar {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 6px;
    background: rgba(0, 158, 132, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007a68;
    font-size: 0.85rem;
}
.topbar-user-info { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-user-name { font-size: 0.72rem; font-weight: 650; color: #0f172a; }
.topbar-user-role { font-size: 0.62rem; color: #64748b; }

.topbar .rz-profile-menu,
.topbar .rz-profile-menu-trigger { background: transparent !important; border: none !important; box-shadow: none !important; }

.topbar-menu-btn {
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.topbar-menu-btn:hover { background: #f1f5f9; color: #009e84; }

/* â”€â”€ Page content â”€â”€ */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.15rem;
}
.page-shell {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}
