@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ==========================================================================
   RESET E CONFIGURAÇÕES GERAIS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   SIDEBAR (BARRA LATERAL)
   ========================================================================== */
aside {
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
    width: 260px;
    min-width: 260px;
    height: 100vh;          /* Garante altura total da janela */
    position: sticky;       /* Mantém a barra fixa ao rolar a página */
    top: 0;
    transition: all 0.3s ease;
    z-index: 1050;
}

/* Marca / Logo */
.brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #1e293b;
}

.brand div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand i.logo-icon {
    font-size: 1.5rem;
    color: #38bdf8;
}

.brand span {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Botão Fechar Sidebar (Mobile) */
.close-sidebar-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
}

/* Itens do Menu */
.menu {
    list-style: none;
    padding: 1.5rem 0;
    flex: 1;                /* Empurra o rodapé dinamicamente para baixo */
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.menu-item a:hover,
.menu-item.active a {
    color: #fff;
    background-color: #1e293b;
}

.menu-item.active a {
    border-left: 4px solid #38bdf8;
    padding-left: calc(1.5rem - 4px);
}

/* Rodapé do Menu (Sair) */
.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 1px solid #1e293b;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: #ff6b6b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-link:hover {
    color: #f87171;
    background-color: rgba(255, 107, 107, 0.1);
}

/* Overlay de fundo (Mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    display: none;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL E HEADER
   ========================================================================== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    min-height: 100vh;
}

header {
    background: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    height: 70px;
}

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

/* Botão Hambúrguer (Mobile) */
.toggle-sidebar-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    display: none;
    font-size: 1rem;
    transition: all 0.2s;
}

.toggle-sidebar-btn:hover {
    background: #e2e8f0;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

/* Bloco de Perfil do Usuário Dinâmico */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-info .user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.user-info .user-role {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Área Interna de Conteúdo */
.content {
    padding: 2rem;
    flex: 1;
}

.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   TABELAS
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

table th {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

table tr:hover {
    background: #f8fafc;
}

/* ==========================================================================
   RODAPÉ DA PÁGINA (FOOTER)
   ========================================================================== */
footer {
    background: #ffffff;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   📱 REGRAS DE RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 992px) {
    aside {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
    }

    aside.active {
        left: 0;
        box-shadow: 10px 0 25px -5px rgba(0, 0, 0, 0.3);
    }

    .toggle-sidebar-btn,
    .close-sidebar-btn {
        display: block;
    }

    header {
        padding: 1rem;
    }

    .content {
        padding: 1.25rem;
    }

    /* Oculta os textos do usuário mantendo apenas o Avatar para salvar espaço */
    .user-info {
        display: none !important;
    }
}