/* IronGate OTC - design system, navy/dourado/azul/cinza */

:root {
    --cinza-900: #1a1a2e;
    --cinza-700: #45455c;
    --cinza-500: #6b6b80;
    --cinza-300: #d8d8e2;
    --cinza-100: #f4f4f8;
    --branco: #ffffff;
    --verde: #00a86b;
    --amarelo: #b8860b;
    --vermelho: #c0392b;
    --azul: #2a6fdb;
    --azul-claro: #e6f0fb;
    --ig-gold: #d69a2d;
    --ig-gold-light: #f5cd72;
    --ig-gold-claro: #f6e4c4;
    --ig-navy-1: #0d2f63;
    --ig-navy-2: #051329;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(26, 26, 46, 0.08), 0 1px 2px rgba(26, 26, 46, 0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--cinza-100);
    color: var(--cinza-900);
    line-height: 1.5;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--cinza-900); margin-top: 0; }

/* ---------------------------------------------------------------- */
/* Layout                                                            */
/* ---------------------------------------------------------------- */
.topbar {
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-300);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.topbar nav a {
    color: var(--cinza-700);
    margin-left: 20px;
    font-weight: 500;
}

.topbar nav a.active { color: var(--azul); }

.cs9-admin-brand { display: inline-flex; align-items: center; gap: 8px; }
.cs9-admin-nav { display: flex; align-items: center; }
.cs9-admin-nome { margin-right: 16px; }

/* Botão de menu (hambúrguer) do painel staff — só existe visualmente em
   mobile (ver media query abaixo); em telas largas a sidebar já fica
   sempre visível, então o botão fica escondido. */
.cs9-admin-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    color: var(--cinza-700);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.cs9-admin-sidebar-overlay { display: none; }

.layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 220px;
    background: var(--branco);
    border-right: 1px solid var(--cinza-300);
    padding: 20px 12px;
    flex-shrink: 0;
}

.sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--cinza-700);
    font-weight: 500;
    margin-bottom: 4px;
}

.sidebar a:hover { background: var(--cinza-100); text-decoration: none; }
.sidebar a.active { background: var(--azul-claro); color: var(--azul); }


.content {
    flex: 1;
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- */
/* Navegação do cliente: abas de categoria (topo) + barra inferior   */
/* de ícones (Início / OTC / Banco / Perfil) — substitui a sidebar   */
/* lateral só nas páginas do cliente (o admin continua com .sidebar) */
/* ---------------------------------------------------------------- */
.content-wrapper {
    min-height: calc(100vh - 64px);
    padding-bottom: 104px;
}

.category-tabs {
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-300);
    display: flex;
    gap: 4px;
    padding: 0 24px;
    overflow-x: auto;
}

.category-tabs a {
    padding: 14px 16px;
    color: var(--cinza-700);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.category-tabs a:hover { color: var(--azul); text-decoration: none; }
.category-tabs a.active { color: var(--azul); border-bottom-color: var(--azul); font-weight: 700; }

.bottom-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: 480px;
    margin: 0 auto;
    background: var(--branco);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.14), 0 2px 6px rgba(26, 26, 46, 0.08);
    display: flex;
    justify-content: space-around;
    gap: 4px;
    padding: 10px 8px;
    z-index: 30;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--cinza-500);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 16px;
    min-width: 60px;
}

.bottom-nav a svg { display: block; }
.bottom-nav a:hover { background: var(--cinza-100); color: var(--ig-gold); text-decoration: none; }
.bottom-nav a.active { color: var(--ig-gold); background: var(--ig-gold-claro); }

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ---------------------------------------------------------------- */
/* Componentes                                                        */
/* ---------------------------------------------------------------- */
.card {
    background: var(--branco);
    border: 1px solid var(--cinza-300);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
}

