/* Ecossistema — identidade própria: papel quente, índigo, coral e verde-azulado. */
:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-2: #ebe6da;
  --surface: #ffffff;
  --ink: #1c2233;
  --muted: #5b6478;
  --line: #ddd7ca;
  --field: #faf8f3;
  --primary: #3b3f9e;
  --primary-2: #2c3080;
  --on-primary: #ffffff;
  --accent: #c8502a;
  --c1: #3b3f9e;
  --c2: #e4673f;
  --c3: #1f9d8b;
  --danger: #b3261e;
  --ok: #17794a;
  --warn: #8a5a00;
  --wa: #1fa855;
  --shadow: 0 18px 40px -24px rgba(28, 34, 51, .45);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* O claro é sempre o primeiro; o escuro só entra quando o cliente escolhe (data-theme="dark"). */
:root[data-theme="dark"] {
  --bg: #12141f; --bg-2: #181b2b; --surface: #1b1f30; --ink: #eceef6; --muted: #a0a8bf;
  --line: #2c3250; --field: #151827; --primary: #9ea2ff; --primary-2: #b9bcff; --on-primary: #10122a;
  --accent: #ff9a78; --c1: #8f94ff; --c2: #ff8f6b; --c3: #46c9b5;
  --danger: #ff8a80; --ok: #6fdba3; --warn: #f2c15c; --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  padding: max(16px, env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--c3); outline-offset: 2px; }
.noscript { text-align: center; padding: 24px; }

/* estrutura */
.shell { max-width: 1040px; margin-inline: auto; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (max-width: 899px) {
  .header { order: -2; }
  .col.side { order: -1; }
}
@media (min-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: start; }
  .col.side { position: sticky; top: 20px; }
}

/* cabeçalho */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand svg { width: 44px; height: 44px; }
.brand .l1 { fill: var(--c1); } .brand .l2 { fill: var(--c2); } .brand .l3 { fill: var(--c3); }
.brand svg circle { fill-opacity: .92; }
.brand b { font: 700 1.55rem/1 var(--serif); letter-spacing: .01em; }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.langs { display: inline-flex; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.langs button { border: 0; background: transparent; padding: 7px 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.flag { display: block; width: 26px; height: 17px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .28); opacity: .6; transition: opacity .15s; }
.langs button:hover .flag, .langs button:focus-visible .flag { opacity: 1; }
.langs button[aria-pressed="true"] { background: var(--primary); }
.langs button[aria-pressed="true"] .flag { opacity: 1; box-shadow: 0 0 0 1.5px var(--on-primary); }
.themebtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 500; font-size: .9rem; }
.themebtn svg { width: 18px; height: 18px; }

/* herói */
.hero { background: var(--surface); border: 1.5px solid var(--line); border-radius: 28px; padding: 34px 26px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--c3), transparent 70%); opacity: .22; pointer-events: none; }
.eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 0; font: 700 clamp(1.9rem, 6.2vw, 2.7rem)/1.12 var(--serif); text-wrap: balance; }
.hero p.lead { margin: 14px 0 0; color: var(--muted); font-size: 1.08rem; max-width: 46ch; text-wrap: pretty; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--on-primary); background: var(--primary); }
.steps li:nth-child(2) .num { background: var(--c2); color: #fff; }
.steps li:nth-child(3) .num { background: var(--c3); color: #fff; }
.steps button.stepbtn { border: 0; background: none; padding: 0; text-align: left; font-weight: 500; display: flex; align-items: center; gap: 14px; }

/* cartões */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; padding: 24px 22px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 4px; font: 700 1.3rem/1.2 var(--serif); }
.card .sub { margin: 0 0 18px; color: var(--muted); font-size: .96rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--field); border: 1.5px solid var(--line); margin-bottom: 16px; }
.seg button { border: 0; background: transparent; padding: 10px 8px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.inwrap { position: relative; display: flex; }
input { width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); font-size: 1.08rem; }
input.has-btn { padding-right: 92px; }
input[aria-invalid="true"] { border-color: var(--danger); }
.peek { position: absolute; right: 6px; top: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--primary); font-weight: 600; font-size: .88rem; }
.err { margin: 0; min-height: 1.2em; color: var(--danger); font-size: .9rem; }
.btn { height: 54px; border: 0; border-radius: 999px; font-weight: 700; font-size: 1.04rem; color: var(--on-primary); background: var(--primary); }
.btn:hover:not(:disabled) { background: var(--primary-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { height: 42px; padding: 0 20px; background: transparent; color: var(--primary); border: 1.5px solid var(--line); font-weight: 600; }

/* conta */
.me { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c3)); }
.who { flex: 1; min-width: 0; }
.who strong { display: block; font-size: 1.15rem; overflow-wrap: anywhere; }
.who span { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sechead h3 { margin: 0; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1.5px solid currentColor; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 4px; }
.meter i { height: 6px; border-radius: 3px; background: var(--line); }
.meter[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-s="3"] i:nth-child(-n+3), .meter[data-s="4"] i:nth-child(-n+4) { background: var(--ok); }
.hint { margin: 0; font-size: .84rem; color: var(--muted); }

/* benefícios */
.sechd { display: flex; align-items: center; gap: 14px; margin: 4px 2px 0; }
.sechd h2 { margin: 0; font: 700 .85rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--primary); }
.sechd::after { content: ""; flex: 1; height: 1.5px; background: linear-gradient(90deg, var(--line), transparent); }
.benefit { display: flex; flex-direction: column; gap: 16px; }
.benefit .row { display: flex; gap: 18px; align-items: center; }
.ico { width: 72px; height: 72px; flex: none; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--c3) 16%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--c3) 40%, var(--line)); }
.ico svg { width: 42px; height: 42px; color: var(--c3); }
.benefit h3 { margin: 0; font: 600 1.2rem/1.3 var(--sans); text-wrap: balance; }
.benefit .acts { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link { border: 0; background: transparent; padding: 6px 0; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 5px; display: inline-flex; align-items: center; gap: 8px; }
.link.go { color: var(--accent); }
.desc { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--field); color: var(--muted); font-size: .96rem; }

