
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --sidebar-bg: #1a1d28;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --transition-speed: 0.3s;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #151823 100%);
    color: white;
    transition: all var(--transition-speed) ease;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

    .sidebar.collapsed {
        margin-left: calc(var(--sidebar-width) * -1);
    }

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

    .sidebar-logo i {
        color: var(--primary-color);
        font-size: 2rem;
    }

    .sidebar-logo span {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.sidebar-menu {
    padding: 20px 0;
}

.nav-item {
    margin-bottom: 5px;
    padding: 0 15px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

    .nav-link:hover {
        color: white;
        background: rgba(255, 255, 255, 0.05);
        transform: translateX(5px);
    }

    .nav-link.active {
        color: white;
        background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(114, 9, 183, 0.2));
        border-left: 4px solid var(--primary-color);
    }

    .nav-link i {
        width: 20px;
        text-align: center;
        font-size: 1.1rem;
    }

    .nav-link .badge {
        margin-left: auto;
        background: var(--primary-color);
        font-size: 0.7rem;
        padding: 2px 8px;
    }

.menu-section {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 20px 10px 20px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Topbar */
.topbar {
    background: white;
    height: var(--topbar-height);
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-speed) ease;
    margin-left: var(--sidebar-width);
}

.sidebar.collapsed ~ .content-wrapper .topbar {
    margin-left: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    border: 2px solid #e1e5ee;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .toggle-btn:hover {
        background: var(--primary-color);
        color: white;
        transform: rotate(90deg);
        border-color: var(--primary-color);
    }

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: #6c757d;
}

.logout-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .logout-btn:hover {
        background: linear-gradient(135deg, #c82333, #b21f2d);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(220, 53, 69, 0.2);
        color: white;
        text-decoration: none;
    }

/* Main Content */
.content-wrapper {
    flex: 1;
    transition: all var(--transition-speed) ease;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .content-wrapper {
    margin-left: 0;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 25px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Footer */
.app-footer {
    background: white;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
}

.sidebar.collapsed ~ .content-wrapper .app-footer {
    margin-left: 0;
}

/* Modal */
.modal-custom .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-custom .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px 20px 0 0;
    border: none;
    padding: 20px 30px;
}

.modal-custom .modal-title {
    font-weight: 600;
    font-size: 1.4rem;
}

/* Responsividade */
@@media (max-width: 992px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
        z-index: 1050;
    }

        .sidebar.show {
            margin-left: 0;
        }

    .topbar {
        margin-left: 0 !important;
    }

    .content-wrapper,
    .app-footer {
        margin-left: 0 !important;
    }

    .toggle-btn {
        display: flex !important;
    }
}

@@media (max-width: 768px) {
    .topbar {
        padding: 0 15px;
    }

    .main-content {
        padding: 20px 15px;
    }

    .user-details {
        display: none;
    }

    .logout-btn span {
        display: none;
    }

    .logout-btn {
        padding: 8px 12px;
    }

    .page-title {
        font-size: 1.3rem;
    }
}

@@media (max-width: 576px) {
    .sidebar {
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Animations */
@@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Badge notifications */
.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollbar personalizado */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }


/* Logo da Sidebar */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo-circle {
    width: 50px;
    height: 50px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-logo-img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

/* Quando sidebar estiver recolhida */
.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar.collapsed .sidebar-logo-circle {
    margin: 0 auto;
}