.card-sm { padding: 18px 20px; }

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cinza-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.card-saldo {
    border-top: 4px solid var(--ig-gold);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

/* Acentos de cor genéricos pra "cards-herói" — mesma paleta dos badges de
   status, pra reforçar o mesmo significado (âmbar = aguardando, azul = em
   andamento, verde = concluído, vermelho = reprovado/cancelado). Usar com
   moderação: no máximo 1 card por tela, senão perde o efeito. */
.card-accent-verde { border-top: 4px solid var(--verde); border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card-accent-amarelo { border-top: 4px solid var(--amarelo); border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card-accent-azul { border-top: 4px solid var(--azul); border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card-accent-vermelho { border-top: 4px solid var(--vermelho); border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }

.card-saldo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cinza-700);
    font-weight: 700;
    margin-bottom: 20px;
}

.card-saldo-header svg { color: var(--azul); flex-shrink: 0; }

.card-saldo-label {
    color: var(--cinza-500);
    margin: 0 0 4px;
}

.card-saldo-valor {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--cinza-900);
    margin-bottom: 16px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .layout { flex-direction: column; }

    /* Painel staff: a topbar (logo + sino de notificação + nome + "Meu
       perfil" + "Sair") não cabia numa linha só em telas estreitas —
       "Sair" ficava fora da viewport. Esconde o nome (só decorativo) e
       reduz o padding lateral pra abrir espaço; sidebar vira um menu
       hambúrguer deslizante (drawer) em vez de barra de scroll
       horizontal, que escondia a maioria dos itens sem indicação
       nenhuma de que dava pra rolar. */
    .topbar { padding: 0 12px; }
    .cs9-admin-subtitle { display: none; }
    .cs9-admin-nome { display: none; }
    .cs9-admin-menu-toggle { display: flex; }

    .sidebar {
        position: fixed;
        top: 64px;
        left: -260px;
        bottom: 0;
        width: 260px;
        max-width: 80vw;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        background: var(--branco);
        border-right: 1px solid var(--cinza-300);
        border-bottom: none;
        padding: 16px 12px;
        gap: 4px;
        transition: left .22s ease;
        z-index: 45;
    }
    .sidebar.open { left: 0; box-shadow: 6px 0 28px rgba(26, 26, 46, .18); }

    .sidebar a {
        white-space: normal;
        font-size: 0.95rem;
        padding: 10px 14px;
    }

    .cs9-admin-sidebar-overlay.open {
        display: block;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(16, 16, 28, .4);
        z-index: 40;
    }

    .content { padding: 20px 16px; }

    /* Dropdown de notificação: `right: 0` ancorava o menu na borda direita
       do SINO, e como o sino fica perto da esquerda no mobile, os 340px de
       largura cresciam pra fora da tela pela esquerda (o conteúdo aparecia
       cortado). `max-width: 90vw` limitava a largura mas não a posição.
       No mobile ele passa a ser fixo em relação à viewport, ocupando a
       largura da tela com uma folga nas laterais. */
    .cs9-notif-dropdown { position: static; margin-right: 8px; }
    .cs9-notif-menu {
        position: fixed;
        top: 68px;
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
    }
    .cs9-notif-list { max-height: 60vh; }

    /* ---------------------------------------------------------------
       Tabelas do painel viram CARDS empilhados no mobile.

       Antes elas rolavam na horizontal dentro do .table-responsive —
       tecnicamente funcionava, mas com 9 colunas virava uma faixa
       ilegível: só dava pra ver 2 colunas por vez e era preciso rolar
       de lado pra cada linha, sem nunca ver um pedido inteiro.

       Cada linha vira um bloco e cada célula mostra o rótulo da sua
       coluna à esquerda (via `data-rotulo`, preenchido pelo JS em
       partials/admin_layout_end.php a partir do próprio <thead> — assim
       vale pra TODAS as tabelas do painel, inclusive as futuras, sem
       precisar mexer no HTML de cada tela).
       --------------------------------------------------------------- */
    .table-responsive { overflow-x: visible; }

    .table-responsive table,
    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    /* Cabeçalho some: o rótulo passa a ficar em cada célula. */
    .table-responsive thead { display: none; }

    .table-responsive tr {
        border: 1px solid var(--cinza-300);
        border-radius: var(--radius);
        margin-bottom: 10px;
        background: var(--branco);
        overflow: hidden;
    }
    .table-responsive tr:last-child { margin-bottom: 0; }
    .table-responsive tr:hover td { background: transparent; }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 14px;
        padding: 8px 12px;
        border-bottom: 1px solid var(--cinza-100);
        text-align: right;
        word-break: break-word;
    }
    .table-responsive tr td:last-child { border-bottom: none; }

    .table-responsive td::before {
        content: attr(data-rotulo);
        flex: 0 0 auto;
        max-width: 45%;
        text-align: left;
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--cinza-500);
    }

    /* `table-layout: fixed` e larguras de coluna (.cs9-table-texto) só
       fazem sentido no modo tabela — empilhado, atrapalhariam. */
    .cs9-table-texto { table-layout: auto; }
    .cs9-table-texto .cs9-col-data,
    .cs9-table-texto .cs9-col-quem,
    .cs9-table-texto .cs9-col-acao,
    .cs9-table-texto .cs9-col-tipo,
    .cs9-table-texto .cs9-col-status,
    .cs9-table-texto .cs9-col-link { width: auto; }

    /* Número do pedido não pode forçar largura quando empilhado. */
    .cs9-table-compact .cs9-col-pedido { white-space: normal; }
    .cs9-table-compact td, .cs9-table-compact th { font-size: 0.85rem; }
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cinza-700);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--cinza-300);
    border-radius: var(--radius);
    background: var(--branco);
    color: var(--cinza-900);
    font-size: 0.95rem;
    font-family: var(--font);
    margin-bottom: 16px;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed var(--cinza-300);
    border-radius: var(--radius);
    background: var(--cinza-100);
    color: var(--cinza-700);
    font-size: 0.85rem;
    font-family: var(--font);
    margin-bottom: 20px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px var(--azul-claro);
}

