/* Duck AutoMed — Painel do Mediador · v3 (tema preto, cartões #212121/#242429 como as embeds) */
:root {
  --bg: #0e0e0f;
  --side: #141415;
  --card: #1b1b1d;
  --card2: #212121;
  --embed: #242429;
  --line: rgba(255, 255, 255, .06);
  --line2: rgba(255, 255, 255, .11);
  --ink: #ededee;
  --ink2: #b4b4ba;
  --muted: #85858c;
  --blue: #4c8dff;
  --blue-soft: rgba(76, 141, 255, .14);
  --yellow: #f5c518;
  --yellow-soft: rgba(245, 197, 24, .13);
  --green: #3ccf7f;
  --green-soft: rgba(60, 207, 127, .13);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, .13);
  /* métodos (validado p/ superfície #212121: lightness, CVD e contraste) */
  --m1: #4c8dff; --m2: #c76a1e; --m3: #1fa383; --m4: #c955b9; --m5: #6b6b73;
  --r: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.mt14 { margin-top: 14px; }
svg.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── botões / campos ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card2);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: #2a2a2d; border-color: rgba(255, 255, 255, .18); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: #111; border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; margin-top: 12px; }
.btn.ghost { background: transparent; }
.input, .select { width: 100%; background: #121213; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 44px; height: 24px; border-radius: 99px; background: #38383c; position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ── login ─────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(76, 141, 255, .12), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--card2); border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.brand-logo { width: 72px; height: 72px; border-radius: 20px; display: block; margin: 0 auto 16px; box-shadow: 0 0 0 1px var(--line2), 0 10px 30px rgba(76, 141, 255, .25); }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; }
.login-card p.lead { margin: 4px 0 22px; color: var(--muted); }
.code-input { text-align: center; font: 700 24px/1 var(--mono); letter-spacing: 6px; text-transform: uppercase; padding: 15px 10px; }
.steps { text-align: left; margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; color: var(--ink2); font-size: 13.5px; }
.steps b { color: var(--ink); }
.steps .n { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: #2c2c30; color: var(--ink); }
.form-msg { min-height: 20px; margin-top: 10px; font-size: 13.5px; }
.form-msg.err { color: var(--red); }
.foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ── layout do painel: barra lateral + conteúdo ── */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.side .brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 0 0 1px var(--line2); }
.side .brand b { display: block; font-size: 15px; letter-spacing: -.1px; }
.side .brand small { color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 2px; }
.tab { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; color: var(--ink2); padding: 10px 11px; border-radius: 10px;
  cursor: pointer; font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.tab:hover { background: #1f1f21; color: var(--ink); }
.tab.on { background: var(--card2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.tab.on .ico { color: var(--yellow); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #06170d; font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.me img { width: 34px; height: 34px; border-radius: 50%; background: #2a2a2d; }
.me .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .out { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.me .out:hover { color: var(--ink); background: #2a2a2d; }
main { padding: 28px 30px 60px; min-width: 0; max-width: 1240px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.page-title h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.page-title .sub { color: var(--muted); font-size: 13px; }
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(20, 20, 21, .92); backdrop-filter: blur(10px); flex-wrap: wrap; }
  .side .brand { padding: 0; }
  .side .brand div { display: none; }
  .nav { grid-auto-flow: column; justify-content: start; overflow-x: auto; order: 3; flex: 0 0 100%; min-width: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .side { min-width: 0; }
  .tab { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .side .spacer { display: none; }
  .me { margin-left: auto; padding: 4px 6px; }
  main { padding: 18px 16px 50px; }
}
@media (max-width: 560px) { .me .nm { display: none; } .side .brand div { display: block; } .side .brand small { display: none; } }

/* ── cartões / grade ───────────────────────────── */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-21 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g4, .g3, .g2 { grid-template-columns: 1fr; } }
.card { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card.embed { background: var(--embed); }
.card h3 { margin: 0 0 14px; font-size: 13px; color: var(--ink2); font-weight: 700; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .6px; }
.card h3 .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); }
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink2); font-size: 12.5px; }
.kpi .spark { position: absolute; right: 16px; top: 16px; width: 84px; height: 30px; opacity: .9; }
.kpi .lbl { padding-right: 92px; }
.kpi.hero { background: linear-gradient(145deg, #262629, #1d1d20); border-color: var(--line2); }
.kpi.hero::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--yellow), transparent 70%); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #2c2c30; color: var(--ink2); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--yellow-soft); color: var(--yellow); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.blue { background: var(--blue-soft); color: #8db7ff; }
.stat-list { display: grid; gap: 0; margin: 0; }
.stat-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stat-list > div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--ink2); }
.stat-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── gráficos SVG ──────────────────────────────── */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.chart .area { fill: url(#gArea); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { fill: var(--blue); }
.chart .bar.now { fill: var(--yellow); }
.chart .bar.zero { fill: rgba(255, 255, 255, .06); }
.chart .dot { fill: var(--yellow); stroke: var(--card2); stroke-width: 2; }
.chart .cross { stroke: rgba(255, 255, 255, .25); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .slice { stroke: var(--card2); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: #0f0f10; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; z-index: 5; }
.tip.show { opacity: 1; }
.tip b { display: block; font-size: 13.5px; }
.tip span { color: var(--muted); }
.donut-wrap { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.donut-wrap svg { width: 140px; height: 140px; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut-center { font-size: 22px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.donut-sub { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.legend { display: grid; gap: 8px; }
.legend .li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.legend .li > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .pc { color: var(--ink2); font-variant-numeric: tabular-nums; font-weight: 700; }
.sw.m1 { background: var(--m1); } .sw.m2 { background: var(--m2); } .sw.m3 { background: var(--m3); } .sw.m4 { background: var(--m4); } .sw.m5 { background: var(--m5); }
.chart .s-m1 { fill: var(--m1); } .chart .s-m2 { fill: var(--m2); } .chart .s-m3 { fill: var(--m3); } .chart .s-m4 { fill: var(--m4); } .chart .s-m5 { fill: var(--m5); }

/* ── listas (filas, PIX, ao vivo) ──────────────── */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar .input { max-width: 440px; }
.q-list, .pix-list { display: grid; gap: 10px; }
.q, .px, .live { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.q-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.q-head .t { font-weight: 700; flex: 1; min-width: 170px; overflow-wrap: anywhere; }
.q-head .when { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.p { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.p:last-child { border-bottom: 0; }
.p .paid { font-weight: 700; overflow-wrap: anywhere; }
.p .disc { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p .disc img { width: 16px; height: 16px; border-radius: 50%; }
.p .amt { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p .tm { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-family: var(--mono); }
@media (max-width: 560px) { .p { grid-template-columns: 1fr auto; } .p .tm { grid-column: 1 / -1; } }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; border: 1px dashed var(--line2); border-radius: var(--r); }
.more { display: flex; justify-content: center; margin-top: 16px; }

.live-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 400px) { .live-grid { grid-template-columns: 1fr; } }
.live { display: flex; flex-direction: column; }
.live.done { box-shadow: inset 0 2px 0 var(--green); }
.live-head { padding: 14px 16px 10px; display: grid; gap: 7px; }
.live-head .t { font-weight: 700; overflow-wrap: anywhere; }
.live-head .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }
.progress { height: 5px; background: #2c2c30; border-radius: 99px; overflow: hidden; margin: 2px 16px 0; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 99px; transition: width .4s; }
.lp { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.lp:first-of-type { margin-top: 12px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #2c2c30; object-fit: cover; display: grid; place-items: center; color: var(--ink2); font-weight: 800; font-size: 13px; }
.lp .n1 { font-weight: 700; overflow-wrap: anywhere; }
.lp .n2 { color: var(--muted); font-size: 12.5px; }
.live-foot { margin-top: auto; padding: 11px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.st .ico { width: 13px; height: 13px; }
.st.pago { background: var(--green-soft); color: var(--green); }
.st.verificando { background: var(--yellow-soft); color: var(--yellow); }
.st.aguardando { background: #2c2c30; color: var(--muted); }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 10px; vertical-align: 3px; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 127, .55); } 70% { box-shadow: 0 0 0 10px rgba(60, 207, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 127, 0); } }

.px-row { display: grid; grid-template-columns: 38px 1fr auto auto 36px; gap: 12px; align-items: center; padding: 11px 14px; }
.px-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #2c2c30; color: var(--ink2); }
.px-ic.m1 { color: var(--m1); } .px-ic.m2 { color: var(--m2); } .px-ic.m3 { color: var(--m3); } .px-ic.m4 { color: var(--m4); }
.px-main { min-width: 0; }
.px-main .n1 { font-weight: 700; overflow-wrap: anywhere; }
.px-main .n2 { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-amt { font-weight: 800; font-size: 15.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.px-tm { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; font-family: var(--mono); line-height: 1.35; }
.eye { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: all .15s; }
.eye:hover { color: var(--ink); background: #2a2a2d; }
.eye[aria-expanded="true"] { color: #111; background: var(--yellow); border-color: transparent; }
.px-det { border-top: 1px solid var(--line); background: #1c1c1e; padding: 14px; display: grid; gap: 14px; }
.det-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.det-grid > div { background: var(--card2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; min-width: 0; }
.det-grid .k { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.det-grid .v { font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.det-players { display: grid; gap: 8px; }
.det-players .lp { border: 1px solid var(--line); border-radius: 11px; background: var(--card2); margin: 0; }
.det-players .lp.me { border-color: rgba(245, 197, 24, .45); }
.det-h { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
@media (max-width: 600px) {
  .px-row { grid-template-columns: 38px 1fr 36px; }
  .px-amt { grid-column: 2; }
  .px-tm { grid-column: 2; text-align: left; }
  .eye { grid-row: 1; grid-column: 3; }
}

/* ── configurações ─────────────────────────────── */
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row .d { color: var(--muted); font-size: 12.5px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ── toast / carregando ────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; background: #1f1f21; border: 1px solid var(--line2);
  padding: 11px 16px; border-radius: 11px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); transition: all .25s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255, 93, 108, .5); }
.skel { background: linear-gradient(90deg, #202022, #29292c, #202022); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 18px; }
.skel.h140 { height: 140px; } .skel.h200 { height: 200px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── admin ─────────────────────────────────────── */
.viewas { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 18px; border-radius: var(--r);
  background: linear-gradient(90deg, rgba(245, 197, 24, .14), rgba(245, 197, 24, .04)); border: 1px solid rgba(245, 197, 24, .35); position: sticky; top: 10px; z-index: 15; backdrop-filter: blur(8px); }
.viewas img { width: 36px; height: 36px; border-radius: 50%; background: #2c2c30; }
.viewas .t { flex: 1; min-width: 0; }
.viewas .t b { color: var(--yellow); }
.viewas small { display: block; color: var(--ink2); font-size: 12px; }
.adm-list { display: grid; gap: 8px; }
.adm { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; }
.adm img, .adm .av { width: 38px; height: 38px; border-radius: 50%; }
.adm .n1 { font-weight: 700; overflow-wrap: anywhere; }
.adm .n2 { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.adm .mo { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm .mo small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; }
@media (max-width: 560px) { .adm { grid-template-columns: 38px 1fr auto; } .adm .mo { display: none; } }
