﻿/* ═══════════════════════════════════════════════════════════════
   MEGA RADIADORES — MAIN LAYOUT v3.0
   Solo: Sidebar + Navbar + Workspace
   ═══════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 260px;
    --bg-primary: #0b1120;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --border-color: rgba(148, 163, 184, 0.08);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* ── Layout Root ── */
.mega-layout-root {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-primary);
}

/* ── Sidebar ── */
.mega-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    position: relative;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

    .mega-sidebar::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #38bdf8, #0ea5e9, #0284c7);
        z-index: 10;
    }

    .mega-sidebar.collapsed {
        width: 0 !important;
        padding: 0 !important;
        border-right: none !important;
        box-shadow: none !important;
    }

        .mega-sidebar.collapsed .sidebar-brand,
        .mega-sidebar.collapsed .sidebar-nav,
        .mega-sidebar.collapsed .sidebar-footer {
            opacity: 0;
            pointer-events: none;
            width: 0;
            overflow: hidden;
        }

/* ── Brand ── */
.sidebar-brand {
    padding: 24px 20px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    transition: opacity 0.2s ease;
}

.brand-logo-wrap {
    position: relative;
    display: inline-block;
}

    .brand-logo-wrap img {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 3px rgba(56,189,248,0.15);
    }

.brand-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 12px;
}

.brand-subtitle {
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ── Nav ── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.15);
        border-radius: 4px;
    }

.nav-section-title {
    color: rgba(148, 163, 184, 0.4);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 16px 14px 8px;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin: 2px 4px;
    border-radius: 10px;
    color: rgba(203, 213, 225, 0.75);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - 8px);
    position: relative;
    overflow: hidden;
}

    .nav-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 0;
        background: linear-gradient(180deg, #38bdf8, #0ea5e9);
        border-radius: 10px 0 0 10px;
        transition: width 0.25s ease;
    }

    .nav-item:hover {
        background: rgba(56, 189, 248, 0.08);
        color: var(--text-primary);
    }

        .nav-item:hover::before {
            width: 3px;
        }

    .nav-item.active {
        background: linear-gradient(90deg, rgba(56,189,248,0.12) 0%, rgba(56,189,248,0.03) 100%);
        color: var(--accent-blue);
        font-weight: 600;
    }

        .nav-item.active::before {
            width: 3px;
        }

    .nav-item i {
        font-size: 1rem;
        width: 22px;
        text-align: center;
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }

    .nav-item:hover i {
        transform: translateX(2px);
    }

    .nav-item.active i {
        color: var(--accent-blue);
    }

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148,163,184,0.1), transparent);
    margin: 8px 16px;
}

/* ── Footer ── */
.sidebar-footer {
    padding: 14px;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.06);
    background: rgba(15, 23, 42, 0.3);
}

    .sidebar-footer span {
        color: rgba(148, 163, 184, 0.35);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 1px;
    }

/* ── Workspace ── */
.mega-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* ── Navbar ── */
.mega-navbar {
    height: 64px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
    z-index: 50;
    flex-shrink: 0;
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Buttons ── */
.btn-hamburger {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

    .btn-hamburger:hover {
        background: rgba(56, 189, 248, 0.1);
        border-color: rgba(56, 189, 248, 0.2);
        color: var(--accent-blue);
        transform: scale(1.08);
    }

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid rgba(148,163,184,0.12);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .btn-back-home:hover {
        background: rgba(56, 189, 248, 0.08);
        border-color: rgba(56, 189, 248, 0.2);
        color: var(--accent-blue);
    }

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 24px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

    .user-badge:hover {
        background: rgba(56, 189, 248, 0.06);
        border-color: rgba(56, 189, 248, 0.15);
    }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-name {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 500;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
    color: #f87171;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-logout:hover {
        background: rgba(239, 68, 68, 0.12);
        border-color: rgba(239, 68, 68, 0.35);
        color: #ef4444;
    }

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
    }

.navbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(148, 163, 184, 0.1);
}

/* ── Content ── */
.mega-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px;
    box-sizing: border-box;
    background: var(--bg-primary);
    min-width: 0;
}

    .mega-content::-webkit-scrollbar {
        width: 6px;
    }

    .mega-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .mega-content::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.12);
        border-radius: 6px;
    }

/* ── Overlay ── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

/* ── Responsive ── */
@media (max-width: 768px) {
    .mega-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        box-shadow: 8px 0 32px rgba(0,0,0,0.6);
    }

        .mega-sidebar.collapsed {
            transform: translateX(-100%);
            width: var(--sidebar-width) !important;
        }

    .mega-content {
        padding: 16px;
    }

    .user-name {
        display: none;
    }
}
