/* Painel da loja — roxo e preto, cantos arredondados. Paleta documentada no CLAUDE.md §7.6. */

:root {
  color-scheme: dark;

  --bg: #06040b;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --chart-surface: #120d1c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);

  --text: #f3effb;
  --text-2: #bfb7d2;
  --muted: #8d85a4;

  --violet: #9b6cf7;
  --violet-hi: #b794ff;
  --violet-lo: #6d28d9;
  --violet-wash: rgba(155, 108, 247, 0.14);
  --grad-primary: linear-gradient(135deg, #b583ff 0%, #8b5cf6 45%, #6d28d9 100%);
  --grad-card: radial-gradient(130% 90% at 85% -10%, rgba(139, 92, 246, 0.24), transparent 58%),
               linear-gradient(180deg, rgba(24, 16, 39, 0.94), rgba(11, 8, 18, 0.96));
  --grad-border: linear-gradient(160deg, rgba(183, 148, 255, 0.42), rgba(255, 255, 255, 0.06) 38%,
               rgba(255, 255, 255, 0.04) 70%, rgba(124, 58, 237, 0.32));

  /* Estados: as mesmas cores dos ecrãs do bot no Discord (CLAUDE.md §7.2). */
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --info: #8b949e;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --pill: 999px;

  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
  --glow: 0 12px 34px -12px rgba(139, 92, 246, 0.75);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
html, .sheet-body, .table-wrap { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

/* Fundo: brilhos roxos a flutuar devagar */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.bg span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg span:nth-child(1) { width: 640px; height: 640px; right: -160px; top: -260px; background: #5b21b6; }
.bg span:nth-child(2) { width: 520px; height: 520px; left: -220px; bottom: -240px; background: #4c1d95; animation-duration: 32s; }
.bg span:nth-child(3) { width: 360px; height: 360px; left: 42%; top: 38%; background: #7c3aed; opacity: .16; animation-duration: 40s; }
.bg::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 70%); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 50px) scale(1.12); } }

img { display: block; max-width: 100%; }
a { color: var(--violet-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
::selection { background: rgba(155, 108, 247, 0.4); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ cartões (borda em gradiente) */

.card {
  position: relative; min-width: 0; padding: 22px; border-radius: var(--r-lg);
  border: 1px solid transparent;
  background: var(--grad-card) padding-box, var(--grad-border) border-box;
  box-shadow: var(--shadow);
}
.card--flat { background: linear-gradient(rgba(14, 10, 22, 0.7), rgba(14, 10, 22, 0.7)) padding-box, linear-gradient(var(--line), var(--line)) border-box; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.card-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.badge-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, rgba(183, 148, 255, 0.28), rgba(109, 40, 217, 0.18));
  box-shadow: inset 0 0 0 1px rgba(183, 148, 255, 0.25); color: var(--violet-hi); }
.badge-icon .icon { width: 17px; height: 17px; }
.badge-icon--ok { background: rgba(63, 185, 80, 0.14); box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.3); color: #6fdc80; }
.badge-icon--warn { background: rgba(210, 153, 34, 0.14); box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.3); color: #f0c869; }
.badge-icon--err { background: rgba(248, 81, 73, 0.12); box-shadow: inset 0 0 0 1px rgba(248, 81, 73, 0.3); color: #ff9a94; }

/* ------------------------------------------------------------------ botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--pill); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, opacity .15s, filter .15s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.22); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn--primary:hover { background: var(--grad-primary); filter: brightness(1.1); border-color: transparent; }
.btn--danger { background: rgba(248, 81, 73, 0.1); border-color: rgba(248, 81, 73, 0.35); color: #ff9a94; }
.btn--danger:hover { background: rgba(248, 81, 73, 0.18); border-color: rgba(248, 81, 73, 0.55); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--block { width: 100%; min-height: 54px; border-radius: 16px; font-size: 15px; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.is-done { background: rgba(63, 185, 80, 0.16); border-color: rgba(63, 185, 80, 0.45); color: #8ce79a; box-shadow: none; filter: none; }

/* ------------------------------------------------------------------ formulários */

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.label { font-size: 11.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.label .req { color: var(--violet-hi); }
.label .opt { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.hint--warn { color: #e8b84a; }
.hint--err { color: #ff8f88; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.textarea--mono { font-family: var(--mono); font-size: 13px; min-height: 160px; }
.input::placeholder, .textarea::placeholder { color: #6f6886; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(155, 108, 247, 0.7); box-shadow: 0 0 0 4px rgba(155, 108, 247, 0.16); background: rgba(255, 255, 255, 0.05);
}
.input.is-invalid { border-color: rgba(248, 81, 73, 0.6); }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bdb5d0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.select option { background: #160f22; color: var(--text); }

.amount {
  display: flex; align-items: baseline; gap: 10px; padding: 22px 22px 20px; border-radius: 20px;
  background: radial-gradient(120% 140% at 85% 0%, rgba(139, 92, 246, 0.24), transparent 60%), rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s;
}
.amount:focus-within { border-color: rgba(155, 108, 247, 0.7); box-shadow: 0 0 0 4px rgba(155, 108, 247, 0.16); }
.amount-prefix { font-size: 17px; font-weight: 600; color: var(--text-2); }
.amount-input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0;
  font-size: clamp(36px, 7vw, 50px); font-weight: 760; letter-spacing: -0.035em; line-height: 1.1; }
.amount-input:focus { outline: none; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: var(--pill);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text-2);
  font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.pill:hover { border-color: var(--line-strong); color: var(--text); }
.pill[aria-pressed="true"] { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.pill[disabled] { opacity: .35; cursor: not-allowed; }
.pill .count { font-size: 12px; padding: 1px 7px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.08); }
.pill[aria-pressed="true"] .count { background: rgba(255, 255, 255, 0.22); }

.dropzone {
  display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 18px; border-radius: var(--r);
  border: 1.5px dashed rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.02); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: rgba(155, 108, 247, 0.7); background: var(--violet-wash); }
.dropzone strong { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.dropzone span { font-size: 13px; color: var(--muted); }

.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.section-label { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--violet-hi); }
.section-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(155, 108, 247, 0.4), transparent); }

.summary { display: grid; gap: 10px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14.5px; color: var(--text-2); }
.summary-row strong { color: var(--text); font-weight: 650; text-align: right; }
.summary-row--total strong { font-size: 18px; color: var(--violet-hi); }
.summary-row .icon { width: 15px; height: 15px; color: var(--muted); }
.summary-row > span { display: inline-flex; align-items: center; gap: 8px; }

.dest { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.dest strong { color: var(--text); font-weight: 650; }
.dest > span { display: inline-flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ passos */

.steps { display: flex; align-items: center; gap: 12px; margin: 4px 0 22px; }
.step { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); font-size: 13px; font-weight: 700; }
.step-dot .icon { width: 15px; height: 15px; stroke-width: 3; }
.step.is-active { color: var(--text); }
.step.is-active .step-dot { background: #fff; color: #1a1028; border-color: #fff; }
.step.is-done .step-dot { background: var(--grad-primary); color: #fff; border-color: transparent; }
.step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line);
  background-image: linear-gradient(90deg, var(--violet) 0 var(--progress, 50%), transparent var(--progress, 50%)); }

/* ------------------------------------------------------------------ chips de estado */

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--text-2);
  background: color-mix(in srgb, var(--c, var(--info)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--info)) 30%, transparent); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--info)); }
.chip--ok { --c: var(--ok); }
.chip--warn { --c: var(--warn); }
.chip--err { --c: var(--err); }
.chip--info { --c: var(--info); }
.chip--live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--pill);
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; background: var(--violet-wash); color: var(--violet-hi); }

