:root {
    --sidebar-width: 230px;
    --marrom-escuro: #3D3025;
    --marrom-claro: #6E5C4A;
    --bege: #E9E3DC;
    --dourado: #C5B08A;
    --texto: #2A2A2A;
    --branco: #FFFFFF;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bege);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: var(--texto);
}

body.logged-in {
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin-top: 0;
    color: var(--marrom-escuro);
}

/* ===== SIDEBAR DESKTOP ===== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--marrom-escuro);
    color: var(--branco);
    padding: 18px 14px;
    z-index: 2500;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #fff !important;
    text-align: center;
}

.sidebar small {
    display: block;
    margin-top: 6px;
    margin-bottom: 22px;
    font-size: 14px;
    color: #f1f1f1 !important;
    text-align: center;
    line-height: 1.3;
}

.sidebar .section-title {
    margin: 18px 6px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #d6c7b7;
    opacity: .9;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f3f3f3 !important;
    text-decoration: none;
    padding: 10px 12px;
    margin: 0 0 6px 0;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.2;
}

.sidebar a:hover {
    background: var(--marrom-claro);
    color: #fff !important;
}

.sidebar i {
    min-width: 16px;
}

/* ===== ÁREAS DESLOCADAS QUANDO LOGADO ===== */

.header-wrap-rede,
.userbar-wrap-rede,
.content-wrap-rede {
    margin-left: 0;
}

.logged-in .header-wrap-rede,
.logged-in .userbar-wrap-rede,
.logged-in .content-wrap-rede {
    margin-left: var(--sidebar-width);
}

/* ===== CONTEÚDO ===== */

.content-inner {
    padding: 24px 28px 40px 28px;
}

/* ===== HEADER / LOGOS ===== */

.header-logo-small {
    height: 56px;
    width: auto;
    object-fit: contain;
}

/* ===== COMPONENTES ===== */

.box {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.box .heading {
    font-size: 0.85rem;
    color: #777;
}

.box .title {
    font-size: 1.8rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th,
table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

table th {
    background: var(--marrom-claro);
    color: #fff;
    text-align: left;
}

button {
    border-radius: 4px;
}

/* ===== BOTÃO HAMBURGUER ===== */

.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 3001;
    background: #3D3025;
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}

/* ===== OVERLAY MOBILE ===== */

.menu-overlay {
    display: none;
}

/* ===== RESPONSIVO / MOBILE ===== */

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        width: 270px !important;
        transform: translateX(-100%);
        box-shadow: 2px 0 12px rgba(0,0,0,0.25);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 2400;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    body.menu-open .menu-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .logged-in .header-wrap-rede,
    .logged-in .userbar-wrap-rede,
    .logged-in .content-wrap-rede {
        margin-left: 0 !important;
    }

    .header-wrap-rede {
        padding-top: 0;
    }

    .novo-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 14px 12px 12px 12px;
    }

    .header-left {
        min-width: auto !important;
        width: 100%;
        padding: 12px 16px !important;
    }

    .header-center {
        padding: 0 !important;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-logo-small {
        height: 42px;
    }

    .user-bar-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .content-inner {
        padding: 12px;
    }

    .box .title {
        font-size: 1.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===== IMPRESSÃO ===== */

@media print {
    .sidebar,
    .userbar-wrap-rede,
    .menu-toggle,
    .menu-overlay,
    .no-print {
        display: none !important;
    }

    .logged-in .header-wrap-rede,
    .logged-in .content-wrap-rede {
        margin-left: 0 !important;
    }

    .content-inner {
        padding: 0 !important;
    }
}


/* ===== DASHBOARD MOBILE ===== */
@media (max-width: 900px) {
    .columns.is-multiline {
        display: block;
    }

    .columns.is-multiline > .column {
        width: 100% !important;
        display: block;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 12px;
    }

    .box {
        padding: 14px;
    }

    .box .heading {
        font-size: 0.8rem;
    }

    .box .title {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .title.is-4,
    .title.is-5,
    .subtitle {
        font-size: 1rem !important;
    }

    canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 280px;
    }
}

.grafico-wrap {
    position: relative;
    width: 100%;
    min-height: 320px;
}

@media (max-width: 900px) {
    .grafico-wrap {
        min-height: 220px;
    }
}

@media (max-width: 900px) {
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 900px;
    }

    .table-wrap .table th,
    .table-wrap .table td {
        font-size: 13px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .table-wrap .button.is-small {
        font-size: 12px;
        padding-left: 10px;
        padding-right: 10px;
    }
}
