/*
 * Portal Atração v4 — design system (identidade derivada do logotipo, vinda do protótipo v3)
 *
 * De onde vem cada decisão (ver LEIA-ME.md):
 *  - Cores medidas no arquivo do logo (editora/public/img/logo_atracao.png):
 *      amarelo dos arcos  #FFCD26  → cor principal (botões, destaques, gráficos)
 *      vermelho do círculo #E53312 → acento pontual (item ativo, avatar, alertas, melhor mês)
 *      preto da palavra    #000000 → barra superior, faixas e texto
 *    e o bordô do "PORTAL ATRAÇÃO" (logo_texto.png) #800000 → rótulos de seção.
 *  - Formas: os arcos (ondas que se abrem) viram ornamento de faixas e títulos;
 *    o círculo vira a forma de avatares, ícones e marcadores; botões em pílula.
 *  - Tipografia: palavra "ATRAÇÃO" em sans geométrica pesada → Montserrat 800/900 nos títulos
 *    e números; Inter no texto corrido e nas tabelas (legível em tamanhos pequenos).
 */
:root,
[data-coreui-theme=light] {
    --sol: #FFCD26;
    --sol-rgb: 255, 205, 38;
    --sol-escuro: #F0B800;
    --sol-tinta: #7A5800;          /* amarelo escurecido para texto sobre fundo claro (contraste AA) */
    --brasa: #E53312;
    --brasa-rgb: 229, 51, 18;
    --bordo: #800000;
    --preto: #0B0B0B;

    --ink: #141210;
    --bg: #FBF8F1;
    --surface: #ffffff;
    --surface-2: #F7F2E6;
    --line: #EBE4D3;
    --muted: #6B6456;
    --ok: #1C7A3C;
    --ok-rgb: 28, 122, 60;
    --bad: #C42B0E;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 1px 0 rgba(20, 18, 16, .04), 0 10px 30px -12px rgba(60, 45, 10, .18);
    --f-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
    --f-texto: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --topo-h: 64px;

    --cui-primary: var(--sol);
    --cui-primary-rgb: var(--sol-rgb);
    --cui-link-color: var(--ink);
    --cui-link-hover-color: var(--brasa);
    --cui-body-font-family: var(--f-texto);
    --cui-border-radius: 12px;
    --cui-focus-ring-color: rgba(var(--brasa-rgb), .3);
}
[data-coreui-theme=dark] {
    --ink: #F6F1E4;
    --bg: #0B0B0A;
    --surface: #161513;
    --surface-2: #1F1D19;
    --line: #2E2B25;
    --muted: #A69E8D;
    --sol-tinta: #FFCD26;
    --ok: #5BC47F;
    --ok-rgb: 91, 196, 127;
    --bad: #FF6B4A;
    --bordo: #FF8A70;
    --shadow: 0 1px 0 rgba(0, 0, 0, .5);
    --cui-body-bg: var(--bg);
    --cui-link-color: var(--ink);
}

html, body { font-size: 15px; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-texto); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration-color: rgba(var(--brasa-rgb), .5); text-underline-offset: 3px; }
a:hover { color: var(--brasa); }
h1, h2, h3, h4, h5, .h3, .h5, .fw-bold, .display-4 { font-family: var(--f-display); }
.text-muted-2 { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(var(--brasa-rgb), .55); outline-offset: 2px; }
kbd { background: rgba(255,255,255,.12); color: inherit; border: 1px solid rgba(255,255,255,.2); font-size: .68rem; padding: .05rem .35rem; border-radius: 6px; font-family: var(--f-texto); }

