@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Lato:wght@300;400;700&display=swap');

:root {
    --midnight: #181c32;
    --navy: #22285a;
    --navy-hover: #2a3272;
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --gold-glow: rgba(201,168,76,0.15);
    --cream: #f7f3ec;
    --warm-white: #fdfaf5;
    --muted: #8c8a99;
    --border-light: #eae6dd;
    --texto: #2c2a3d;

    --verde: #0f6e56;
    --verde-bg: rgba(29,158,117,.1);
    --vermelho: #993c1d;
    --vermelho-bg: rgba(216,90,48,.1);

    --sidebar-w: 260px;
    --raio: 14px;
    --raio-sm: 9px;
    --sombra: 0 1px 2px rgba(24,28,50,.04), 0 4px 16px rgba(24,28,50,.05);
    --sombra-md: 0 8px 24px rgba(24,28,50,.09);
    --sombra-lg: 0 24px 64px rgba(15,17,35,.35);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f2efe8;
    color: var(--texto);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--gold);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd6c4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

@keyframes surgir {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Login (tela dividida) ===== */

.tela-login {
    min-height: 100vh;
    display: flex;
}

.painel-esquerdo {
    flex: 0 0 48%;
    background: var(--navy);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
    overflow: hidden;
}

.painel-esquerdo::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 110%, rgba(201,168,76,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(201,168,76,0.07) 0%, transparent 60%);
}

.orbe {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.25);
    pointer-events: none;
}

.orbe-1 { width: 460px; height: 460px; top: -140px; left: -140px; opacity: 0.3; }
.orbe-2 { width: 300px; height: 300px; bottom: -80px; right: -80px; opacity: 0.2; }
.orbe-3 { width: 150px; height: 150px; bottom: 110px; left: 60px; opacity: 0.15; }

.marca-login {
    position: relative;
    z-index: 1;
    margin-bottom: 32px;
    animation: surgir 0.9s ease both;
}

.marca-login svg {
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 0 18px rgba(201,168,76,0.4));
}

.texto-login {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: surgir 0.9s 0.1s ease both;
}

.texto-login h1 {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--gold-light);
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin: 0 0 16px;
}

.texto-login h1 em {
    font-style: italic;
    color: #fff;
}

.linha-dourada {
    width: 56px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 20px;
    opacity: 0.6;
}

.texto-login p {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.02em;
    max-width: 320px;
    margin: 0 auto;
}

.recursos-login {
    position: relative;
    z-index: 1;
    margin-top: 44px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    width: 100%;
    max-width: 320px;
    animation: surgir 0.9s 0.2s ease both;
}

.recurso-item {
    display: flex;
    align-items: center;
    gap: 13px;
}

.recurso-ponto {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    opacity: 0.75;
}

.recurso-item span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 400;
}

.painel-direito {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--warm-white);
}

.cartao-login {
    width: 100%;
    max-width: 380px;
    animation: surgir 0.8s 0.1s ease both;
}

.rotulo-topo {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.cartao-login h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--midnight);
    line-height: 1.15;
    margin: 0;
}

.cartao-login .subtitulo-login {
    margin-top: 8px;
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 300;
}

.campo {
    margin-bottom: 20px;
    position: relative;
}

.campo label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5a5872;
    font-weight: 700;
    margin-bottom: 8px;
}

.campo .campo-icone {
    position: relative;
}

.campo .campo-icone svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--muted);
    pointer-events: none;
}

.campo input,
.campo select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #ddd8cc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--midnight);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.campo .campo-icone input {
    padding-left: 40px;
}

.campo input::placeholder {
    color: #bfbbad;
}

.campo input:focus,
.campo select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.13);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 8px;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s, opacity 0.15s;
}

.btn-primario {
    background: var(--navy);
    color: var(--gold-light);
    width: 100%;
    margin-top: 6px;
}

.btn-primario:hover {
    background: var(--navy-hover);
}

.btn-primario:active {
    transform: scale(0.98);
}

.btn-secundario {
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 700;
}

.btn-secundario:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-perigo {
    background: var(--vermelho-bg);
    color: var(--vermelho);
    text-transform: none;
    letter-spacing: normal;
}

.btn-perigo:hover {
    opacity: 0.85;
}

.erro-login {
    display: flex;
    gap: 10px;
    background: rgba(192,57,43,0.08);
    border: 1px solid rgba(192,57,43,0.25);
    color: #a93226;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 22px;
    animation: surgir 0.4s ease both;
}

