/* ============================================================================
   SGJ - Sistema de Gestão Jurídica
   Estilos Customizados (Bootstrap 5 Override)
   ============================================================================ */

/* ---- Typography ---- */
:root {
    --sgj-primary: #1e3a5f;
    --sgj-primary-light: #2c5282;
    --sgj-primary-dark: #162d4a;
    --sgj-accent: #3182ce;
    --sgj-success: #38a169;
    --sgj-danger: #e53e3e;
    --sgj-warning: #d69e2e;
    --sgj-sidebar-width: 260px;
    --sgj-sidebar-collapsed: 0px;
    --sgj-navbar-height: 60px;
    --sgj-transition: 0.25s ease;
}

/* Sem efeito elástico ao passar do fim da rolagem (Edge/Chrome com touchpad, Safari): a página não "estica" mostrando o fundo */
html,
body {
    overscroll-behavior: none;
    background-color: #f7fafc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    color: #1a202c;
    background-color: #f7fafc;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sgj-sidebar-width);
    height: 100vh;
    background: var(--sgj-primary);
    color: #fff;
    z-index: 1040;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform var(--sgj-transition);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.btn-sidebar-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .5);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-heading {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, .35);
    padding: 1.25rem 1.5rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--sgj-transition);
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-left-color: rgba(255, 255, 255, .3);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-left-color: var(--sgj-accent);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.8;
}

.sidebar-link.active i {
    opacity: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1035;
}

/* ---- Main Content ---- */
#main-wrapper {
    margin-left: var(--sgj-sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--sgj-transition);
    /* Item flexível: sem isto, tabelas e textos largos alargam a página inteira no celular */
    min-width: 0;
}

#top-navbar {
    height: var(--sgj-navbar-height);
}

/* ---- Avatar ---- */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sgj-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .06) !important;
    background: #fff;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sgj-primary) 0%, var(--sgj-primary-light) 50%, var(--sgj-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: var(--sgj-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sgj-primary);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

/* ---- Cards & Tables ---- */
.card {
    border-radius: 0.75rem;
}

.card-header {
    padding: 1rem 1.25rem;
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ---- Buttons ---- */
.btn-primary {
    background-color: var(--sgj-primary);
    border-color: var(--sgj-primary);
}

.btn-primary:hover {
    background-color: var(--sgj-primary-light);
    border-color: var(--sgj-primary-light);
}

.btn-outline-primary {
    color: var(--sgj-primary);
    border-color: var(--sgj-primary);
}

.btn-outline-primary:hover {
    background-color: var(--sgj-primary);
    border-color: var(--sgj-primary);
}

/* ---- Scrollbar ---- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar.show+.sidebar-overlay {
        display: block;
    }

    #main-wrapper {
        margin-left: 0;
    }
}

/* ---- Utilities ---- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* ---- Global Loading Bar ---- */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    display: none;
    overflow: hidden;
    background: rgba(49, 130, 206, 0.2);
}

#global-loader::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--sgj-accent);
    animation: loader-slide 1.5s infinite ease-in-out;
}

#global-loader.show {
    display: block;
}

@keyframes loader-slide {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

.loading-overlay.show {
    display: flex;
}

/* ---- Priority Badges ---- */
.priority-alta {
    color: #e53e3e;
}

.priority-media {
    color: #d69e2e;
}

.priority-baixa {
    color: #38a169;
}

/* ---- Form ---- */
.form-label {
    font-size: 0.825rem;
    color: #4a5568;
}

.form-control,
.form-select {
    border: 1px solid #94a3b8 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sgj-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, .25) !important;
}

/* ---- Upload Progress Bar ---- */
.upload-progress-wrapper {
    display: none;
    margin-top: 0.5rem;
}

.upload-progress-wrapper.active {
    display: block;
}

.upload-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}

.upload-progress-bar .bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sgj-accent), #38bdf8);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.upload-progress-text {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.card {
    animation: fadeIn 0.4s ease forwards;
}

.stat-card:nth-child(2) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.15s;
}

/* ===========================================================================
   Fichas (cliente, processo...): cabeçalho, indicadores, dados e abas
   =========================================================================== */
.ficha-cabecalho {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    padding: 1.25rem 1.5rem;
}

.ficha-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--sgj-primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.ficha-titulo {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.25;
}

.ficha-contatos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: 0.375rem;
    color: #4a5568;
}

.ficha-contatos a {
    color: inherit;
    text-decoration: none;
}

.ficha-contatos a:hover {
    color: var(--sgj-accent);
    text-decoration: underline;
}