/* Positivo por padrão (seguro em qualquer contexto). Onde o texto precisa
   ficar colado logo abaixo de um campo específico, use
   style="margin-top:-12px" naquele ponto de uso — não como padrão global,
   que já causou sobreposição em botões e inputs sem margem própria. */
.field-hint { font-size: 0.8rem; color: var(--cinza-500); margin-top: 6px; margin-bottom: 16px; }

.cs9-senha-forca-track { height: 5px; border-radius: 3px; background: var(--cinza-200); margin-top: 8px; overflow: hidden; }
.cs9-senha-forca-bar { height: 100%; width: 0%; border-radius: 3px; background: var(--vermelho); transition: width 0.2s ease, background 0.2s ease; }

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--font);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(100deg, var(--ig-gold-light), var(--ig-gold));
    color: #07101f;
    border: 1px solid #ffd878;
}
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; }
.btn-secondary { background: var(--cinza-100); color: var(--cinza-900); border: 1px solid var(--cinza-300); }
.btn-secondary:hover { background: var(--cinza-300); text-decoration: none; }
.btn-danger { background: var(--vermelho); color: var(--branco); }
.btn-block { display: block; width: 100%; }

/* Degradê safira (navy da marca → azul), pra ações ligadas à aprovação de
   dinheiro parado esperando um dono agir — o dourado do .btn-primary é a
   ação comum de "confirmar"; este aqui destaca o caminho da biometria sem
   competir com ele. `color` marcado no :hover também porque `a.btn` herda
   a cor de link global (azul) e ficaria texto azul sobre fundo azul. */
