:root {
  /* VaultSystem — preto + verde */
  --bg: #050706;
  --panel: #0b0f0d;
  --panel-2: #111714;
  --line: #19221d;
  --line-2: #243029;
  --text: #e4efe8;
  --text-2: #a3b5aa;
  --muted: #66786d;
  --accent: #1fe07f;
  --accent-2: #5cf2a4;
  --accent-soft: rgba(31, 224, 127, .1);
  --accent-line: #1d4d33;
  --accent-deep: #0a2417;
  --accent-ink: #02130a;
  --glow: 0 0 0 1px rgba(31, 224, 127, .25), 0 0 24px rgba(31, 224, 127, .15);
  --good: #3bd68c;
  --warn: #f0b03c;
  --bad: #ff5f57;
  --info: #5fb8ff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; }
.brand svg { flex: none; }
.sidebar { background: linear-gradient(180deg, #08100c 0%, var(--panel) 40%); }
.nav a.active { box-shadow: inset 2px 0 0 var(--accent); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--accent-2);
}

.main { min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 6px; display: inline-block; }

.topbar { display: none; }

/* ---------- cards & grids ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head .muted { font-size: 12px; }
.card-body { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 16px; }
.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.hero { background: linear-gradient(160deg, var(--accent-deep) 0%, var(--panel) 65%); border-color: var(--accent-line); }
.kpi.hero .value { color: var(--accent-2); }
.kpi.inline { padding: 0 0 8px; }
.section { margin-top: 16px; }

/* ---------- avatars & team ---------- */
img.avatar { object-fit: cover; padding: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; }
.avatar.xxl { width: 84px; height: 84px; font-size: 26px; border-width: 2px; border-color: var(--accent-line); }
#me-avatar { text-decoration: none; display: block; flex: none; }
.avatar-wrap { position: relative; flex: none; }
.presence {
  position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted); border: 2.5px solid var(--panel);
}
.presence.on { background: var(--accent); box-shadow: 0 0 8px rgba(31, 224, 127, .7); }
.online-text { color: var(--accent-2); }
.members { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.member { display: block; padding: 18px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.member:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-1px); }
.member-top { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.member-name { font-weight: 600; font-size: 15px; }
.member-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.member-stats span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.member-stats b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.member-head { display: flex; gap: 18px; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.photo-card { display: flex; gap: 20px; align-items: center; padding: 20px; }
.photo-card h2 { margin-bottom: 4px; }
.photo-card p { margin: 0 0 12px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.twofa-box { padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft); }
.twofa-box p { margin: 0 0 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin: 4px 0 12px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.card-head .actions { display: flex; gap: 6px; }
.account { max-width: 460px; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }

/* ---------- chart ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis-label.current { fill: var(--text); font-weight: 600; }
.chart .bar { fill: var(--accent); opacity: .85; transition: opacity .12s; }
.chart .bar.current { opacity: 1; }
.chart .bar.dim { opacity: .35; }
.chart .hit { fill: transparent; cursor: default; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #020302; border: 1px solid var(--accent-line); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px));
}
.tooltip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--accent-line); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); box-shadow: var(--glow); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn.icon { width: 30px; height: 30px; padding: 0; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  outline: none;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
textarea.input.mono { font-family: var(--mono); font-size: 13px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 0 0 10px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar .search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.toolbar .search .input { padding-left: 34px; }

.tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.tabs button {
  border: 0; background: transparent; color: var(--text-2);
  height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer;
}
.tabs button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs .count { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ativo { color: var(--good); border-color: rgba(59, 214, 140, .3); background: rgba(59, 214, 140, .08); }
.pill.negociacao { color: var(--warn); border-color: rgba(240, 176, 60, .3); background: rgba(240, 176, 60, .08); }
.pill.prospeccao { color: var(--info); border-color: rgba(95, 184, 255, .3); background: rgba(95, 184, 255, .08); }
.pill.encerrado { color: var(--muted); }
.pill.expired { color: var(--bad); border-color: rgba(255, 95, 87, .3); background: rgba(255, 95, 87, .08); }
.pill.admin { color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.plain::before { display: none; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
td.right, th.right { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }

/* ---------- casino detail ---------- */
.detail { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
.primary-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-deep) 0%, var(--panel) 70%);
}
.primary-link .tag { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.primary-link .url { font-family: var(--mono); font-size: 16px; color: var(--text); word-break: break-all; }
.primary-link .grow { flex: 1; min-width: 0; }
.links li { padding: 7px 0; }
.links .url { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.links .label { font-size: 12px; color: var(--muted); }
.links .link-actions { display: flex; gap: 2px; opacity: .35; transition: opacity .1s; }
.links li:hover .link-actions, .links li:focus-within .link-actions { opacity: 1; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; }
.notes { white-space: pre-wrap; color: var(--text-2); }

/* ---------- link status ---------- */
.ls {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; white-space: nowrap; color: var(--muted); cursor: help;
}
.ls::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, .03); }
.ls.up { color: var(--good); }
.ls.blocked { color: var(--warn); }
.ls.error, .ls.down { color: var(--bad); }
.ls.unknown::before { background: transparent; border: 1.5px solid var(--muted); width: 7px; height: 7px; }
.cell-sub .ls { vertical-align: middle; margin-right: 2px; }

/* ---------- misc ---------- */
.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rate-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px;
}
.rate-chip b { color: var(--accent-2); }
.input-group { display: flex; gap: 6px; }
.input-group .btn.icon { height: 38px; width: 38px; flex: none; }
.input.auto { width: auto; }
.conversion {
  margin: -2px 0 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 13px; font-variant-numeric: tabular-nums;
}
.conversion b { color: var(--accent-2); font-size: 15px; }
.avatar.bot { color: var(--info); }
.avatar.bot svg { width: 16px; height: 16px; }
.list li > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.links .label .mono { font-size: 12px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 4, 3, .78); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .12s ease-out;
}
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow);
  animation: pop .14s ease-out;
}
.modal.wide { max-width: 640px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.modal .body { padding: 14px 20px 4px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #020302; border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-width: 360px; animation: pop .14s ease-out;
}
.toast.error { border-left-color: var(--bad); }

/* ---------- login ---------- */
.login {
  position: relative; overflow: hidden;
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(700px 420px at 50% -8%, rgba(31, 224, 127, .16), transparent 70%),
    radial-gradient(500px 300px at 50% 110%, rgba(31, 224, 127, .06), transparent 70%),
    var(--bg);
}
/* Faint vault grid */
.login::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 224, 127, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 224, 127, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.login .card {
  position: relative; width: 100%; max-width: 400px; padding: 34px 30px 28px;
  border-color: var(--accent-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(31, 224, 127, .05);
}
.login .card::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.login .brand { justify-content: center; flex-direction: column; text-align: center; gap: 14px; padding: 0 0 22px; }
.login .wordmark b, .login .wordmark span { font-size: 22px; }
.login .btn.primary { width: 100%; height: 42px; margin-top: 6px; }
.login .tagline { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.login .back { display: block; margin: 14px auto 0; }
.login .foot { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.login .foot svg { width: 12px; height: 12px; vertical-align: -2px; color: var(--accent); }
.steps { display: flex; justify-content: center; gap: 8px; margin: -6px 0 20px; font-size: 12px; color: var(--muted); }
.steps span { display: inline-flex; align-items: center; gap: 6px; }
.steps i {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 11px; border: 1px solid var(--line-2);
}
.steps .on { color: var(--accent-2); }
.steps .on i { border-color: var(--accent); background: var(--accent-soft); }
.steps .sep { width: 18px; height: 1px; background: var(--line-2); align-self: center; }
.code-input {
  text-align: center; font-family: var(--mono); font-size: 26px !important; letter-spacing: .35em;
  height: 52px !important; padding-left: .35em !important;
}
.qr-box {
  display: grid; place-items: center; margin: 0 auto 14px; width: 196px; height: 196px;
  background: #fff; border-radius: 10px; padding: 10px; box-shadow: var(--glow);
}
.qr-box svg { width: 100%; height: 100%; }
.secret {
  font-family: var(--mono); font-size: 13px; text-align: center; letter-spacing: .06em;
  padding: 8px 10px; border: 1px dashed var(--accent-line); border-radius: var(--radius-sm);
  color: var(--accent-2); margin-bottom: 14px; user-select: all; word-break: break-all;
}
.howto { margin: 0 0 16px; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.howto li { margin: 3px 0; }

/* ---------- brand ---------- */
.wordmark { line-height: 1.05; }
.wordmark b { font-family: var(--mono); font-weight: 700; letter-spacing: .16em; color: var(--text); font-size: 15px; }
.wordmark span { font-family: var(--mono); font-weight: 400; letter-spacing: .16em; color: var(--accent); font-size: 15px; }
.wordmark small { display: block; font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.logo { filter: drop-shadow(0 0 10px rgba(31, 224, 127, .25)); }
.security-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent-2);
  letter-spacing: .04em;
}
.security-badge svg { width: 13px; height: 13px; }
.badge-ok { color: var(--good); }
.badge-off { color: var(--warn); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .detail, .thirds { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; width: 260px;
    transform: translateX(-100%); transition: transform .18s ease-out; box-shadow: var(--shadow);
  }
  .shell.nav-open .sidebar { transform: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .topbar b { letter-spacing: .14em; font-size: 14px; }
  .main { padding: 20px 16px 50px; }
  .halves, .row { grid-template-columns: minmax(0, 1fr); }
  .kpi .value { font-size: 22px; }
  .hide-sm { display: none; }
}