/* Botões do cabeçalho com área de toque confortável */
.ficha-acoes .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.ficha-indicadores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.ficha-indicador {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    padding: 0.875rem 1rem;
}

.ficha-indicador-rotulo {
    font-size: 0.75rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.ficha-indicador-valor {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.ficha-indicador-detalhe {
    font-size: 0.75rem;
    color: #4a5568;
}

.ficha-abas {
    border-bottom: 1px solid #e2e8f0;
    gap: 0.25rem;
}

.ficha-abas .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: #4a5568;
    font-weight: 600;
    padding: 0.75rem 1rem;
    background: transparent;
}

.ficha-abas .nav-link:hover {
    color: var(--sgj-primary);
}

.ficha-abas .nav-link.active {
    color: var(--sgj-primary);
    border-bottom-color: var(--sgj-primary);
    background: transparent;
}

.ficha-abas .contador {
    font-size: 0.75rem;
    background: #edf2f7;
    color: #2d3748;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    margin-left: 0.375rem;
}

.ficha-secao {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    padding: 1.25rem 1.5rem;
}

.ficha-secao-titulo {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.875rem;
}

/* Lista de dados rótulo/valor em grade (várias colunas no desktop, 1 no celular) */
.dados-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.875rem 1.5rem;
    margin: 0;
}

.dados-lista dt {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.125rem;
}

.dados-lista dd {
    margin: 0;
    color: #1a202c;
    word-break: break-word;
}

.dado-faltando {
    color: #975a16;
    font-size: 0.8125rem;
}

.ficha-vazio {
    text-align: center;
    color: #4a5568;
    padding: 2rem 1rem;
}

.ficha-vazio .bi {
    font-size: 2rem;
    color: #a0aec0;
    display: block;
    margin-bottom: 0.5rem;
}

.btn-copiar {
    border: 0;
    background: transparent;
    color: #718096;
    padding: 0 0.25rem;
    line-height: 1;
}

.btn-copiar:hover {
    color: var(--sgj-accent);
}

/* Permite text-truncate dentro de flex */
.min-w-0 {
    min-width: 0;
}

@media (max-width: 767.98px) {
    /* Mais área útil no celular (o layout usa p-4 = 24px) */
    #main-content {
        padding: 1rem !important;
    }

    /* Agenda (FullCalendar): a barra de botões quebra linha em vez de alargar a página */
    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }

    .fc .fc-button {
        padding: 0.3rem 0.55rem;
    }

    .ficha-cabecalho,
    .ficha-secao {
        padding: 1rem;
    }

    .ficha-acoes {
        width: 100%;
    }

    .ficha-acoes .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .ficha-abas {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .ficha-abas .nav-link {
        white-space: nowrap;
    }
}

/* ===========================================================================
   Barra de navegação inferior (celular e tablet, abaixo de 992px)
   =========================================================================== */
.barra-inferior {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030; /* abaixo do fundo escuro (1035) e do menu lateral (1040) */
    display: flex;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 8px rgba(16, 24, 40, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
}

.barra-inferior-item {
    flex: 1 1 0;
    min-width: 0;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #4a5568;
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.barra-inferior-item .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.barra-inferior-item.ativo {
    color: var(--sgj-primary);
    font-weight: 700;
}

/* Traço no topo do item ativo */
.barra-inferior-item.ativo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--sgj-primary);
}

.barra-inferior-item:focus-visible {
    outline: 2px solid var(--sgj-accent);
    outline-offset: -4px;
}

@media (max-width: 991.98px) {
    /* O conteúdo e o rodapé não ficam escondidos atrás da barra */
    #main-wrapper {
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
    }

    /* O menu completo abre pelo "Mais" da barra; o ☰ do topo ficaria repetido */
    #btn-sidebar-toggle {
        display: none !important;
    }
}

@media print {
    .barra-inferior {
        display: none !important;
    }
}

/* ===========================================================================
   Tabelas em cartões no celular (classes aplicadas por SGJ.tabelasEmCartao)
   Título = 1ª coluna; demais colunas como "rótulo  valor"; ações no rodapé.
   =========================================================================== */
@media (max-width: 767.98px) {
    /* Cabeçalho só para leitores de tela */
    .tabela-cartao thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .tabela-cartao,
    .tabela-cartao tbody,
    .tabela-cartao tfoot,
    .tabela-cartao tr,
    .tabela-cartao td {
        display: block;
        width: 100%;
    }

    .table.tabela-cartao {
        min-width: 0 !important;
        margin-bottom: 0;
        border: 0;
        background: transparent;
    }

    /* Sem rolagem lateral e com respiro em volta dos cartões */
    .table-responsive:has(> .tabela-cartao) {
        overflow: visible;
        padding: 0.75rem;
    }

    .table.tabela-cartao > tbody > tr,
    .table.tabela-cartao > tfoot > tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 0.625rem 0.875rem;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    }

    .table.tabela-cartao > :not(caption) > * > * {
        border: 0;
        background: transparent;
        box-shadow: none;
        padding: 0.3rem 0 !important;
        white-space: normal !important;
    }

    .table.tabela-cartao td[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        text-align: right !important;
        word-break: break-word;
    }

    .table.tabela-cartao td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 45%;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 600;
        color: #4a5568;
    }

    .table.tabela-cartao td[data-label=""]::before {
        content: none;
    }

    .table.tabela-cartao td.celula-titulo {
        display: block;
        text-align: left !important;
        font-size: 0.9375rem;
        padding-bottom: 0.5rem !important;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid #edf2f7;
    }

    .table.tabela-cartao td.celula-titulo::before,
    .table.tabela-cartao td.celula-acoes::before {
        content: none;
    }

    .table.tabela-cartao td.celula-acoes {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.25rem;
        padding-top: 0.5rem !important;
        border-top: 1px solid #edf2f7;
    }

    /* Linha "nenhum registro": sem moldura de cartão */
    .table.tabela-cartao td.celula-cheia {
        text-align: center !important;
    }

    .table.tabela-cartao > tbody > tr:has(> td.celula-cheia:only-child) {
        border-style: dashed;
        box-shadow: none;
    }
}

/* ===========================================================================
   Cabeçalho padrão das páginas (função cabecalhoPagina em core/Functions.php)
   =========================================================================== */
.pagina-cabecalho {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.pagina-titulo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a202c;
}

.pagina-titulo .bi {
    color: var(--sgj-primary);
    font-size: 1.25rem;
}

.pagina-apoio {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #4a5568;
}

.pagina-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagina-acoes .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 767.98px) {
    .pagina-acoes {
        width: 100%;
    }

    .pagina-acoes > .btn,
    .pagina-acoes > form {
        flex: 1 1 auto;
    }

    .pagina-acoes .btn {
        justify-content: center;
        width: 100%;
    }
}

/* ===========================================================================
   Faixa do modo visualização (administrador acessando como outro usuário)
   =========================================================================== */
.faixa-acesso-como {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060; /* acima do menu lateral (1040) e da barra inferior (1030) */
    height: 48px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    background: #fef3c7;
    color: #78350f;
    border-bottom: 1px solid #f59e0b;
    font-size: 0.875rem;
}

.faixa-acesso-como .btn {
    white-space: nowrap;
}

body.com-faixa-acesso {
    padding-top: 48px;
}

body.com-faixa-acesso .sidebar {
    top: 48px;
    height: calc(100vh - 48px);
}

@media (max-width: 575.98px) {
    .faixa-acesso-como span {
        font-size: 0.75rem;
    }

    .faixa-acesso-como .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ===================== Relatórios gerenciais ===================== */
.rel-barras { display: flex; flex-direction: column; gap: .6rem; }
.rel-colunas { display: flex; align-items: flex-end; gap: .4rem; height: 180px; overflow-x: auto; padding-bottom: .25rem; }
.rel-coluna { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.rel-coluna-barras { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.rel-coluna-barras span { width: 40%; min-height: 2px; border-radius: 3px 3px 0 0; }
.rel-coluna small { font-size: .65rem; color: #4a5568; margin-top: .25rem; white-space: nowrap; }
@media print {
    .sidebar, #top-navbar, .barra-inferior, .faixa-acesso-como, footer, .d-print-none { display: none !important; }
    #main-wrapper { margin: 0 !important; }
    .ficha-secao, .ficha-indicador, .rel-cliente { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
    body { background: #fff !important; }
}

/* ---- Painel: seletor de visão (Meu painel / Escritório) ---- */
.painel-visao {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.painel-visao-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: background var(--sgj-transition), color var(--sgj-transition);
}
.painel-visao-btn:hover { background: #f1f5f9; color: var(--sgj-primary); }
.painel-visao-btn.ativo { background: var(--sgj-primary); color: #fff; }
.painel-visao-btn:focus-visible { outline: 2px solid var(--sgj-accent); outline-offset: 2px; }

/* Faixa da licença (modo somente leitura): pisca quando uma gravação é recusada */
.aviso-licenca.piscar { animation: piscarAviso 0.45s ease-in-out 3; }
@keyframes piscarAviso { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 158, 46, 0); transform: none; } 50% { box-shadow: 0 0 0 6px rgba(214, 158, 46, .45); transform: scale(1.01); } }
