:root {
  --ink: #0f172a; --ink-2: #1e293b; --ink-3: #334155;
  --bg: #f8fafc; --surface: #fff; --line: #e2e8f0; --line-2: #f1f5f9;
  --text: #0f172a; --muted: #475569; --faint: #64748b;
  --violet: #4338ca; --violet-d: #3730a3; --violet-l: #ecebfb; --accent: #6366f1;
  --mint: #0fa97a; --mint-l: #e2f6ef; --rose: #d9435b; --rose-l: #fdebee; --amber-l: #fff4dc; --amber: #a86a00;
  --gold-1: #f3d98b; --gold-2: #c99a3b; --gold-3: #8f6414;
  --r: 20px; --r-s: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -12px rgb(15 23 42 / .10);
  --shadow-lifted: 0 4px 10px rgb(15 23 41 / .05), 0 36px 72px -18px rgb(15 23 41 / .34);
  --display: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.015em; } h2 { font-size: 20px; font-weight: 650; } h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; } a { color: var(--violet); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #b7a8ff; outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1; }
.stack > * + * { margin-top: 16px; } .stack-s > * + * { margin-top: 8px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { background: linear-gradient(135deg, #f5f7ff, #cfe3fd); color: #1c2b56; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ''; position: absolute; width: 480px; height: 480px; right: -160px; bottom: -190px; border-radius: 50%; background: conic-gradient(from 210deg, var(--gold-1), var(--gold-2), var(--gold-3), var(--gold-1)); }
.login-art::after { content: ''; position: absolute; width: 340px; height: 340px; right: -90px; bottom: -110px; border-radius: 50%; background: linear-gradient(140deg, #6366f1, #38a1f3); opacity: .92; }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-size: 44px; max-width: 13ch; font-weight: 700; letter-spacing: -.02em; }
.login-art p { color: #3b4a73; max-width: 38ch; margin-top: 16px; font-size: 17px; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(140deg, var(--violet), var(--accent)); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); color: var(--muted); padding: 22px 14px; position: sticky; top: 16px; margin: 16px 0 16px 16px; height: calc(100vh - 32px); border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.side .brand { color: var(--text); padding: 0 10px 22px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--muted); font-weight: 500; }
.side nav a svg { width: 19px; height: 19px; flex: none; }
.side nav a:hover { background: var(--line-2); color: var(--text); }
.side nav a.on { background: var(--violet-l); color: var(--violet); font-weight: 600; }
.side .who { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.side .who b { color: var(--text); display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .who button { margin-top: 8px; background: none; border: 0; color: var(--faint); padding: 0; cursor: pointer; }
.side .who button:hover { color: var(--violet); }
.main { padding: 36px clamp(20px, 4vw, 56px) 80px; max-width: 1240px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.head p { margin-top: 6px; color: var(--muted); }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-s); padding: 9px 16px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--line-2); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; } .btn.primary:hover { background: var(--violet-d); }
.btn.gold { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-2); color: #3a2706; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { color: var(--rose); } .btn.sm { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.field { display: block; } .field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--r-s); padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b7a8ff; border-color: var(--violet); }
.money { position: relative; } .money::before { content: 'R$'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }
.money input { padding-left: 38px; text-align: right; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--muted); }
.pill.ok { background: var(--mint-l); color: #076b4c; } .pill.warn { background: var(--amber-l); color: var(--amber); } .pill.bad { background: var(--rose-l); color: #a3243b; } .pill.gold { background: #fbefcb; color: #7a5410; }
table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; } tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #faf9fd; }
.scroll-x { overflow-x: auto; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); } .empty h3 { color: var(--text); margin-bottom: 6px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 14px; cursor: pointer; font-weight: 500; font-size: 14px; }
.chip.on { background: var(--violet); color: #fff; border-color: var(--violet); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #cfcce0; border-radius: 99px; transition: background .2s; }
.switch i::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--mint); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled { cursor: not-allowed; } .switch input:disabled + i { opacity: .5; }
.switch input:focus-visible + i { outline: 3px solid #b7a8ff; outline-offset: 2px; }

/* ---------- Premium: o elemento de destaque ---------- */
.premium { position: relative; overflow: hidden; border-radius: 24px; padding: 30px; color: #fff; background: linear-gradient(120deg, #0f172a 0%, #1e1b4b 62%, #312e81 100%); box-shadow: var(--shadow-lifted); }
.premium::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 46%; background: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 45%, var(--gold-3) 100%); clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%); opacity: .95; }
.premium::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px); clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%); margin-left: 54%; mix-blend-mode: overlay; }
.premium > * { position: relative; z-index: 1; }
.premium h2 { font-size: 30px; } .premium .lead { color: #cfc9ee; max-width: 46ch; margin-top: 8px; }
.premium .plans { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.plan-opt { border: 1.5px solid rgba(255,255,255,.28); background: #1a1f4a; border-radius: 14px; padding: 12px 18px; min-width: 190px; cursor: pointer; text-align: left; color: #fff; }
.plan-opt:hover { background: #242a5e; }
.plan-opt.on { border-color: var(--gold-1); background: #312e81; }
.plan-opt b { font-family: var(--display); font-size: 26px; display: block; } .plan-opt small { color: #cfc9ee; }
.plan-opt s { color: #aaa4cf; font-size: 13px; margin-left: 6px; }
.premium .gold-tag { position: absolute; right: 26px; top: 22px; color: #3a2706; font-family: var(--display); font-weight: 700; text-align: right; z-index: 2; }
.premium .gold-tag b { font-size: 34px; display: block; line-height: 1; } 

/* ---------- loja ---------- */
.store { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 12px; position: relative; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: #c9c0f5; } .tile.on { border-color: var(--violet); box-shadow: 0 0 0 4px rgb(67 56 202 / .12); }
.tile.owned { background: #fafafd; }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tile .ico svg { width: 22px; height: 22px; }
.tile .price { font-family: var(--display); font-size: 22px; font-weight: 700; } .tile .price small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 400; }
.tile .price s { font-size: 14px; color: var(--faint); font-weight: 400; margin-right: 6px; }
.tile .check { position: absolute; right: 14px; top: 14px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.tile.on .check { background: var(--violet); border-color: var(--violet); } .tile.on .check::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.months { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.months select { width: auto; padding: 4px 8px; }
.summary { position: sticky; top: 24px; }
.summary .line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary .total { font-family: var(--display); font-size: 32px; font-weight: 700; }

/* ---------- módulos ---------- */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.mod { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.mod.on { border-color: #b8e6d6; background: #fbfefd; } .mod b { display: block; font-weight: 600; line-height: 1.25; }
.locked-banner { display: flex; gap: 14px; align-items: center; background: var(--amber-l); border: 1px solid #f1d58f; color: #6b4600; padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; }
.sectitle { margin: 28px 0 12px; display: flex; align-items: baseline; gap: 10px; } .sectitle:first-child { margin-top: 0; }

/* ---------- master ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; } .stat .v { font-family: var(--display); font-size: 30px; font-weight: 700; margin-top: 2px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .formgrid .full { grid-column: 1 / -1; }
.pricerow { display: grid; grid-template-columns: minmax(0, 1fr) 90px 130px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; background: var(--line-2); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
pre.mono { padding: 12px; overflow-x: auto; white-space: pre-wrap; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { background: #fff; border-radius: 24px; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; padding: 26px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.modal.wide { max-width: 560px; }
.pix-qr { width: 230px; height: 230px; margin: 0 auto; display: block; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.pix-code { display: flex; gap: 8px; } .pix-code input { font-family: ui-monospace, monospace; font-size: 12px; }
.paid-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--mint); margin: 0 auto 14px; display: grid; place-items: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.paid-mark svg { width: 38px; height: 38px; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: fade .2s; max-width: 340px; }
.toast.err { background: var(--rose); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.4); opacity: 0; } }

@media (max-width: 1000px) {
  .store, .cols { grid-template-columns: 1fr; } .summary { position: static; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; margin: 10px; padding: 10px 12px; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; border-radius: 18px; }
  .side .brand { padding: 0 8px 0 0; } .side nav { flex-direction: row; } .side nav a { white-space: nowrap; padding: 8px 12px; } .side nav a svg { display: none; }
  .side .who { margin: 0 0 0 auto; border: 0; padding: 0; white-space: nowrap; } .side .who b { display: none; }
  .main { padding: 24px 16px 60px; } .formgrid { grid-template-columns: 1fr; }
  .premium::before, .premium::after { width: 100%; clip-path: polygon(0 78%, 100% 60%, 100% 100%, 0 100%); margin: 0; } .premium .gold-tag { display: none; } .premium { padding-bottom: 80px; }
  .premium .plans { margin-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.stack > .pix-qr { margin: 16px auto 0; }
