/* ==========================================================================
   Painel do afiliado + admin (mesma paleta da home)
   ========================================================================== */
:root {
  --bg: #05070e;
  --bg-2: #070c16;
  --panel: #080f1c;
  --panel-2: #0b1322;
  --line: #16233a;
  --cyan: #00e5ff;
  --violet: #8b5cf6;
  --magenta: #ff2e88;
  --green: #00d68f;
  --amber: #ffb020;
  --white: #f4f8ff;
  --soft: #c9d6e8;
  --grey: #8b99af;
  --dim: #5f6e86;
  --display: "Anton", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;
  --r: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--soft);
  font-family: var(--body); font-size: 15.5px; line-height: 1.65; font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: rgba(0, 229, 255, .28); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #04060c; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #12324a, #1b2a48); border-radius: 8px; }

/* fundo */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: -40%;
  background-image:
    linear-gradient(to right, rgba(0, 229, 255, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 229, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
}
.halo { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .42; }
.halo.a { width: 560px; height: 560px; top: -240px; left: -160px;
  background: radial-gradient(circle, rgba(0, 190, 230, .3), transparent 68%); }
.halo.b { width: 520px; height: 520px; top: 18%; right: -220px;
  background: radial-gradient(circle, rgba(139, 92, 246, .24), transparent 68%); }

/* ---------------------------------------------------------------- topbar */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 12px clamp(14px, 3vw, 28px);
  background: rgba(5, 7, 14, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.brand b { color: var(--white); font-size: 14.5px; font-weight: 600; }
.brand small { color: var(--dim); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; border-radius: 10px; font-size: 13.5px; color: var(--grey);
  white-space: nowrap; transition: background .18s, color .18s; display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--white); background: rgba(255, 255, 255, .04); }
.tab.on { color: #04121a; background: linear-gradient(120deg, var(--cyan), #74f1ff); font-weight: 600; }
.tab .bdg {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px;
  display: grid; place-items: center; background: var(--magenta); color: #fff; font-weight: 600;
}
.tab.on .bdg { background: rgba(4, 18, 26, .55); color: #d8fbff; }

.who { display: none; align-items: center; gap: 10px; font-size: 13px; color: var(--grey); }
@media (min-width: 760px) { .who { display: flex; } }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 229, 255, .12); border: 1px solid rgba(0, 229, 255, .28);
  color: var(--cyan); font-size: 12px; font-weight: 600;
}

/* ----------------------------------------------------------------- layout */
main { position: relative; z-index: 2; width: min(var(--wrap), 100% - 28px); margin: 0 auto; padding: 26px 0 80px; }
.view { display: none; animation: fade .25s ease; }
.view.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 6px 0 22px; }
.page-head h1 {
  margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(26px, 4vw, 38px); line-height: 1; color: var(--white); letter-spacing: .01em;
}
.page-head p { margin: 6px 0 0; color: var(--dim); font-size: 13.5px; }

/* ------------------------------------------------------------------- kpi */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 19, 34, .92), rgba(7, 12, 22, .6));
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--cyan); opacity: .65;
}
.kpi.violet::after { background: var(--violet); }
.kpi.green::after { background: var(--green); }
.kpi.amber::after { background: var(--amber); }
.kpi.magenta::after { background: var(--magenta); }
.kpi span { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.kpi b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 30px); color: var(--white); line-height: 1; }
.kpi small { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }

/* ------------------------------------------------------------------ card */
.card {
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 17, 31, .92), rgba(7, 12, 22, .62));
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h2, .card h3 {
  margin: 0 0 14px; font-family: var(--display); font-weight: 400; text-transform: uppercase;
  color: var(--white); font-size: 18px; letter-spacing: .01em;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.muted { color: var(--dim); font-size: 13px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--grey); background: rgba(255, 255, 255, .02);
}
.pill.green { color: var(--green); border-color: rgba(0, 214, 143, .32); background: rgba(0, 214, 143, .08); }
.pill.amber { color: var(--amber); border-color: rgba(255, 176, 32, .3); background: rgba(255, 176, 32, .07); }
.pill.magenta { color: var(--magenta); border-color: rgba(255, 46, 136, .3); background: rgba(255, 46, 136, .07); }
.pill.cyan { color: var(--cyan); border-color: rgba(0, 229, 255, .3); background: rgba(0, 229, 255, .07); }
.pill.violet { color: #c4b1ff; border-color: rgba(139, 92, 246, .3); background: rgba(139, 92, 246, .08); }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #04121a; background: linear-gradient(120deg, var(--cyan), #74f1ff);
  box-shadow: 0 14px 34px -18px rgba(0, 229, 255, .9);
  transition: transform .16s, opacity .16s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 11.5px; }
