/* JMDC WebKit: design system (identidade JMDC: grafite #11100F, cobre #C18A55, oliva #8FB07A) */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
    --fundo: #11100F; --fundo-2: #171513; --painel: rgba(33, 25, 19, 0.62); --painel-solido: #1d1814; --linha: rgba(193, 138, 85, 0.22); --linha-forte: rgba(193, 138, 85, 0.45);
    --texto: #EDE6DC; --texto-2: #C9BFB2; --texto-3: #9C8F80;
    --cobre: #C18A55; --cobre-claro: #D9A673; --cobre-escuro: #9E6C3E; --oliva: #8FB07A; --ambar: #D9A441; --tijolo: #C4553D; --azul-aco: #6E8CA8;
    --ok: #8FB07A; --atencao: #D9A441; --perigo: #E06A4F;
    --raio: 14px; --raio-p: 10px; --sombra: 0 18px 50px rgba(0, 0, 0, 0.45); --sombra-p: 0 6px 18px rgba(0, 0, 0, 0.35);
    --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif; --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --topo: 64px; --transicao: 220ms cubic-bezier(.2, .8, .2, 1);
    color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; background: var(--fundo); color: var(--texto); font: 400 16px/1.55 var(--f-display); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cobre-claro); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cobre-claro); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Fundo ambiente (todas as telas internas) */
.ambiente { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
    radial-gradient(900px 600px at 85% -10%, rgba(193, 138, 85, 0.14), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(143, 176, 122, 0.10), transparent 60%), var(--fundo); }

/* Barra superior */
.topo { position: sticky; top: 0; z-index: 50; height: var(--topo); display: flex; align-items: center; gap: 12px; padding: 0 clamp(14px, 4vw, 32px);
    background: rgba(17, 16, 15, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--linha); }
.topo .marca { display: flex; align-items: center; gap: 10px; color: var(--texto); font-weight: 800; letter-spacing: .2px; }
.topo .marca img { width: 34px; height: 34px; }
.topo .marca span { color: var(--cobre); }
.topo nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topo nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; color: var(--texto-2); font-weight: 600; font-size: .92rem; }
.topo nav a:hover { color: var(--texto); background: rgba(193, 138, 85, .1); text-decoration: none; }
.topo nav a[aria-current="page"] { color: var(--fundo); background: var(--cobre); }
.topo nav svg { width: 18px; height: 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--cobre), var(--cobre-escuro)); color: #1a120b; font-weight: 800; font-size: .85rem; border: 0; cursor: pointer; }

/* Navegação inferior no celular */
.nav-movel { display: none; }
@media (max-width: 720px) {
    .topo nav { display: none; }
    .nav-movel { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(17, 16, 15, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--linha); }
    .nav-movel a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; color: var(--texto-3); font-size: .7rem; font-weight: 700; }
    .nav-movel a svg { width: 22px; height: 22px; }
    .nav-movel a[aria-current="page"] { color: var(--cobre-claro); background: rgba(193, 138, 85, .12); }
    .nav-movel a:hover { text-decoration: none; }
    body.com-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Página */
