/* Portal Digital Dreams — paleta oficial: #53e5fd ciano, #5f2ff8 violeta, #b000e6 roxo, #0a0a0a, #fafafa */
:root {
  --cyan: #53e5fd;
  --violet: #5f2ff8;
  --purple: #b000e6;
  --ink: #0a0a0a;
  --paper: #fafafa;

  --bg: #eeedf7;
  --surface: #ffffff;
  --surface-2: #f6f5fc;
  --line: #e6e4f2;
  --line-strong: #d7d3ea;
  --text: #15131f;
  --muted: #6c6884;
  --soft: #9a96b0;

  --grad: linear-gradient(120deg, var(--purple) 0%, var(--violet) 50%, var(--cyan) 100%);
  --tint-mapear: linear-gradient(120deg, #f4e1fb 0%, #ece1fd 100%);
  --tint-armar: linear-gradient(120deg, #e9e3fe 0%, #e1e4fd 100%);
  --tint-pilotar: linear-gradient(120deg, #e1ecfd 0%, #dcf7fd 100%);
  --c-mapear: #9a00c9;
  --c-armar: #5f2ff8;
  --c-pilotar: #0a8fb0;

  --ok: #17915a;
  --ok-bg: #e3f6ec;
  --warn: #a56300;
  --warn-bg: #fdf1dc;
  --bad: #c3264b;
  --bad-bg: #fde6ec;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 1px 2px rgba(25, 18, 60, .04), 0 8px 28px rgba(25, 18, 60, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand img { height: 30px; width: auto; }
.brand b { font-weight: 800; letter-spacing: -.01em; font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; margin-top: -2px; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav a:hover { background: #ecebf6; color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav .ico { width: 20px; height: 20px; display: inline-grid; place-items: center; color: currentColor; }
.nav .count { margin-left: auto; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.sidebar-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.mapa-mini { margin: 8px 6px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.mapa-mini .pix { font-family: var(--pixel); font-size: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .06em; }
.mapa-mini p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.user-card { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; }
.user-card:hover { background: #ecebf6; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; background: var(--grad); flex: none; }
.user-card .meta { min-width: 0; }
.user-card .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .meta span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 700; }
.topbar .sep { width: 1px; height: 22px; background: var(--line-strong); }
.topbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 220px; }
.search input { border: 0; background: transparent; outline: 0; width: 100%; padding: 6px 0; }
.mobile-bar { display: none; }

/* ---------- elementos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #24222e; }
.btn.grad { background: var(--grad); color: #fff; border: 0; }
.btn.grad:hover { filter: brightness(1.05); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(230, 228, 242, .7); }
.card-pad { padding: 22px 24px; }
.card h2, .card h3 { margin: 0; letter-spacing: -.01em; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.etapa-tag { font-family: var(--pixel); font-size: 11px; letter-spacing: .06em; padding: 3px 9px; border-radius: 7px; color: #fff; display: inline-block; line-height: 1.4; }
.etapa-tag.mapear { background: var(--c-mapear); }
.etapa-tag.armar { background: var(--c-armar); }
.etapa-tag.pilotar { background: var(--c-pilotar); }

.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.price { font-weight: 800; letter-spacing: -.02em; }
.price small { font-weight: 600; color: var(--muted); font-size: .62em; margin-left: 2px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(95, 47, 248, .12); }
.input.sm { height: 36px; padding: 0 10px; border-radius: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- stats MAPA ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; text-align: left; transition: transform .15s ease, border-color .15s ease;
}
.stat:hover { transform: translateY(-1px); }
.stat.active { border-color: currentColor; }
.stat.mapear { background: var(--tint-mapear); color: var(--c-mapear); }
.stat.armar { background: var(--tint-armar); color: var(--c-armar); }
.stat.pilotar { background: var(--tint-pilotar); color: var(--c-pilotar); }
.stat .letter { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--pixel); font-size: 20px; flex: none; }
.stat .t { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .v { color: var(--text); font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- cards de produto ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.pcard .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard h3 { font-size: 16.5px; line-height: 1.3; }
.pcard p { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pcard .price { font-size: 20px; }
.pcard .actions { display: flex; gap: 8px; }
.pcard select.input { height: 36px; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; white-space: nowrap; }

/* ---------- página de produto ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.product-head { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.product-head h1 { margin: 6px 0 10px; font-size: 30px; letter-spacing: -.025em; line-height: 1.15; }
.buybox { position: sticky; top: 20px; padding: 22px; display: grid; gap: 14px; }
.buybox .price { font-size: 30px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 20px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 12px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--violet); }
.prose { display: grid; gap: 14px; }
.prose .block { padding: 20px 22px; }
.prose h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.prose .txt { white-space: pre-line; color: #2a2738; }
.prose .txt.empty { color: var(--soft); font-style: italic; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.spiced { display: grid; gap: 10px; }
.spiced .row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.spiced .row:first-child { border-top: 0; }
.spiced .k { font-weight: 700; }
.spiced .k small { display: block; color: var(--muted); font-weight: 500; }
.spiced .v div + div { margin-top: 6px; }
.spiced .v b { color: var(--muted); font-weight: 600; }

details.phase { border-top: 1px solid var(--line); }
details.phase:first-of-type { border-top: 0; }
details.phase summary { list-style: none; cursor: pointer; padding: 16px 22px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
details.phase summary::-webkit-details-marker { display: none; }
details.phase summary::before { content: "›"; display: inline-block; transition: transform .15s ease; color: var(--muted); font-size: 18px; }
details.phase[open] summary::before { transform: rotate(90deg); }
details.phase summary .chip { margin-left: auto; }
details.phase .tbl td, details.phase .tbl th { padding: 10px 22px; }

.mat-list { display: grid; gap: 8px; }
.mat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.mat .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- carrinho ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.totals { position: sticky; top: 20px; padding: 22px; display: grid; gap: 12px; }
.totals .line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.totals .line.big { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.totals .line.big small { font-size: 12px; color: var(--muted); font-weight: 600; }
.totals hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 4px 0; width: 100%; }
.cart-item { display: grid; grid-template-columns: 1fr 76px 96px 130px 120px 36px; gap: 10px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.cart-item:first-child { border-top: 0; }
.cart-item .nm b { display: block; line-height: 1.3; }
.cart-item .nm span { font-size: 12.5px; color: var(--muted); }
.cart-head { display: grid; grid-template-columns: 1fr 76px 96px 130px 120px 36px; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.pct { position: relative; }
.pct input { padding-right: 24px; }
.pct::after { content: "%"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state img { width: 110px; opacity: .9; margin-bottom: 10px; }

.result-box { display: grid; gap: 12px; }
.md-view { padding: 22px 26px; max-height: 60vh; overflow: auto; }
.md-view table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 10px 0; }
.md-view th, .md-view td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.md-view th { background: var(--surface-2); }
.md-view h1 { font-size: 22px; } .md-view h2 { font-size: 18px; } .md-view h3 { font-size: 16px; }
.md-view h4, .md-view h5, .md-view h6 { font-size: 14.5px; }
.md-view code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md-view hr { border: 0; border-top: 1px solid var(--line); }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 12, 35, .35); backdrop-filter: blur(2px); animation: fade .2s ease; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(880px, 100%); background: var(--surface); display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(20, 10, 60, .18); animation: slide .25s cubic-bezier(.2, .8, .2, 1); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.01em; }
.drawer-body { overflow: auto; padding: 6px 26px 40px; }
.drawer-body.md-view { max-height: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 600; font-size: 13.5px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: fade .2s ease; }
.toast.err { background: var(--bad); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: #050407 url("/assets/fundo-login.jpg") center right / cover no-repeat; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,4,7,.78) 0%, rgba(5,4,7,.35) 55%, rgba(5,4,7,0) 100%), linear-gradient(180deg, rgba(5,4,7,.35) 0%, rgba(5,4,7,0) 30%); }
.auth-art .steps span { background: rgba(10,10,10,.35); backdrop-filter: blur(6px); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo { width: 190px; }
.auth-art h2 { font-size: 40px; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; max-width: 520px; }
.auth-art .pix { font-family: var(--pixel); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #c9c6d8; max-width: 460px; margin: 0; }
.auth-art .steps { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.auth-art .steps span { font-family: var(--pixel); font-size: 12px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #e9e6ff; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); padding: 34px; display: grid; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.auth-card .switch { text-align: center; color: var(--muted); font-size: 13.5px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; }
.alert.err { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: #ece7ff; color: #3f22b8; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .product-head, .cart-layout { grid-template-columns: 1fr; }
  .buybox, .totals { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(20,10,60,.15); }
  .shell.nav-open .sidebar { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mobile-bar img { height: 26px; }
  .main { padding: 18px 16px 50px; }
  .stats { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: 220px; }
  .auth-art h2 { font-size: 28px; }
  .cols-2, .grid-2 { grid-template-columns: 1fr; }
  .cart-head { display: none; }
  .cart-item { grid-template-columns: 1fr 1fr; }
  .cart-item .nm { grid-column: 1 / -1; }
  .spiced .row { grid-template-columns: 1fr; gap: 4px; }
  .topbar h1 { font-size: 22px; }
}