.cs9-btn-safira,
.cs9-btn-safira:hover {
    background: linear-gradient(135deg, var(--ig-navy-1) 0%, #1c56bd 55%, #3d82ea 100%);
    color: var(--branco);
    border: 1px solid #4a8bf0;
    box-shadow: 0 2px 6px rgba(13, 47, 99, 0.35);
}
.cs9-btn-safira:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(13, 47, 99, 0.45);
    text-decoration: none;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.alert-error { background: #fbeaea; color: var(--vermelho); border: 1px solid #f1c3c0; }
.alert-success { background: #e6f6ee; color: var(--verde); border: 1px solid #b7e6cd; }
.alert-info { background: var(--azul-claro); color: #1a4d8f; border: 1px solid #c7dcf8; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--cinza-300); font-size: 0.9rem; }
th { color: var(--cinza-500); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
tr:hover td { background: var(--cinza-100); }

/* Tabelas com muitas colunas (pedidos DefiBank onramp/offramp, 9 colunas)
   estouravam o .content (max-width 1100px - 220px de sidebar) mesmo dentro
   de .table-responsive — cabia quase nada sem rolar. Padding/fonte
   menores, mais número de pedido e cliente compactos, aliviam bastante
   sem precisar esconder coluna nenhuma. */
.cs9-table-compact th, .cs9-table-compact td { padding: 8px 10px; font-size: 0.82rem; }
.cs9-table-compact th { font-size: 0.68rem; }
.cs9-table-compact .cs9-col-pedido { font-family: monospace; font-size: 0.76rem; white-space: nowrap; }

/* Tabelas com uma coluna de texto livre e longo (logs de auditoria,
   notificações): sem `table-layout: fixed` o navegador dá largura à coluna
   de descrição conforme o conteúdo, a tabela fica mais larga que o
   container e o texto some no corte do overflow horizontal. Com largura
   fixa nas colunas curtas, a descrição herda o espaço restante e quebra em
   várias linhas — nada é cortado, só fica mais alto. */
.cs9-table-texto { table-layout: fixed; }
.cs9-table-texto td { vertical-align: top; overflow-wrap: anywhere; }
.cs9-table-texto .cs9-col-data { width: 88px; white-space: normal; }
.cs9-table-texto .cs9-col-quem { width: 130px; }
.cs9-table-texto .cs9-col-acao { width: 165px; font-family: monospace; font-size: 0.8rem; }
.cs9-table-texto .cs9-col-tipo { width: 150px; }
.cs9-table-texto .cs9-col-status { width: 92px; }
.cs9-table-texto .cs9-col-link { width: 54px; }

/* Indicador de entrada/saída por linha no extrato — reforça visualmente o
   +/- que já aparece no valor, sem precisar ler "Crédito"/"Débito". */
tr.linha-credito td:first-child { border-left: 3px solid var(--verde); }
tr.linha-debito td:first-child { border-left: 3px solid var(--cinza-300); }
.icone-credito { color: var(--verde); }
.icone-debito { color: var(--cinza-500); }

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--cinza-500);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    flex-shrink: 0;
}
.btn-copy:hover { color: var(--azul); background: var(--cinza-100); }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-pendente, .badge-aguardando_pagamento, .badge-processando { background: #fdf2df; color: var(--amarelo); }
.badge-em_analise, .badge-em_processamento, .badge-pagamento_confirmado { background: #e6f0fb; color: var(--azul); }
.badge-aprovado, .badge-concluido { background: #e6f6ee; color: var(--verde); }
.badge-reprovado, .badge-cancelado, .badge-bloqueado { background: #fbeaea; color: var(--vermelho); }

/* Dashboard staff — busca rápida, KPIs compactos, gráfico de volume e funil */
.cs9-quick-search { display: flex; gap: 8px; margin-bottom: 20px; }
.cs9-quick-search input { margin-bottom: 0; flex: 1; }

.cs9-kpi-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.cs9-kpi-item { flex: 1 1 160px; background: var(--branco); border: 1px solid var(--cinza-300); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.cs9-kpi-item--alerta { border-color: var(--amarelo); }
.cs9-kpi-label { font-size: 0.72rem; font-weight: 600; color: var(--cinza-500); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.cs9-kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--azul); line-height: 1.1; }
.cs9-kpi-value--alerta { color: var(--amarelo); }
.cs9-kpi-link { font-size: 0.78rem; margin-top: 4px; display: inline-block; }

.cs9-chart-legenda { display: flex; gap: 16px; margin-top: 10px; font-size: 0.8rem; color: var(--cinza-500); flex-wrap: wrap; }
.cs9-chart-legenda-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.cs9-funil-row { margin-bottom: 12px; }
.cs9-funil-info { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }
.cs9-funil-track { height: 8px; border-radius: 4px; background: var(--cinza-100); overflow: hidden; }
.cs9-funil-bar { height: 100%; border-radius: 4px; }

/* Páginas de conteúdo público (Privacidade, Termos, etc.) */
.cs9-pagina-wrap { max-width: 760px; margin: 0 auto; padding: 32px 24px 60px; }
.cs9-pagina-wrap h1 { margin-top: 0; }
.cs9-pagina-conteudo h3 { margin-top: 28px; margin-bottom: 8px; }
.cs9-pagina-conteudo p { line-height: 1.6; color: var(--cinza-500); }
.cs9-pagina-conteudo p:first-child { margin-top: 0; }


.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--cinza-300); font-size: 0.95rem; }
.summary-row:last-child { border-bottom: none; font-weight: 700; font-size: 1.1rem; color: var(--azul); }

.qr-box { text-align: center; padding: 24px; background: var(--branco); border: 1px solid var(--cinza-300); border-radius: var(--radius); }
.pix-copia-cola {
    background: var(--cinza-100);
    border: 1px solid var(--cinza-300);
    border-radius: var(--radius);
    padding: 12px;
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    margin: 16px 0;
}

.text-muted { color: var(--cinza-500); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

video, canvas.liveness-canvas {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius);
    background: var(--cinza-900);
}

.cs9-face-scan {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 8px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cinza-900);
}

.cs9-face-scan video {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    transform: scaleX(-1); /* espelha, como uma câmera frontal normal */
}

.cs9-scan-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.cs9-scan-track {
    fill: none;
    stroke: var(--cinza-300);
    stroke-width: 5;
    stroke-dasharray: 6 6;
}

/* Anel de progresso: preenche conforme as etapas do desafio (frente,
   direita, esquerda, cima, baixo) são confirmadas. O JS ajusta
   stroke-dashoffset (circunferência = 2*pi*92 ≈ 578) via variável CSS. */
.cs9-scan-progress {
    fill: none;
    stroke: var(--ig-gold);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 578;
    stroke-dashoffset: var(--cs9-progress-offset, 578);
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.cs9-face-scan.success .cs9-scan-progress {
    stroke: var(--verde);
}

.cs9-face-scan.error .cs9-scan-progress {
    stroke: var(--vermelho);
}

/* Logo CS9 — o SVG usa fill="currentColor", a cor é definida por quem o envolve */
.cs9-logo-svg {
    height: 28px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.cs9-logo-svg--lg { height: 42px; }

.cs9-logo-link { display: inline-flex; align-items: center; line-height: 0; }

.cs9-lang-dropdown { position: relative; margin-right: 16px; display: inline-block; }

.cs9-lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--cinza-300);
    border-radius: 20px;
    padding: 4px 10px;
    cursor: pointer;
    color: var(--cinza-700);
}
.cs9-lang-toggle:hover { border-color: var(--azul); }
.cs9-lang-toggle svg.cs9-lang-caret { transition: transform 0.15s ease; }
.cs9-lang-dropdown.open .cs9-lang-toggle svg.cs9-lang-caret { transform: rotate(180deg); }

.cs9-lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--branco);
    border: 1px solid var(--cinza-300);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 150px;
    padding: 6px;
    z-index: 20;
}
.cs9-lang-dropdown.open .cs9-lang-menu { display: block; }

.cs9-lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--cinza-700);
    font-weight: 500;
    font-size: 0.9rem;
}
.cs9-lang-menu a:hover { background: var(--cinza-100); text-decoration: none; }
.cs9-lang-menu a.active { color: var(--azul); font-weight: 700; }

