@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  --bg: #f5f4f0; --surface: #fff; --surface2: #faf9f6; --ink: #14213d; --muted: #6b7280; --line: #e6e3dc;
  --navy: #0f1e3d; --navy2: #1a2d57; --gold: #c9a24b; --gold2: #e3c57a; --goldbg: #f8f1e1;
  --green: #1d7a50; --greenbg: #e5f4ec; --amber: #9a6512; --amberbg: #fbf0dc; --red: #b42318; --redbg: #fdecea;
  --shadow: 0 1px 2px rgba(20,33,61,.06), 0 6px 20px rgba(20,33,61,.06); --r: 14px;
  --pri: #0f1e3d; --pri2: #1a2d57; --pri-ink: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c1220; --surface: #131b2d; --surface2: #172136; --ink: #e7ebf3; --muted: #9aa4b6; --line: #243049;
  --goldbg: #2a2415; --greenbg: #10291f; --green: #4cc38a; --amberbg: #2b2112; --amber: #e0a84a; --redbg: #2e1613; --red: #f08a7e;
  --navy2: #24407a; --pri: #d4ae57; --pri2: #e3c57a; --pri-ink: #1b1504; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0c1220; --surface: #131b2d; --surface2: #172136; --ink: #e7ebf3; --muted: #9aa4b6; --line: #243049;
  --goldbg: #2a2415; --greenbg: #10291f; --green: #4cc38a; --amberbg: #2b2112; --amber: #e0a84a; --redbg: #2e1613; --red: #f08a7e;
  --navy2: #24407a; --pri: #d4ae57; --pri2: #e3c57a; --pri-ink: #1b1504; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark; }

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased }
button, input, select, textarea { font: inherit; color: inherit }
a { color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }

/* ── Marca ─────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: -.01em }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0 }
.mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #0f1e3d, #1a2d57); display: grid; place-items: center; color: var(--gold2); box-shadow: inset 0 0 0 1px rgba(201,162,75,.55); flex: none }
.mark svg { width: 22px; height: 22px }

/* ── Login ─────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr }
.login-arte { position: relative; overflow: hidden; background: radial-gradient(900px 600px at 0% 0%, #1f3a70 0%, transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(201,162,75,.22), transparent 60%), #0b1631; color: #e9edf6; display: flex; align-items: center; padding: 56px }
.login-arte::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%) }
.arte-conteudo { position: relative; max-width: 480px }
.cofre { width: 132px; height: 132px; color: var(--gold2); margin-bottom: 30px; filter: drop-shadow(0 10px 30px rgba(201,162,75,.25)) }
.cofre svg { width: 100%; height: 100% }
.cofre .dial { transform-origin: 100px 100px; animation: gira 40s linear infinite }
@keyframes gira { to { transform: rotate(360deg) } }
.arte-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--gold2); margin: 0 0 10px }
.login-arte h1 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 40px; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 16px; color: #fff; text-wrap: balance }
.login-arte p { color: #b9c3d9; font-size: 16px; margin: 0 0 22px }
.login-arte ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px }
.login-arte li { display: flex; gap: 10px; align-items: center; color: #d6ddec }
.login-arte li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none; background: rgba(201,162,75,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3c57a' stroke-width='3'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center/11px no-repeat; box-shadow: inset 0 0 0 1px rgba(201,162,75,.5) }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg) }
.login-card { width: 100%; max-width: 400px }
.login-card h2 { font-size: 24px; letter-spacing: -.02em; margin: 34px 0 6px }
.login-card .lead { color: var(--muted); margin: 0 0 8px }
label.f { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px }
.inp { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s }
.inp:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,75,.18) }
textarea.inp { resize: vertical; min-height: 90px }
.otp1 { font-size: 26px; letter-spacing: .5em; text-align: center; font-weight: 600; padding: 12px 0 12px .5em }
.olho { position: relative } .olho .inp { padding-right: 76px }
.olho button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 7px }
.olho button:hover { color: var(--ink); background: var(--surface2) }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 16px; text-align: center }
.alerta { background: var(--redbg); color: var(--red); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; margin: 14px 0 0 }
.aviso { background: var(--amberbg); color: var(--amber); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; margin: 14px 0 0 }
.qr { display: grid; place-items: center; background: #fff; padding: 14px; border-radius: 14px; border: 1px solid var(--line); width: max-content; margin: 16px auto 8px }
.segredo { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; text-align: center; word-break: break-all; color: var(--muted) }
.passos { padding-left: 20px; color: var(--muted); margin: 10px 0 0 } .passos li { margin: 4px 0 }

/* ── Botões e etiquetas ────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s, transform .1s }
.btn:hover { border-color: var(--gold) }
.btn:active { transform: translateY(1px) }
.btn:disabled { opacity: .55; cursor: default }
.btn.pri { background: var(--pri); border-color: var(--pri); color: var(--pri-ink) } .btn.pri:hover { background: var(--pri2); border-color: var(--pri2) }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #241c05 }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff }
.btn.perigo { color: var(--red) }
.btn.full { width: 100%; padding: 13px; margin-top: 22px; font-size: 14.5px }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px }
.btn svg { width: 16px; height: 16px }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap }
.t-ok { background: var(--greenbg); color: var(--green) } .t-wait { background: var(--amberbg); color: var(--amber) }
.t-neutro { background: var(--surface2); border: 1px solid var(--line) } .t-off { background: var(--redbg); color: var(--red) }

/* ── Estrutura do app ──────────────────────────────── */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto }
.side .brand { padding: 0 8px 20px }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; font-weight: 500; text-decoration: none; color: var(--ink) }
.nav:hover { background: var(--surface2) }
.nav.on { background: var(--goldbg); font-weight: 600 }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .8 }
.nav .badge { margin-left: auto; background: var(--amber); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700 }
.nav-sep { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 11px 6px }
.side .foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line) }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px; border-radius: 9px }
.me:hover { background: var(--surface2) }
.me b { display: block; font-size: 13.5px } .me span { font-size: 12px; color: var(--muted) }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--gold2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none }
.foot-acoes { display: flex; gap: 6px; margin-top: 8px }
.foot-acoes button { flex: 1 }
.topo { display: none }
.main { padding: 32px 36px 80px; max-width: 1160px; width: 100%; min-width: 0 }
h1.titulo { font-size: 24px; letter-spacing: -.02em; margin: 0 0 4px }
.sub { color: var(--muted); margin: 0 0 22px }
.cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px }
.cab .sub { margin: 0 }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow) }
.vazio { padding: 40px 24px; text-align: center; color: var(--muted) }
.vazio b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px }

