/* =========================================================
   Nyx Store — Design system (base)
   Dono: Agente A. Tokens, shell e componentes compartilhados.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0a0a;
  --bg-2: #0f0d0d;
  --surface: #151313;
  --surface-2: #1c1918;
  --surface-3: #24201f;
  --border: rgba(255, 236, 230, 0.07);
  --border-2: rgba(255, 236, 230, 0.13);

  --text: #efeae8;
  --text-2: #c7bfbc;
  --muted: #8f8582;

  --primary: #e5332a;
  --primary-2: #f0625a;
  --primary-3: #f8a29c;
  --primary-soft: rgba(229, 51, 42, 0.14);
  --primary-glow: rgba(229, 51, 42, 0.45);

  --green: #34d399;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --teal: #2dd4bf;
  --pink: #f472b6;
  --red: #f87171;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.6);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Syne', 'Inter', system-ui, sans-serif;

  /* internos */
  --sb-w: 264px;
  --sb-w-collapsed: 76px;
  --tb-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 60% -180px, rgba(229, 51, 42, 0.13), transparent 70%),
    radial-gradient(700px 400px at 100% 0, rgba(248, 162, 156, 0.04), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--primary-3); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { color: var(--text-2); }
small { font-size: .8em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
table { border-collapse: collapse; width: 100%; }

::selection { background: rgba(229, 51, 42, 0.45); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: #2c2422 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2220; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a2f2d; }

/* ícones */
svg.ic { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* =========================================================
   Shell
   ========================================================= */
.app { min-height: 100vh; min-height: 100dvh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sb-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #100d0d 0%, var(--bg-2) 100%);
  border-right: 1px solid var(--border);
  transition: width .25s var(--ease), transform .3s var(--ease);
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  min-height: var(--tb-h);
  flex-shrink: 0;
}
.sb-logo {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 18px;
  background: linear-gradient(135deg, #f0625a 0%, #e5332a 45%, #c1241c 100%);
  box-shadow: 0 6px 18px -6px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.sb-brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-brand-txt strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.sb-brand-txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 12px;
}
.sb-sec {
  padding: 16px 12px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .8;
  white-space: nowrap;
}
.sb-sec:first-child { padding-top: 6px; }

.sb-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sb-item .ic { font-size: 17px; color: var(--muted); transition: color .15s; }
.sb-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.sb-item:hover .ic { color: var(--text-2); }
.sb-item.active {
  background: linear-gradient(90deg, rgba(229, 51, 42, .20), rgba(229, 51, 42, .08));
  color: var(--primary-3);
}
.sb-item.active .ic { color: var(--primary-2); }
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-2);
  box-shadow: 0 0 10px var(--primary-glow);
}
.sb-badge {
  font-style: normal;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 99px;
  font-size: 11px; font-weight: 700;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg-2);
}

.sb-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  border-top: 1px solid var(--border);
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  min-width: 0;
}
.sb-user-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-user-txt strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* avatar */
.avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #f0625a, #c1241c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Main + topbar ---------- */
.main {
  margin-left: var(--sb-w);
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s var(--ease);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--tb-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  background: rgba(11, 10, 10, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.crumbs {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .ic { font-size: 13px; opacity: .6; }
.crumbs strong { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

.saldo-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border-radius: 99px;
  background: var(--primary-soft);
  border: 1px solid rgba(229, 51, 42, .3);
  color: var(--primary-3);
  font-weight: 600;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.saldo-pill:hover { background: rgba(229, 51, 42, .22); border-color: rgba(240, 98, 90, .5); color: #fff; }
.saldo-pill i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 0 0 0 var(--primary-glow);
  animation: nx-pulse 2s infinite;
}
@keyframes nx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 98, 90, .6); }
  70% { box-shadow: 0 0 0 7px rgba(240, 98, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 98, 90, 0); }
}

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 18px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border); color: var(--text); }
.dot-badge {
  position: absolute;
  top: 3px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-style: normal;
  font-size: 10px; font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--bg);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 12px 0 5px;
  margin-left: 4px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  max-width: 240px;
}
.user-chip span { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.only-mobile { display: none !important; }

/* ---------- View ---------- */
.view {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 32px 56px;
}
.page { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.page-enter { animation: nx-enter .32s var(--ease) both; }
@keyframes nx-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Overlay ---------- */
.overlay {
  position: fixed; inset: 0;
  z-index: 40;
  background: rgba(5, 4, 4, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

/* ---------- Sidebar recolhida (desktop) ---------- */
@media (min-width: 960px) {
  body.sb-collapsed .sidebar { width: var(--sb-w-collapsed); }
  body.sb-collapsed .main { margin-left: var(--sb-w-collapsed); }
  body.sb-collapsed .sb-brand { padding: 18px 0 14px; justify-content: center; }
  body.sb-collapsed .sb-brand-txt,
  body.sb-collapsed .sb-item span,
  body.sb-collapsed .sb-user-txt,
  body.sb-collapsed .sb-foot .btn span { display: none; }
  body.sb-collapsed .sb-nav { padding: 4px 14px 12px; }
  body.sb-collapsed .sb-sec {
    height: 1px; padding: 0; margin: 12px 6px;
    font-size: 0; background: var(--border); opacity: 1;
  }
  body.sb-collapsed .sb-sec:first-child { margin-top: 4px; }
  body.sb-collapsed .sb-item { justify-content: center; padding: 0; }
  body.sb-collapsed .sb-item.active::before { left: -14px; }
  body.sb-collapsed .sb-badge {
    position: absolute; top: 3px; right: 3px;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.5px;
  }
  body.sb-collapsed .sb-foot { padding: 12px 14px 14px; align-items: center; }
  body.sb-collapsed .sb-foot .btn { width: 44px; height: 40px; padding: 0; }
  body.sb-collapsed .sb-user { padding: 0; margin-top: 4px; background: none; border: 0; justify-content: center; }
  body.sb-collapsed [data-action="sb-collapse"] .ic { transform: rotate(180deg); }
  [data-action="sb-collapse"] .ic { transition: transform .25s var(--ease); }
}

/* ---------- Mobile ---------- */
@media (max-width: 959.98px) {
  .sidebar {
    width: min(84vw, 290px);
    transform: translateX(-100%);
    box-shadow: none;
  }
  body.sb-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .55); }
  body.sb-open .overlay { opacity: 1; visibility: visible; }
  body.sb-open { overflow: hidden; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; gap: 6px; }
  .only-mobile { display: inline-grid !important; }
  .only-desktop { display: none !important; }
  .view { padding: 24px 20px 48px; }
  .user-chip { padding: 0; border: 0; background: none; margin-left: 0; }
  .user-chip span { display: none; }
}

@media (max-width: 640px) {
  :root { --tb-h: 58px; }
  body { font-size: 14px; }
  h1 { font-size: 1.4rem; }
  .view { padding: 18px 16px 40px; }
  .page { gap: 18px; }
  .topbar { padding: 0 10px; }
  .crumbs > a, .crumbs > .ic { display: none; }
  .tb-right { gap: 2px; }
  .saldo-pill { height: 34px; padding: 0 11px 0 10px; font-size: 13px; }
  .icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 380px) {
  .user-chip { display: none; }
  .saldo-pill { padding: 0 9px; gap: 6px; }
}

/* =========================================================
   Componentes
   ========================================================= */

/* ---------- Page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head > :first-child { min-width: 0; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Botões ---------- */
.btn {
  --b-bg: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--b-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .2s, transform .1s, filter .15s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(240, 98, 90, .32); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn .ic { font-size: 16px; }

.btn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #ec4a40 0%, #e5332a 50%, #b51d16 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 4px 14px -6px var(--primary-glow);
}
.btn-primary:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #f0625a 0%, #e5332a 50%, #c8261e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 26px -6px var(--primary-glow), 0 0 0 1px rgba(248, 162, 156, .25);
}

.btn-outline { background: transparent; border-color: rgba(229, 51, 42, .45); color: var(--primary-3); }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary-2); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: transparent; color: var(--text); }

