:root {
    --sidebar-width: 260px;
    --bg-dark: #0f172a;
    --sidebar-bg: #1e293b;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: #f8fafc;
    min-height: 100vh;
    margin: 0;
}

.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.sidebar-brand i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.sidebar-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* Sidebar Footer / User Profile & Logout */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(15, 23, 42, 0.5);
}

.logout-form {
    margin: 0;
    padding: 0;
}

.user-logout-btn {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
}

.user-logout-btn:hover .user-card {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.user-logout-btn:hover .logout-icon {
    color: #ef4444;
    transform: translateX(2px);
}

.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.username {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-action {
    font-size: 0.725rem;
    color: #94a3b8;
}

.logout-icon {
    color: #64748b;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

/* Content Area */
#content {
    flex-grow: 1;
    padding: 2rem;
    background-color: var(--bg-dark);
    overflow-y: auto;
}

.content-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        min-width: 100%;
    }
}

/* Character Portraits */
.portrait {
    display: block;
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    border: var(--bs-border-width, 1px) solid var(--bs-secondary, #6c757d);
    flex-shrink: 0;
}

.portrait--sm {
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
}

.portrait--lg {
    width: 140px;
    height: 140px;
    font-size: 4rem;
}