/* ------------------------------------------------------------ botões e formulários (CoreUI) */
.btn { font-family: var(--f-display); font-weight: 700; border-radius: 999px; padding-left: 1.1rem; padding-right: 1.1rem; letter-spacing: .01em; }
.btn-sm { padding-left: .85rem; padding-right: .85rem; }
.btn-primary, [data-coreui-theme] .btn-primary { --cui-btn-bg: var(--sol); --cui-btn-border-color: var(--sol); --cui-btn-color: #111; --cui-btn-hover-bg: var(--sol-escuro); --cui-btn-hover-border-color: var(--sol-escuro); --cui-btn-hover-color: #000; --cui-btn-active-bg: #E0AA00; --cui-btn-active-border-color: #E0AA00; --cui-btn-active-color: #000; --cui-btn-disabled-bg: var(--sol); --cui-btn-disabled-border-color: var(--sol); --cui-btn-disabled-color: #111; }
.btn-outline-secondary, [data-coreui-theme] .btn-outline-secondary { --cui-btn-color: var(--ink); --cui-btn-border-color: var(--line); --cui-btn-hover-bg: var(--ink); --cui-btn-hover-border-color: var(--ink); --cui-btn-hover-color: var(--bg); --cui-btn-active-bg: var(--ink); --cui-btn-active-color: var(--bg); background: var(--surface); }
.btn-light { --cui-btn-bg: #fff; --cui-btn-border-color: #fff; --cui-btn-color: #111; --cui-btn-hover-bg: #f1ece0; --cui-btn-hover-border-color: #f1ece0; }
.btn-danger { --cui-btn-bg: var(--brasa); --cui-btn-border-color: var(--brasa); }
.form-control, .form-select { border-color: var(--line); border-radius: 12px; }
.form-control:focus, .form-select:focus { border-color: var(--sol-escuro); box-shadow: 0 0 0 .2rem rgba(var(--sol-rgb), .35); }
.input-group > .form-control, .input-group > .input-group-text, .input-group > .btn { border-radius: 12px; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-text { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.form-check-input:checked { background-color: var(--brasa); border-color: var(--brasa); }
.badge { font-family: var(--f-display); font-weight: 700; border-radius: 999px; }
.text-bg-success { background: rgba(var(--ok-rgb), .14) !important; color: var(--ok) !important; }
.text-bg-danger { background: var(--brasa) !important; color: #fff !important; }
.text-bg-warning { background: var(--sol) !important; color: #111 !important; }
.text-bg-light { background: var(--surface-2) !important; color: var(--muted) !important; }
.nav-underline .nav-link { font-family: var(--f-display); font-weight: 700; color: var(--muted); }
.nav-underline .nav-link.active { color: var(--ink); border-bottom-color: var(--brasa); }
.accordion { --cui-accordion-active-bg: rgba(var(--sol-rgb), .18); --cui-accordion-active-color: var(--ink); --cui-accordion-btn-focus-box-shadow: 0 0 0 .2rem rgba(var(--sol-rgb), .35); }
.accordion-button { font-weight: 600; }
.modal-content { border-radius: var(--radius); border: 0; }
.modal-title { font-weight: 800; }
.dropdown-menu { border-radius: 16px; border-color: var(--line); padding: .4rem; }
.dropdown-item { border-radius: 10px; padding: .5rem .75rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--sol); color: #111; }
.progress-bar { background-color: var(--sol); color: #111; }

/* ------------------------------------------------------------ marca (símbolo + palavra) */
.marca { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.marca img { width: 38px; height: 38px; }
.marca b { display: block; font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; letter-spacing: .02em; line-height: 1; }
.marca small { display: block; white-space: nowrap; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sol); font-weight: 600; margin-top: .2rem; }

/* ------------------------------------------------------------ barra superior (preta, como a palavra do logo) */
.topo { position: sticky; top: 0; z-index: 1030; background: var(--preto); color: #fff; }
.topo::after { /* fio amarelo + ponto vermelho: a "assinatura" do logo na borda da barra */
    content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
    background: linear-gradient(90deg, var(--sol) 0, var(--sol) calc(100% - 22px), transparent calc(100% - 22px), transparent calc(100% - 16px), var(--brasa) calc(100% - 16px));
}
.topo-in { max-width: 1440px; margin: 0 auto; height: var(--topo-h); display: flex; align-items: center; gap: 1.25rem; padding: 0 1.5rem; }
.nav-prim { display: flex; align-items: stretch; height: 100%; gap: .25rem; }
.nav-prim > a, .nav-prim > .dropdown > a {
    display: flex; align-items: center; gap: .45rem; padding: 0 .9rem; height: 100%; color: #d9d4c7; text-decoration: none;
    font-family: var(--f-display); font-weight: 700; font-size: .9rem; position: relative; white-space: nowrap;
}
.nav-prim > a i, .nav-prim > .dropdown > a i { font-size: 1.05rem; opacity: .75; }
.nav-prim > a:hover, .nav-prim > .dropdown > a:hover { color: #fff; }
.nav-prim a.active { color: #fff; }
.nav-prim a.active::after { /* arco amarelo sob o item ativo */
    content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 10px; height: 10px;
    border-top: 3px solid var(--sol); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.nav-prim a.active i { color: var(--sol); opacity: 1; }
.nav-prim .dropdown { height: 100%; }
.nav-prim .dropdown-menu { margin-top: 0 !important; }
.nav-prim .dropdown-menu .dropdown-item i { width: 1.4rem; display: inline-block; }
.topo-acoes { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.busca-btn { display: inline-flex; align-items: center; gap: .55rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #cfc9ba; border-radius: 999px; padding: .4rem .55rem .4rem .9rem; font-size: .85rem; min-width: 210px; }
.busca-btn span { margin-right: auto; }
.busca-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.icon-btn { border: 0; background: transparent; color: inherit; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.topo .icon-btn { color: #cfc9ba; }
.topo .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brasa); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-display); font-weight: 800; font-size: .8rem; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--sol); }
.avatar.sol { background: var(--sol); color: #111; }
.avatar.ink { background: var(--ink); color: var(--bg); }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .2rem; border-radius: 999px; cursor: pointer; color: #fff; }
.user-chip .avatar { box-shadow: 0 0 0 2px var(--preto), 0 0 0 4px var(--sol); }
.user-chip .nome { font-size: .82rem; font-weight: 600; line-height: 1.15; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .papel { font-size: .68rem; color: var(--sol); letter-spacing: .06em; text-transform: uppercase; }

.sim-banner { background: var(--sol); color: #111; font-size: .74rem; text-align: center; padding: .3rem 1rem; margin-top: 3px; font-weight: 600; }
.sim-banner a { color: #111; }

/* ------------------------------------------------------------ cabeçalho da página */
.app-content { max-width: 1440px; width: 100%; margin: 0 auto; padding: 1.5rem 1.5rem 2rem; flex: 1; }
.pg-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; position: relative; }
.pg-head .crumb { font-size: .74rem; color: var(--bordo); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-bottom: .2rem; }
.pg-head .crumb a { color: var(--bordo); text-decoration: none; }
.pg-head .crumb a:hover { text-decoration: underline; }
.pg-head .crumb i { font-size: .55rem; margin: 0 .3rem; opacity: .6; }
.pg-head h1 { font-family: var(--f-display); font-weight: 900; font-size: 2rem; letter-spacing: -.015em; margin: 0; line-height: 1.05; }
.pg-head h1::after { content: ""; display: inline-block; width: .32em; height: .32em; border-radius: 50%; background: var(--brasa); margin-left: .12em; vertical-align: baseline; }
.pg-head .pg-ctx { margin-left: auto; }

/* seletor "Visualizando" (chip que abre a busca de titulares/contratos) */
.ctx-chip { display: inline-flex; align-items: center; gap: .65rem; background: var(--surface); border: 2px solid var(--sol); border-radius: 999px; padding: .3rem .4rem .3rem .3rem; color: var(--ink); text-align: left; box-shadow: var(--shadow); max-width: 100%; }
.ctx-chip:hover { border-color: var(--sol-escuro); background: rgba(var(--sol-rgb), .1); }
.ctx-chip .rot { display: block; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sol-tinta); font-weight: 800; font-family: var(--f-display); }
.ctx-chip .nm { display: block; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ctx-chip .troca { margin-left: .4rem; font-size: .72rem; font-weight: 700; background: var(--ink); color: var(--bg); border-radius: 999px; padding: .3rem .7rem; font-family: var(--f-display); }
.ctx-chip.vazio-ctx { border-style: dashed; }

/* ------------------------------------------------------------ painéis sobrepostos (busca rápida / visualizando / "mais") */
.sobre { position: fixed; inset: 0; z-index: 2000; background: rgba(11, 11, 10, .55); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; animation: aparece .12s ease; }
.painel { width: 100%; max-width: 620px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; max-height: 78vh; }
.painel .p-busca { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.painel .p-busca i { color: var(--muted); font-size: 1.15rem; }
.painel .p-busca input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 1.05rem; color: var(--ink); }
.painel .p-busca kbd { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.painel .p-lista { overflow-y: auto; padding: .4rem; }
.painel .p-sec { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bordo); font-weight: 800; padding: .7rem .7rem .3rem; font-family: var(--f-display); }
.painel .p-item { display: flex; align-items: center; gap: .75rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .55rem .7rem; border-radius: 12px; color: var(--ink); }
.painel .p-item .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 1rem; }
.painel .p-item .tx { flex: 1; min-width: 0; }
.painel .p-item .tx .t { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.painel .p-item .tx .d { font-size: .76rem; color: var(--muted); }
.painel .p-item .lado { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.painel .p-item.sel, .painel .p-item:hover { background: rgba(var(--sol-rgb), .22); }
.painel .p-item.sel .ic { background: var(--sol); color: #111; }
.painel .p-item.atual .lado::after { content: " ●"; color: var(--brasa); }
.painel .p-rodape { border-top: 1px solid var(--line); padding: .55rem 1rem; font-size: .74rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.painel .p-vazio { padding: 2rem 1rem; text-align: center; color: var(--muted); }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ barra de abas inferior (celular) */
.tabbar { display: none; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; background: var(--surface); border-radius: 24px 24px 0 0; padding: .5rem .75rem calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.3); animation: sobe .18s ease; }
.folha::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: .25rem auto .75rem; }
.folha a { display: flex; align-items: center; gap: .85rem; padding: .75rem .6rem; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.folha a i { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.folha a.active i { background: var(--sol); color: #111; }
.folha .p-sec { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bordo); font-weight: 800; padding: .6rem .6rem .2rem; font-family: var(--f-display); }
@keyframes sobe { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.app-foot { max-width: 1440px; width: 100%; margin: 0 auto; padding: 1.25rem 1.5rem 1.5rem; font-size: .78rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.app-foot a { color: var(--muted); }
.app-foot .redes { display: flex; gap: .8rem; }
.app-foot .redes a { font-size: 1.05rem; text-decoration: none; }
.app-foot .redes a:hover { color: var(--brasa); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ componentes */
.k-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.k-card > .hd { display: flex; align-items: center; gap: .75rem; padding: 1.05rem 1.35rem; border-bottom: 1px solid var(--line); }
.k-card > .hd h2, .k-card > .hd h3 { font-size: 1.02rem; margin: 0; font-weight: 800; font-family: var(--f-display); display: flex; align-items: center; gap: .5rem; }
.k-card > .hd h2::before, .k-card > .hd h3::before { /* mini-arcos do logo antes de cada título de cartão */
    content: ""; width: 18px; height: 18px; flex: none; background: url(../img/arcos.svg) center / contain no-repeat;
}
.k-card > .hd > i:first-child { display: none; } /* o mini-arco do título substitui o ícone */
.k-card > .hd .sub { font-size: .8rem; color: var(--muted); font-family: var(--f-texto); }
.k-card > .bd { padding: 1.35rem; }
.k-card > .bd.p0 { padding: 0; }

.kpi { padding: 1.2rem 1.35rem; display: flex; flex-direction: column; gap: .35rem; height: 100%; position: relative; overflow: hidden; }
.kpi .rot { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: .55rem; font-family: var(--f-display); }
.kpi .rot i { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--brasa); color: #fff; }
.kpi.y .rot i { background: var(--sol); color: #111; }
.kpi.g .rot i { background: rgba(var(--ok-rgb), .14); color: var(--ok); }
.kpi.k .rot i { background: var(--ink); color: var(--bg); }
.kpi .val { font-family: var(--f-display); font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.kpi .det { font-size: .8rem; color: var(--muted); }
.kpi::after { /* arcos discretos no canto de cada indicador */
    content: ""; position: absolute; right: -14px; bottom: -14px; width: 86px; height: 86px; opacity: .14;
    background: url(../img/arcos.svg) right bottom / contain no-repeat; pointer-events: none;
}
.delta { font-size: .74rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; font-family: var(--f-display); white-space: nowrap; }
.delta.up { background: rgba(var(--ok-rgb), .14); color: var(--ok); }
.delta.down { background: rgba(var(--brasa-rgb), .12); color: var(--bad); }

/* faixa de boas-vindas: preta com os arcos amarelos e o círculo vermelho, como o logo */
.hero {
    border-radius: var(--radius); padding: 1.7rem 1.75rem; color: #fff; position: relative; overflow: hidden;
    background: var(--preto);
}
.hero::before { content: ""; position: absolute; right: -10px; bottom: -6px; width: 300px; height: 300px; background: url(../img/arcos.svg) right bottom / contain no-repeat; opacity: .95; }
.hero::after { content: ""; position: absolute; right: 54px; bottom: 70px; width: 64px; height: 64px; border-radius: 50%; background: var(--brasa); box-shadow: 0 0 0 6px var(--preto); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-family: var(--f-display); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sol); font-weight: 800; margin-bottom: .35rem; }
[data-coreui-theme=dark] .hero { background: #1A1814; border: 1px solid var(--line); }
[data-coreui-theme=dark] .hero::after { box-shadow: 0 0 0 6px #1A1814; }
.hero h2 { font-family: var(--f-display); font-size: 2rem; margin: 0 0 .35rem; font-weight: 900; letter-spacing: -.02em; }
.hero p { margin: 0; color: #d9d4c7; max-width: 560px; }
.hero p strong { color: #fff; }
.hero .acoes-hero { margin-right: 240px; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .34rem .9rem; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--sol); border-color: var(--sol); color: #111; }
.chip .n { font-size: .7rem; min-width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.chip.on .n { background: #111; color: var(--sol); }

.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: .38rem .95rem; border-radius: 999px; font-size: .84rem; color: var(--muted); font-weight: 700; font-family: var(--f-display); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg a { padding: .38rem .95rem; border-radius: 999px; font-size: .84rem; color: var(--muted); font-weight: 700; font-family: var(--f-display); white-space: nowrap; text-decoration: none; }
.seg a.on { background: var(--ink); color: var(--bg); }

.pill-tipo { font-family: var(--f-display); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill-tipo.royalt { background: rgba(var(--ok-rgb), .14); color: var(--ok); }
.pill-tipo.pagamento { background: var(--ink); color: var(--bg); }
.pill-tipo.adiantamento { background: var(--sol); color: #111; }
.valor-pos { color: var(--ok); font-weight: 700; }
.valor-neg { color: var(--bad); font-weight: 700; }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.tbl th { font-family: var(--f-display); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; padding: .75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: rgba(var(--sol-rgb), .09); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.grupo td { background: var(--bg); font-family: var(--f-display); font-weight: 800; font-size: .74rem; color: var(--bordo); text-transform: uppercase; letter-spacing: .12em; }
.tbl tr.grupo td::first-letter { color: inherit; }
.tbl-wrap { overflow: auto; max-height: 70vh; border-radius: 0 0 var(--radius) var(--radius); }

.dl-btn { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: var(--surface); white-space: nowrap; font-weight: 600; }
.dl-btn:hover { border-color: var(--sol); background: var(--sol); color: #111; }

.resumo-barra { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.resumo-barra > div { padding: 1.1rem 1.35rem; border-right: 1px solid var(--line); }
.resumo-barra > div:last-child { border-right: 0; background: rgba(var(--sol-rgb), .14); border-radius: 0 var(--radius) var(--radius) 0; }
.resumo-barra .rot { font-family: var(--f-display); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.resumo-barra .val { font-family: var(--f-display); font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.vazio { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.vazio .vz-arte { width: 92px; height: 92px; margin: 0 auto .9rem; position: relative; }
.vazio .vz-arte::before { content: ""; position: absolute; inset: 0; background: url(../img/arcos.svg) center / contain no-repeat; opacity: .55; }
.vazio .vz-arte i { position: absolute; right: 2px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%; background: var(--brasa); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 0 0 4px var(--surface); }
.vazio .vz-t { font-family: var(--f-display); font-weight: 800; color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; }

.barra-h { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.barra-h > span { display: block; height: 100%; background: var(--sol); border-radius: 999px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px dashed var(--line); align-items: center; }
.timeline li:last-child { border-bottom: 0; }
.timeline .ic { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.timeline .ic.royalt { background: rgba(var(--ok-rgb), .14); color: var(--ok); }
.timeline .ic.pagamento { background: var(--ink); color: var(--bg); }
.timeline .ic.adiantamento { background: var(--sol); color: #111; }
.timeline .tx { flex: 1; min-width: 0; }
.timeline .tx .t { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .tx .d { font-size: .76rem; color: var(--muted); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 16px; margin-bottom: .6rem; background: var(--surface); cursor: pointer; }
.steps li:hover { border-color: var(--sol-escuro); }
.steps li.on { border-color: var(--sol); box-shadow: 0 0 0 3px rgba(var(--sol-rgb), .35); }
.steps li .n { counter-increment: s; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--f-display); font-size: .85rem; flex: none; }
.steps li .n::before { content: counter(s); }
.steps li.on .n { background: var(--sol); border-color: var(--sol); color: #111; }
.steps li.feito .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.feito .n::before { content: "✓"; }
.steps li .tx { flex: 1; }
.steps li .tx .t { font-weight: 700; }
.steps li .tx .d { font-size: .78rem; color: var(--muted); }

.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 2rem 1rem; text-align: center; background: var(--surface-2); transition: .15s; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--sol-escuro); background: rgba(var(--sol-rgb), .12); }
.dropzone i { font-size: 1.6rem; width: 56px; height: 56px; border-radius: 50%; background: var(--sol); color: #111; display: inline-flex; align-items: center; justify-content: center; }

.toast-area { position: fixed; right: 1rem; bottom: 1rem; z-index: 2100; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.k-toast { background: var(--preto); color: #fff; border-radius: 16px; padding: .85rem 1rem; box-shadow: 0 12px 30px rgba(0,0,0,.3); display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; animation: entra .2s ease; border-left: 5px solid var(--sol); }
.k-toast.erro { border-left-color: var(--brasa); }
.k-toast i { font-size: 1.2rem; }
.k-toast.ok i { color: #6ee7a0; }
.k-toast.erro i { color: #ff8a70; }
.k-toast.info i { color: var(--sol); }
@keyframes entra { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.nota-sim { border: 1px dashed rgba(var(--brasa-rgb), .45); background: rgba(var(--sol-rgb), .1); border-radius: 16px; padding: .85rem 1.1rem; font-size: .82rem; }
.nota-sim strong.t { display: block; margin-bottom: .2rem; font-family: var(--f-display); font-weight: 800; color: var(--bordo); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ login: painel amarelo com os arcos do logo */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.login-arte { position: relative; background: var(--sol); color: #111; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; overflow: hidden; }
.login-arte .arcos-gig { position: absolute; right: -6%; bottom: -4%; width: 78%; max-width: 620px; aspect-ratio: 1; }
.login-arte .arcos-gig path { fill: #fff; opacity: .5; }
.login-arte .arcos-gig circle { fill: var(--brasa); }
.login-arte > *:not(.arcos-gig) { position: relative; z-index: 1; }
.login-arte .selo { font-family: var(--f-display); font-weight: 900; letter-spacing: .28em; font-size: .9rem; color: var(--bordo); }
.login-arte h2 { font-family: var(--f-display); font-size: 2.6rem; font-weight: 900; max-width: 480px; letter-spacing: -.025em; line-height: 1.05; }
.login-arte h2 span { background: #111; color: var(--sol); padding: 0 .2em; border-radius: 10px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.login-arte ul { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: 420px; }
.login-arte li { margin-bottom: .55rem; display: flex; gap: .6rem; align-items: center; font-weight: 600; }
.login-arte li i { width: 26px; height: 26px; border-radius: 50%; background: #111; color: var(--sol); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; flex: none; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-form .caixa { width: 100%; max-width: 410px; }
.login-form .logo { height: 112px; }
.login-form h1 { font-weight: 900; letter-spacing: -.02em; }
.login-form .form-control { padding: .75rem 1rem; }
.login-form .btn-primary { padding: .8rem; font-size: 1rem; }
.contas-demo .list-group-item { border-color: var(--line); }
.contas-demo button { text-align: left; }
.contas-demo button:hover { background: rgba(var(--sol-rgb), .16); }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1399.98px) {
    .user-chip .nome, .user-chip .papel { display: none; }
}
@media (max-width: 1199.98px) {
    .marca small { display: none; }
    .busca-btn { min-width: 0; }
    .busca-btn span, .busca-btn kbd { display: none; }
    .user-chip .nome, .user-chip .papel { display: none; }
    .nav-prim > a, .nav-prim > .dropdown > a { padding: 0 .6rem; }
    .nav-prim a.active::after { left: .6rem; right: .6rem; }
}
@media (max-width: 991.98px) {
    :root { --topo-h: 56px; }
    .nav-prim { display: none; }
    .topo-in { padding: 0 1rem; gap: .75rem; }
    .app-content { padding: 1rem 1rem calc(88px + env(safe-area-inset-bottom)); }
    .app-foot { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .pg-head h1 { font-size: 1.6rem; }
    .pg-head .pg-ctx { margin-left: 0; width: 100%; }
    .ctx-chip { width: 100%; }
    .ctx-chip .nm { max-width: none; }
    .ctx-chip .troca { margin-left: auto; }
    .tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom)); z-index: 1030;
        background: var(--preto); border-radius: 22px; padding: .35rem; box-shadow: 0 12px 30px rgba(0,0,0,.35);
    }
    .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: .1rem; color: #bdb7a8; text-decoration: none; font-size: .64rem; font-weight: 700; padding: .35rem 0; border: 0; background: transparent; border-radius: 16px; font-family: var(--f-display); }
    .tabbar i { font-size: 1.2rem; width: 38px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
    .tabbar a.active { color: #fff; }
    .tabbar a.active i { background: var(--sol); color: #111; }
    .resumo-barra { grid-template-columns: repeat(2, 1fr); }
    .resumo-barra > div:nth-child(2) { border-right: 0; }
    .resumo-barra > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .resumo-barra > div:last-child { border-radius: 0 0 var(--radius) 0; }
    .login-arte { padding: 2rem; }
    .login-arte h2 { font-size: 1.9rem; }
    .hero .acoes-hero { margin-right: 0; }
    .hero::before { width: 200px; height: 200px; opacity: .35; }
    .hero::after { width: 40px; height: 40px; right: 34px; bottom: 46px; opacity: .6; }
}
@media (max-width: 767.98px) {
    .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-arte { min-height: 0; padding: 1.4rem 1.5rem 1.6rem; }
    .login-arte .arcos-gig { width: 46%; right: -4%; bottom: -14%; }
    .login-arte h2 { font-size: 1.45rem; margin: .5rem 0 0; max-width: 62%; }
    .login-arte ul { display: none; }
    .login-form .logo { height: 84px; }
    .hero h2 { font-size: 1.55rem; }
    .marca small { display: none; }
    /* tabelas viram "cartões" no celular */
    .tbl-stack thead { display: none; }
    .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
    .tbl-stack tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
    .tbl-stack td { border: 0; padding: .25rem 1rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .tbl-stack td::before { content: attr(data-label); font-family: var(--f-display); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; text-align: left; }
    .tbl-stack td.num { text-align: right; }
    .tbl-stack tr.grupo td::before { content: none; }
    .kpi .val { font-size: 1.4rem; }
    .resumo-barra > div { padding: .9rem 1rem; }
    .resumo-barra .val { font-size: 1.02rem; letter-spacing: -.01em; }
    .toast-area { bottom: calc(92px + env(safe-area-inset-bottom)); left: 1rem; }
}
@media print {
    .topo, .app-foot, .sim-banner, .nao-imprime, .toast-area, .tabbar, .pg-ctx { display: none !important; }
    .k-card { box-shadow: none; }
    .kpi::after, .hero::before, .hero::after { display: none; }
}

/* ------------------------------------------------------------ páginas (v4: estilos que no protótipo ficavam em cada HTML) */
.demo-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; height: 100%; }
.demo-card .mes { font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; }
.demo-card .per { font-size: .78rem; color: var(--muted); }
.demo-card .v { font-family: var(--f-display); font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.demo-card .membros { font-size: .8rem; border-top: 1px dashed var(--line); padding-top: .5rem; }
.demo-card .membros div { display: flex; justify-content: space-between; }
.demo-card .membros .membro { flex-wrap: wrap; gap: 0 .5rem; padding: .15rem 0; }
.demo-card .membros .membro .nome { flex: 1; min-width: 0; }
.demo-card .membros .membro .docs { flex-basis: 100%; display: flex; gap: .75rem; font-size: .75rem; }
.demo-card .membros .membro .docs a { text-decoration: none; }
.demo-card.novo { border-color: rgba(var(--sol-rgb), .9); box-shadow: 0 0 0 3px rgba(var(--sol-rgb), .2); }
.ano-tit { font-family: var(--f-display); font-size: 1.6rem; letter-spacing: -.01em; color: var(--ink); font-weight: 900; margin: 1.5rem 0 .75rem; display: flex; align-items: center; gap: .75rem; }
.ano-tit::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.regras { padding-left: 0; }
.regras li { list-style: none; color: var(--muted); }
.regras li::before { content: "○"; margin-right: .5rem; }
.regras li.ok { color: var(--ok); }
.regras li.ok::before { content: "✓"; }
.forca { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.forca span { display: block; height: 100%; width: 0; transition: .2s; }
.dropdown-item[type=submit] { width: 100%; text-align: left; }
.contas-demo button:disabled { opacity: .55; }
