/* =========================================
   RESET GLOBAL
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --sidebar-bg: #172554;
    --sidebar-hover: #263b70;

    --background: #f3f5f9;
    --surface: #ffffff;

    --text-primary: #1e293b;
    --text-secondary: #64748b;

    --border: #e2e8f0;

    --success: #16a34a;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 78px;

    --header-height: 70px;

}


/* =========================================
   ESTRUTURA GERAL
========================================= */

html,
body {
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text-primary);
}

body {
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}


/* =========================================
   SIDEBAR
========================================= */

.sidebar {

    width: var(--sidebar-width);
    min-width: var(--sidebar-width);

    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    background: var(--sidebar-bg);
    color: #ffffff;

    z-index: 1000;

    transition:
        width 0.25s ease,
        min-width 0.25s ease,
        transform 0.25s ease;

}


/* LOGO */

.sidebar-header {

    height: var(--header-height);

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 20px;

    border-bottom: 1px solid rgba(255,255,255,0.10);

    overflow: hidden;

}

.sidebar-logo {

    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,0.12);

    border-radius: 10px;

    font-size: 21px;

}

.sidebar-brand {

    display: flex;
    flex-direction: column;

    white-space: nowrap;

    transition: opacity 0.2s ease;

}

.sidebar-brand strong {
    font-size: 17px;
    letter-spacing: 1px;
}

.sidebar-brand small {

    margin-top: 3px;

    font-size: 11px;

    color: #b9c8e8;

}


/* =========================================
   NAVEGAÇÃO
========================================= */

.sidebar-navigation {

    flex: 1;

    padding: 20px 12px;

    overflow-y: auto;
    overflow-x: hidden;

}

.menu-section-title {

    display: block;

    padding: 15px 12px 9px;

    color: #8fa4d0;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 1.2px;

    white-space: nowrap;

}

.menu-item {

    display: flex;
    align-items: center;

    gap: 13px;

    min-height: 46px;

    padding: 0 12px;

    margin-bottom: 5px;

    border-radius: 8px;

    color: #dbe5f8;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease;

    overflow: hidden;

}

.menu-item:hover {

    background: var(--sidebar-hover);
    color: #ffffff;

}

.menu-item.active {

    background: var(--primary);
    color: #ffffff;

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);

}

.menu-icon {

    width: 25px;
    min-width: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 19px;

}

.menu-label {

    flex: 1;

    font-size: 13px;
    font-weight: 500;

    white-space: nowrap;

}

.menu-badge {

    padding: 3px 6px;

    background: rgba(255,255,255,0.12);

    border-radius: 5px;

    color: #b9c8e8;

    font-size: 9px;

    white-space: nowrap;

}

.menu-item.disabled {

    opacity: 0.55;
    cursor: not-allowed;

}

.menu-item.disabled:hover {
    background: transparent;
}


/* =========================================
   USUÁRIO DO MENU
========================================= */

.sidebar-footer {

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 18px;

    border-top: 1px solid rgba(255,255,255,0.10);

    overflow: hidden;

}

.sidebar-user-icon {

    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,0.12);

    border-radius: 50%;

    font-size: 18px;

}

.sidebar-user-info {

    display: flex;
    flex-direction: column;

    white-space: nowrap;

}

.sidebar-user-info strong {
    font-size: 12px;
}

.sidebar-user-info small {

    margin-top: 4px;

    color: #b9c8e8;

    font-size: 10px;

}


/* =========================================
   ÁREA PRINCIPAL
========================================= */

.main-wrapper {

    flex: 1;

    min-width: 0;

    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    min-height: 100vh;

    transition: margin-left 0.25s ease;

}


/* =========================================
   CABEÇALHO
========================================= */

.topbar {

    height: var(--header-height);
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;

    z-index: 100;

}

.topbar-left,
.topbar-right {

    display: flex;
    align-items: center;

    gap: 18px;

}