/* ── Busca ─────────────────────────────────────────── */
.searchbar { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 7px 7px 7px 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s }
.searchbar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,75,.15), var(--shadow) }
.searchbar svg { width: 20px; height: 20px; color: var(--muted); flex: none }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16.5px; padding: 11px 0 }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 20px }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer }
.chip:hover { border-color: var(--gold) }
.chip.on { background: var(--pri); color: var(--pri-ink); border-color: var(--pri) }
.grid { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start }
.grid > * { min-width: 0 }
.filtros { padding: 16px; position: sticky; top: 20px }
.filtros h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted) }
.filtros .grp { margin-bottom: 18px } .filtros .grp:last-child { margin: 0 }
.filtros label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer }
.filtros label small { margin-left: auto; color: var(--muted) }
.filtros input[type=checkbox] { accent-color: var(--navy); width: 15px; height: 15px }
.filtros select, .filtros .inp { padding: 8px 10px; font-size: 13.5px }
.anos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.filtros-btn { display: none }
.count { font-size: 13px; color: var(--muted); margin-bottom: 10px }
.res { display: block; padding: 17px 19px; margin-bottom: 12px; text-decoration: none; transition: border-color .15s, transform .15s }
.res:hover { border-color: var(--gold); transform: translateY(-1px) }
.linha-tags { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-bottom: 6px }
.res .t { font-weight: 650; font-size: 15.5px }
.meta { font-size: 12.5px; color: var(--muted) }
.res p { margin: 9px 0 0; font-family: "Source Serif 4", Georgia, serif; font-size: 15.5px; line-height: 1.6 }
mark { background: rgba(201,162,75,.3); color: inherit; border-radius: 3px; padding: 0 2px }
.paginas { display: flex; gap: 8px; justify-content: center; margin-top: 18px }

/* ── Entes ─ */
.entes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px }
.entes-grid .res { margin: 0 }

