/*
===============================================================================
 RITTER ATACADISTA - CSS PRINCIPAL
 Arquivo: css/style.css

 Organização:
   01. Variáveis e reset
   02. Estrutura geral
   03. Sidebar / navegação
   04. Cabeçalho
   05. Cards e indicadores
   06. Gráficos
   07. Alertas
   08. Ofertas
   09. Tabela de produtos
   10. Componentes auxiliares
   11. Responsividade

 Observação:
 O CSS original possuía duas camadas de estilos. Elas foram mantidas em ordem
 para preservar o visual atual, mas agora ficam em um único arquivo.
===============================================================================
*/


/* ==========================================================================
   01. ESTILOS BASE / VERSÃO ORIGINAL
   ========================================================================== */
*{box-sizing:border-box}
body{margin:0;background:#080a0c;color:#f5f5f5;font:14px Segoe UI,Arial,sans-serif}
.app{display:flex;min-height:100vh}
.side{width:205px;position:fixed;inset:0 auto 0 0;background:#07090b;border-right:1px solid #292d31;padding:18px 12px}
.logo{display:flex;gap:10px;align-items:center;padding:0 8px 18px;border-bottom:1px solid #292d31;margin-bottom:18px}
.r{font-size:40px;font-weight:900;color:#ffbd00;font-style:italic}
.logo b{font-size:21px}
.logo small{display:block;font-size:8px;letter-spacing:2px;color:#ccc}
.nav a{display:block;color:#cbd0d5;text-decoration:none;padding:11px 12px;border-radius:8px;margin:3px 0}
.nav a:hover{background:#171b1f}
.nav .on{background:#ffbd00;color:#111;font-weight:700}
.profile{position:absolute;bottom:15px;border-top:1px solid #292d31;left:14px;right:14px;padding-top:14px;display:flex;gap:8px;align-items:center}
.avatar{background:white;color:#222;border-radius:50%;width:34px;height:34px;display:grid;place-items:center;font-weight:bold}
.profile small{color:#9ea5ad}
.main{margin-left:205px;width:calc(100% - 205px);padding:0 20px 28px}
.top{height:62px;border-bottom:1px solid #292d31;display:flex;align-items:center;justify-content:space-between}
.top b{font-size:19px}
.brand{color:#ffbd00;font-size:21px;font-weight:900}
.wrap{max-width:1450px;margin:auto}
h2{font-size:18px;margin:20px 0 12px}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.card,.panel{background:linear-gradient(145deg,#15191d,#101315);border:1px solid #30353a;border-radius:10px;box-shadow:0 8px 25px #0008}
.metric{padding:15px;min-height:105px}
.muted{font-size:10px;color:#aeb5bd;text-transform:uppercase}
.value{font-size:25px;font-weight:800;margin:8px 0}
.green{color:#55c75c}
.orange{color:#ffb400}
.red{color:#ff3835}
.sub{font-size:11px;color:#72d279}
.grid{display:grid;grid-template-columns:1.1fr .9fr;gap:12px;margin-top:12px}
.panel{padding:15px}
.panel h3{margin:0 0 14px;font-size:14px}
.chart{height:220px;display:flex;align-items:end;gap:14px;padding:10px 20px 32px;position:relative;border-bottom:1px solid #292d31}
.bar{background:#ffb400;flex:1;max-width:55px;border-radius:4px 4px 0 0;position:relative}
.bar span{position:absolute;top:calc(100% + 8px);font-size:9px;color:#9ca2a9;left:50%;transform:translateX(-50%)}
.donutbox{height:220px;display:flex;align-items:center;justify-content:center;gap:25px}
.donut{width:150px;height:150px;border-radius:50%;background:conic-gradient(#55c75c 0 66.35%,#ffb400 66.35% 70.4%,#ff3835 70.4% 100%);position:relative}
.donut:after{content:'1159\A Total';white-space:pre;text-align:center;position:absolute;inset:35px;border-radius:50%;background:#111519;display:grid;place-content:center;font-weight:800;font-size:18px}
.legend{line-height:2.3;font-size:11px}
.dot{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:7px}
.g{background:#55c75c}
.o{background:#ffb400}
.rd{background:#ff3835}
.alert{margin-top:12px}
.row{display:grid;grid-template-columns:70px 1fr 120px 90px 150px;padding:9px 8px;border-top:1px solid #292d31;font-size:11px}
.head{color:#aeb5bd;font-weight:bold;background:#191d21}
.offers{display:grid;grid-template-columns:1.35fr .7fr 1fr;gap:12px;margin-top:12px}
.offergrid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.offer{text-align:center;border:1px solid #3a3f43;border-radius:7px;padding:9px;background:#0d1012}
.pic{height:75px;font-size:38px;display:grid;place-items:center}
.price{color:#ffbd00;font-size:17px;font-weight:800;margin-top:8px}
.unit{font-size:9px;color:#aaa}
.quick{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.quick div{border:1px solid #353a3f;border-radius:7px;padding:13px 3px;text-align:center;font-size:10px}
.quick b{display:block;color:#ffbd00;font-size:22px;margin-bottom:5px}
.cat{display:flex;gap:8px;align-items:center;margin:12px 0;font-size:11px}
.cat label{width:65px}
.track{height:8px;flex:1;background:#292d31;border-radius:10px}
.fill{height:100%;background:#ffb400;border-radius:10px}
.table{margin-top:12px;padding:15px}
.toolbar{display:flex;gap:8px;margin-bottom:12px}
.search,.select,.btn{background:#0b0e10;color:#eee;border:1px solid #353a3f;border-radius:7px;padding:10px}
.search{flex:1}
.btn{background:#ffbd00;color:#111;font-weight:bold}
table{width:100%;border-collapse:collapse;font-size:11px}
th{text-align:left;background:#191d21;color:#aeb5bd;padding:10px}
td{padding:9px;border-bottom:1px solid #292d31}
.status{padding:4px 8px;border-radius:4px;font-size:9px;font-weight:bold}
.status.ok{background:#153c1d;color:#72dc79}
.status.low{background:#4b3b0c;color:#ffc52c}
.status.neg{background:#4b1716;color:#ff7773}
.pagination{text-align:right;margin-top:12px}
.page{display:inline-block;border:1px solid #353a3f;padding:6px 9px;border-radius:4px;margin-left:4px;font-size:10px}
.page.active{border-color:#ffbd00;color:#ffbd00}
@media(max-width:1050px){.side{width:72px}
.logo b,.logo small,.nav span,.profile div:not(.avatar){display:none}
.main{margin-left:72px;width:calc(100% - 72px)}
.cards,.offers{grid-template-columns:repeat(2,1fr)}
.grid{grid-template-columns:1fr}
.offergrid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.cards,.offers{grid-template-columns:1fr}
.main{padding:0 10px}
.row{grid-template-columns:55px 1fr 75px}
.row>*:nth-child(4),.row>*:nth-child(5){display:none}
.offergrid{grid-template-columns:repeat(2,1fr)}}


/* ==========================================================================
   02. REFINOS VISUAIS / OVERRIDES
   Estas regras complementam e refinam os estilos base.
   ========================================================================== */
:root{--gold:#ffbd00;--gold2:#f4a900;--bg:#080a0d;--panel:#111519;--border:#252c32;--text:#f4f6f8;--muted:#8f99a3}
            *{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:radial-gradient(circle at 80% 0%,rgba(255,189,0,.055),transparent 28%),linear-gradient(180deg,#080a0d,#0a0d10);color:var(--text);font:14px "Segoe UI",Arial,sans-serif}
.side{width:238px;padding:20px 14px;background:linear-gradient(180deg,#07090b,#090c0f);border-right:1px solid #20262b;box-shadow:18px 0 45px rgba(0,0,0,.22)}
.logo{height:78px;padding:2px 8px 17px;margin-bottom:20px;border-bottom:1px solid #242a30;display:flex;align-items:center}
.logo img{width:176px;height:60px;object-fit:contain;object-position:left center;display:block}
.nav a{color:#aeb7c0;padding:12px 13px;margin:5px 0;border:1px solid transparent;transition:.18s ease;font-size:13px}
.nav a:hover{color:#fff;background:#12161a;border-color:#252c32;transform:translateX(2px)}
.nav .on{color:#111!important;background:linear-gradient(135deg,#ffca22,#ffae00);border-color:#ffca22;box-shadow:0 8px 22px rgba(255,189,0,.16)}
.profile{padding:15px 4px 0;color:#e8ebee}
.avatar{width:38px;height:38px;box-shadow:0 0 0 3px #171c21}
.main{margin-left:238px;width:calc(100% - 238px);padding:0 28px 34px}
.top{height:72px;max-width:1510px;margin:auto}
.top b{font-size:18px}
.brand{width:155px;height:52px;display:flex;justify-content:flex-end;align-items:center}
.brand img{width:145px;height:50px;object-fit:contain}
.wrap{max-width:1510px}
h2{font-size:20px;margin:25px 0 14px}
.cards{gap:14px}
.card,.panel{border-radius:14px;border:1px solid var(--border);background:linear-gradient(145deg,#151a1f,#0f1317);box-shadow:0 12px 34px rgba(0,0,0,.20)}
.card:hover,.panel:hover{border-color:#343c43}
.metric{padding:18px;min-height:116px;position:relative;overflow:hidden}
.metric:after{content:"";position:absolute;width:90px;height:90px;right:-32px;bottom:-40px;border-radius:50%;background:rgba(255,189,0,.055)}
.muted{font-size:10px;letter-spacing:.07em}
.value{font-size:28px}
.grid,.offers{gap:15px;margin-top:15px}
.panel{padding:17px}
.panel h3{font-size:14px;margin:0 0 15px}
.chart{height:235px;padding:15px 20px 34px;background:linear-gradient(180deg,rgba(255,255,255,.012),transparent)}
.bar{background:linear-gradient(180deg,#ffc72a,#f0a900);box-shadow:0 -5px 18px rgba(255,189,0,.08);min-width:22px}
.donut{box-shadow:0 0 35px rgba(0,0,0,.35)}
.alert{overflow:hidden}
.row{min-height:43px;align-items:center;padding:10px 12px}
.row:not(.head):hover{background:#151a1e}
.head{border-radius:7px;margin-bottom:2px}
.offer{border-radius:10px;background:linear-gradient(180deg,#111519,#0c0f12);border-color:#2c3339;transition:.18s ease}
.offer:hover{transform:translateY(-2px);border-color:#80650b}
.table{margin-top:15px}
.toolbar{padding:4px;border-radius:10px;background:#0b0e11;border:1px solid #242a30}
.search,.select,.btn{border-radius:8px;border-color:#30373e}
.search:focus,.select:focus{outline:none;border-color:#b88700;box-shadow:0 0 0 3px rgba(255,189,0,.08)}
.btn{background:linear-gradient(135deg,#ffc51e,#ffae00);border-color:#ffbd00;padding:10px 15px}
table{font-size:12px}
th{padding:12px 10px;background:#181d22;border-bottom:1px solid #30363c}
td{padding:11px 10px}
tr:last-child td{border-bottom:0}
.status{display:inline-block;min-width:90px;text-align:center;border-radius:20px;padding:5px 9px}
.pagination .page{background:#0d1114}
.pagination .page.active{background:rgba(255,189,0,.08)}
            @media(max-width:1050px){
            .side{width:78px}
.logo{justify-content:center;padding-left:0;padding-right:0}
.logo img{width:50px;object-position:left}
.main{margin-left:78px;width:calc(100% - 78px)}
            }
            @media(max-width:700px){
            .main{padding:0 10px 25px}
.top{height:62px}
.brand{display:none}
            }

/* ==========================================================================\n   12. RESPONSIVIDADE MOBILE - PAINEL\n   --------------------------------------------------------------------------\n   No celular a navegação permanece fixa à esquerda, porém reduzida para\n   aproximadamente 147px. O conteúdo ocupa todo o espaço restante.\n   ========================================================================== */
@media (max-width: 768px) {
    html,
    body {
        min-width: 0;
        overflow-x: hidden;
    }

    .app {
        min-height: 100vh;
        width: 100%;
    }

    /* Sidebar mobile: largura semelhante ao layout de referência */
    .side {
        width: 147px;
        padding: 18px 18px 16px;
        z-index: 20;
    }

    .logo {
        height: 74px;
        margin: 0 0 24px;
        padding: 0 0 16px;
        justify-content: center;
    }

    .logo img {
        width: 92px;
        height: 46px;
        object-fit: contain;
        object-position: center;
    }

    /* Mantemos somente os ícones no menu, mas aumentamos a área de toque. */
    .nav a {
        width: 100%;
        height: 58px;
        margin: 5px 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        border-radius: 12px;
    }

    .nav a span {
        display: none;
    }

    .nav a:hover {
        transform: none;
    }

    .nav .on {
        box-shadow: 0 8px 20px rgba(255, 189, 0, .18);
    }

    /* Perfil reduzido para não ocupar espaço desnecessário. */
    .profile {
        left: 18px;
        right: 18px;
        bottom: 14px;
        padding-top: 12px;
        justify-content: center;
    }

    .profile > div:not(.avatar) {
        display: none;
    }

    .avatar {
        width: 54px;
        height: 54px;
        font-size: 17px;
        box-shadow: 0 0 0 4px #171c21, 0 5px 18px rgba(0,0,0,.35);
    }

    /* Área principal: começa exatamente depois da sidebar. */
    .main {
        margin-left: 147px;
        width: calc(100% - 147px);
        padding: 0 20px 28px;
        min-width: 0;
    }

    .top {
        height: 74px;
        width: 100%;
        gap: 12px;
        white-space: nowrap;
    }

    .top b {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top > span {
        margin-left: auto;
        font-size: 13px;
        flex-shrink: 0;
    }

    .brand {
        display: none;
    }

    .wrap {
        width: 100%;
        max-width: none;
    }

    h2 {
        font-size: 25px;
        margin: 28px 0 18px;
    }

    /* Cards sempre em uma coluna no celular. */
    .cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .metric {
        min-height: 190px;
        padding: 28px 34px;
        border-radius: 18px;
    }

    .metric:after {
        width: 125px;
        height: 125px;
        right: -45px;
        bottom: -58px;
    }

    .muted {
        font-size: 12px;
        letter-spacing: .08em;
    }

    .value {
        font-size: 46px;
        line-height: 1.05;
        margin: 22px 0 14px;
    }

    .sub {
        font-size: 15px;
    }

    /* Gráficos também ficam empilhados. */
    .grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 14px;
    }

    .panel {
        border-radius: 18px;
        padding: 20px;
    }

    .panel h3 {
        font-size: 17px;
        line-height: 1.25;
    }

    .chart {
        height: 250px;
        padding: 18px 12px 36px;
        gap: 9px;
    }

    .bar {
        min-width: 16px;
    }

    /* Esconde informações secundárias do gráfico circular para ganhar espaço. */
    .donutbox {
        min-height: 220px;
        flex-wrap: wrap;
    }

    .alert,
    .offers,
    .table {
        margin-top: 14px;
    }

    /* Tabelas passam a permitir rolagem horizontal sem quebrar o layout. */
    .alert {
        overflow-x: auto;
    }

    .alert .row {
        min-width: 480px;
    }

    .offers {
        grid-template-columns: 1fr;
    }

    .offergrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Inputs e controles ficam mais fáceis de tocar. */
    .toolbar {
        flex-wrap: wrap;
    }

    .search,
    .select,
    .btn {
        min-height: 44px;
    }
}

/* Celulares mais estreitos: reduzimos apenas os espaçamentos, sem alterar a
   largura da sidebar, para preservar a identidade do layout. */
@media (max-width: 430px) {
    .side {
        width: 88px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .logo {
        height: 62px;
        margin-bottom: 16px;
    }

    .logo img {
        width: 62px;
        height: 36px;
    }

    .nav a {
        height: 52px;
        font-size: 16px;
        border-radius: 10px;
    }

    .profile {
        left: 12px;
        right: 12px;
    }

    .avatar {
        width: 48px;
        height: 48px;
    }

    .main {
        margin-left: 88px;
        width: calc(100% - 88px);
        padding: 0 11px 22px;
    }

    .top {
        height: 62px;
    }

    .top b {
        font-size: 15px;
    }

    .top > span {
        font-size: 10px;
    }

    h2 {
        font-size: 22px;
        margin: 22px 0 14px;
    }

    .metric {
        min-height: 155px;
        padding: 22px 20px;
    }

    .value {
        font-size: 38px;
        margin: 16px 0 10px;
    }

    .sub {
        font-size: 12px;
    }
}


/* ============================================================================
   13. MOBILE — MENU + LISTA DE PRODUTOS
   ----------------------------------------------------------------------------
   Regras finais para celular.
   - A barra lateral fica escondida e abre pelo botão ☰.
   - A consulta de produtos continua sendo uma TABELA, como no computador.
   - A tabela apenas fica mais compacta e pode rolar horizontalmente.
   - Não usamos cards para cada produto.
   ============================================================================ */

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
}

.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* ======================================================================
       MENU LATERAL
       ====================================================================== */
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .side {
        width: 245px;
        left: 0;
        right: auto;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .45);
        z-index: 1001;
    }

    .side.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .62);
        backdrop-filter: blur(2px);
        z-index: 1000;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 0 14px 28px;
    }

    /* ======================================================================
       CABEÇALHO
       ====================================================================== */
    .top {
        height: 66px;
        gap: 10px;
    }

    .top b {
        font-size: 19px;
    }

    .top > span {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ======================================================================
       CONSULTA DE PRODUTOS
       ====================================================================== */
    .table {
        padding: 18px 0 16px;
        overflow: hidden;
    }

    .table h3 {
        padding: 0 18px;
        margin: 0 0 16px;
        font-size: 20px;
    }

    /* Barra de pesquisa permanece em duas linhas. */
    .toolbar {
        margin: 0 14px 18px;
        padding: 9px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 120px;
        gap: 8px;
        background: #0a0d10;
        border-radius: 14px;
    }

    .toolbar .search {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        height: 50px;
        padding: 0 14px;
        font-size: 15px;
    }

    .toolbar .select,
    .toolbar .btn {
        width: 100%;
        min-width: 0;
        height: 50px;
        font-size: 14px;
    }

    .toolbar .select {
        padding: 0 8px;
    }

    /* ======================================================================
       LISTA / TABELA
       ----------------------------------------------------------------------
       O wrapper é o único elemento que recebe rolagem horizontal.
       Assim, título e filtros permanecem no lugar.
       ====================================================================== */
    .table-scroll {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .table table {
        display: table !important;
        width: 680px;
        min-width: 680px;
        max-width: none;
        margin: 0;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 11px;
    }

    .table thead {
        display: table-header-group !important;
    }

    .table tbody {
        display: table-row-group !important;
        padding: 0 !important;
    }

    .table tr {
        display: table-row !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .table th,
    .table td {
        display: table-cell !important;
        box-sizing: border-box;
        height: 48px;
        padding: 8px 9px;
        vertical-align: middle;
        white-space: nowrap;
        border: 0;
        border-bottom: 1px solid #292f35;
        text-align: left;
        line-height: 1.25;
    }

    .table th {
        height: 42px;
        padding: 10px 9px;
        background: #181d22;
        color: #aeb6bf;
        font-size: 10px;
        font-weight: 700;
        border-bottom: 1px solid #30373e;
    }

    .table tbody tr:hover {
        background: #151a1e !important;
    }

    /* Código */
    .table th:nth-child(1),
    .table td:nth-child(1) {
        width: 58px;
        min-width: 58px;
        font-weight: 700;
    }

    /* Descrição */
    .table th:nth-child(2),
    .table td:nth-child(2) {
        width: 190px;
        min-width: 190px;
        max-width: 190px;
    }

    .table td:nth-child(2) {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
        color: #eef1f3;
    }

    /* Unidade */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        width: 48px;
        min-width: 48px;
        text-align: center !important;
    }

    /* Mínimo e Atual */
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        width: 66px;
        min-width: 66px;
        text-align: right !important;
    }

    /* Custo e Venda */
    .table th:nth-child(6),
    .table td:nth-child(6),
    .table th:nth-child(7),
    .table td:nth-child(7) {
        width: 78px;
        min-width: 78px;
        text-align: right !important;
    }

    /* Status */
    .table th:nth-child(8),
    .table td:nth-child(8) {
        width: 96px;
        min-width: 96px;
        text-align: center !important;
    }

    .table td:nth-child(3),
    .table td:nth-child(4),
    .table td:nth-child(5),
    .table td:nth-child(6),
    .table td:nth-child(7) {
        font-size: 11px;
        font-weight: 600;
    }

    /* Cores de alerta do estoque. */
    .table td.red {
        color: #ff4242 !important;
        font-weight: 800;
    }

    .table td.orange {
        color: #ffb300 !important;
        font-weight: 800;
    }

    .table .status {
        display: inline-block !important;
        width: auto;
        min-width: 78px;
        padding: 4px 7px;
        font-size: 8px;
        line-height: 1.1;
    }

    /* Paginação */
    .pagination {
        overflow-x: auto;
        white-space: nowrap;
        padding: 12px 14px 0;
    }
}

/* ============================================================================
   14. MOBILE ESTREITO
   ----------------------------------------------------------------------------
   Em aparelhos pequenos reduzimos somente medidas da interface.
   A tabela continua sendo uma lista horizontal, nunca cartões.
   ============================================================================ */
@media (max-width: 430px) {
    .main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .top {
        height: 62px;
    }

    .top b {
        font-size: 18px;
    }

    .top > span {
        max-width: 125px;
        font-size: 10px;
    }

    .table {
        padding: 16px 0;
    }

    .table h3 {
        padding: 0 16px;
        margin-bottom: 14px;
        font-size: 19px;
    }

    .toolbar {
        margin-left: 16px;
        margin-right: 16px;
        grid-template-columns: minmax(0, 1fr) 108px;
    }

    .table table {
        width: 650px;
        min-width: 650px;
        font-size: 10px;
    }

    .table th {
        height: 40px;
        padding: 9px 7px;
        font-size: 9px;
    }

    .table td {
        height: 48px;
        padding: 7px;
        font-size: 10px;
    }

    .table th:nth-child(1),
    .table td:nth-child(1) {
        width: 52px;
        min-width: 52px;
    }

    .table th:nth-child(2),
    .table td:nth-child(2) {
        width: 178px;
        min-width: 178px;
        max-width: 178px;
    }

    .table th:nth-child(3),
    .table td:nth-child(3) {
        width: 45px;
        min-width: 45px;
    }

    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        width: 62px;
        min-width: 62px;
    }

    .table th:nth-child(6),
    .table td:nth-child(6),
    .table th:nth-child(7),
    .table td:nth-child(7) {
        width: 75px;
        min-width: 75px;
    }

    .table th:nth-child(8),
    .table td:nth-child(8) {
        width: 100px;
        min-width: 100px;
    }
}

/* ============================================================================
   15. AJUSTE FINAL — MENU LATERAL NO CELULAR
   ----------------------------------------------------------------------------
   No celular a sidebar fica TOTALMENTE escondida por padrão.
   O usuário acessa o menu somente pelo botão de três linhas (☰) no cabeçalho.

   Importante:
   Este bloco vem por último para sobrescrever regras mobile antigas do arquivo.
   ============================================================================ */

@media (max-width: 768px) {
    /* ------------------------------------------------------------------------
       Sidebar fechada
       ------------------------------------------------------------------------ */
    .side {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 270px !important;
        max-width: 82vw !important;
        margin: 0 !important;
        padding: 20px 18px !important;
        box-sizing: border-box !important;
        transform: translateX(-110%) !important;
        transition: transform .25s ease !important;
        z-index: 1001 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* ------------------------------------------------------------------------
       Sidebar aberta pelo botão ☰
       ------------------------------------------------------------------------ */
    .side.mobile-open {
        transform: translateX(0) !important;
    }

    /* ------------------------------------------------------------------------
       Conteúdo principal ocupa 100% da largura no celular
       ------------------------------------------------------------------------ */
    .main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ------------------------------------------------------------------------
       Botão de três linhas
       ------------------------------------------------------------------------ */
    .menu-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        height: 42px !important;
        flex: 0 0 42px !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: var(--text, #f4f6f8) !important;
        font-size: 25px !important;
        line-height: 1 !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .menu-toggle:active {
        background: rgba(255, 189, 0, .12) !important;
    }

    /* ------------------------------------------------------------------------
       Fundo escuro somente enquanto o menu estiver aberto
       ------------------------------------------------------------------------ */
    .mobile-overlay {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 1000 !important;
        background: rgba(0, 0, 0, .62) !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }

    .mobile-overlay.active {
        display: block !important;
    }
}

/* Celulares pequenos: o menu aberto continua confortável sem ocupar a tela toda. */
@media (max-width: 430px) {
    .side {
        width: 270px !important;
        max-width: 82vw !important;
    }
}

/* ============================================================================
   16. CORREÇÃO DEFINITIVA — SIDEBAR MOBILE
   ----------------------------------------------------------------------------
   Objetivo:
   - No celular a sidebar NÃO ocupa espaço do layout.
   - Ela permanece completamente fora da tela enquanto fechada.
   - O conteúdo principal usa 100% da largura.
   - O menu aparece somente quando .mobile-open é aplicado pelo JavaScript.
   ============================================================================ */
@media screen and (max-width: 768px) {
    /* O aplicativo não reserva nenhuma coluna para a sidebar. */
    .app {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Sidebar fechada: fora da tela e sem capturar toques. */
    .side {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(280px, 84vw) !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 20px 16px !important;
        transform: translate3d(-105%, 0, 0) !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
        z-index: 2000 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition:
            transform .25s ease,
            opacity .18s ease,
            visibility 0s linear .25s !important;
    }

    /* Sidebar aberta pelo botão de três linhas. */
    .side.mobile-open {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        transition:
            transform .25s ease,
            opacity .18s ease,
            visibility 0s linear 0s !important;
    }

    /* O conteúdo nunca deve ficar deslocado pela sidebar. */
    .main {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    /* Cabeçalho ocupa toda a largura disponível. */
    .top {
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
    }

    .menu-toggle {
        display: inline-flex !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #f4f6f8 !important;
        font-size: 25px !important;
        line-height: 1 !important;
        cursor: pointer !important;
    }

    /* Fundo escuro só existe quando o menu estiver aberto. */
    .mobile-overlay {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        z-index: 1999 !important;
        background: rgba(0, 0, 0, .68) !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }

    .mobile-overlay.active {
        display: block !important;
    }

    /* Sidebar aberta: organização interna mais próxima do desktop. */
    .side .logo {
        height: 78px !important;
        margin-bottom: 22px !important;
        justify-content: center !important;
    }

    .side .logo img {
        width: 145px !important;
        height: 58px !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .side .nav a {
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        padding: 0 14px !important;
        margin: 5px 0 !important;
        border-radius: 10px !important;
        font-size: 15px !important;
    }

    .side .nav a span {
        display: inline !important;
    }

    .side .profile {
        left: 16px !important;
        right: 16px !important;
        justify-content: flex-start !important;
    }

    .side .profile > div:not(.avatar) {
        display: block !important;
    }
}

/* Em telas pequenas, o menu fica um pouco mais estreito. */
@media screen and (max-width: 430px) {
    .side {
        width: 270px !important;
        max-width: 84vw !important;
    }
}

/* ============================================================================
   17. AJUSTE FINAL — ESPAÇAMENTO DO MENU MOBILE
   ----------------------------------------------------------------------------
   Evita que o último item (Configurações) fique por baixo do bloco do
   usuário. A área da navegação recebe espaço reservado para o perfil.
   ============================================================================ */
@media screen and (max-width: 768px) {
    .side {
        /* Mantém o perfil no rodapé sem sobrepor os últimos links. */
        padding-bottom: 18px !important;
    }

    .side .nav {
        /* Espaço reservado para o perfil fixado no rodapé. */
        padding-bottom: 105px !important;
    }

    .side .nav a {
        /* Espaçamento vertical mais equilibrado entre os botões. */
        height: 46px !important;
        min-height: 46px !important;
        margin: 4px 0 !important;
    }

    .side .nav a:last-child {
        margin-bottom: 8px !important;
    }

    .side .profile {
        /* O perfil continua no rodapé, mas fica visualmente separado
           do último item do menu. */
        bottom: 14px !important;
        padding-top: 14px !important;
        min-height: 82px !important;
        background: linear-gradient(
            180deg,
            rgba(7, 9, 11, 0),
            rgba(7, 9, 11, .96) 24%
        ) !important;
    }
}

/* Em aparelhos muito baixos, permite rolar o menu sem cortar itens. */
@media screen and (max-width: 768px) and (max-height: 700px) {
    .side .nav {
        padding-bottom: 110px !important;
        overflow-y: auto !important;
        scrollbar-width: thin;
    }

    .side .nav a {
        height: 43px !important;
        min-height: 43px !important;
        margin: 3px 0 !important;
    }
}
