/* Wasai v2 Layout Architecture */

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    z-index: 1000;
    background: #fdfcfb;
    border-right: 1.5px solid var(--border-peach);
}

.sidebar-brand {
    padding: 0.25rem 0.5rem 1.25rem 0.5rem;
    border-bottom: 1px solid rgba(244, 219, 204, 0.6);
    margin-bottom: 1rem;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.sidebar-version-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-glow);
    border: 1px solid var(--border-peach);
    padding: 0.15rem 0.45rem;
    border-radius: 12px;
    margin-left: 0.25rem;
    letter-spacing: 0.05em;
}

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

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 87, 0.2);
    border-radius: 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 0.75rem 0.35rem 0.75rem;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link i {
    font-size: 1.15rem;
    color: #8a7c76;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f7f2ed;
    color: var(--text-main);
    border-color: rgba(244, 219, 204, 0.8);
}

.nav-link:hover i {
    color: var(--primary);
}

.nav-link.active {
    background: #fbf7f4;
    color: var(--primary);
    font-weight: 600;
    border: 1.5px solid var(--border-peach);
    box-shadow: 0 2px 8px rgba(217, 119, 87, 0.08);
}

.nav-link.active i {
    color: var(--primary);
    transform: scale(1.08);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1.5px solid var(--border-peach);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-peach);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-user-card:hover {
    background: #fbf7f4;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #e68d70);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(217, 119, 87, 0.25);
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-user-role.role-admin { color: #8b5cf6; }
.sidebar-user-role.role-user { color: var(--text-muted); }

.sidebar-user-gear {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-user-card:hover .sidebar-user-gear {
    color: var(--primary);
    transform: rotate(45deg);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-peach);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: var(--error);
}

/* Floating Header */
.main-header {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    left: calc(var(--sidebar-width) + 1.5rem);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-radius: var(--radius-lg);
    z-index: 999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-peach);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.header-status-pill.online {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.header-status-pill.offline {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.status-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-dot 2s infinite;
}

.header-status-pill.offline .status-pulse-dot {
    animation: none;
    background: #f59e0b;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-profile-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border-radius: 24px;
    background: #fbf7f4;
    border: 1px solid var(--border-peach);
    text-decoration: none;
    transition: var(--transition);
}

.header-profile-chip:hover {
    background: #f4ece6;
    border-color: var(--primary);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-username {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-header {
        left: 1rem;
        right: 1rem;
        top: 0.75rem;
        padding: 0 1rem;
    }
    .header-status-label {
        display: none;
    }
}
