@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400..800&display=swap');

:root {
  --bg: #f4f6f8; --card: #ffffff; --border: #e7e9ee; --border-strong: #d6dae1;
  --text: #111827; --text-2: #374151; --muted: #6b7482; --faint: #9aa3af;
  --primary: #128c4b; --primary-ink: #ffffff; --primary-tint: #e8f5ee; --primary-dark: #0d6e3a;
  --ok: #1f9d55; --ok-bg: #e9f7ef; --ok-ink: #146c3a;
  --info: #2f7bd8; --info-bg: #ebf3fd; --info-ink: #1d5aa6;
  --warn: #d98a04; --warn-bg: #fdf5e6; --warn-ink: #8a5600;
  --bad: #d64545; --bad-bg: #fdeeee; --bad-ink: #a12c2c;
  --off: #8a97a3; --off-bg: #f0f2f4; --off-ink: #4b5563;
  --evo: #6c5ce7; --wuz: #0e8fd6; --bai: #e07a1f;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --sheet-shadow: 0 20px 50px rgba(16, 24, 40, .18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.sidebar { background: #fcfcfd; border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav-title { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; min-height: 40px; }
.nav a:hover { background: #f1f3f6; color: var(--text); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(18, 140, 75, .25); font-weight: 500; }
.nav a .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #7b8794) 13%, #fff); color: var(--c, #7b8794); }
.nav a.active .ic { background: rgba(255, 255, 255, .18); color: #fff; }
.nav a .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-tint); color: var(--primary-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(244, 246, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.content { padding: 20px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
.demo-flag { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #f3dcae; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.tabbar { display: none; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-b { padding: 16px; }
.icon-box { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--c, var(--primary)); color: #fff; flex: none; }
.icon-box svg.i { width: 16px; height: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.section-gap { margin-top: 16px; }

/* Stat tiles */
.tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .15s; text-align: left; }
.tile:hover { border-color: var(--border-strong); }
.tile .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tile .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.tile .foot { font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pill svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.t-ok { background: var(--ok-bg); color: var(--ok-ink); }
.t-info { background: var(--info-bg); color: var(--info-ink); }
.t-warn { background: var(--warn-bg); color: var(--warn-ink); }
.t-bad { background: var(--bad-bg); color: var(--bad-ink); }
.t-off { background: var(--off-bg); color: var(--off-ink); }
.t-muted { background: #f3f4f6; color: var(--muted); }
.prov { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 6px; border: 1px solid var(--border); background: #fff; white-space: nowrap; }
.prov::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--pc, var(--off)); }
.prov.evolution { --pc: var(--evo); } .prov.wuzapi { --pc: var(--wuz); } .prov.baileys { --pc: var(--bai); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #f6f7f9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #b83636; }
.btn.danger-ghost { color: var(--bad-ink); border-color: #f1c6c6; }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef0f3; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
.btn.lg { min-height: 46px; padding: 10px 18px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; outline: none; }
textarea.input { min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18, 140, 75, .15); }
.search { position: relative; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 36px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-strong); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--text-2); }
.chip .n { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.chip.on .n { color: #cbd2d9; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--text-2); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary-tint); color: var(--primary-dark); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left: 4px solid var(--c); background: #fff; }
.alert.erro { --c: var(--bad); background: #fffafa; }
.alert.alerta { --c: var(--warn); background: #fffdf8; }
.alert.info { --c: var(--info); background: #fbfdff; }
.alert .a-ic { color: var(--c); margin-top: 1px; }
.alert > div > b { display: block; font-size: 13.5px; }
.alert p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.alert .btn { margin-left: auto; flex: none; }

/* ---------- Instance list ---------- */
.list { display: flex; flex-direction: column; }
.inst { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) 112px minmax(0, 1.6fr) 96px 20px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; color: inherit; }
.inst:last-child { border-bottom: 0; }
.inst:hover { background: #fafbfc; }
.inst .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst .who span { font-size: 12px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.inst .what { font-size: 13px; color: var(--text-2); min-width: 0; }
.inst .what .ellipsis { display: block; }
.inst .when { font-size: 12px; color: var(--muted); text-align: right; }
.inst .lvl-erro { color: var(--bad-ink); font-weight: 600; }
.inst .lvl-alerta { color: var(--warn-ink); font-weight: 600; }
.list-head { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) 112px minmax(0, 1.6fr) 96px 20px; gap: 14px; padding: 9px 16px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); border-bottom: 1px solid var(--border); background: #fbfbfc; border-radius: var(--radius) var(--radius) 0 0; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; color: var(--faint); margin-bottom: 6px; }

/* ---------- Instance detail ---------- */
.hero { padding: 18px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.hero h2 { font-size: 20px; font-weight: 800; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 5px; }
.big-status { margin-left: auto; text-align: right; }
.big-status .pill { font-size: 14px; padding: 6px 14px; }
.headline { margin-top: 6px; font-size: 13px; color: var(--text-2); max-width: 340px; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px; border-top: 1px solid var(--border); }
.act { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; min-height: 86px; transition: border-color .15s, background .15s; }
.act:hover { border-color: var(--border-strong); background: #fafbfc; }
.act b { font-size: 13.5px; }
.act span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.act .icon-box { width: 28px; height: 28px; color: #fff; }
.act.danger b { color: var(--bad-ink); }
.act:disabled { opacity: .5; cursor: not-allowed; }
.problem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.problem:last-child { border-bottom: 0; padding-bottom: 0; }
.problem:first-child { padding-top: 0; }
.problem .p-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.problem .p-ic.erro { background: var(--bad-bg); color: var(--bad); }
.problem .p-ic.alerta { background: var(--warn-bg); color: var(--warn); }
.problem .p-ic.info { background: var(--info-bg); color: var(--info); }
.problem b { font-size: 13.5px; display: block; }
.problem p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.techs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tech { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tech.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tech .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12.5px; }
.tech .kv dt { color: var(--muted); }
.tech .kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 112px 24px 1fr; gap: 10px; padding: 9px 0; font-size: 13px; }
.tl .t { color: var(--muted); font-size: 12px; text-align: right; padding-top: 2px; }
.tl .b { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--off)); margin: 5px auto 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--off)) 18%, transparent); }
.tl .src { font-size: 11px; color: var(--faint); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; margin-left: 6px; }
pre.json { background: #0f172a; color: #dbe4f0; border-radius: 10px; padding: 14px; overflow: auto; font-size: 12px; max-height: 520px; margin: 0; }

/* ---------- Logs ---------- */
.logbox { background: #0f172a; color: #cbd5e1; font-family: var(--mono); font-size: 12px; border-radius: 0 0 var(--radius) var(--radius); max-height: 64vh; overflow: auto; padding: 8px 0; }
.logline { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 2px 14px; white-space: pre-wrap; word-break: break-word; }
.logline:hover { background: rgba(255, 255, 255, .04); }
.logline .ts { color: #64748b; }
.logline.erro .tx { color: #fca5a5; }
.logline.alerta .tx { color: #fcd34d; }
.logline .srcb { color: #93c5fd; margin-right: 6px; }
mark { background: #fde68a; color: #111; border-radius: 2px; padding: 0 1px; }
.patterns { display: flex; flex-direction: column; gap: 8px; }
.pattern { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pattern .bar { flex: none; width: 120px; height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.pattern .bar i { display: block; height: 100%; border-radius: 4px; background: var(--c); }
.pattern .n { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ---------- Proxies ---------- */
.proxy { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1.3fr) 170px minmax(0, 1.5fr) auto; gap: 16px; align-items: center; }
.proxy:last-child { border-bottom: 0; }
.proxy .addr { font-family: var(--mono); font-weight: 600; font-size: 13.5px; }
.usage { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; display: flex; gap: 2px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--primary)); }
.target { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.target:last-child { border-bottom: 0; }
.ok-ic { color: var(--ok); } .bad-ic { color: var(--bad); } .warn-ic { color: var(--warn); }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding-top: 6px; }
.bars .b { flex: 1; background: var(--warn); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b.zero { background: #eef0f3; }
.bars .b:hover { filter: brightness(.9); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }
.spark { width: 100%; height: 42px; display: block; }
.provider-card .split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: #eef0f3; margin: 10px 0 8px; }
.provider-card .split i { display: block; height: 100%; border-radius: 4px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.tip { position: fixed; z-index: 100; background: #111827; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }

/* ---------- Modal (folha no celular) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: var(--sheet-shadow); overflow: hidden; }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 15.5px; font-weight: 700; }
.modal-b { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--border); background: #f8f9fb; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.opt { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; align-items: flex-start; }
.opt:hover { background: #fafbfc; }
.opt.on { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 1px var(--primary); }
.opt input { margin-top: 3px; accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.opt b { display: block; font-size: 14px; }
.opt span { font-size: 12.5px; color: var(--muted); }
.opt.disabled { opacity: .5; cursor: not-allowed; }
.qr-wrap { display: flex; gap: 20px; align-items: center; }
.qr-box { width: 264px; height: 264px; border: 1px solid var(--border); border-radius: 12px; display: grid; place-items: center; background: #fff; flex: none; position: relative; }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; }
.qr-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.success { text-align: center; padding: 20px 10px; }
.success .big { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 12px; }
.success .big svg.i { width: 32px; height: 32px; stroke-width: 2.5; }
.steps { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.steps div { display: flex; gap: 8px; align-items: flex-start; }
.copybox { display: flex; gap: 8px; }
.copybox .input { font-family: var(--mono); font-size: 12px; }
.secret { font-family: var(--mono); font-size: 18px; font-weight: 700; background: #f6f7f9; border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px; text-align: center; letter-spacing: .05em; user-select: all; }
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); display: flex; gap: 10px; align-items: center; max-width: 380px; animation: fade .2s; }
.toast.err { background: #8f2424; }
.toast.ok svg.i { color: #6ee7a0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fbfbfc; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Login / pareamento ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 0%, #e3f3ea 0, transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-card .brand { padding: 0 0 20px; }
.auth-card .brand-logo { width: 44px; height: 44px; border-radius: 12px; }
.form-error { background: var(--bad-bg); color: var(--bad-ink); padding: 10px 12px; border-radius: 8px; font-size: 13px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxy { grid-template-columns: minmax(0, 1fr) 150px; }
  .proxy .p-test { grid-column: 1 / -1; }
  .proxy .p-act { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; min-height: 54px; }
  .topbar h1 { font-size: 16.5px; }
  .content { padding: 14px 16px 96px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 > :first-child { grid-column: 1 / -1; }
  .techs { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .inst { grid-template-columns: 1fr auto; grid-template-areas: "who st" "what what" "meta meta"; gap: 6px 10px; padding: 12px 14px; }
  .inst .st { grid-area: st; justify-self: end; }
  .inst .who { grid-area: who; min-width: 0; }
  .inst .what { grid-area: what; }
  .inst .pv { grid-area: meta; display: flex; gap: 8px; align-items: center; }
  .inst .when, .inst .chev { display: none; }
  .hero { padding: 16px; }
  .big-status { margin-left: 0; text-align: left; width: 100%; }
  .headline { max-width: none; }
  .actions { padding: 12px; gap: 8px; }
  .tl { grid-template-columns: 76px 18px 1fr; }
  .topbar .btn span, .topbar .demo-flag { display: none; }
  .topbar .btn { padding: 8px 10px; }
  .problem { flex-wrap: wrap; }
  .problem > .grow { flex: 1 1 calc(100% - 40px); }
  .problem > .btn { margin-left: 40px; }
  .alert { flex-wrap: wrap; }
  .alert > .grow { flex: 1 1 calc(100% - 40px); }
  .alert > .btn { margin-left: 32px; }
  .logline { grid-template-columns: 1fr; gap: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; position: relative; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a .count { position: absolute; top: 0; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 10px; border-radius: 10px; padding: 0 5px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 100dvh; height: auto; }
  .modal-b { flex: 1; }
  .modal-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
  .input, select.input { min-height: 44px; font-size: 16px; }
  .qr-wrap { flex-direction: column; }
  .qr-box { width: 100%; max-width: 290px; height: auto; aspect-ratio: 1; }
  .qr-box img { width: 90%; height: auto; }
  .toasts { left: 12px; right: 12px; bottom: 84px; }
  .toast { max-width: none; }
  .proxy { grid-template-columns: 1fr; gap: 10px; }
}
