/**
 * AutoParts Pro CEO Dashboard
 * Layout Components (Topbar, Sidebar, Bottom Nav)
 * EDESSIS SRL - 2026
 */

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-6);
    border-bottom: 1px solid var(--gb);
    transition: background var(--transition-smooth);
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--bg3);
    color: var(--tx);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.topbar-btn:active {
    transform: scale(0.9);
    background: var(--p);
    color: #fff;
}

.topbar-center {
    flex: 1;
    text-align: center;
}

.topbar-center h1 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    margin: 0;
    background: var(--pg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-center small {
    font-size: var(--fs-xs);
    color: var(--t2);
    font-weight: var(--fw-medium);
}

.topbar-actions {
    display: flex;
    gap: var(--sp-3);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--err);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg2);
    z-index: 210;
    transform: translateX(-100%);
    transition: transform var(--transition-bounce);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gb);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: var(--sp-9) var(--sp-8);
    border-bottom: 1px solid var(--gb);
}

.sidebar-logo-row {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    margin-bottom: var(--sp-7);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-xl);
    background: var(--pg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-black);
    font-size: var(--fs-2xl);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 111, 255, 0.3);
}

.sidebar-brand {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extrabold);
}

.sidebar-subtitle {
    font-size: var(--fs-xs);
    color: var(--t2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: var(--fw-semibold);
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-6);
    background: var(--gb);
    border-radius: var(--radius-2xl);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xl);
    background: var(--pg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-bold);
    font-size: var(--fs-lg);
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.sidebar-user-role {
    font-size: var(--fs-sm);
    color: var(--t2);
}

/* ===== SIDEBAR MENU ===== */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3) var(--sp-4);
}

.sidebar-label {
    font-size: 8.5px;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--t3);
    padding: var(--sp-6) var(--sp-4) var(--sp-2);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius-xl);
    color: var(--t2);
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: var(--transition-base);
    margin-bottom: 1px;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: var(--gb);
    color: var(--tx);
}

.sidebar-item.active {
    color: var(--pl);
}

.sidebar-item i {
    font-size: 17px;
    width: 22px;
    text-align: center;
}

.sidebar-item-badge {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--err);
    margin-left: auto;
    animation: dotPulse 2s infinite;
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
    padding: var(--sp-6) var(--sp-8);
    border-top: 1px solid var(--gb);
}

.sidebar-footer-link {
    color: var(--t2);
    font-size: var(--fs-base);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: var(--botbg);
    backdrop-filter: blur(24px);
    border-top: 1px solid var(--gb);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-nav);
    padding-bottom: var(--safe-area-bottom);
    transition: background var(--transition-smooth);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    color: var(--t3);
    border: none;
    background: none;
    padding: var(--sp-2) var(--sp-5);
    position: relative;
    transition: var(--transition-base);
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item span {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
}

.bottom-nav-item.active i {
    color: var(--p);
}

.bottom-nav-item.active span {
    color: var(--p);
    font-weight: var(--fw-semibold);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--pg);
    border-radius: 0 0 4px 4px;
}

.bottom-nav-center {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pg);
    border: 4px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    top: -30px;
    box-shadow: 0 6px 25px rgba(124, 111, 255, 0.45);
    transition: var(--transition-slow);
    z-index: 5;
}

.bottom-nav-center:active {
    transform: scale(0.88);
}

/* ===== NOTIFICATION PANEL OVERLAY ===== */
.notif-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-slow);
}

.notif-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(310px, 85vw);
    height: 100%;
    background: var(--bg2);
    z-index: 310;
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    border-left: 1px solid var(--gb);
    display: flex;
    flex-direction: column;
}

.notif-panel.active {
    transform: translateX(0);
}

.notif-panel-header {
    padding: var(--sp-9) var(--sp-7);
    border-bottom: 1px solid var(--gb);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-panel-header h5 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    margin: 0;
}

.notif-panel-close {
    border: none;
    background: none;
    color: var(--tx);
    font-size: 20px;
    cursor: pointer;
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-5);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 500px) {
    .page-wrapper {
        max-width: var(--max-content-width);
        margin: 0 auto;
    }
    
    .bottom-nav {
        max-width: var(--max-content-width);
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-4xl) var(--radius-4xl) 0 0;
    }
}