/* ===== Painel RBytes — estilos (complementam o Bootstrap 5; mesma identidade do sistema principal) ===== */

:root {
    --rb-lateral-largura: 16rem;
    --rb-menu-fundo: #141920;
    --rb-menu-fundo-base: #0d1116;
    --rb-menu-texto: #c4ccd8;
    --rb-menu-suave: #8590a2;
    --rb-menu-hover: rgba(255, 255, 255, .06);
    --rb-menu-ativo: rgba(255, 193, 7, .13);
    --rb-menu-borda: rgba(255, 255, 255, .08);
    --rb-ambar: #ffc107;
    --rb-gradiente: linear-gradient(135deg, #ffd54a 0%, #ffc107 45%, #ff9500 100%);
}

html {
    font-size: 15px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: #f3f5f8;
}

.min-w-0 {
    min-width: 0;
}

.pular-conteudo:focus {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    padding: .5rem .85rem;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2);
}

/* ----- Menu lateral (gaveta no celular, fixo no computador) ----- */
.painel-lateral {
    --bs-offcanvas-width: var(--rb-lateral-largura);
    --bs-offcanvas-bg: var(--rb-menu-fundo);
    --bs-offcanvas-color: var(--rb-menu-texto);
    display: flex;
    flex-direction: column;
    background-image: linear-gradient(180deg, var(--rb-menu-fundo) 0%, var(--rb-menu-fundo-base) 100%);
    color: var(--rb-menu-texto);
}

@media (min-width: 992px) {
    .painel-lateral {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
        width: var(--rb-lateral-largura);
    }

    .com-menu .painel-conteudo {
        margin-left: var(--rb-lateral-largura);
    }
}

.painel-lateral-cabecalho {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 4.25rem;
    padding: 1rem 1.15rem .75rem;
}

.painel-marca {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.painel-marca:hover {
    color: #fff;
}

.painel-marca-destaque {
    color: var(--rb-ambar);
}

.painel-marca-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: .6rem;
    background: var(--rb-gradiente);
    color: #12161c;
    font-weight: 800;
}

.painel-marca-icone-lg {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: .9rem;
    font-size: 1.6rem;
}

.painel-nav {
    flex: 1 1 auto;
    padding: .25rem .75rem .75rem;
    overflow-y: auto;
}