/* ── Ficha ─────────────────────────────────────────── */
.voltar { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; margin-bottom: 14px }
.voltar:hover { color: var(--ink) }
.ficha { padding: 28px 30px }
.ficha h2 { margin: 10px 0 2px; font-size: 23px; letter-spacing: -.015em }
.verb { margin: 20px 0; padding: 20px 24px; background: var(--surface2); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; font-family: "Source Serif 4", Georgia, serif; font-size: 17.5px; line-height: 1.7; white-space: pre-wrap }
.verb .lbl { display: block; font-family: Inter, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; white-space: normal }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 }
.kv div { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere }
.kv span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em }
.kv .largo { grid-column: 1 / -1 }
.acts { display: flex; gap: 8px; flex-wrap: wrap }
.bloco { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px }
.bloco h3 { font-size: 14px; margin: 0 0 10px }
.nota { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px }
.nota .meta { margin-top: 4px }
.hist { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--muted) } .hist li { padding: 3px 0 }
.resumo { font-size: 13.5px; color: var(--muted); margin: -6px 0 14px }
.barra-cur { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--amberbg); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px }
.barra-cur span { flex: 1; min-width: 200px; color: var(--amber); font-weight: 600; font-size: 13.5px }

/* ── Formulários ───────────────────────────────────── */
.form { padding: 24px 26px; max-width: 860px }
.form .duas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px }
.form .tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px }
.ajuda { font-size: 12.5px; color: var(--muted); margin-top: 5px }
.temas-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.temas-sel .tag { cursor: pointer }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface2); cursor: pointer }
.check input { accent-color: var(--green); width: 17px; height: 17px; margin-top: 2px }
.rodape-form { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 34px 20px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s }
.drop:hover, .drop.on { border-color: var(--gold); background: var(--goldbg) }
.drop b { color: var(--ink) }

/* ── Tabelas ───────────────────────────────────────── */
.tblwrap { overflow-x: auto }
.tbl { width: 100%; border-collapse: collapse }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface2) }
.tbl tr:last-child td { border-bottom: 0 }
.tbl td.acoes { white-space: nowrap; text-align: right }
.tbl select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2) }

/* ── Claude ────────────────────────────────────────── */
.passo-lista { counter-reset: s; list-style: none; padding: 0; margin: 0 }
.passo-lista li { counter-increment: s; display: flex; gap: 14px; margin: 14px 0; align-items: flex-start }
.passo-lista li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--gold2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none }
.url-box { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap }
code { background: var(--surface2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; overflow-wrap: anywhere }

/* ── Modal e aviso ─────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(10,15,30,.5); display: grid; place-items: center; z-index: 80; padding: 20px; animation: surge .15s }
.modal .card { max-width: 440px; width: 100%; padding: 26px }
.modal h3 { margin: 0 0 6px; font-size: 18px }
@keyframes surge { from { opacity: 0 } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 10px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 11px; font-size: 13.5px; opacity: 0; transition: .25s; z-index: 90; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.25) }
.toast.on { opacity: 1; transform: translate(-50%, 0) }
.carregando { color: var(--muted); padding: 30px; text-align: center }

/* ── Celular ───────────────────────────────────────── */
@media (max-width: 960px) {
  .login-wrap { grid-template-columns: 1fr }
  .login-arte { padding: 36px 24px 30px }
  .login-arte h1 { font-size: 28px }
  .login-arte ul, .login-arte p { display: none }
  .cofre { width: 64px; height: 64px; margin-bottom: 16px }
  .login-card h2 { margin-top: 26px }
  .app { grid-template-columns: 1fr }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 70; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow) }
  .app.menu .side { transform: none }
  .app.menu::after { content: ""; position: fixed; inset: 0; background: rgba(10,15,30,.4); z-index: 60 }
  .topo { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50 }
  .topo .brand { font-size: 15px } .topo .mark { width: 32px; height: 32px } .topo .brand small { display: none }
  .topo button { border: 0; background: none; padding: 6px; cursor: pointer; color: var(--ink) } .topo svg { width: 24px; height: 24px }
  .main { padding: 20px 16px 70px }
  .grid { grid-template-columns: 1fr }
  .filtros { position: static } .filtros-btn { display: inline-flex } .filtros.fechado { display: none }
  .kv { grid-template-columns: 1fr 1fr }
  .ficha { padding: 20px 18px } .verb { padding: 16px 16px; font-size: 16.5px }
  .form { padding: 20px 18px } .form .duas, .form .tres { grid-template-columns: 1fr }
}
@media (max-width: 520px) { .kv { grid-template-columns: 1fr } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }
