/* GMIX — identidade: verde #4EB852, grafite #363435 (fatura GMIX, D-026). Sem dependências externas. */
:root {
  --bg: #f3f5f4; --card: #ffffff; --ink: #2b2a2b; --muted: #6b6f6d; --line: #e2e6e4; --soft: #f7f9f8;
  --brand: #4eb852; --brand-strong: #3a9a3f; --brand-ink: #ffffff; --brand-soft: #e9f6ea; --graphite: #363435;
  --warn: #8a5300; --warn-bg: #fff3dc; --err: #b3261e; --err-bg: #fdecea; --ok: #1f6f2a; --ok-bg: #e7f5e8; --info-bg: #eef3fb; --info: #2a4f8a;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .05); --radius: 12px; --side: 248px;
}
:root:not([data-theme="light"]) { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141716; --card: #1c201e; --ink: #e8ebea; --muted: #a0a7a3; --line: #2c322f; --soft: #202523;
    --brand: #5cc561; --brand-strong: #74d278; --brand-ink: #0d1a0e; --brand-soft: #1d3320; --graphite: #e8ebea;
    --warn: #f0b45a; --warn-bg: #33270f; --err: #ff8a80; --err-bg: #3a1714; --ok: #8ad690; --ok-bg: #15301a; --info-bg: #172338; --info: #9dbcf0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] { --bg: #141716; --card: #1c201e; --ink: #e8ebea; --muted: #a0a7a3; --line: #2c322f; --soft: #202523; --brand: #5cc561; --brand-ink: #0d1a0e; --brand-soft: #1d3320; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }

/* ---------- casca: menu lateral + conteúdo ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); z-index: 20; }
.side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.side-brand img { display: block; width: 132px; height: auto; background: #fff; border-radius: 8px; }
.side-brand span { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding-left: 4px; }
.side-foot { margin-top: auto; padding: 12px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
nav#nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
nav#nav .group { margin: 2px 0; }
nav#nav button { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
nav#nav button:hover { background: var(--soft); }
nav#nav button svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
nav#nav button .lbl { flex: 1; }
nav#nav button .chev { width: 14px; height: 14px; opacity: .5; transition: transform .15s; }
nav#nav .group.open > button .chev { transform: rotate(90deg); }
nav#nav button.mod[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
nav#nav .subs { display: none; margin: 2px 0 6px 20px; padding-left: 10px; border-left: 2px solid var(--line); }
nav#nav .group.open .subs { display: block; }
nav#nav button.sub { padding: 6px 10px; font-size: 13.5px; font-weight: 400; color: var(--muted); }
nav#nav button.sub[aria-current="page"] { color: var(--brand-strong); font-weight: 600; background: transparent; box-shadow: inset 2px 0 0 var(--brand); border-radius: 0 8px 8px 0; margin-left: -12px; padding-left: 20px; }
nav#nav .soon { font-size: 10.5px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; font-weight: 500; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); min-height: 58px; }
.crumb { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; }
.session { display: flex; gap: 10px; align-items: center; }
.session select { width: auto; max-width: 260px; padding: 6px 10px; }
.user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; text-decoration: none; border-radius: 999px; padding: 2px 8px 2px 2px; min-height: 36px; } a.user:hover, a.user:focus-visible { background: var(--brand-soft); color: var(--brand-strong); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-strong); color: #fff; font-weight: 700; font-size: 12px; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(20, 25, 22, .45); z-index: 19; }
.icon-btn { display: none; background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 6px 10px; }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; }
body.signed-out .sidebar, body.signed-out .top { display: none; }
body.signed-out main { max-width: none; min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), var(--bg) 60%); }
body.signed-out form.card button[type=submit] { width: 100%; }
.login-brand { display: flex; justify-content: center; margin-bottom: 8px; } .login-brand img { width: 150px; height: auto; background: #fff; border-radius: 10px; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; }
  .icon-btn { display: inline-block; }
  .top { padding: 10px 16px; } main { padding: 16px; }
  .session .user span#who { display: none; }
  .session { min-width: 0; flex: 0 1 auto; gap: 6px; } .session select { min-width: 0; max-width: 42vw; }
  .crumb { flex: 1 1 0; }
}

/* ---------- cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; } .page-head p { margin: 2px 0 0; color: var(--muted); }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.01em; } h2 { font-size: 17px; margin: 0 0 6px; } h3 { font-size: 15px; margin: 0 0 8px; }

/* ---------- cartões e indicadores ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 18px; }
.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi .ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 8px; }
.kpi .ico svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi.alert .ico { background: var(--warn-bg); color: var(--warn); } .kpi.bad .ico { background: var(--err-bg); color: var(--err); }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi button { align-self: flex-start; margin-top: 10px; padding: 4px 10px; font-size: 12.5px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1.4fr 1fr; } @media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); } .attn li:first-child { border-top: 0; }
.attn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); flex: none; } .attn .dot.bad { background: var(--err); } .attn .dot.ok { background: var(--brand); }
.attn .txt { flex: 1; } .attn .txt b { font-weight: 600; } .attn .txt small { display: block; color: var(--muted); }
.shortcuts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.shortcuts button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; text-align: left; }
.shortcuts button:hover { border-color: var(--brand); background: var(--brand-soft); }
.shortcuts svg { width: 18px; height: 18px; stroke: var(--brand-strong); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tabelas, formulários, botões ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; } th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: var(--soft); }
tbody tr:hover td { background: var(--soft); }
.scroll { overflow-x: auto; }
.narrow { width: 100%; max-width: 420px; margin: 0 auto; }
.muted { color: var(--muted); } .small { font-size: 13px; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
button { padding: 9px 15px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s; }
button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
button.ghost { background: transparent; color: var(--brand-strong); border-color: var(--line); } button.ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
button:disabled { opacity: .55; cursor: wait; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; font-weight: 500; }
.tabs button:hover { color: var(--ink); background: transparent; }
.tabs button[aria-selected="true"] { color: var(--brand-strong); border-bottom-color: var(--brand); font-weight: 600; }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px; border-radius: 11px; background: var(--warn-bg); color: var(--warn); font-size: 12px; text-align: center; }
.item { border-top: 1px solid var(--line); padding: 12px 0; } .item:first-of-type { border-top: 0; }
.item header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.note { background: var(--warn-bg); color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 6px; }
.wip { border-style: dashed; } .wip ul { margin: 6px 0 0; padding-left: 18px; }
#toast { position: sticky; top: 58px; z-index: 15; }
#toast div { max-width: 980px; margin: 10px auto; padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow); }
#toast .err { background: var(--err-bg); color: var(--err); } #toast .ok { background: var(--ok-bg); color: var(--ok); }
.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; columns: 2; padding-left: 18px; }
.qr { display: block; margin: 10px auto; width: 220px; height: 220px; background: #fff; padding: 6px; border-radius: 8px; }
.secret { font-family: ui-monospace, monospace; word-break: break-all; font-size: 13px; }
details summary { cursor: pointer; color: var(--brand-strong); margin-top: 8px; font-weight: 500; }
.thumb { display: block; max-width: 100%; max-height: 260px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
ol.history { padding-left: 1.2rem; } ol.history li { margin-bottom: .6rem; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; } .funnel ul { padding-left: 1rem; }
.bar { background: var(--line); height: 8px; border-radius: 4px; min-width: 80px; } .bar span { display: block; height: 8px; border-radius: 4px; background: var(--brand); }

/* cabeçalho de página: seção ativa do submenu */
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); margin-bottom: 2px; }
.card.filter { padding: 12px 18px; max-width: 420px; }
.card.filter label { margin-top: 0; }
/* Minha conta (D-047) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