/* WhatsApp e aviso */
.wa { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 24px -8px rgba(20, 120, 60, .7); }
.wa svg { width: 34px; height: 34px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); background: var(--primary); color: var(--on-primary); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: up .25s ease-out; }
  @keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
}
/* ---------- App 11 ---------- */
.envbadge { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--warn); color: var(--warn); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card .h2 { margin: 0 0 4px; font: 700 1.3rem/1.2 var(--serif); }
.card .h3 { margin: 0 0 12px; font: 700 1.1rem/1.2 var(--serif); }
.col.one { grid-column: 1 / -1; width: 100%; max-width: 560px; margin-inline: auto; }
.card.center { text-align: center; }
.header .btn.ghost { height: 42px; }
.logo { display: grid; place-items: center; margin-bottom: 18px; }
.logo img { width: auto; max-width: 70%; height: 96px; object-fit: contain; }
.brandlogo { display: block; height: 44px; width: auto; }
.texto { white-space: pre-line; overflow-wrap: anywhere; text-align: center; line-height: 1.6; margin: 0 0 22px; }
.texto:empty { display: none; }
.actions { display: flex; flex-direction: column; gap: 12px; }
.actions .btn, .stack .btn { height: auto; min-height: 54px; padding: 12px 20px; line-height: 1.25; }
.btn.alt { background: var(--c3); color: #fff; }
.btn.alt:hover:not(:disabled) { background: var(--c3); filter: brightness(.92); }
.folders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.folder { width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); font-weight: 600; overflow-wrap: anywhere; }
.folder:hover { border-color: var(--primary); }
select { width: 100%; height: 52px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); font-size: 1.04rem; }
select[aria-invalid="true"] { border-color: var(--danger); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
legend { padding: 0; margin: 10px 0 4px; font: 700 1.15rem/1.2 var(--serif); color: var(--ink); }
.datepick { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.peek.cal { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
.peek.cal svg { width: 22px; height: 22px; }
.backbtn { align-self: flex-start; margin: 4px 0 14px; }
.mtitle.left, .mbody.left { text-align: left; }
.summary { margin: 0 0 18px; padding: 0; display: grid; gap: 1px; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); }
.srow { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 12px; padding: 10px 14px; background: var(--field); }
.srow dt { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.srow dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .srow { grid-template-columns: 1fr; gap: 2px; } }
.opt { font-weight: 400; color: var(--muted); }

/* janelas */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(14, 16, 28, .55); overflow-y: auto; }
.modal { width: 100%; max-width: 420px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 24px; padding: 28px 24px; box-shadow: var(--shadow); text-align: center; }
.modal form { text-align: left; }
.mtitle { margin: 0 0 12px; font: 700 1.35rem/1.2 var(--serif); }
.mbody { margin: 0 0 20px; overflow-wrap: anywhere; }
.stack { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair .btn { height: 50px; padding: 0 12px; }
.center-link { display: flex; margin: 16px auto 0; }
.busy { margin: 18px 0 0; font-weight: 600; }
.spin { width: 54px; height: 54px; margin: 6px auto 0; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--primary); }
@media (prefers-reduced-motion: no-preference) {
  .spin { animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
.printframe { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

@media (max-width: 420px) {
  .modal { padding: 24px 18px; }
}

/* ---------- dashboard de manutenção ---------- */
.col.one.wide { max-width: 1040px; }
.adm-title { margin: 0 0 14px; text-align: center; font: 700 1.2rem/1.25 var(--serif); letter-spacing: .02em; text-wrap: balance; }
.adm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 16px; }
.adm-actions .btn { height: 48px; padding: 0 28px; min-width: 150px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(.92); background: var(--danger); }
.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.flash.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); border: 1.5px solid var(--ok); }
.flash.bad { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border: 1.5px solid var(--danger); }
.tablewrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .95rem; }
.adm-table th, .adm-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table thead th { background: var(--field); font-weight: 700; padding: 0; white-space: nowrap; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.adm-table td.adm-num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.adm-table td.file { overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88rem; }
.adm-table .mcell { width: 1%; text-align: center; }
.adm-info { text-align: center; color: var(--muted); padding: 22px 12px !important; }
.sortbtn { width: 100%; padding: 12px; border: 0; background: transparent; text-align: left; font-weight: 700; font-size: .85rem; letter-spacing: .03em; color: var(--ink); white-space: nowrap; }
.sortbtn:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--primary); }
.iconbtn:hover { border-color: var(--primary); }
.iconbtn svg { width: 20px; height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modal.formmodal { max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; }
.filein { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.filein:focus-visible + .filebtn { outline: 3px solid var(--c3); outline-offset: 2px; }
.filerow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filebtn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 16px; cursor: pointer; font-size: .9rem; }
.fname { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: .9rem; }
.hint { margin: 2px 0 0; }
.relrow { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 8px; margin: 2px 0; }
.relrow label { font-weight: 600; color: var(--muted); }
.relrow input { width: 5.2rem; min-width: 0; height: 46px; padding: 0 8px; text-align: center; }
.relrow .btn { height: 46px; padding: 0 18px; min-height: 0; flex: none; }
.relrow label { white-space: nowrap; }
.relrow { flex-wrap: wrap; }
@media (max-width: 340px) { .relrow { flex-wrap: wrap; } }
/* Janela lateral à direita ("Listar Combos"): fica sobre a camada escura, ao lado da janela de manutenção */
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(340px, 92vw); padding: 24px 18px; overflow-y: auto; text-align: left;
  background: var(--surface); color: var(--ink); border-left: 1.5px solid var(--line); box-shadow: var(--shadow); }
.side-title { margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; }
.combo-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.combo-table th { font-weight: 700; text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--line); }
.combo-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.combo-table .adm-num { width: 3.2rem; text-align: left; }
.hint.note { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1.5px solid var(--warn); color: var(--ink); text-align: left; }
input[type="number"] { -moz-appearance: textfield; }