@media (max-width: 900px) {
    .tela-login { flex-direction: column; }
    .painel-esquerdo { flex: 0 0 auto; padding: 36px 32px 32px; }
    .marca-login { margin-bottom: 18px; }
    .marca-login svg { width: 46px; height: 46px; }
    .orbe-1 { width: 260px; height: 260px; top: -90px; left: -90px; }
    .orbe-2 { width: 170px; height: 170px; }
    .orbe-3 { display: none; }
    .texto-login h1 { font-size: 1.6rem; margin-bottom: 10px; }
    .recursos-login { display: none; }
    .painel-direito { padding: 36px 24px 40px; }
}

/* ===== Layout geral (painel interno) ===== */

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

.sidebar {
    width: var(--sidebar-w);
    background: var(--midnight);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.sidebar .logo {
    padding: 28px 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar .logo .marca-nome {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}

.sidebar .logo .marca-nome svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar .logo .marca-sub {
    font-size: 0.66rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding-left: 30px;
    margin-top: 3px;
}

.sidebar-usuario {
    margin: 16px 16px 6px;
    padding: 12px 14px;
    background: rgba(201,168,76,0.07);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-usuario .avatar {
    width: 36px;
    height: 36px;
    background: var(--navy);
    border: 1.5px solid var(--gold);
    box-shadow: none;
}

.sidebar-usuario .u-nome {
    font-size: 0.82rem;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-usuario .u-papel {
    font-size: 0.66rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar nav {
    padding: 8px 0 16px;
    flex: 1;
    overflow-y: auto;
}

.nav-secao {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 16px 24px 6px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    position: relative;
    transition: background 0.18s, color 0.18s;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.sidebar nav a.ativo {
    background: var(--gold-glow);
    color: var(--gold-light);
    font-weight: 700;
}

.sidebar nav a.ativo::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}

.sidebar nav a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar nav a.ativo svg {
    opacity: 1;
}

.nav-divisor {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 10px 20px;
}

.sidebar nav a.sair {
    color: rgba(220,80,80,0.7);
}

.sidebar nav a.sair:hover {
    background: rgba(220,80,80,0.1);
    color: #e06060;
}

.conteudo {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--warm-white);
    border-bottom: 1px solid var(--border-light);
    padding: 20px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--midnight);
    line-height: 1.2;
}

.topbar .usuario-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-glow);
    border: 1.5px solid var(--gold);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.botao-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--midnight);
}

.botao-menu svg {
    width: 22px;
    height: 22px;
}

.principal {
    padding: 32px 36px 48px;
    flex: 1;
}

/* ===== Banner de boas-vindas ===== */

.banner-boas-vindas {
    background: var(--midnight);
    border-radius: 16px;
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    animation: surgir 0.4s ease-out backwards;
}

.banner-boas-vindas::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 100% 50%, rgba(201,168,76,0.13) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 0% 100%, rgba(34,40,90,0.8) 0%, transparent 60%);
}

.banner-orbe {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.12);
}

.banner-orbe-2 {
    position: absolute;
    right: 60px;
    top: 10px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.08);
}

.banner-conteudo {
    position: relative;
    z-index: 1;
}

.banner-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.banner-conteudo h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: #fff;
    font-weight: 700;
    margin: 0 0 6px;
}

.banner-conteudo h2 em {
    font-style: italic;
    color: var(--gold-light);
}

.banner-conteudo p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    font-weight: 300;
    margin: 0;
}

.banner-data {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.06em;
}

/* ===== Cards / KPIs ===== */

.grade-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--raio);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: surgir 0.4s ease-out backwards;
}

.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-md);
}

