/* PO Manager — Component Styles (Sidebar + Topbar) */

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    overflow-x: hidden;
}

.sidebar-logo {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent-lime), var(--accent-green));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; color: #0d1117;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 1rem;
    width: 90%;
    height: 42px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-lime), var(--accent-green));
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}

body.light-theme .nav-item.active {
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.2);
}

.nav-item svg { width: 20px; height: 20px; }

.nav-item .tooltip {
    display: none !important;
}

.nav-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.nav-separator {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 1rem;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 1rem 0.5rem 1rem 1.25rem;
    align-items: center;
}

.sidebar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-peach), var(--accent-blush));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: #0d1117;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-avatar:hover {
    box-shadow: 0 0 12px rgba(248, 180, 0, 0.3);
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 90;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.topbar-search {
    position: relative;
    width: 280px;
}

.topbar-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    outline: none;
    transition: var(--transition);
}

.topbar-search input:focus {
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 3px rgba(200, 241, 105, 0.1);
}

.topbar-search svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px; height: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    border-color: var(--accent-lime);
    color: var(--text-primary);
}

.topbar-btn svg { width: 18px; height: 18px; }

.topbar-btn #theme-sun,
.topbar-btn #theme-moon {
    display: none;
}
body.light-theme .topbar-btn #theme-moon {
    display: block;
}
body:not(.light-theme) .topbar-btn #theme-sun {
    display: block;
}

.topbar-btn .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--accent-lime);
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topbar-user:hover { background: var(--bg-card); }

.topbar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-peach), var(--accent-blush));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; color: #0d1117;
}

.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: 0.8125rem; font-weight: 600; line-height: 1.2; }
.topbar-user-role { font-size: 0.7rem; color: var(--text-muted); }

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: var(--transition);
    z-index: 200;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-dropdown a svg { width: 16px; height: 16px; }

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* Stats Cards (Dashboard) */
.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-peach { background: var(--card-peach-bg); color: var(--card-peach-text); }
.stat-card-sage { background: var(--card-sage-bg); color: var(--card-sage-text); }
.stat-card-blush { background: var(--card-blush-bg); color: var(--card-blush-text); }
.stat-card-lavender { background: var(--card-lavender-bg); color: var(--card-lavender-text); }

.stat-card-icon {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    display: flex; align-items: center; justify-content: center;
}

.stat-card-icon svg { width: 16px; height: 16px; }

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.sidebar .logo-text {
    display: block;
    margin-left: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.sidebar .nav-label {
    display: block;
    margin-left: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar .sidebar-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 0.75rem;
    overflow: hidden;
}

.sidebar-user-name { font-size: 0.8125rem; font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

@keyframes fadeIn {
    to { opacity: 1; }
}

.mobile-only { display: none !important; }

@media (max-width: 768px) {
    .mobile-only { display: flex !important; }
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.active {
        transform: translateX(0) !important;
    }
    .topbar { left: 0; padding: 0 1rem; }
    .topbar-search { display: none; }
}
