/* Portal do Cliente MLopes: claro e limpo (Attio), pensado primeiro para o celular. */
:root {
  --bg: #f6f6f7; --surface: #ffffff; --ink: #1d1d1f; --ink-2: #3a3a3c; --ink-3: #6e6e73;
  --sep: rgba(60, 60, 67, .12); --sep-strong: rgba(60, 60, 67, .22); --fill: rgba(118, 118, 128, .12); --fill-2: rgba(118, 118, 128, .07);
  --accent: #1a6b46; --accent-ink: #fff; --accent-soft: rgba(26, 107, 70, .1); --accent-text: #145c3b;
  --red: #c4000f; --red-bg: rgba(255, 59, 48, .1); --orange: #a34a00; --orange-bg: rgba(255, 149, 0, .14);
  --blue: #0066cc; --blue-bg: rgba(0, 113, 227, .09); --green: #1e7a36; --green-bg: rgba(52, 199, 89, .14);
  --yellow-bg: #fff6d6; --yellow-ink: #6b5200;
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  --mola: cubic-bezier(.34, 1.45, .64, 1); --suave: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c; --surface: #1c1c1e; --ink: #f5f5f7; --ink-2: #d1d1d6; --ink-3: #98989f;
    --sep: rgba(84, 84, 88, .55); --sep-strong: rgba(120, 120, 128, .6); --fill: rgba(118, 118, 128, .3); --fill-2: rgba(118, 118, 128, .18);
    --accent: #30d158; --accent-ink: #002810; --accent-soft: rgba(48, 209, 88, .16); --accent-text: #5ee08a;
    --red: #ff6961; --red-bg: rgba(255, 69, 58, .2); --orange: #ffb340; --orange-bg: rgba(255, 159, 10, .2);
    --blue: #409cff; --blue-bg: rgba(10, 132, 255, .18); --green: #4fd97a; --green-bg: rgba(48, 209, 88, .18);
    --yellow-bg: #3a3214; --yellow-ink: #ffd95c; --shadow-pop: 0 24px 60px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -0.011em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 17px; height: 17px; }
.mut { color: var(--ink-3); }
.pequeno { font-size: 13.5px; }

/* ---------- entrar ---------- */
.entrar { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.entrar .caixa { width: min(400px, 100%); display: grid; gap: 14px; animation: entra .5s var(--mola) both; }
.marca { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(150deg, #2e8b5f, #145236); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.marca b { display: block; font-size: 16px; } .marca small { color: var(--ink-3); font-size: 13px; }
.entrar h1 { margin: 18px 0 0; font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; }
.entrar p { margin: 0; color: var(--ink-2); }
.campo { width: 100%; height: 50px; border-radius: 13px; border: 1px solid var(--sep-strong); background: var(--surface); padding: 0 14px; outline: none; font-size: 17px; transition: border-color .2s, box-shadow .2s; }
.campo:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.campo { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; font-size: 16px; }
select.campo { appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; font-size: 16px; }
.codigo { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
label.f { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.f .dica { font-weight: 400; color: var(--ink-3); }
.btn { height: 50px; border-radius: 13px; border: 0; background: var(--fill); color: var(--ink); font-weight: 600; font-size: 16px; padding: 0 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .18s var(--mola), box-shadow .2s, filter .2s; -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.pri { background: var(--accent); color: var(--accent-ink); }
.btn.pri:hover:not(:disabled) { box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.mini { height: 36px; border-radius: 10px; font-size: 14px; padding: 0 14px; }
.btn.link { background: none; color: var(--blue); height: auto; padding: 4px 0; }
.btn:disabled { opacity: .5; cursor: default; }
.erro-msg { color: var(--red); font-size: 14px; min-height: 20px; }
.demo { background: var(--yellow-bg); color: var(--yellow-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.rodape-l { color: var(--ink-3); font-size: 13px; }

/* ---------- casca ---------- */
.casca { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.lado { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--sep); background: var(--surface); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.lado .marca { padding: 0 8px 16px; }
.nav { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-size: 15px; transition: background-color .2s, transform .2s var(--mola); }
.nav:hover { background: var(--fill-2); }
.nav.on { background: var(--fill); color: var(--ink); font-weight: 600; }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; background: var(--red); color: #fff; }
.lado .eu { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--sep); cursor: pointer; border-radius: 10px; }
.lado .eu:hover { background: var(--fill-2); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.topo { display: none; }
.conteudo { min-width: 0; padding: 32px 36px 56px; max-width: 980px; width: 100%; }
.emp-sel { display: inline-flex; }
.emp-sel select { height: 36px; border-radius: 10px; border: 1px solid var(--sep); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; padding: 0 30px 0 12px; font-weight: 600; font-size: 14px; max-width: 100%; }

/* ---------- páginas ---------- */
.pag { animation: pagina .4s var(--suave) both; display: grid; gap: 22px; }
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cab h1 { margin: 0; font-size: 30px; letter-spacing: -0.032em; line-height: 1.15; }
.cab p { margin: 4px 0 0; color: var(--ink-3); font-size: 15px; }
.ola { font-size: 34px; }
.secao { display: grid; gap: 10px; }
.secao-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.secao-cab h2 { margin: 0; font-size: 18px; letter-spacing: -0.015em; }
.cartao { background: var(--surface); border: 1px solid var(--sep); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--sep); color: var(--ink); min-width: 0; }
.item:first-child { border-top: 0; }
a.item, button.item { cursor: pointer; transition: background-color .15s; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; }
a.item:hover, button.item:hover { background: var(--fill-2); }
a.item:active, button.item:active { background: var(--fill); }
.item .meio { flex: 1; min-width: 0; }
.item .meio b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meio small { display: block; color: var(--ink-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-doc { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--fill-2); color: var(--ink-2); }
.ic-doc.sai { background: var(--blue-bg); color: var(--blue); }
.ic-doc.ent { background: var(--accent-soft); color: var(--accent-text); }
.ic-doc.alerta { background: var(--red-bg); color: var(--red); }
.selo { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--fill-2); color: var(--ink-2); }
.selo.ok { background: var(--green-bg); color: var(--green); }
.selo.aviso { background: var(--orange-bg); color: var(--orange); }
.selo.erro { background: var(--red-bg); color: var(--red); }
.selo.azul { background: var(--blue-bg); color: var(--blue); }
.vazio { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 15px; }
.destaque { background: var(--surface); border: 1px solid var(--sep); border-radius: 18px; padding: 18px; display: grid; gap: 4px; }
.grade2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.seg { display: inline-flex; background: var(--fill); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; cursor: pointer; transition: transform .2s var(--mola); }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.seg button:active { transform: scale(.95); }
.noticia { padding: 16px; border-top: 1px solid var(--sep); display: grid; gap: 4px; }
.noticia:first-child { border-top: 0; }
.noticia b { font-size: 16px; }
.noticia p { margin: 0; color: var(--ink-2); white-space: pre-wrap; }
.tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tipo { text-align: left; border: 1px solid var(--sep); background: var(--surface); border-radius: 16px; padding: 16px; cursor: pointer; display: grid; gap: 4px; transition: transform .2s var(--mola), box-shadow .2s, border-color .2s; }
.tipo:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .07); border-color: var(--sep-strong); }
.tipo:active { transform: scale(.98); }
.tipo b { font-size: 16px; } .tipo small { color: var(--ink-3); }
.form { display: grid; gap: 16px; max-width: 560px; }
.ok-grande { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 30px 10px; animation: entra .5s var(--mola) both; }
.ok-grande .circ { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; }
.ok-grande .circ .i { width: 32px; height: 32px; stroke-width: 2.4; }
.ok-grande h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -0.02em; }
.ok-grande .prot { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--fill-2); padding: 8px 16px; border-radius: 12px; }

/* folha (janela de baixo para cima no celular) */
.veu { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.folha { background: var(--surface); border-radius: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow-pop); animation: janela .38s var(--mola); }
.folha h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.folha .acoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.arquivo { border: 1.5px dashed var(--sep-strong); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-3); cursor: pointer; transition: border-color .2s, background-color .2s; }
.arquivo:hover, .arquivo.sobre { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.arquivo b { color: var(--ink); display: block; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(24px) scale(.94); background: color-mix(in srgb, var(--ink) 94%, transparent); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 500; opacity: 0; transition: opacity .25s, transform .45s var(--mola); pointer-events: none; z-index: 60; max-width: 90vw; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
@keyframes fade { from { opacity: 0; } }
@keyframes janela { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes entra { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pagina { from { transform: translateY(6px); } }
.esq { height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--fill-2), var(--fill), var(--fill-2)); background-size: 200% 100%; animation: brilho 1.2s infinite; }
@keyframes brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- celular ---------- */
.baixo { display: none; }
@media (max-width: 820px) {
  .casca { display: block; }
  .lado { display: none; }
  .topo { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--sep); }
  .topo .logo { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
  .topo .emp-sel { flex: 1; min-width: 0; } .topo .emp-sel select { width: 100%; }
  .conteudo { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .baixo { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--sep); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .baixo a { display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--ink-3); padding: 6px 0; border-radius: 10px; position: relative; transition: transform .2s var(--mola); }
  .baixo a:active { transform: scale(.92); }
  .baixo a.on { color: var(--accent-text); font-weight: 600; }
  .baixo .n { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
  .cab h1 { font-size: 26px; } .ola { font-size: 28px; }
  .grade2 { grid-template-columns: 1fr; }
  .item .meio b, .item .meio small { white-space: normal; }
  .veu { place-items: end center; padding: 0; }
  .folha { border-radius: 22px 22px 0 0; width: 100%; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: sobe-baixo .42s var(--mola); }
  @keyframes sobe-baixo { from { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.cal-dia { width: 44px; height: 46px; border-radius: 11px; background: var(--orange-bg); color: var(--orange); display: grid; place-items: center; align-content: center; gap: 0; flex: none; line-height: 1.1; }
.cal-dia b { font-size: 17px; } .cal-dia small { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.cal-dia.venceu { background: var(--red-bg); color: var(--red); }