.cs9-notif-dropdown { position: relative; margin-right: 16px; display: inline-block; }

.cs9-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--cinza-700);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
}
.cs9-notif-bell:hover { background: var(--cinza-100); color: var(--azul); }

.cs9-notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--vermelho);
    color: var(--branco);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.cs9-notif-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--branco);
    border: 1px solid var(--cinza-300);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 340px;
    max-width: 90vw;
    z-index: 20;
}
.cs9-notif-dropdown.open .cs9-notif-menu { display: block; }

.cs9-notif-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cinza-300);
}
.cs9-notif-menu-header strong { font-size: 0.9rem; }

.cs9-notif-clear {
    background: none;
    border: none;
    color: var(--azul);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 4px;
}
.cs9-notif-clear:hover { text-decoration: underline; }

.cs9-notif-list { max-height: 360px; overflow-y: auto; }

.cs9-notif-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--cinza-100);
    color: var(--cinza-900);
}
.cs9-notif-item:last-child { border-bottom: none; }
.cs9-notif-item:hover { background: var(--cinza-100); text-decoration: none; }
.cs9-notif-item.unread { background: var(--azul-claro); }
.cs9-notif-item.unread:hover { background: #d5e5fb; }
.cs9-notif-item-titulo { font-weight: 700; font-size: 0.85rem; margin: 0 0 2px; }
.cs9-notif-item-desc { font-size: 0.8rem; color: var(--cinza-700); margin: 0 0 2px; }
.cs9-notif-item-data { font-size: 0.72rem; color: var(--cinza-500); margin: 0; }

.cs9-notif-empty { padding: 24px 16px; text-align: center; font-size: 0.85rem; color: var(--cinza-500); }

.cs9-staff-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    padding: 14px 16px;
    font-family: var(--font);
    color: var(--cinza-900);
}
.cs9-staff-toggle:hover { background: var(--cinza-100); }
.cs9-staff-toggle .cs9-staff-caret { flex-shrink: 0; color: var(--cinza-500); transition: transform 0.2s ease; }
.cs9-staff-item.open .cs9-staff-toggle .cs9-staff-caret { transform: rotate(180deg); }

.cs9-staff-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.cs9-staff-item.open .cs9-staff-body { max-height: 400px; }

.cs9-staff-body-inner { padding: 4px 16px 16px; }

.cs9-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--azul-claro);
    color: var(--azul);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.cs9-link-chip:hover {
    background: var(--azul);
    color: var(--branco);
    text-decoration: none;
}
.cs9-link-chip svg { flex-shrink: 0; }

/* ---------------------------------------------------------------- */
/* Dashboard do cliente — hero de saldo + cards de ação               */
/* (única tela com degradê, aqui em navy, por pedido explícito do     */
/* usuário pra bater com o mockup do rebranding IronGate — resto do   */
/* site continua sóbrio, sem degradê)                                 */
/* ---------------------------------------------------------------- */

.cs9-dash-header { margin-bottom: 20px; }
.cs9-dash-header h2 { font-size: 1.9rem; font-weight: 800; margin: 0 0 8px; }
.cs9-dash-header p { color: var(--cinza-700); font-size: 1rem; margin: 0; }

.cs9-dash-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ig-navy-1) 0%, var(--ig-navy-2) 100%);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 20px;
    color: var(--branco);
}

.cs9-dash-hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.cs9-dash-hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--branco);
    color: var(--ig-navy-1);
}

.cs9-dash-hero-top strong { font-size: 1.1rem; font-weight: 700; }

.cs9-dash-hero-sub {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0 0 6px;
    position: relative;
    z-index: 1;
}

.cs9-dash-hero-valor {
    font-size: 2.4rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.cs9-dash-hero-decor {
    position: absolute;
    right: -16px;
    bottom: -22px;
    width: 170px;
    height: 170px;
    pointer-events: none;
}

.cs9-dash-action-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.cs9-dash-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--azul-claro);
    color: var(--azul);
}
.cs9-dash-action-icon--dourado { background: var(--ig-gold-claro); color: var(--ig-gold); }

.cs9-dash-action-info { flex: 1; min-width: 0; }

.cs9-dash-action-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.cs9-dash-action-desc {
    color: var(--cinza-700);
    font-size: 0.88rem;
    margin: 0;
}

.cs9-dash-action-chevron {
    color: var(--azul);
    flex-shrink: 0;
    margin-top: 10px;
}

.cs9-dash-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 0.95rem;
}
.cs9-dash-action-btn.btn-secondary {
    background: var(--branco);
    color: var(--azul);
    border: 2px solid var(--azul);
}
.cs9-dash-action-btn.btn-secondary:hover { background: var(--azul-claro); }

/* Impressão / exportar PDF (comprovantes) — esconde o chrome do app,
   deixa só o conteúdo marcado como recibo. */
@media print {
    .topbar, .category-tabs, .bottom-nav, .sidebar, .no-print { display: none !important; }
    body { background: #fff; }
    .content-wrapper, .content { padding: 0; margin: 0; max-width: none; }
}