/* ------------------------------------------------------------------ layout */

.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(22, 14, 37, 0.78), rgba(8, 6, 14, 0.82));
  backdrop-filter: blur(16px); overflow-y: auto; scrollbar-width: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand img { width: 40px; height: 40px; border-radius: 13px; box-shadow: var(--glow); }
.brand-name { font-weight: 750; letter-spacing: -0.015em; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }

.cta { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; color: #fff; font-weight: 650;
  background: var(--grad-primary); box-shadow: var(--glow); text-decoration: none; transition: filter .15s, transform .08s; }
.cta:hover { filter: brightness(1.1); text-decoration: none; }
.cta:active { transform: translateY(1px); }
.cta small { display: block; font-weight: 500; font-size: 12px; opacity: .8; }
.cta .badge-icon { background: rgba(255, 255, 255, 0.18); box-shadow: none; color: #fff; }

.nav { display: grid; gap: 2px; }
.nav-group { margin: 12px 0 6px; padding: 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6c6583; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  color: var(--text-2); font-weight: 550; font-size: 14.5px; text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: #fff; background: linear-gradient(90deg, rgba(155, 108, 247, 0.26), rgba(109, 40, 217, 0.08)); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--violet-hi); box-shadow: 0 0 12px var(--violet); }
.nav a[aria-current="page"] .icon { color: var(--violet-hi); }
.nav .nav-count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: var(--pill);
  background: rgba(210, 153, 34, 0.18); color: #f0c869; }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); }
.me img { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
.me-name { font-weight: 600; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.me-role::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.me-text { min-width: 0; flex: 1; }

.main { min-width: 0; padding: 30px clamp(16px, 3.4vw, 44px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { margin: 0; font-size: clamp(25px, 3vw, 32px); font-weight: 780; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 30%, #cdbdf5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.mobile-bar { display: none; }
.tabbar { display: none; }

.view { display: grid; gap: 20px; }
.view.is-loading { opacity: .55; transition: opacity .2s; }
.view.is-entering > * { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.view.is-entering > *:nth-child(2) { animation-delay: .04s; }
.view.is-entering > *:nth-child(3) { animation-delay: .08s; }
.view.is-entering > *:nth-child(4) { animation-delay: .12s; }
.view.is-entering > *:nth-child(5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.grid-kpi { display: grid; grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 16px; }
.grid-kpi .tile--hero { grid-row: span 2; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-pix { display: grid; grid-template-columns: minmax(0, 580px) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 20px; }
.flip { transform: rotate(180deg); color: var(--muted); }
.cta[aria-current="page"] { box-shadow: var(--glow), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
.stack--sm { gap: 10px; }

/* ------------------------------------------------------------------ números */

.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 128px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-label { font-size: 13px; color: var(--text-2); font-weight: 550; }
.tile-value { font-size: 27px; font-weight: 760; letter-spacing: -0.025em; line-height: 1.1; }
.tile-meta { font-size: 13px; color: var(--muted); }
.tile--hero { justify-content: flex-start; background: radial-gradient(120% 100% at 100% 0%, rgba(167, 120, 255, 0.38), transparent 60%),
  linear-gradient(160deg, rgba(56, 30, 98, 0.95), rgba(14, 9, 24, 0.97)) padding-box, var(--grad-border) border-box; }
.tile--hero .tile-value { font-size: clamp(40px, 4.6vw, 56px); letter-spacing: -0.04em; }
.tile--hero .spark { margin-top: auto; }
.spark { display: block; width: 100%; height: 70px; overflow: visible; }
.spark path.line { fill: none; stroke: var(--violet-hi); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: url(#spark-fill); }
.spark circle { fill: var(--violet-hi); stroke: #1c1230; stroke-width: 2; }

/* ------------------------------------------------------------------ gráfico */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--violet); transition: fill .12s; pointer-events: none; }
.chart .bar.is-hot { fill: var(--violet-hi); }
.chart .hit { fill: transparent; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible { fill: rgba(255, 255, 255, 0.04); }
.tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 160px; padding: 10px 12px; border-radius: 12px;
  background: #1b1329; border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); font-size: 13px;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; }
.tooltip.is-on { opacity: 1; }
.tooltip strong { display: block; font-size: 16px; font-weight: 700; }
.tooltip span { display: block; color: var(--muted); }
.empty-chart { display: grid; place-items: center; height: 240px; color: var(--muted); font-size: 14px; }

.meter { height: 6px; border-radius: 6px; background: rgba(155, 108, 247, 0.16); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--violet); }
.rank { display: grid; gap: 14px; }
.rank-row { display: grid; gap: 7px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.rank-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-top strong { white-space: nowrap; }

/* ------------------------------------------------------------------ listas e tabelas */

.list { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 6px;
  border: 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; background: none; width: 100%;
  text-align: left; cursor: pointer; border-radius: 0; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: rgba(255, 255, 255, 0.025); text-decoration: none; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-end { text-align: right; display: grid; gap: 4px; justify-items: end; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 0 12px 12px; white-space: nowrap; }
.table td { padding: 14px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table tbody tr:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: -2px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700;
  background: linear-gradient(145deg, #3b2370, #1c1230); color: var(--violet-hi); box-shadow: inset 0 0 0 1px rgba(183, 148, 255, 0.25); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty > .icon { width: 42px; height: 42px; padding: 10px; border-radius: 14px; background: var(--violet-wash); color: var(--violet-hi); }
.empty strong { color: var(--text); font-size: 16px; }

/* ------------------------------------------------------------------ produtos */

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer; color: inherit; font: inherit;
  transition: transform .18s, box-shadow .18s; }
.product:hover { transform: translateY(-3px); box-shadow: 0 30px 70px -30px rgba(124, 58, 237, 0.7); }
.product-media img { transition: transform .35s ease; }
.product:hover .product-media img { transform: scale(1.04); }
.media-chip { position: absolute; top: 10px; left: 10px; z-index: 1; backdrop-filter: blur(8px); background: rgba(10, 6, 18, 0.72); }
.product-media { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(80% 120% at 30% 0%, rgba(167, 120, 255, 0.45), transparent 60%), linear-gradient(135deg, #2a1748, #120c1d); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-initial { font-size: 42px; font-weight: 800; color: rgba(255, 255, 255, 0.9); letter-spacing: -0.04em; text-shadow: 0 6px 30px rgba(139, 92, 246, 0.8); }
.product-body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.product-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.product-name { font-weight: 650; font-size: 15.5px; line-height: 1.3; }
.product-price { font-size: 22px; font-weight: 760; letter-spacing: -0.02em; }
.stock-bar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.06); gap: 2px; }
.stock-bar i { display: block; height: 100%; }
.stock-bar .s-available { background: var(--violet); }
.stock-bar .s-reserved { background: var(--warn); }
.stock-bar .s-sold { background: rgba(255, 255, 255, 0.28); }
.stock-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.stock-legend b { color: var(--text); font-weight: 650; }
.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; min-height: 42px; border-radius: var(--pill); width: min(300px, 100%); }

/* ------------------------------------------------------------------ Pix */

.pix-card { padding: 26px; }
.pix-result { display: grid; gap: 18px; }
.qr-box { position: relative; width: min(264px, 100%); margin: 4px auto 0; padding: 14px; border-radius: 24px; background: #fff;
  box-shadow: 0 0 0 6px rgba(155, 108, 247, 0.18), 0 24px 60px -20px rgba(139, 92, 246, 0.8); }
.qr-box img { width: 100%; height: auto; border-radius: 10px; image-rendering: pixelated; }
.qr-box.is-dim img { opacity: .12; filter: blur(2px); }
.qr-box .qr-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #1a1028; font-weight: 700; padding: 20px; }
.pix-status { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text-2); font-size: 13.5px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; padding: 6px 6px 6px 14px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.copy-field code { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.payer-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 13px; color: var(--text-2);
  background: var(--violet-wash); border: 1px solid rgba(155, 108, 247, 0.3); }
.payer-note .icon { color: var(--violet-hi); margin-top: 1px; width: 16px; height: 16px; }
.success-burst { position: relative; width: 92px; height: 92px; margin: 6px auto 4px; display: grid; place-items: center; }
.success-burst::before, .success-burst::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(63, 185, 80, 0.5);
  animation: ring 1.8s ease-out infinite; }
.success-burst::after { animation-delay: .6s; }
.success-burst span { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #4ade80, #16a34a); box-shadow: 0 16px 40px -10px rgba(63, 185, 80, 0.8); animation: popin .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.success-burst .icon { width: 34px; height: 34px; color: #fff; stroke-width: 3; }
@keyframes ring { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes popin { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.big-amount { text-align: center; font-size: 40px; font-weight: 780; letter-spacing: -0.035em; line-height: 1.1; }
.center { text-align: center; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tips li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }

/* ------------------------------------------------------------------ imagem do produto */

.image-picker { display: grid; gap: 10px; }
.dropzone--image { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; gap: 16px; padding: 14px; place-items: center start; }
.dropzone-text { display: grid; gap: 3px; }
.img-preview { width: 96px; height: 96px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; flex: none;
  background: radial-gradient(80% 120% at 30% 0%, rgba(167, 120, 255, 0.4), transparent 60%), #1a1129;
  box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .icon { width: 28px; height: 28px; opacity: .7; }
.created-image { width: 120px; height: 120px; object-fit: cover; border-radius: 20px; margin: 0 auto 10px; box-shadow: var(--glow); }

/* ------------------------------------------------------------------ procura rápida */

.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.search-trigger span { flex: 1; text-align: left; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 7px; color: var(--text-2);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong); border-bottom-width: 2px; white-space: nowrap; }
dialog.sheet.palette { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; margin-bottom: auto; }
.palette-search .input { width: 100%; min-height: 52px; font-size: 16px; border-radius: 16px; }
.palette-list { margin-top: 12px; }
.palette-list .list-row:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: -2px; border-radius: 12px; }
.palette-hint { margin-top: 12px; text-align: center; }

/* ------------------------------------------------------------------ diálogos */

dialog.sheet {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; color: var(--text);
  border: 1px solid transparent; border-radius: var(--r-xl);
  background: var(--grad-card) padding-box, var(--grad-border) border-box; box-shadow: var(--shadow); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: pop .2s ease-out; }
dialog.sheet::backdrop { background: rgba(4, 2, 9, 0.72); backdrop-filter: blur(8px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 6px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.sheet-head-text { flex: 1; min-width: 0; }
.sheet-body { padding: 16px 22px 24px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; }
.sheet-thumb { width: 44px; height: 44px; aspect-ratio: auto; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: none; }
.sheet-thumb .product-initial { font-size: 20px; }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { flex: 1; min-height: 36px; border: 0; border-radius: var(--pill); background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.kv--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv > div { padding: 12px 14px; border-radius: var(--r); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); min-width: 0; }
.kv dt { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.kv dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 0 16px 28px; color: var(--muted); font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li.is-done { color: var(--text); }
.timeline li.is-done::before { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 10px var(--violet); }
.timeline time { display: block; font-size: 12.5px; color: var(--muted); }

.danger-zone { border: 1px solid rgba(248, 81, 73, 0.28); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 14px; }
.danger-zone h3 { margin: 0; font-size: 14px; color: #ff9a94; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.danger-row p { margin: 0; font-size: 13.5px; color: var(--text-2); max-width: 340px; }

.success-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 14px; background: var(--grad-primary); box-shadow: var(--glow); }
.success-mark .icon { width: 30px; height: 30px; color: #fff; stroke-width: 2.6; }

/* ------------------------------------------------------------------ avisos */

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 100; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: #1a1228;
  border: 1px solid var(--line-strong); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); font-size: 14px; animation: pop .18s ease-out; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--c, var(--violet)); }
.toast-text { flex: 1; }
.toast-close { flex: none; width: 26px; height: 26px; margin: -3px -6px -3px 0; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; }
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast-close .icon { width: 15px; height: 15px; }
.toast--ok { --c: var(--ok); }
.toast--err { --c: var(--err); }
.toast--warn { --c: var(--warn); }

.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); font-size: 13.5px;
  background: rgba(210, 153, 34, 0.1); border: 1px solid rgba(210, 153, 34, 0.35); color: #f0c869; }
.notice .icon { flex: none; }
.notice--info { background: var(--violet-wash); border-color: rgba(155, 108, 247, 0.35); color: var(--text-2); }

.status-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--info));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--info)) 20%, transparent); }

.audit-row { display: flex; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.audit-row:first-child { border-top: 0; }
.audit-text { min-width: 0; flex: 1; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.facts .icon { color: var(--violet-hi); margin-top: 2px; width: 16px; height: 16px; }

.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ login */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(440px, 100%); padding: 36px 30px 28px; border-radius: var(--r-xl); text-align: center; }
.login-card .brand-mark { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 22px; box-shadow: var(--glow); }
.login-card h1 { margin: 0; font-size: 27px; font-weight: 780; letter-spacing: -0.03em; }
.login-card .lead { margin: 8px 0 26px; color: var(--text-2); }
.login-notice { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; text-align: left; }
.login-notice--erro { background: rgba(248, 81, 73, 0.1); border: 1px solid rgba(248, 81, 73, 0.35); color: #ffb3ae; }
.login-notice--ok { background: var(--violet-wash); border: 1px solid rgba(155, 108, 247, 0.35); color: var(--text-2); }
.login-facts { list-style: none; margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; text-align: left; }
.login-facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.login-facts .icon { color: var(--violet-hi); margin-top: 2px; width: 16px; height: 16px; }

/* ------------------------------------------------------------------ responsivo */

@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-kpi .tile--hero { grid-column: 1 / -1; grid-row: auto; }
  .grid-2, .grid-pix { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20;
    padding: 12px 16px; background: rgba(9, 6, 15, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand img { width: 34px; height: 34px; border-radius: 11px; }
  .tabbar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
    align-items: end; gap: 2px; padding: 6px; border-radius: 24px; background: rgba(18, 12, 29, 0.92);
    border: 1px solid var(--line-strong); backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 16px; border: 0; background: none;
    color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .tabbar a[aria-current="page"] { color: #fff; background: rgba(155, 108, 247, 0.22); }
  .tabbar a[aria-current="page"] .icon { color: var(--violet-hi); }
  .tabbar .tab-fab, .tabbar .tab-fab[aria-current="page"] { color: #fff; background: none; }
  .tabbar .tab-fab .fab { width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center;
    background: var(--grad-primary); box-shadow: var(--glow), 0 0 0 5px rgba(12, 8, 20, 0.95); }
  .tabbar .tab-fab .fab .icon { width: 22px; height: 22px; }
  .main { padding: 20px 16px 120px; }
  .page-head .toolbar { width: 100%; }
  .page-head .search { flex: 1 1 200px; }
  .page-head .search .input { width: 100%; }
  .toasts { bottom: 100px; right: 16px; }
  .hide-mobile { display: none; }
}

@media (max-width: 560px) {
  .grid-kpi { gap: 12px; }
  .tile { min-height: 0; padding: 16px; }
  .tile-value { font-size: 21px; }
  .tile .badge-icon { width: 28px; height: 28px; border-radius: 9px; }
  .card { padding: 18px; }
  .pix-card { padding: 20px 18px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .sheet-head { padding: 18px 16px 4px; }
  .sheet-body { padding: 14px 16px 22px; }
  .table .hide-sm { display: none; }
  .big-amount { font-size: 34px; }
  /* Tabelas viram cartões no telemóvel: sem deslizar para o lado. */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; gap: 4px 12px;
    padding: 12px 6px; border-top: 1px solid var(--line); }
  .table tbody tr:first-child { border-top: 0; }
  .table td { display: block; grid-column: 1; padding: 0; border: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .table td.num, .table td:last-child { grid-column: 2; text-align: right; justify-self: end; }
  .table td.hide-sm { display: none; }
  .dropzone--image { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .dropzone-text strong { justify-content: center; }
  dialog.sheet.palette { margin: auto 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
