:root {
  --bg: #070b14;
  --panel: #0c121e;
  --panel-2: #101827;
  --line: #1a2436;
  --text: #e6edf7;
  --muted: #7d8fa8;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(700px 400px at 5% 0%, rgba(129, 140, 248, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* topbar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(7, 11, 20, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand b { color: var(--accent); font-weight: 800; }
.brand svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--accent); background: rgba(34, 211, 238, .08); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 99px; font-weight: 600; }
.who i { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-style: normal; font-size: 11px; color: #06101c; }

/* layout */
main { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--muted); font-weight: 600; }
h1 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 0 0 4px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.back { color: var(--muted); display: inline-block; margin-bottom: 8px; }
.back:hover { color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card .lbl { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); font-weight: 600; }
.card .val { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.card .val small { color: var(--muted); font-size: 14px; font-weight: 500; }
.card .val.acc { color: var(--accent); }
.card .val.pos { color: var(--ok); }
.card .val.neg { color: var(--danger); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin: 0 0 14px; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.side { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2, .side { grid-template-columns: 1fr; } }

/* tables */
.tbl { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(26, 36, 54, .6); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
td.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--accent); font-weight: 700; letter-spacing: .04em; cursor: pointer; }
td.dest { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
td.num, th.num { text-align: right; }
td.acts { text-align: right; white-space: nowrap; }
td.acts .btn { margin-left: 6px; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* pills / buttons */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .25); }
.pill.warn { color: var(--warn); background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .25); }
.pill.hot { color: var(--danger); background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .25); }
.pill.cold { color: #93c5fd; background: rgba(147, 197, 253, .08); border-color: rgba(147, 197, 253, .25); }
.btn { border: 1px solid var(--line); background: var(--panel-2); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; transition: border-color .15s, transform .05s; }
.btn:hover { border-color: #2b3a54; }
.btn:active { transform: translateY(1px); }
.btn.pri { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101c; border: 0; box-shadow: 0 6px 22px rgba(34, 211, 238, .25); }
.btn.dng { color: var(--danger); border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .06); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* forms */
.form { max-width: 520px; }
.form.wide { max-width: none; }
label { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
input, select, textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: rgba(34, 211, 238, .5); box-shadow: 0 0 0 3px rgba(34, 211, 238, .08); }
select option { background: #101827; }
input::placeholder, textarea::placeholder { color: #4a5b74; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0 6px; }
.stack > * + * { margin-top: 16px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { flex: 1 1 160px; }
.inline-form label { margin-top: 0; }
.inline-form .btn { flex: 0 0 auto; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 22px; height: 210px; padding: 8px 6px 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar i { display: block; position: relative; width: 100%; max-width: 110px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--accent), var(--accent-2)); min-height: 3px; }
.bar b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; }
.labels { display: flex; gap: 22px; padding: 8px 6px 0; }
.labels span { flex: 1; text-align: center; color: var(--muted); font-size: 12px; }
.recent { display: flex; flex-direction: column; gap: 14px; }
.recent > div { display: flex; justify-content: space-between; gap: 12px; }
.recent small { color: var(--muted); display: block; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; font-size: 24px; margin-bottom: 22px; }
.login .brand svg { width: 28px; height: 28px; }
.login .panel { padding: 26px; }
.login h2 { margin: 0 0 4px; font-size: 18px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; margin: 12px 0; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; color: var(--accent); }
.tag { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #131c2e; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { border-color: rgba(248, 113, 113, .5); color: var(--danger); }

.bar i { font-style: normal; }
.who { white-space: nowrap; }
@media (max-width: 560px) {
  .top-in { gap: 10px; padding: 0 12px; }
  .who { font-size: 0; padding: 4px; }
  .who i { font-size: 11px; }
  .brand span { display: none; }
}
.qrbox { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; }
.qrbox img { background: #fff; border-radius: 10px; padding: 4px; }

/* mobile: sem zoom automático do iOS nos campos, sem estouro lateral, alvos de toque maiores */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
.side > *, .grid2 > *, .row2 > *, .head > *, .cards > * { min-width: 0; }
@media (max-width: 720px) {
  input, select, textarea { font-size: 16px; padding: 12px; }
  .btn { padding: 11px 16px; font-size: 14px; min-height: 44px; }
  .btn.sm { padding: 9px 13px; font-size: 13px; min-height: 40px; }
  .nav a { padding: 10px 13px; }
  main { padding: 20px 14px 90px; }
  h1 { font-size: 22px; }
  .panel { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px; }
  .card .val { font-size: 20px; }
  .head .acts, .head .acts .btn { width: 100%; }
  .head .acts .btn { text-align: center; }
  .inline-form > div { flex: 1 1 100%; }
  .inline-form .btn { width: 100%; }
  .linkbox { flex-wrap: wrap; }
  .linkbox code { flex: 1 1 100%; word-break: break-all; white-space: normal; }
  .qrbox { flex-direction: column; align-items: flex-start; }
  th, td { padding: 12px 12px; }
  .chart, .labels { gap: 10px; }
  #toast { bottom: 16px; width: calc(100% - 28px); text-align: center; }
}
@media (max-width: 380px) { .cards { grid-template-columns: 1fr; } }

.qrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.qrcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qrcard.off img { opacity: .35; }
.qrcard img { width: 100%; aspect-ratio: 1; background: #fff; border-radius: 10px; }
.qrinfo { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.qrinfo b { overflow-wrap: anywhere; }
.qracts { display: flex; flex-wrap: wrap; gap: 6px; }
