:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e4e7ec;
  --text: #101828;
  --muted: #5d6679;
  --faint: #98a2b3;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef0ff;
  --on-brand: #ffffff;
  --ok: #067647;
  --ok-soft: #e3f8ec;
  --warn: #b54708;
  --warn-soft: #fff3df;
  --danger: #b42318;
  --danger-soft: #fee9e7;
  --bubble: #d9fdd3;
  --bubble-text: #111b21;
  --chat-bg: #efeae2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .22);
  --radius: 14px;
  --display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016; --surface: #171a22; --surface-2: #1d212b; --line: #2a2f3c;
    --text: #eef0f5; --muted: #a2abbd; --faint: #6f788a;
    --brand: #8b85ff; --brand-strong: #a39eff; --brand-soft: #23244a; --on-brand: #0e1016;
    --ok: #5fd39a; --ok-soft: #12301f; --warn: #f5b25c; --warn-soft: #382710;
    --danger: #ff8f85; --danger-soft: #3a1714;
    --bubble: #144d37; --bubble-text: #e9edef; --chat-bg: #0f1418;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
svg { flex: none; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-family: var(--display); font-weight: 800; font-size: 18px; }
.logo-img { width: 32px; height: 32px; display: block; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #6d5efc, #22c55e); display: grid; place-items: center; color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; background: none; border-radius: 10px; color: var(--muted); font-weight: 500; text-align: left; width: 100%; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--faint); padding: 16px 12px 6px; text-transform: uppercase; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.trial { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); font-size: 13px; }
.trial b { display: block; font-family: var(--display); }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-family: var(--display); }
.me .who { min-width: 0; flex: 1; }
.me .who b, .me .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: var(--muted); }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 7px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.content { padding: 26px 28px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1 1 260px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 14px; border: 1px solid transparent; font-weight: 600; background: var(--brand); color: var(--on-brand); white-space: nowrap; }
.btn:hover { background: var(--brand-strong); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: none; color: var(--brand); padding: 7px 10px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: none; color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row .grow { flex: 1 1 200px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-family: var(--display); font-weight: 800; font-size: 28px; margin-top: 6px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; align-items: flex-start; }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.empty { text-align: center; padding: 44px 20px; }
.empty .ico { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty p { color: var(--muted); margin: 6px auto 16px; max-width: 420px; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* formulários */
label.f { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=search], select, textarea, input:not([type]) {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 150px; resize: vertical; line-height: 1.45; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13.5px; font-weight: 500; }
.chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:disabled + i { opacity: .45; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 6px 13px; font-weight: 500; font-size: 13.5px; }
.tabs button[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }

/* passo a passo de boas-vindas */
.onboard { padding: 20px; background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.steps { display: grid; gap: 10px; margin-top: 14px; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); flex: none; }
.step.done .num { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step.done b { color: var(--muted); text-decoration: line-through; }
.step .grow span { display: block; color: var(--muted); font-size: 13px; }

/* ofertas */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.offer { display: flex; flex-direction: column; overflow: hidden; }
.offer .thumb { height: 210px; background: #fff; color: #98a2b3; display: grid; place-items: center; position: relative; border-bottom: 1px solid var(--line); }
.offer .thumb img { max-width: 80%; max-height: 178px; object-fit: contain; }
.offer .thumb .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.offer .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.offer .title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.price { font-family: var(--display); font-weight: 800; font-size: 20px; }
.price s { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--faint); margin-left: 6px; }
.offer .foot { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.offer .foot .btn { flex: 1; }
.linkline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.linkline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* listas */
.list > .item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list > .item:first-child { border-top: 0; }
.item .grow { flex: 1 1 240px; min-width: 0; }
.item .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.icon-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }

/* pré-visualização estilo WhatsApp */
.phone { background: var(--chat-bg); border-radius: var(--radius); padding: 18px 14px; border: 1px solid var(--line); }
.phone .head { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.bubble { background: var(--bubble); color: var(--bubble-text); border-radius: 10px 10px 10px 2px; padding: 8px 10px 6px; max-width: 320px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.bubble img { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.bubble .time { display: block; text-align: right; font-size: 11px; opacity: .6; margin-top: 2px; }
.bubble a { color: #027eb5; }
.bubble.compact { max-width: none; font-size: 13px; max-height: 120px; overflow: hidden; }

/* assistente e modal */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .55); display: grid; place-items: center; padding: 18px; z-index: 20; overflow: auto; }
.modal { background: var(--surface); border-radius: 18px; width: min(680px, 100%); box-shadow: var(--shadow-lg); max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); }
.modal header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal header .grow { flex: 1; }
.modal .mbody { padding: 20px; overflow: auto; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.stepper { display: flex; gap: 6px; padding: 14px 20px 0; flex-wrap: wrap; }
.stepper span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.stepper span i { font-style: normal; width: 19px; height: 19px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 11px; }
.stepper span.on { background: var(--brand); color: var(--on-brand); }
.stepper span.on i { background: rgba(255,255,255,.25); }
.stepper span.past { color: var(--ok); background: var(--ok-soft); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--line); width: fit-content; }

/* entrada */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .hero { background: linear-gradient(150deg, #1e1b4b, #312e81 55%, #166534); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .hero h1 { font-size: 38px; line-height: 1.12; max-width: 460px; }
.auth .hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 440px; }
.auth .hero li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.88); }
.auth .hero li svg { color: #86efac; margin-top: 2px; }
.auth .form { display: grid; place-items: center; padding: 32px; }
.auth .box { width: min(400px, 100%); }
.auth .box h2 { font-size: 24px; font-weight: 800; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 11px 18px; border-radius: 12px; max-width: 92vw; display: none; z-index: 40; box-shadow: var(--shadow-lg); font-weight: 500; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); z-index: 10; overflow-x: auto; }
  .sidebar .logo, .sidebar .nav-label, .sidebar .side-foot, .nav .count { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav button { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 10px; min-width: 68px; align-items: center; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 96px; }
  .split { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth .hero { display: none; }
  #toast { bottom: 84px; }
  .mobile-only { display: inline-flex !important; }
}
.mobile-only { display: none; }