.menu-toggle {

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;

    background: #f1f5f9;

    border-radius: 8px;

    color: var(--text-primary);

    font-size: 20px;

    cursor: pointer;

    transition: background 0.2s ease;

}

.menu-toggle:hover {
    background: #e2e8f0;
}


/* BREADCRUMB */

.breadcrumb {

    display: flex;
    align-items: center;

    gap: 9px;

    font-size: 13px;

}

.breadcrumb-home {
    color: var(--text-secondary);
}

.breadcrumb-separator {
    color: #cbd5e1;
}

.breadcrumb strong {
    color: var(--text-primary);
    font-weight: 600;
}


/* STATUS */

.system-status {

    display: flex;
    align-items: center;

    gap: 7px;

    color: var(--text-secondary);

    font-size: 11px;

}

.status-indicator {

    width: 8px;
    height: 8px;

    background: var(--success);

    border-radius: 50%;

}

.topbar-profile {

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eff6ff;

    border-radius: 50%;

    font-size: 17px;

}


/* =========================================
   CONTEÚDO
========================================= */

.main-content {

    flex: 1;

    padding: 28px;

}

.page-container {

    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

}


/* =========================================
   RODAPÉ
========================================= */

.main-footer {

    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 10px 28px;

    background: var(--surface);

    border-top: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 11px;

}


/* =========================================
   MENU RECOLHIDO
========================================= */

.sidebar-collapsed .sidebar {

    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);

}

.sidebar-collapsed .main-wrapper {

    margin-left: var(--sidebar-collapsed-width);

}

.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .menu-label,
.sidebar-collapsed .menu-section-title,
.sidebar-collapsed .menu-badge,
.sidebar-collapsed .sidebar-user-info {

    opacity: 0;
    width: 0;

    overflow: hidden;

}

.sidebar-collapsed .sidebar-header {

    justify-content: center;
    padding: 0;

}

.sidebar-collapsed .sidebar-footer {

    justify-content: center;
    padding: 18px 8px;

}

.sidebar-collapsed .menu-item {

    justify-content: center;
    padding: 0;

}

.sidebar-collapsed .menu-icon {

    width: 100%;

}


/* =========================================
   OVERLAY MOBILE
========================================= */

.sidebar-overlay {
    display: none;
}


/* =========================================
   RESPONSIVIDADE
========================================= */

@media (max-width: 768px) {

    .sidebar {

        transform: translateX(-100%);

        width: var(--sidebar-width);
        min-width: var(--sidebar-width);

    }

    .main-wrapper {

        margin-left: 0;

    }

    .sidebar-collapsed .sidebar {

        width: var(--sidebar-width);
        min-width: var(--sidebar-width);

    }

    .sidebar-collapsed .main-wrapper {

        margin-left: 0;

    }

    .sidebar-collapsed .sidebar-brand,
    .sidebar-collapsed .menu-label,
    .sidebar-collapsed .menu-section-title,
    .sidebar-collapsed .menu-badge,
    .sidebar-collapsed .sidebar-user-info {

        opacity: 1;
        width: auto;

    }

    .sidebar-collapsed .sidebar-header {

        justify-content: flex-start;
        padding: 0 20px;

    }

    .sidebar-collapsed .sidebar-footer {

        justify-content: flex-start;
        padding: 18px;

    }

    .sidebar-collapsed .menu-item {

        justify-content: flex-start;
        padding: 0 12px;

    }

    .sidebar-collapsed .menu-icon {
        width: 25px;
    }

    .mobile-menu-open .sidebar {

        transform: translateX(0);

    }

    .mobile-menu-open .sidebar-overlay {

        display: block;

        position: fixed;
        inset: 0;

        background: rgba(15,23,42,0.45);

        z-index: 900;

    }

    .topbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 18px;
    }

    .main-footer {

        padding: 12px 18px;

        flex-direction: column;
        align-items: flex-start;

    }

}

@media (max-width: 480px) {

    .system-status {
        display: none;
    }

    .breadcrumb {
        font-size: 12px;
    }

    .main-content {
        padding: 12px;
    }

}