.pagina { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 36px) clamp(14px, 4vw, 32px) 48px; }
.cabeca { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.cabeca h1 { font-size: clamp(1.5rem, 4.4vw, 2.2rem); font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.cabeca h1 em { font-style: normal; color: var(--cobre); }
.cabeca p { color: var(--texto-3); margin-top: 4px; }
.secao-titulo { font-size: .78rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--texto-3); margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.secao-titulo::after { content: ""; flex: 1; height: 1px; background: var(--linha); }

/* Cartões */
.cartao { background: var(--painel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.grade { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: .74rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-3); }
.kpi b { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { color: var(--texto-3); font-size: .82rem; }

/* Botões */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform var(--transicao), background var(--transicao), border-color var(--transicao), box-shadow var(--transicao); white-space: nowrap; }
.botao:active { transform: translateY(1px) scale(.99); }
.botao:disabled { opacity: .55; cursor: not-allowed; }
.botao svg { width: 18px; height: 18px; }
.botao-pri { background: linear-gradient(135deg, var(--cobre-claro), var(--cobre) 55%, var(--cobre-escuro)); color: #1a120b; box-shadow: 0 8px 22px rgba(193, 138, 85, .28); }
.botao-pri:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(193, 138, 85, .42); transform: translateY(-1px); }
.botao-sec { background: rgba(255, 255, 255, .04); border-color: var(--linha-forte); color: var(--texto); }
.botao-sec:hover:not(:disabled) { border-color: var(--cobre); background: rgba(193, 138, 85, .08); }
.botao-ok { background: var(--oliva); color: #13200d; }
.botao-perigo { background: transparent; border-color: rgba(224, 106, 79, .5); color: var(--perigo); }
.botao-perigo:hover:not(:disabled) { background: rgba(224, 106, 79, .1); }
.botao-mini { min-height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 10px; }
.botao-icone { width: 40px; padding: 0; }
.botao-largo { width: 100%; }

/* Formulários */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo label, .rotulo { font-size: .82rem; font-weight: 700; color: var(--texto-2); }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(193, 138, 85, .28); background: rgba(10, 9, 8, .55); color: var(--texto); transition: border-color var(--transicao), box-shadow var(--transicao); }
.campo textarea { min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--cobre); box-shadow: 0 0 0 4px rgba(193, 138, 85, .16); }
.campo small { color: var(--texto-3); font-size: .78rem; }
.campos { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.campos .largo { grid-column: 1 / -1; }
@media (max-width: 560px) { .campos { grid-template-columns: 1fr; } }
.chave { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--texto-2); }
.chave input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .12); position: relative; cursor: pointer; transition: background var(--transicao); flex-shrink: 0; }
.chave input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--texto); transition: transform var(--transicao); }
.chave input:checked { background: var(--cobre); }
.chave input:checked::after { transform: translateX(18px); }
.segmentos { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--linha); }
.segmentos button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--texto-3); cursor: pointer; }
.segmentos button[aria-pressed="true"] { background: var(--cobre); color: #1a120b; }
.erro-form { padding: 10px 14px; border-radius: 10px; background: rgba(224, 106, 79, .12); border: 1px solid rgba(224, 106, 79, .4); color: #f2a08c; font-weight: 600; font-size: .9rem; }

/* Selos de situação */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.selo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.selo.ok { color: var(--ok); background: rgba(143, 176, 122, .12); }
.selo.proximo { color: var(--atencao); background: rgba(217, 164, 65, .14); }
.selo.vencido { color: var(--perigo); background: rgba(224, 106, 79, .14); }
.selo.sem_registro { color: var(--texto-3); background: rgba(255, 255, 255, .06); }

/* Modal (diálogo nativo) */
dialog.modal { margin: auto; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--linha-forte); border-radius: 18px; background: var(--painel-solido); color: var(--texto); padding: 0; box-shadow: var(--sombra); }
dialog.modal::backdrop { background: rgba(8, 7, 6, .72); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: subir .28s cubic-bezier(.2, .8, .2, 1); }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--painel-solido); z-index: 1; }
.modal-topo h2 { font-size: 1.1rem; }
.modal-corpo { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 0 18px 18px; }
@media (max-width: 560px) {
    dialog.modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    dialog.modal[open] { animation: deslizar .3s cubic-bezier(.2, .8, .2, 1); }
    .modal-acoes .botao { flex: 1; }
}
@keyframes subir { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes deslizar { from { transform: translateY(100%); } }

/* Avisos */
.avisos { position: fixed; z-index: 200; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
body.com-nav .avisos { bottom: calc(90px + env(safe-area-inset-bottom)); }
.aviso { padding: 12px 16px; border-radius: 12px; background: #2a211a; border: 1px solid var(--linha-forte); color: var(--texto); font-weight: 600; box-shadow: var(--sombra-p); animation: subir .25s ease; }
.aviso.erro { background: #3a1d16; border-color: rgba(224, 106, 79, .5); }
.aviso.ok { background: #1f2a19; border-color: rgba(143, 176, 122, .5); }

/* WhatsApp JMDC */
.whatsapp { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 70; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #25D366; color: #fff; box-shadow: 0 10px 26px rgba(37, 211, 102, .35); }
.whatsapp svg { width: 30px; height: 30px; }
.whatsapp::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25D366; animation: onda 2.4s ease-out infinite; }
.whatsapp:hover { text-decoration: none; transform: scale(1.05); }
body.com-nav .whatsapp { bottom: calc(86px + env(safe-area-inset-bottom)); }
@keyframes onda { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }

.vazio { text-align: center; padding: 34px 16px; color: var(--texto-3); }
.vazio svg { width: 54px; height: 54px; margin: 0 auto 10px; color: var(--cobre); opacity: .7; }
.carregando { height: 120px; border-radius: var(--raio); background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(193,138,85,.08), rgba(255,255,255,.03)); background-size: 200% 100%; animation: brilho 1.4s infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.offline-logo { margin: 40px auto 16px; width: 90px; height: 90px; }

/* Barra superior: ações (sino + conta) e menus suspensos */
.topo .nav-desktop { margin-left: auto; }
.topo-acoes { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.botao-topo { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linha); background: rgba(255, 255, 255, .03); color: var(--texto-2); display: grid; place-items: center; cursor: pointer; }
.botao-topo:hover { color: var(--cobre-claro); border-color: var(--linha-forte); }
.botao-topo svg { width: 20px; height: 20px; }
.contador { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--perigo); color: #fff; font: 800 .68rem/18px var(--f-display); text-align: center; animation: subir .3s; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.avatar img.pixelado, .pixelado { image-rendering: pixelated; }
.avatar-botao { width: 40px; height: 40px; border: 2px solid var(--cobre); padding: 0; }
.avatar-grande { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cobre), var(--cobre-escuro)); color: #1a120b; font-weight: 800; flex-shrink: 0; }
.menu-suspenso { position: absolute; top: calc(var(--topo) - 6px); right: clamp(10px, 4vw, 32px); width: min(340px, calc(100vw - 20px)); max-height: min(70dvh, 520px); overflow-y: auto; z-index: 80;
    background: var(--painel-solido); border: 1px solid var(--linha-forte); border-radius: 16px; box-shadow: var(--sombra); padding: 8px; animation: subir .2s ease; }
.menu-cab { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
.link-mini { border: 0; background: none; color: var(--cobre-claro); font-weight: 700; font-size: .8rem; cursor: pointer; }
.menu-perfil { display: flex; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--linha); margin-bottom: 6px; }
.menu-perfil b { display: block; } .menu-perfil small { color: var(--texto-3); font-size: .8rem; word-break: break-all; }
.menu-conta a, .menu-conta button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 10px; border: 0; background: none; color: var(--texto); font-weight: 600; font-size: .92rem; text-align: left; cursor: pointer; }
.menu-conta a:hover, .menu-conta button:hover { background: rgba(193, 138, 85, .1); text-decoration: none; }
.menu-conta svg { width: 18px; height: 18px; color: var(--cobre-claro); }
.menu-conta .sair { color: var(--perigo); } .menu-conta .sair svg { color: var(--perigo); }
.lista-sino { display: flex; flex-direction: column; gap: 4px; }
.item-sino { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; color: var(--texto); }
.item-sino:hover { background: rgba(193, 138, 85, .08); text-decoration: none; }
.item-sino.nova { background: rgba(193, 138, 85, .1); border-left: 3px solid var(--cobre); }
.item-sino span { color: var(--texto-2); font-size: .84rem; } .item-sino small { color: var(--texto-3); font-size: .72rem; }
.versiculo { font-size: .86rem; line-height: 1.5; color: var(--texto-2); cursor: pointer; max-width: 70ch; transition: opacity .16s; margin-top: 8px; }
.versiculo .versiculo-texto { font-style: italic; }
.versiculo .versiculo-ref { display: block; margin-top: 2px; font: 700 .74rem var(--f-mono); color: var(--cobre-claro); }
.versiculo.versiculo-troca { opacity: 0; }
@media (max-width: 720px) { .topo .nav-desktop { display: none; } .topo-acoes { margin-left: auto; } }
.chave > span { min-width: 0; overflow-wrap: anywhere; }
