:root {
  --ink: #f4ebe1;
  --mute: #b9a898;
  --bg: #14110f;
  --panel: #1e1915;
  --line: #3a3129;
  --terra: #d46a32;
  --ok: #7cb87c;
  --err: #d36a5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Manrope, Segoe UI, sans-serif; }
h1, h2, .brand strong { font-family: Fraunces, Georgia, serif; }
a { color: #f0c3a4; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: 240px; background: #100d0b;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px;
  overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.brand .brand-logo { width: 100%; height: auto; display: block; border-radius: 16px; }
.mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--terra); color: #fff; font-weight: 800;
}
.rail nav { display: grid; gap: 6px; }
.rail nav a {
  color: var(--mute); text-decoration: none; padding: 10px 12px; border-radius: 12px;
}
.rail nav a.on, .rail nav a:hover { background: #2a221c; color: #fff; }
.who { margin-top: auto; font-size: .85rem; color: var(--mute); display: grid; gap: 4px; }
.rail-pass {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(212, 106, 50, .45);
  border-radius: 16px;
  background: #1a140f;
  display: grid;
  gap: 10px;
}
.rail-pass .kicker { color: #d46a32; margin-bottom: 2px; }
.rail-pass-item { display: grid; gap: 6px; }
.rail-pass-item code {
  display: block;
  font-size: 1.08rem;
  letter-spacing: .08em;
  color: #fff;
  background: #14110f;
  padding: 8px 10px;
  border-radius: 10px;
  word-break: break-all;
}
.rail-pass-item .btn { width: 100%; text-align: center; margin: 0; }
.rail-pass-item small { color: var(--mute); }
.wrap { margin-left: 240px; padding: 28px 36px 80px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 22px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; color: var(--mute); font-size: .72rem; margin: 0; }
.top h1 { margin: 4px 0 0; font-size: 1.8rem; }
.btn {
  background: var(--terra); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px;
  font-weight: 700; text-decoration: none; display: inline-block; cursor: pointer;
}
.btn.sm { padding: 7px 10px; font-size: .85rem; }
.btn.danger { background: #8f2f0e; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stats article { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stats span { color: var(--mute); font-size: .8rem; }
.stats strong { display: block; margin-top: 6px; font-size: 1.2rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.pill { border-radius: 999px; padding: 3px 8px; font-size: .75rem; background: #332820; }
.pill.active, .pill.paid { background: #244024; color: #c6e6c6; }
.pill.blocked, .pill.overdue, .pill.cancelled { background: #4a2218; color: #f0b8ae; }
.pill.trial, .pill.open { background: #3a3218; color: #ead89a; }
.pill.trial, .pill.open, .pill.overdue, .pill.paid, .pill.cancelled, .pill.active {
  font-size: 0;
  line-height: 0;
}
.pill.trial::after, .pill.open::after, .pill.overdue::after, .pill.paid::after,
.pill.cancelled::after, .pill.active::after {
  font-size: .75rem;
  line-height: 1.35;
}
.pill.trial::after { content: "Período de teste"; }
.pill.open::after { content: "Aberta"; }
.pill.overdue::after { content: "Atrasada"; }
.pill.paid::after { content: "Paga"; }
.pill.cancelled::after { content: "Cancelado"; }
.pill.active::after { content: "Ativo"; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide, .form-grid .btn { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: .85rem; color: var(--mute); }
input, select {
  background: #14110f; border: 1px solid var(--line); color: #fff; border-radius: 10px; padding: 10px 12px;
}
.flash { padding: 10px 12px; border-radius: 12px; }
.flash.ok { background: #1f3320; }
.flash.err { background: #3a1c18; }
.copy { background: #14110f; padding: 10px 12px; border-radius: 12px; overflow: auto; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin-right: 8px; }
.asaas-test {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; margin: 0 0 16px;
}
.asaas-test label { margin: 0; min-width: 240px; }
.asaas-test select { min-width: 240px; }
.pix-pay { max-width: 520px; display: grid; gap: 12px; }
.pix-qr { background: #fff; border-radius: 12px; padding: 12px; width: 240px; height: 240px; }
.pix-pay textarea { width: 100%; min-height: 96px; font-size: .8rem; word-break: break-all; }
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.keys .btn { margin-top: 0; }
.app-pass {
  border: 1px solid rgba(193, 255, 94, .35);
  background: #1a2410;
}
.app-pass h2 { margin: 4px 0 8px; }
.app-pass-value {
  font-size: 1.45rem;
  letter-spacing: .08em;
  font-weight: 800;
}
.filters { display: flex; gap: 12px; }
.muted { color: var(--mute); }
.login-body {
  min-height: 100dvh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(212, 106, 50, .28), transparent 55%),
    radial-gradient(700px 380px at 110% 110%, rgba(212, 106, 50, .12), transparent 50%),
    #0c0b0a;
  font-family: Manrope, Segoe UI, sans-serif;
}
.login-body h1, .login-body h2, .login-body .brand strong, .login-body .auth-aside-brand strong,
.login-body .auth-mobile-brand strong { font-family: Manrope, Segoe UI, sans-serif; }
.auth-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #161310;
  border: 1px solid #2c2621;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0,0,0,.45);
}
.auth-aside {
  padding: 40px 36px;
  background:
    linear-gradient(165deg, rgba(212, 106, 50, .16), transparent 42%),
    #12100e;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.auth-aside-brand, .auth-mobile-brand { display: flex; gap: 12px; align-items: center; }
.auth-aside-brand .brand-logo { height: 112px; width: auto; display: block; }
.auth-mobile-brand .brand-logo { height: 84px; width: auto; display: block; }
.auth-aside-brand small, .auth-mobile-brand small { display: block; color: var(--mute); font-size: .78rem; }
.auth-aside h2 { margin: 8px 0 0; font-size: 1.7rem; line-height: 1.25; font-weight: 800; }
.auth-aside p { margin: 0; color: var(--mute); line-height: 1.5; }
.auth-aside ul { margin: 8px 0 0; padding-left: 18px; color: #e8d8c8; display: grid; gap: 8px; font-size: .92rem; }
.auth-mobile-brand { display: none; margin-bottom: 8px; }
.login-card {
  width: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 40px 36px;
  display: grid;
  gap: 14px;
  align-content: center;
}
.login-card .kicker { margin: 0; }
.login-card h1 { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.auth-lead { margin: 0 0 4px; color: var(--mute); font-size: .92rem; }
.auth-field { display: grid; gap: 8px; font-size: .82rem; font-weight: 650; color: #cbbbaa; }
.login-card input {
  width: 100%;
  min-height: 50px;
  background: #0e0c0b;
  border: 1px solid #3a3129;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
}
.login-card input:focus {
  outline: 2px solid rgba(212, 106, 50, .55);
  outline-offset: 1px;
  border-color: var(--terra);
}
.auth-pass { display: flex; align-items: center; position: relative; }
.auth-pass input { padding-right: 48px; }
.auth-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: transparent; color: #cbbbaa;
  display: grid; place-items: center; cursor: pointer; border-radius: 10px;
}
.auth-eye.is-on, .auth-eye:hover { color: var(--terra); }
.auth-submit, .login-card button.auth-submit, .login-card button[type=submit] {
  background: var(--terra); color: #fff; border: 0; border-radius: 14px;
  min-height: 52px; padding: 14px 16px; font-weight: 800; font-size: 1rem; cursor: pointer;
  margin-top: 6px;
}
.auth-submit:hover { filter: brightness(1.06); }
@media (max-width: 800px) {
  .auth-shell { grid-template-columns: 1fr; border-radius: 24px; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: flex; }
  .login-card { padding: 28px 22px 32px; }
}
.auth-site { margin: 8px 0 0; text-align: center; }
.auth-site a { color: var(--mute); text-decoration: none; font-size: .88rem; }
.auth-site a:hover { color: #fff; }
.pill.interest { background: #3a3218; color: #ead89a; }
.pill.partnership { background: #243044; color: #c5d8f0; }
.pill.new { background: #3a3218; color: #ead89a; }
.pill.contacted { background: #243044; color: #c5d8f0; }
.pill.won { background: #244024; color: #c6e6c6; }
.pill.lost { background: #332820; color: #cbbbaa; }
.pill.interest::after { content: "Saber mais"; font-size: .75rem; line-height: 1.35; }
.pill.partnership::after { content: "Parceria"; font-size: .75rem; line-height: 1.35; }
.pill.new::after { content: "Nova"; font-size: .75rem; line-height: 1.35; }
.pill.contacted::after { content: "Em contato"; font-size: .75rem; line-height: 1.35; }
.pill.won::after { content: "Convertida"; font-size: .75rem; line-height: 1.35; }
.pill.lost::after { content: "Descartada"; font-size: .75rem; line-height: 1.35; }
.lead-msg { color: var(--mute); font-size: .85rem; max-width: 42ch; }
.status-form { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 960px) {
  .rail { position: relative; width: auto; }
  .wrap { margin-left: 0; padding: 16px; }
  .stats, .split, .form-grid { grid-template-columns: 1fr; }
}