.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .55); color: #fecaca; }

.btn-success { background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .32); color: #6ee7b7; }
.btn-success:hover { background: rgba(52, 211, 153, .22); border-color: rgba(52, 211, 153, .55); color: #a7f3d0; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .ic { font-size: 14px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }

.btn[disabled], .btn.disabled, .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  filter: saturate(.6);
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-head p { color: var(--muted); font-size: 13px; }
.card-body { padding: 20px; }
.card > .card-body:only-child { padding: 20px; }
.card.glow {
  border-color: rgba(229, 51, 42, .45);
  box-shadow: 0 0 0 1px rgba(229, 51, 42, .15), 0 0 32px -8px var(--primary-glow), var(--shadow);
  background: radial-gradient(120% 80% at 50% -20%, rgba(229, 51, 42, .12), transparent 60%), var(--surface);
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.stat {
  --c: var(--primary-2);
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s var(--ease);
}
.stat:hover { border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-ic {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 17px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.stat-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------- Form ---------- */
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #7a6f6c; }
.input:hover { border-color: rgba(240, 98, 90, .32); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(229, 51, 42, .22); background: #100d0d; }
select.input {
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a85a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select.input option { background: var(--surface-2); color: var(--text); }
.input:disabled { opacity: .5; cursor: not-allowed; }

.field { position: relative; display: block; width: 100%; }
.field > .ic {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: color .15s;
}
.field > .input { padding-left: 40px; }
.field:focus-within > .ic { color: var(--primary-2); }

.range {
  --p: 50%;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary) 0 var(--p), var(--surface-3) var(--p) 100%);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  accent-color: var(--primary);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 51, 42, .2), 0 2px 8px rgba(0, 0, 0, .4);
  transition: box-shadow .15s;
}
.range::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 51, 42, .2);
}
.range::-moz-range-progress { background: var(--primary); height: 6px; border-radius: 99px; }
.range::-moz-range-track { background: var(--surface-3); height: 6px; border-radius: 99px; }
.range:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(229, 51, 42, .25), 0 2px 8px rgba(0, 0, 0, .4); }
.range:focus-visible { outline-offset: 6px; }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip .ic { font-size: 14px; }
.chip:hover { background: var(--surface-2); color: var(--text); border-color: rgba(240, 98, 90, .32); }
.chip.active {
  background: var(--primary-soft);
  border-color: rgba(229, 51, 42, .55);
  color: var(--primary-3);
}

