/* Sidebar minimalista e Premium para Med Penguim */
:root {
    --sidebar-width: 280px;
    --sidebar-bg: var(--surface, #0f172a);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --nav-item-color: var(--text-muted, #94a3b8);
    --nav-item-hover-bg: rgba(59, 130, 246, 0.1);
    --nav-item-active-bg: #3b82f6;
    --nav-item-active-color: #ffffff;
    --nav-icon-size: 22px;
}

body.dark-mode {
    --sidebar-bg: #1e293b;
    /* Slate 800 */
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --nav-item-color: #94a3b8;
    --nav-item-hover-bg: rgba(255, 255, 255, 0.05);
}

body.light-mode {
    --sidebar-bg: #FFFFFF;
    --sidebar-border: #E2E8F0;
    --nav-item-color: #64748B;
    --nav-item-hover-bg: #F1F5F9;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 50;
    transition: all 0.3s ease;
}

.sidebar-inner {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Brand Section */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 24px 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Navigation */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--nav-item-color);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--nav-item-hover-bg);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--nav-item-active-bg);
    color: var(--nav-item-active-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.nav-item.active:hover {
    transform: none;
}

/* Icons */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-icon-size);
    height: var(--nav-icon-size);
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2px;
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--sidebar-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: var(--nav-item-hover-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Logout Button (Small icon) */
.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Main Content Adjustment */
.app-container {
    margin-left: var(--sidebar-width);
    padding: 0;
    /* Let internal sections handle padding */
    transition: margin-left 0.3s ease;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 260px;
        /* Slightly smaller on mobile */
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .app-container {
        margin-left: 0;
        width: 100%;
        padding: 0;
    }

    /* Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        /* Below sidebar (50) */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}