/* Ajustes nossos dentro do Django Unfold (carregado em todas as telas do painel) */

/* ---- switch de modo escuro dentro da barra lateral ---- */
.painel-tema {
    display: flex; align-items: center; gap: .55rem; cursor: pointer; user-select: none;
    margin: 0 .75rem .6rem; padding: .5rem .6rem; border-radius: 11px;
    border: 1px solid rgba(128, 128, 138, .26); font-size: .82rem; font-weight: 600;
    transition: background .15s, border-color .15s;
}
.painel-tema:hover { background: rgba(128, 128, 138, .12); border-color: rgba(229, 18, 27, .35); }
.painel-tema .material-symbols-outlined { font-size: 18px; opacity: .85; }
.painel-tema-rotulo { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.painel-switch {
    position: relative; flex: none; width: 38px; height: 21px; border: 0; padding: 0; cursor: pointer;
    border-radius: 999px; background: rgba(128, 128, 138, .38); transition: background .2s;
}
.painel-switch i {
    position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s;
}
.painel-switch[aria-checked="true"] { background: #e5121b; }
.painel-switch[aria-checked="true"] i { transform: translateX(16px); }
.painel-switch:focus-visible { outline: 2px solid #e5121b; outline-offset: 2px; }

/* ---- link do convite (na tela de Convites) ---- */
.convite-link { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.convite-link input {
    flex: 1;
    min-width: 260px;
    padding: .55rem .7rem;
    border-radius: 10px;
    border: 1px solid rgba(128, 128, 138, .35);
    background: rgba(128, 128, 138, .08);
    color: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
}
.convite-link button { white-space: nowrap; }

/* ---- "Rebecche" ao lado do logo, no topo da barra lateral ---- */
.painel-marca {
    font-family: 'Google Sans', 'Product Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: -.015em;
    white-space: nowrap;
    margin-left: .15rem;
    opacity: .88;
    user-select: none;
}
@media (max-width: 420px) { .painel-marca { display: none; } }

/* ================= widgets 3D das telas de lista ================= */
.w3d { position: relative; display: flex; flex-direction: column; gap: .5rem; }
.w3d-caixa {
    position: relative; flex: 0 0 auto; height: 320px; border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(128, 128, 138, .28);
    background: linear-gradient(180deg, rgba(229, 18, 27, .05), rgba(229, 18, 27, 0) 62%);
}
.w3d-caixa canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.w3d-titulo {
    position: absolute; left: 1rem; top: .75rem; z-index: 3; display: flex; align-items: flex-start; gap: .45rem;
    font-size: .9rem; font-weight: 700; pointer-events: none; line-height: 1.25;
}
.w3d-titulo .material-symbols-outlined { font-size: 19px; color: #e5121b; line-height: 1.1; }
.w3d-titulo i { display: block; font-style: normal; font-weight: 400; font-size: .73rem; opacity: .6; }
.w3d-legenda {
    position: absolute; right: .9rem; top: .8rem; z-index: 3; display: flex; flex-direction: column;
    gap: .22rem; align-items: flex-end; pointer-events: none; max-width: 42%;
}
.w3d-legenda-esq { right: auto; left: .9rem; top: auto; bottom: .8rem; align-items: flex-start; max-width: 60%; }
.w3d-legenda-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .5; font-weight: 700; }
.w3d-item { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; opacity: .85; }
.w3d-item i { width: 8px; height: 8px; border-radius: 50%; background: #e5121b; flex: none; }
.w3d-item i.fds { background: #ffb0b5; }
.w3d-item b { font-variant-numeric: tabular-nums; }
.w3d-numeros {
    display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; padding: 0 .2rem; font-size: .78rem; opacity: .72;
}
.w3d-numeros b { font-size: .86rem; }
.w3d-dica-uso { opacity: .6; font-style: italic; }
.w3d-dica {
    position: absolute; z-index: 6; pointer-events: none; padding: .35rem .55rem; border-radius: 9px;
    font-size: .74rem; line-height: 1.4; background: rgba(16, 16, 20, .93); color: #fff; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.w3d-dica-sub { opacity: .68; }
.w3d-botoes { position: absolute; right: .8rem; bottom: .7rem; z-index: 3; display: flex; gap: .35rem; }
.w3d-botao {
    padding: .35rem .7rem; border-radius: 999px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer;
    border: 1px solid rgba(128, 128, 138, .35); background: transparent; color: inherit; opacity: .8;
}
.w3d-botao:hover { opacity: 1; border-color: rgba(229, 18, 27, .5); }
.w3d-botao.on { background: #e5121b; border-color: #e5121b; color: #fff; opacity: 1; }
.w3d-grupo { display: grid; gap: 1rem; grid-template-columns: 1.4fr 1fr; align-items: stretch; }
@media (max-width: 1200px) { .w3d-grupo { grid-template-columns: 1fr; } }
.w3d-cidades { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .2rem 0; }
.w3d-cidade { display: grid; grid-template-columns: 9px 1fr 90px auto; align-items: center; gap: .5rem; font-size: .78rem; }
.w3d-cidade i { width: 9px; height: 9px; border-radius: 50%; }
.w3d-cidade-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w3d-cidade-barra { height: 6px; border-radius: 999px; background: rgba(128, 128, 138, .2); overflow: hidden; }
.w3d-cidade-barra b { display: block; height: 100%; background: #e5121b; border-radius: 999px; }
.w3d-cidade-n { font-variant-numeric: tabular-nums; opacity: .7; }
.w3d-vazio { font-size: .78rem; opacity: .6; }

/* gráfico em SVG (sem three.js) da tela de Visitas */
.w3d-caixa--grafico { height: auto; min-height: 330px; padding: 3.2rem .4rem .4rem; }
.w3d-svg { color: inherit; }
.w3d-svg svg { display: block; width: 100%; height: auto; }
.w3d-dias { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; padding: 0 .2rem; }
.w3d-dias .w3d-item { opacity: .95; }

/* ===== botões de período das telas de lista ===== */
.pf {
    display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem;
    margin: 0 0 1rem; padding: .55rem .7rem; border-radius: 14px;
    border: 1px solid rgba(128, 128, 138, .22); background: rgba(229, 18, 27, .035);
}
.pf-icone { font-size: 19px; color: #e5121b; }
.pf-rotulo { font-size: .82rem; font-weight: 700; }
.pf-botoes { display: flex; gap: .35rem; flex-wrap: wrap; }
.pf-btn {
    padding: .38rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
    text-decoration: none; color: inherit; border: 1px solid rgba(128, 128, 138, .35);
    background: transparent; transition: background .15s, border-color .15s, color .15s;
}
.pf-btn:hover { border-color: rgba(229, 18, 27, .55); background: rgba(229, 18, 27, .08); }
.pf-btn.on { background: #e5121b; border-color: #e5121b; color: #fff; }
.pf-dica { font-size: .74rem; opacity: .6; margin-left: auto; }
@media (max-width: 900px) { .pf-dica { margin-left: 0; } }

/* ===== no modo escuro o logo (PNG preto) vira branco =====
   Vale para o logo ao lado de "G. Rebecche" na barra lateral e para o da tela de login. */
html.dark #nav-sidebar-inner a img,
html.dark .painel-logo-escuro { filter: invert(1) brightness(1.08); }