/* ---------- Tags ---------- */
.cat-ic {
  --c: var(--primary-2);
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  font-size: 18px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 24%, transparent);
}
.cat-ic.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.cat-ic.lg { width: 48px; height: 48px; border-radius: 13px; font-size: 23px; }

.lvl {
  --c: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.lvl-lendario {
  color: #1a1204;
  border-color: rgba(253, 230, 138, .6);
  background: linear-gradient(110deg, #f59e0b 0%, #fbbf24 30%, #fde68a 50%, #fbbf24 70%, #f59e0b 100%);
  background-size: 220% 100%;
  box-shadow: 0 0 12px -2px rgba(251, 191, 36, .55);
  animation: nx-shine 3.2s linear infinite;
}
@keyframes nx-shine {
  from { background-position: 110% 0; }
  to { background-position: -110% 0; }
}

.reg {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-2);
}
.badge .ic { font-size: 12px; }
.badge-green { color: #6ee7b7; background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .3); }
.badge-amber { color: #fcd34d; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.badge-red { color: #fca5a5; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); }
.badge-purple { color: var(--primary-3); background: var(--primary-soft); border-color: rgba(229, 51, 42, .35); }

.mono {
  font-family: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: .94em;
  letter-spacing: .02em;
}
.muted { color: var(--muted) !important; }
.code-mask {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: .08em;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px dashed var(--border-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Empty ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 56px 20px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--border-2);
  background: radial-gradient(60% 80% at 50% 0%, rgba(229, 51, 42, .06), transparent 70%);
}
.empty .empty-ic, .empty-ic {
  width: 56px; height: 56px;
  padding: 14px;
  border-radius: 16px;
  color: var(--primary-2);
  background: var(--primary-soft);
  border: 1px solid rgba(229, 51, 42, .25);
}
.empty p { color: var(--muted); max-width: 380px; }

/* ---------- Layout utils ---------- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 380px;
  padding: 12px 16px 12px 12px;
  border-radius: 12px;
  background: rgba(28, 24, 23, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-2);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast > .ic {
  width: 26px; height: 26px;
  padding: 5px;
  border-radius: 8px;
}
.toast-ok > .ic { color: var(--green); background: rgba(52, 211, 153, .15); }
.toast-err > .ic { color: var(--red); background: rgba(248, 113, 113, .15); }
.toast-ok { border-color: rgba(52, 211, 153, .25); }
.toast-err { border-color: rgba(248, 113, 113, .3); }

@media (max-width: 640px) {
  .toasts { left: 12px; right: 12px; bottom: 14px; align-items: center; }
  .toast { max-width: 100%; width: auto; }
}

/* ---------- Tabela utilitária (opcional) ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Sessão / carregamento (integração com API) ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }
.loading-state .empty-ic { color: var(--primary); opacity: .9; }
.sb-user .sb-logout { margin-left: auto; width: 32px; height: 32px; flex-shrink: 0; }
body.sb-collapsed .sb-user .sb-logout { display: none; }
.sb-item.sb-admin { color: var(--amber); }
.btn .badge-soon, .badge-soon {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px; background: rgba(251, 191, 36, .12); color: #fcd34d; border: 1px solid rgba(251, 191, 36, .3);
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.cat-ic img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.cat-ic:has(img) { background: var(--surface-2); }

/* honeypot: link invisível para humanos (robôs seguem) */
.hp-link { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* página "não existe" (renderizada pelo core.js para rotas inexistentes) */
.nf-body { margin: 0; background: var(--bg, #0b0a0a); }
.nf-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; color: var(--text, #f3eeec); }
.nf-code { font-family: Syne, Inter, sans-serif; font-weight: 800; font-size: clamp(72px, 18vw, 140px); line-height: 1; letter-spacing: -.04em; color: var(--primary, #e5332a); margin: 0; }
.nf-page h1 { font-family: Syne, Inter, sans-serif; font-weight: 700; font-size: clamp(22px, 5vw, 30px); margin: 16px 0 8px; }
.nf-txt { color: var(--text-2, #b4aaa7); margin: 0 auto 28px; max-width: 36ch; line-height: 1.5; }