.menu-secao {
    margin: 1.1rem .6rem .35rem;
    color: var(--rb-menu-suave);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .125rem;
    padding: .55rem .75rem;
    border-radius: .6rem;
    color: var(--rb-menu-texto);
    font-size: .925rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.menu-link > .bi {
    flex: 0 0 1.25rem;
    color: var(--rb-menu-suave);
    font-size: 1.1rem;
    text-align: center;
}

.menu-link:hover,
.menu-link:focus-visible {
    background: var(--rb-menu-hover);
    color: #fff;
}

.menu-link:focus-visible {
    outline: 2px solid var(--rb-ambar);
    outline-offset: -2px;
}

.menu-link.active {
    background: var(--rb-menu-ativo);
    box-shadow: inset 3px 0 0 var(--rb-ambar);
    color: #fff;
    font-weight: 600;
}

.menu-link.active > .bi {
    color: var(--rb-ambar);
}

.painel-lateral-rodape {
    padding: .75rem;
    border-top: 1px solid var(--rb-menu-borda);
}

/* ----- Conteúdo e cabeçalho ----- */
.painel-conteudo {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.painel-cabecalho {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 4.5rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 .35rem 1.25rem rgba(17, 24, 39, .05);
    backdrop-filter: saturate(180%) blur(10px);
}

@media (min-width: 992px) {
    .painel-cabecalho {
        padding: .5rem 1.75rem;
    }
}

.painel-cabecalho-botao {
    font-size: 1.4rem;
    line-height: 1;
}

.painel-cabecalho-textos {
    flex: 1 1 auto;
    min-width: 0;
}

.painel-titulo {
    margin: 0;
    overflow: hidden;
    font-size: 1.2rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-descricao {
    margin: 0;
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-conta {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .5rem;
    border: 0;
    border-radius: .75rem;
    background: transparent;
}

.painel-conta:hover,
.painel-conta[aria-expanded="true"] {
    background: var(--bs-tertiary-bg);
}

.painel-avatar {
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--rb-gradiente);
    color: #12161c;
    font-size: .85rem;
    font-weight: 700;
}

.painel-avatar-sm {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    font-size: .75rem;
}

.painel-avatar-lg {
    flex-basis: 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.2rem;
}

.painel-avatar.bloqueado {
    background: #343a40;
    color: #fff;
}

.painel-pagina {
    flex: 1 0 auto;
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

@media (min-width: 992px) {
    .painel-pagina {
        padding-right: 1.75rem;
        padding-left: 1.75rem;
    }
}

/* ----- Login ----- */
.pagina-login {
    background: radial-gradient(circle at 20% 20%, #2b3440 0%, #12161c 60%, #0b0d10 100%);
}

.pagina-login .painel-pagina {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-area {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
}

.login-cartao {
    border-radius: 1rem;
}

/* Áreas com rolagem própria recortam também os textos só para leitor de tela (.visually-hidden, posição absoluta):
   sem isso eles escapam do recorte e alargam a página inteira no celular (como no sistema principal). */
.table-responsive,
.overflow-auto {
    position: relative;
}

/* ----- Cartões, filtros e tabelas ----- */
.card {
    border-color: rgba(17, 24, 39, .08);
    border-radius: .85rem;
    box-shadow: 0 .25rem 1rem rgba(17, 24, 39, .04);
}

.filtros .form-label {
    margin-bottom: .25rem;
    color: var(--bs-secondary-color);
}

.tabela-painel thead th {
    color: var(--bs-secondary-color);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tabela-painel td {
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.linha-inativa td {
    background-color: rgba(108, 117, 125, .04);
}

.linha-inativa .painel-avatar {
    filter: grayscale(1);
}

.coluna-selecao {
    width: 2.5rem;
}

.kebab {
    width: 2rem;
    padding-right: 0;
    padding-left: 0;
}

.dados dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.dados dd {
    margin-bottom: .5rem;
}

/* ----- Indicadores da tela inicial ----- */
.indicador {
    color: inherit;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
}

.indicador:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08);
}

.indicador-rotulo {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-secondary-color);
    font-size: .82rem;
    font-weight: 600;
}

.indicador-rotulo .bi {
    color: #e0a800;
}

.indicador-valor {
    margin: .35rem 0 .1rem;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.indicador-detalhe {
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

/* ----- E-mails: pré-visualização e código ----- */
.previa-email {
    display: block;
    width: 100%;
    height: 70vh;
    min-height: 26rem;
    border: 0;
    border-radius: 0 0 .85rem .85rem;
    background: #eef1f5;
}

.previa-email-modal {
    height: 75vh;
    border-radius: 0;
}

.codigo-email {
    max-height: 70vh;
    padding: 1rem;
    overflow: auto;
    background: #0f1318;
    color: #d5dde8;
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ----- Editor de templates ----- */
.editor-template .CodeMirror {
    height: 60vh;
    min-height: 22rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    font-size: .82rem;
}

.editor-template .CodeMirror-activeline-background {
    background: #fff8e1;
}

.editor-template .CodeMirror-matchingtag {
    background: rgba(255, 193, 7, .3);
}

.previa-template .previa-email-editor {
    height: calc(60vh + 14rem);
    min-height: 34rem;
}

@media (min-width: 1400px) {
    .previa-template {
        position: sticky;
        top: 5.5rem;
    }
}

.marcador code {
    color: #b45309;
}

/* ----- SweetAlert2 ----- */
.swal2-container {
    z-index: 1100;
}

.rb-dialogo {
    border-radius: .85rem;
    font-family: inherit;
}

.rb-dialogo .swal2-title {
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--bs-emphasis-color);
}

.rb-dialogo .swal2-html-container {
    font-size: .95rem;
    color: var(--bs-secondary-color);
}

.rb-dialogo .swal2-actions .btn {
    min-width: 7.5rem;
}

.rb-dialogo .swal2-checkbox {
    font-size: .92rem;
}

.rb-dialogo .swal2-textarea {
    font-size: .95rem;
}

.rb-toast.swal2-popup {
    font-family: inherit;
}

.rb-toast .swal2-title {
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.4;
}