.kpi::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--raio) var(--raio) 0 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.kpi:nth-child(4n+2)::after { background: linear-gradient(90deg, #22285a, #3a44a0); }
.kpi:nth-child(4n+3)::after { background: linear-gradient(90deg, #0f6e56, #1d9e75); }
.kpi:nth-child(4n+4)::after { background: linear-gradient(90deg, #993c1d, #d85a30); }

.kpi .rotulo {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 10px;
}

.kpi .valor {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: var(--midnight);
    line-height: 1;
}

.kpi .rodape {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 300;
    margin-top: 7px;
}

.painel {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--raio);
    padding: 24px;
    margin-bottom: 24px;
    animation: surgir 0.4s ease-out backwards;
}

.painel .titulo-painel {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--midnight);
}

/* ===== Filtros / busca ===== */

.barra-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.barra-filtros input[type="text"],
.barra-filtros select {
    padding: 10px 14px;
    border: 1.5px solid #ddd8cc;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}

.barra-filtros input[type="text"]:focus,
.barra-filtros select:focus {
    outline: none;
    border-color: var(--gold);
}

.barra-filtros input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* ===== Tabela ===== */

.tabela-wrap {
    overflow-x: auto;
}

table.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.tabela th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border-bottom: 1px solid var(--border-light);
    background: #faf8f3;
    white-space: nowrap;
}

table.tabela td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0ede5;
    vertical-align: middle;
    color: #3a3852;
}

table.tabela tbody tr {
    cursor: pointer;
    transition: background 0.12s;
}

table.tabela tbody tr:hover td {
    background: #faf8f3;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-verde { background: var(--verde-bg); color: var(--verde); }
.badge-vermelho { background: var(--vermelho-bg); color: var(--vermelho); }
.badge-cinza { background: #f5f0e8; color: #b0a88c; }

.vazio {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ===== Ficha individual ===== */

.cabecalho-ficha {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.cabecalho-ficha .avatar {
    width: 58px;
    height: 58px;
    font-size: 1.1rem;
}

.cabecalho-ficha h1 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 0 5px;
    color: var(--midnight);
}

.cabecalho-ficha .subinfo {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.grade-dados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 26px;
}

.item-dado .rotulo {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 5px;
}

.item-dado .valor {
    font-size: 0.9rem;
    color: var(--midnight);
    font-weight: 400;
}

.grade-meses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.mes-card {
    border: 1px solid var(--border-light);
    background: #faf8f3;
    border-radius: var(--raio-sm);
    padding: 14px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.mes-card:hover {
    border-color: var(--gold);
    background: #fff;
}

.mes-card .nome-mes {
    font-size: 0.78rem;
    font-weight: 700;
    color: #3a3852;
    margin-bottom: 9px;
}

.voltar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 18px;
    transition: color 0.15s, gap 0.15s;
}

.voltar:hover {
    color: var(--navy);
    gap: 9px;
}

/* ===== Formularios ===== */

.form-grade {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.acoes-form {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

/* ===== Gráficos (relatórios) ===== */

.legenda-grafico {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.legenda-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
}

.legenda-ponto {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.grafico-barras-v {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 200px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 2px;
}

.barra-v-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.barra-v-valor {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--midnight);
    margin-bottom: 6px;
}

.barra-v-corpo {
    width: 100%;
    max-width: 24px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: opacity 0.15s;
}

.barra-v-item:hover .barra-v-corpo {
    opacity: 0.8;
}

.barra-v-rotulo {
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 8px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.grafico-empilhado {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 2px;
}

.empilhado-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
    cursor: default;
}

.empilhado-coluna {
    width: 100%;
    max-width: 26px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}

.empilhado-coluna .segmento {
    width: 100%;
}

.empilhado-coluna .segmento:not(:last-child) {
    box-shadow: inset 0 -2px 0 var(--warm-white);
}

.seg-verde { background: var(--verde); }
.seg-vermelho { background: var(--vermelho); }
.seg-cinza { background: #ddd8cc; }

.grafico-barras-h {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.barra-h-item {
    display: grid;
    grid-template-columns: 140px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.barra-h-rotulo {
    font-size: 0.78rem;
    color: var(--texto);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barra-h-trilho {
    background: #f5f0e8;
    border-radius: 6px;
    height: 14px;
    overflow: hidden;
}

.barra-h-corpo {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 6px;
    min-width: 6px;
    transition: opacity 0.15s;
}

.barra-h-item:hover .barra-h-corpo {
    opacity: 0.8;
}

.barra-h-valor {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--midnight);
    text-align: right;
}

@media (max-width: 700px) {
    .barra-v-rotulo { display: none; }
    .barra-h-item { grid-template-columns: 90px 1fr 36px; }
}

/* ===== Responsivo (painel) ===== */

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.aberta {
        transform: translateX(0);
    }

    .conteudo {
        margin-left: 0;
    }

    .botao-menu {
        display: inline-flex;
    }

    .principal {
        padding: 20px 18px 40px;
    }

    .topbar {
        padding: 16px 20px;
    }

    .fundo-sidebar {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 35;
    }

    .fundo-sidebar.ativo {
        display: block;
    }
}