.btn.ghost { color: var(--white); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: rgba(0, 229, 255, .4); }
.btn.danger { color: #ffd4e2; background: rgba(255, 46, 136, .14); border: 1px solid rgba(255, 46, 136, .35); box-shadow: none; }
.btn.ok { color: #06251b; background: linear-gradient(120deg, var(--green), #5ff0bd); }
.linkbtn { color: var(--cyan); font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }

/* --------------------------------------------------------------- inputs */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 10px;
  background: rgba(5, 9, 17, .9); border: 1px solid var(--line);
  color: var(--white); font-size: 14.5px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.input:focus { border-color: rgba(0, 229, 255, .55); box-shadow: 0 0 0 3px rgba(0, 229, 255, .1); }
textarea.input { height: auto; min-height: 90px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--grey) 50%), linear-gradient(135deg, var(--grey) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-row { display: grid; gap: 12px; }
@media (min-width: 620px) { .form-row.two { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--grey); margin: 4px 0 12px; }
.check input { width: 16px; height: 16px; accent-color: var(--cyan); }

.alert {
  display: none; margin-bottom: 12px; padding: 10px 13px; border-radius: 10px; font-size: 13px;
  background: rgba(255, 46, 136, .1); border: 1px solid rgba(255, 46, 136, .32); color: #ffb3cf;
}
.alert.on { display: block; }
.alert.ok { background: rgba(0, 214, 143, .1); border-color: rgba(0, 214, 143, .32); color: #9bf0cf; }

/* ---------------------------------------------------------------- tabela */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 9px 10px; font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); font-weight: 500;
  white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid rgba(22, 35, 58, .55); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- ofertas */
.offer-row {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 19, 34, .8), rgba(7, 12, 22, .45));
  margin-bottom: 10px;
}
.offer-row .oc-main { flex: 1 1 240px; min-width: 0; }
.offer-row h3 { margin: 0 0 4px; font-family: var(--body); font-size: 15.5px; font-weight: 600; color: var(--white); }
.offer-row p { margin: 0; font-size: 13px; color: var(--dim); }
.offer-row .oc-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--grey); }
.offer-row .oc-stats b { display: block; color: var(--white); font-size: 15px; font-weight: 600; }
.offer-row .oc-actions { display: flex; gap: 8px; margin-left: auto; }

.linkbox {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(0, 229, 255, .35);
  background: rgba(0, 229, 255, .05);
}
.linkbox code {
  flex: 1 1 240px; font-family: var(--mono); font-size: 12.5px; color: #a8f4ff;
  word-break: break-all; min-width: 0;
}

.mat {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px;
  background: rgba(9, 16, 29, .6);
}
.mat .mi {
  flex: 0 0 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-size: 14px; background: rgba(0, 229, 255, .1); border: 1px solid rgba(0, 229, 255, .22);
}
.mat .mb { flex: 1; min-width: 0; }
.mat .mb b { display: block; font-size: 13.5px; color: var(--white); font-weight: 600; margin-bottom: 3px; }
.mat .mb pre {
  margin: 0; font-family: var(--body); font-size: 13px; color: var(--grey);
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
  max-height: 190px; overflow: auto;
}
.mat .mb a { color: var(--cyan); font-size: 12.5px; word-break: break-all; }
.mat .ma { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; padding: 16px; overflow-y: auto; }
.modal.on { display: block; }
.modal-bg { position: fixed; inset: 0; background: rgba(3, 5, 10, .84); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; width: min(560px, 100%); margin: 8vh auto 40px;
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #0a1120, #070c16);
  padding: 24px; box-shadow: 0 40px 100px -50px rgba(0, 229, 255, .4);
}
.modal-card.wide { width: min(860px, 100%); }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--grey); display: grid; place-items: center;
}
.modal-x:hover { color: var(--white); border-color: rgba(0, 229, 255, .4); }
.modal-card h3 {
  margin: 0 0 4px; font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 19px; color: var(--white);
}
.modal-card .sub { margin: 0 0 16px; color: var(--dim); font-size: 13px; }

/* ---------------------------------------------------------------- empty */
.empty { text-align: center; padding: 34px 16px; color: var(--dim); font-size: 13.5px; }
.empty b { display: block; color: var(--soft); font-size: 15px; margin-bottom: 6px; font-weight: 500; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  padding: 11px 18px; border-radius: 999px; font-size: 13px;
  background: #0d1626; border: 1px solid rgba(0, 229, 255, .3); color: var(--white);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .9);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0, 0, 0, .25); border-top-color: #04121a; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* barra de proporção (conversão) */
.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
