/* Menu lateral + barra fina de cima (21/10/2026). Ver templates/partials/menu_lateral.html. */
:root {
    --sb-largura: 248px;
    --sb-recolhido: 64px;
    --tb-altura: 52px;
    --faixa: 0px;               /* faixa vermelha do ambiente de testes */
    --sb-fundo: #2b1a0c;
    --sb-fundo-2: #3a2412;
    --sb-texto: #f3e6d8;
    --sb-texto-2: #c9b29a;
    --sb-destaque: #f08a00;
}
body.com-menu { padding-top: calc(var(--tb-altura) + var(--faixa) + 12px) !important; padding-left: var(--sb-largura); transition: padding-left .18s ease; }
html.sb-recolhido body.com-menu { padding-left: var(--sb-recolhido); }

.sb-check { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* ---------------- coluna ---------------- */
.sb {
    position: fixed; top: var(--faixa); left: 0; bottom: 0; width: var(--sb-largura);
    background: linear-gradient(180deg, var(--sb-fundo) 0%, var(--sb-fundo-2) 100%);
    color: var(--sb-texto); z-index: 5200; display: flex; flex-direction: column;
    transition: width .18s ease, transform .2s ease; font-family: 'Inter', system-ui, sans-serif;
}
.sb-topo { display: flex; align-items: center; justify-content: space-between; height: var(--tb-altura); padding: 0 10px 0 14px; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.sb-marca { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none !important; font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; }
.sb-marca-ico { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, #f7a200, #d35400); color: #fff; font-weight: 800; }
.sb-recolher { background: none; border: none; color: var(--sb-texto-2); cursor: pointer; width: 30px; height: 30px; border-radius: 7px; }
.sb-recolher:hover { background: rgba(255,255,255,.08); color: #fff; }

.sb-lista { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 8px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sb-secao { margin: 14px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(243,230,216,.45); white-space: nowrap; }

.sb-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 1px 0; border-radius: 8px;
    color: var(--sb-texto) !important; text-decoration: none !important; font-size: .9rem; font-weight: 500;
    cursor: pointer; white-space: nowrap; list-style: none; user-select: none;
}
.sb-item::-webkit-details-marker { display: none; }
.sb-item > i:first-child { width: 20px; text-align: center; font-size: .95rem; color: var(--sb-texto-2); flex-shrink: 0; }
.sb-item:hover { background: rgba(255,255,255,.07); color: #fff !important; }
.sb-item:hover > i:first-child { color: #fff; }
.sb-item.ativo { background: rgba(240,138,0,.18); color: #fff !important; }
.sb-item.ativo > i:first-child { color: var(--sb-destaque); }
.sb-rotulo { overflow: hidden; text-overflow: ellipsis; }
.sb-seta { margin-left: auto; font-size: .65rem; color: var(--sb-texto-2); transition: transform .18s; }
.sb-grupo[open] > .sb-item .sb-seta { transform: rotate(180deg); }

.sb-sub { padding: 2px 0 6px 31px; position: relative; }
.sb-sub::before { content: ''; position: absolute; left: 19px; top: 4px; bottom: 8px; width: 1px; background: rgba(255,255,255,.1); }
.sb-sub a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--sb-texto-2) !important; text-decoration: none !important; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sub a:hover { color: #fff !important; background: rgba(255,255,255,.06); }
.sb-sub a.ativo { color: #fff !important; background: rgba(240,138,0,.18); font-weight: 600; }

/* recolhido: só os ícones (o título de cada um aparece no hover) */
html.sb-recolhido .sb { width: var(--sb-recolhido); }
html.sb-recolhido .sb .sb-rotulo,
html.sb-recolhido .sb .sb-seta,
html.sb-recolhido .sb .sb-sub { display: none; }
html.sb-recolhido .sb .sb-secao { height: 1px; margin: 10px 12px; background: rgba(255,255,255,.1); }
html.sb-recolhido .sb .sb-topo { padding: 0 8px; justify-content: center; flex-direction: column; height: auto; gap: 6px; padding-top: 9px; padding-bottom: 6px; }
html.sb-recolhido .sb .sb-recolher i { transform: rotate(180deg); }
html.sb-recolhido .sb .sb-item { justify-content: center; padding: 10px 0; }

/* ---------------- barra de cima ---------------- */
.tb {
    position: fixed; top: var(--faixa); left: var(--sb-largura); right: 0; height: var(--tb-altura); z-index: 5100;
    display: flex; align-items: center; gap: 6px; padding: 0 14px; background: #fff;
    border-bottom: 1px solid #ece6df; box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: left .18s ease;
}
html.sb-recolhido .tb { left: var(--sb-recolhido); }
.tb-espaco { flex: 1; }
.tb-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px;
    color: #5a4634 !important; text-decoration: none !important; font-size: .86rem; font-weight: 600;
    background: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; list-style: none;
}
.tb-btn::-webkit-details-marker { display: none; }
.tb-btn i { color: #b86200; }
.tb-btn:hover { background: #fff5ea; border-color: #f5d9b8; }
.tb-hamburguer { display: none; }
.tb-copilot { background: linear-gradient(135deg,#fff7ed,#ffe9cc) !important; border-color: #f3c98b !important; color: #b45309 !important; }
.tb-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #f7a200, #d35400); color: #fff; font-weight: 700; font-size: .8rem; }
.tb-usuario { position: relative; }
.tb-usuario-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid #ece6df;
    border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.14); padding: 6px; z-index: 5300;
}
.tb-usuario-menu a, .tb-usuario-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: none; background: none;
    color: #2d241b !important; text-decoration: none !important; font: inherit; font-size: .88rem; cursor: pointer; text-align: left;
}
.tb-usuario-menu a:hover, .tb-usuario-menu button:hover { background: #fff5ea; }
.tb-usuario-menu i { width: 18px; color: #b86200; text-align: center; }
.tb-usuario-menu form { margin: 0; }
.tb-idioma { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 8px; border-bottom: 1px solid #f1ece6; margin-bottom: 4px !important; font-size: .88rem; color: #2d241b; }
.tb-idioma select { height: 30px; border-radius: 7px; border: 1px solid #e3d5c4; padding: 0 6px; font-weight: 600; }

.sb-fundo { display: none; }

/* Tela média: a barra de cima mostra só os ícones dos atalhos. */
@media (max-width: 1280px) {
    .tb .tb-rotulo { display: none; }
    .tb-copilot .tb-rotulo { display: inline; }
}

/* Celular / janela estreita: a coluna vira gaveta que abre pelo ☰. */
@media (max-width: 900px) {
    body.com-menu, html.sb-recolhido body.com-menu { padding-left: 0; }
    .tb, html.sb-recolhido .tb { left: 0; }
    .tb-hamburguer { display: inline-flex; }
    .sb, html.sb-recolhido .sb { width: min(82vw, 290px); transform: translateX(-102%); box-shadow: 8px 0 30px rgba(0,0,0,.3); }
    html.sb-recolhido .sb .sb-rotulo, html.sb-recolhido .sb .sb-seta { display: inline; }
    html.sb-recolhido .sb .sb-seta { display: inline-block; }
    html.sb-recolhido .sb .sb-sub { display: block; }
    html.sb-recolhido .sb .sb-grupo:not([open]) .sb-sub { display: none; }
    html.sb-recolhido .sb .sb-item { justify-content: flex-start; padding: 9px 10px; }
    html.sb-recolhido .sb .sb-topo { flex-direction: row; height: var(--tb-altura); padding: 0 10px 0 14px; justify-content: space-between; }
    html.sb-recolhido .sb .sb-secao { height: auto; background: none; margin: 14px 10px 4px; }
    .sb-recolher { display: none; }
    .sb-check:checked ~ .sb { transform: none; }
    .sb-check:checked ~ .sb-fundo { display: block; position: fixed; inset: 0; background: rgba(20,12,4,.45); z-index: 5150; }
    .tb-copilot .tb-rotulo { display: none; }
}

/* Impressão: só o conteúdo. */
@media print {
    .sb, .tb, .sb-fundo { display: none !important; }
    body.com-menu { padding: 0 !important; }
}

/* A barra de cima mantém o laranja do RCA Connect (pedido do Jefferson). */
.tb { background: linear-gradient(90deg, #f08a00 0%, #c86400 55%, #9e4d00 100%); border-bottom: 2px solid #ffd966; }
.tb-btn, .tb-btn i { color: #fff !important; }
.tb-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.tb-avatar { background: #fff; color: #b45309; }
.tb-copilot, .tb-copilot i { background: #fff !important; border-color: #fff !important; color: #b45309 !important; }
