:root {
  --bg: #0b0816;
  --sidebar: #0e0a1b;
  --panel: #130f24;
  --panel2: #18132c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(192, 132, 252, 0.28);
  --text: #f6f4ff;
  --muted: #a69fb8;
  --accent: #c9b6ff;
  --accent-strong: #a855f7;
  --purple-btn: linear-gradient(135deg, #ddd0ff 0%, #b79cff 100%);
  --purple-nav: linear-gradient(90deg, #4f299c 0%, #3a1c75 100%);
  --danger: #ff5c5c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(850px 420px at 78% 12%, rgba(147, 51, 234, 0.24), transparent 65%),
    radial-gradient(650px 380px at 35% 0%, rgba(109, 40, 217, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ===== SHELL DE 2 COLUNAS (SIDEBAR + MAIN) ===== */
.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
}

/* ===== SIDEBAR ESQUERDA ===== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 238px;
  background: linear-gradient(180deg, #110c20 0%, #0b0815 100%);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
  transition:
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    border-color 0.28s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 22px 6px;
  font-weight: 800;
  font-size: 17.5px;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}

.brand-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #b7b0ca;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-toggle:hover {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(192, 132, 252, 0.38);
  color: #ffffff;
}

.brand-logo {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px;
  overflow: hidden;
  filter: none;
  flex: none;
}

.brand-logo img,
.brand-logo svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #b7b0ca;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-item-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-count {
  min-width: 26px;
  height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  background: #1c1630;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #b7afd0;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: var(--purple-nav);
  border-color: rgba(192, 132, 252, 0.25);
  color: #fff;
  box-shadow: 0 8px 24px rgba(88, 28, 135, 0.4);
}

.side-section-label {
  margin: 26px 12px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7c7296;
}

.side-formats {
  display: grid;
  gap: 4px;
}

.side-cat {
  width: 100%;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #d2cce2;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.side-cat:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.side-cat .sc-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
}

.side-cat .sc-left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-cat .sc-left svg {
  color: #a99fc2;
  transition: color 0.18s;
  flex-shrink: 0;
}

.side-cat .sc-count {
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  background: #1c1630;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #b7afd0;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.side-cat.active {
  background: rgba(147, 51, 234, 0.16);
  border-color: rgba(192, 132, 252, 0.28);
  color: #fff;
}

.side-cat.active .sc-left svg {
  color: var(--accent);
}

.side-cat.active .sc-count {
  background: #4c2697;
  color: #fff;
  border-color: rgba(216, 180, 254, 0.3);
}

.side-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-discord {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(88, 101, 242, 0.14);
  color: #c7d2fe;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.side-discord:hover {
  background: rgba(88, 101, 242, 0.26);
  border-color: rgba(129, 140, 248, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.side-discord.hidden {
  display: none;
}

html[data-theme="light"] .side-discord {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.28);
  color: #4338ca;
}

html[data-theme="light"] .side-discord:hover {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(79, 70, 229, 0.48);
  color: #312e81;
}

.side-help {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #9e96b6;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s, background 0.2s;
}

.side-help:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

/* ===== MAIN WRAP & TOPBAR ===== */
.main-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 8, 22, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar-inner {
  max-width: 1360px;
  height: 100%;
  margin: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.app-shell.sidebar-collapsed .topbar-inner {
  justify-content: space-between;
}

.topbar-left {
  display: none;
  align-items: center;
  gap: 12px;
}

.app-shell.sidebar-collapsed .topbar-left {
  display: inline-flex;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-btn);
  color: #150e28;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(183, 156, 255, 0.25);
}

.iconbtn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #161126;
  color: #cfc8e4;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: transform 0.2s, border-color 0.2s, color 0.2s;
}

.iconbtn:hover,
.close:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: #fff;
}

@keyframes spinOnce {
  to {
    transform: rotate(360deg);
  }
}

.iconbtn.spinning svg {
  animation: spinOnce 0.55s ease;
}

main {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 28px 64px;
}

/* ===== HERO BANNER ===== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 495px;
  align-items: center;
  gap: 20px;
  padding: 12px 0 22px;
}

.hero-glow {
  position: absolute;
  right: -128px;
  top: -22px;
  bottom: -40px;
  width: 860px;
  max-width: 96%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 5%, #000 13%, #000 86%, rgba(0, 0, 0, 0.3) 94%, transparent 100%),
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.35) 7%, #000 16%, #000 72%, rgba(0, 0, 0, 0.45) 84%, rgba(0, 0, 0, 0.12) 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 5%, #000 13%, #000 86%, rgba(0, 0, 0, 0.3) 94%, transparent 100%),
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.35) 7%, #000 16%, #000 72%, rgba(0, 0, 0, 0.45) 84%, rgba(0, 0, 0, 0.12) 93%, transparent 100%);
  mask-composite: intersect;
  background:
    radial-gradient(250px 155px at 38% 46%, rgba(147, 51, 234, 0.36), transparent 72%),
    radial-gradient(190px 95px at 56% 72%, rgba(168, 85, 247, 0.34), transparent 70%),
    radial-gradient(240px 155px at 70% 52%, rgba(168, 85, 247, 0.32), rgba(107, 33, 168, 0.1) 52%, transparent 76%);
}

.hero-glow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-left {
  position: relative;
  z-index: 1;
}

.hero-left h1 {
  font-size: clamp(38px, 4.1vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  font-weight: 800;
  color: #ffffff;
}

.grad-title {
  background: linear-gradient(90deg, #e0d4ff 0%, #c4afff 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-left p {
  font-size: 15.5px;
  color: #b8b1cb;
  margin: 0 0 18px;
  line-height: 1.45;
}

.search {
  position: relative;
  max-width: 490px;
}

.search-ic {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #8f87a8;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(192, 132, 252, 0.2);
  background: rgba(18, 14, 33, 0.88);
  color: #fff;
  padding: 0 44px 0 44px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input::placeholder {
  color: #8c84a6;
}

.search input:focus {
  border-color: rgba(201, 182, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.search-tune {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #9e96b8;
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s;
}

.search-tune:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.search-tune.is-active {
  color: #130d26;
  background: var(--purple-btn);
  box-shadow: 0 4px 14px rgba(183, 156, 255, 0.3);
}

.search-tune.is-active circle {
  fill: #9333ea;
}

/* Cards Flutuantes do Hero */
.hero-showcase {
  position: relative;
  z-index: 1;
  height: 226px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.showcase-card {
  position: absolute;
  border-radius: 22px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: #171228;
  padding: 0;
  color: #fff;
  text-align: left;
  box-shadow:
    0 24px 55px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(168, 85, 247, 0.28);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.25s;
}

.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(10, 7, 20, 0.58) 100%);
  pointer-events: none;
}

.showcase-card.sc-left {
  width: 242px;
  height: 184px;
  right: 274px;
  top: 22px;
  transform: rotate(-3deg);
  z-index: 1;
}

.showcase-card.sc-right {
  width: 224px;
  height: 222px;
  right: 155px;
  top: 2px;
  transform: rotate(0deg);
  z-index: 2;
}

.showcase-card.sc-right img {
  object-position: center 38%;
}

.showcase-card.sc-left:hover {
  transform: rotate(-1.5deg) translateY(-4px) scale(1.02);
  border-color: rgba(233, 213, 255, 0.55);
}

.showcase-card.sc-right:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  border-color: rgba(233, 213, 255, 0.55);
}

.sc-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: auto;
  width: fit-content;
  max-width: calc(100% - 24px);
  z-index: 2;
  padding: 9px 13px;
  border-radius: 13px;
  background: rgba(18, 14, 26, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #f8f6ff;
}

.sc-badge svg {
  flex: 0 0 auto;
  color: #ffffff;
  margin-bottom: 1px;
}

/* ===== BARRA HORIZONTAL DE FILTROS + ONBOARDING ===== */
.controls-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 18px;
  flex-wrap: wrap;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.cg-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #968eb0;
  white-space: nowrap;
}

.cg-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
}

.media-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #141024;
  border: 1px solid var(--line);
}

.m-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: #b7b0cc;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s, color 0.18s;
}

.m-btn:hover {
  color: #fff;
}

.m-btn.active {
  background: var(--purple-btn);
  color: #130d26;
}

.tool-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
}

.tool-scroll::-webkit-scrollbar {
  display: none;
}

.tl {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #141024;
  color: #ccc5e0;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.tl:hover {
  border-color: rgba(192, 132, 252, 0.35);
  color: #fff;
}

.tl.active {
  background: var(--purple-btn);
  color: #130d26;
  border-color: transparent;
}

/* Card Compacto de Onboarding à Direita */
.welcome-slot {
  flex: 0 0 auto;
  margin-left: auto;
}

.welcome-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px 7px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.32), rgba(24, 18, 44, 0.88));
  border: 1px solid rgba(192, 132, 252, 0.32);
  box-shadow: 0 8px 26px rgba(88, 28, 135, 0.22);
}

.wb-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.18);
  display: grid;
  place-items: center;
  flex: 0 0 32px;
}

.wb-text {
  display: grid;
  gap: 1px;
  line-height: 1.2;
}

.wb-text b {
  font-size: 12px;
  color: #fff;
}

.wb-text small {
  font-size: 10.5px;
  color: #bdb5d4;
}

.wb-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 0;
  background: var(--purple-btn);
  color: #130d26;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.18s, filter 0.18s;
}

.wb-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ===== STEPPER (FLUXO NO FACE) ===== */
.stepper {
  margin: 0 0 18px;
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(20, 15, 36, 0.6));
}

.st-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.st-head b {
  font-size: 14px;
}

.st-all {
  border: 1px solid var(--line);
  background: #17122a;
  color: #ccc5e0;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 12px;
}

.st-all.active {
  background: var(--purple-btn);
  color: #130d26;
  border-color: transparent;
}

.st-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
}

.st-line:before {
  content: "";
  position: absolute;
  top: 17px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.st {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  background: none;
  border: 0;
  color: #cfcfcf;
  padding: 0;
  text-align: center;
}

.st-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #17122a;
  border: 2px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  z-index: 1;
  transition: 0.2s;
}

.st-t {
  font-size: 12px;
  font-weight: 800;
}

.st small {
  font-size: 10.5px;
  color: #8f87a8;
}

.st.active .st-n {
  background: var(--accent);
  border-color: var(--accent);
  color: #130d26;
  box-shadow: 0 0 0 5px rgba(201, 182, 255, 0.16);
}

.st.done .st-n {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== BARRA DE CONTAGEM DE RESULTADOS ===== */
.counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  min-height: 26px;
}

.counter {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.counter-clear {
  border: 1px solid rgba(192, 132, 252, 0.32);
  background: rgba(147, 51, 234, 0.14);
  color: #e9d5ff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  transition: background 0.18s, border-color 0.18s;
}

.counter-clear:hover {
  background: rgba(147, 51, 234, 0.28);
  border-color: var(--accent);
}

/* ===== GRID DE CARDS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel);
  position: relative;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.75, 0.25, 1), border-color 0.25s ease, box-shadow 0.28s ease;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.card:nth-child(n+5) {
  content-visibility: auto;
  contain-intrinsic-size: auto 390px;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(201, 182, 255, 0.42);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5), 0 0 28px rgba(147, 51, 234, 0.16);
}

.cover {
  aspect-ratio: 3 / 4.15;
  position: relative;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: #f6f4ff;
  background: radial-gradient(circle at 70% 18%, rgba(168, 85, 247, 0.22), transparent 35%), linear-gradient(145deg, #211838 0%, #130f22 45%, #090712 100%);
}

.cover:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 6, 16, 0.05) 0%, rgba(8, 6, 16, 0.2) 42%, rgba(8, 6, 16, 0.88) 72%, rgba(8, 6, 16, 0.98) 100%);
  z-index: 1;
}

.cover-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.35s ease;
}

.card:hover .cover-media {
  transform: scale(1.03);
}

.cover-media.lazy-media {
  opacity: 0;
}

.cover-media.lazy-media.is-loaded {
  opacity: 1;
}

.soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8f87a8;
  font-weight: 700;
  font-size: 13px;
  padding-bottom: 38%;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(14, 11, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f3f0ff;
}

.novo-badge {
  position: absolute;
  top: 46px;
  left: 12px;
  z-index: 2;
  background: #9333ea;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 9, 22, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  transition: 0.18s;
}

.icon-btn:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn.on {
  color: #d8b4fe;
  border-color: rgba(216, 180, 254, 0.6);
  background: rgba(147, 51, 234, 0.28);
}

.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.step-tag {
  align-self: flex-start;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(216, 180, 254, 0.35);
  color: #e9d5ff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.cover h3 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
  color: #ffffff;
}

.desc {
  margin: 0 0 11px;
  font-size: 12px;
  line-height: 1.38;
  color: #c2bcd4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ctag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 12, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 700;
  color: #e9e4f5;
}

.ctag svg {
  width: 13px;
  height: 13px;
}

.card-copy-btn {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: var(--purple-btn);
  color: #140d26;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 20px rgba(183, 156, 255, 0.2);
  transition: transform 0.18s, filter 0.18s, box-shadow 0.18s;
}

.card-copy-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(183, 156, 255, 0.32);
}

.card-copy-btn:active {
  transform: scale(0.98);
}

.card-copy-btn.copied,
.primary.copied {
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  color: #052e16;
  box-shadow: 0 8px 22px rgba(74, 222, 128, 0.3);
}

.empty small {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #8f87a8;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 60px;
  text-align: center;
  color: var(--muted);
}

.reset-filters {
  margin-top: 16px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 11px;
  font-weight: 800;
}

.reset-filters:hover {
  background: var(--accent);
  color: #130d26;
}

/* ===== MODAIS E TOAST ===== */
.primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 13px;
  background: var(--purple-btn);
  color: #140d26;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(183, 156, 255, 0.22);
}

.btn2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #1a142e;
  color: #f5f5f5;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}

.btn2:hover {
  border-color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 14, 0.78);
  z-index: 80;
  padding: 24px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}

.modal-box {
  width: min(860px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #130f24;
  border: 1px solid rgba(192, 132, 252, 0.24);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.85);
}

.modal-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.modal-body-grid.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.modal-media {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0c0918;
  aspect-ratio: 9 / 14;
  position: relative;
}

.modal-media img,
.modal-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-content-col {
  min-width: 0;
}

.modal h2 {
  font-size: 26px;
  margin: 8px 0 4px;
  letter-spacing: -0.03em;
}

.modal .meta {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #1b1530;
  color: white;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transition: transform 0.2s, border-color 0.2s, color 0.2s;
}

.close svg {
  display: block;
}

.modal-cfg {
  background: #19132c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: #e5e0f5;
}

.modal-req {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #e9d5ff;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0c0918;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 16px;
  color: #e2dcf2;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  max-height: 48vh;
  overflow: auto;
}

#modalPrompt {
  max-height: clamp(150px, 34vh, 320px);
  overflow-y: auto;
}

.modal-actions.m2 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-actions.m2 .primary {
  flex: 1 1 220px;
  width: auto;
  padding: 0 22px;
}

.btn-tool {
  flex: 1 1 180px;
}

.modal-actions2 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.modal-actions2 .btn2 {
  flex: 1 1 200px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq p {
  color: #c7c0dc;
  font-size: 14px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--purple-btn);
  color: #140d26;
  font-weight: 900;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 100;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== MODO CLARO ===== */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2fc;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel2: #ede8f8;
  --line: rgba(91, 33, 182, 0.12);
  --line-strong: rgba(126, 34, 206, 0.35);
  --text: #18112b;
  --muted: #655b80;
}

html[data-theme="light"] body {
  background:
    radial-gradient(850px 420px at 78% 12%, rgba(168, 85, 247, 0.14), transparent 65%),
    var(--bg);
  color: var(--text);
}

html[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: var(--line);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .topbar-brand {
  color: var(--text);
}

html[data-theme="light"] .sidebar-toggle {
  background: #f5f2fc;
  border-color: rgba(91, 33, 182, 0.18);
  color: #4a4063;
}

html[data-theme="light"] .sidebar-toggle:hover {
  background: rgba(147, 51, 234, 0.14);
  border-color: rgba(126, 34, 206, 0.38);
  color: #3b0764;
}

html[data-theme="light"] .nav-item,
html[data-theme="light"] .side-cat,
html[data-theme="light"] .side-help {
  color: #4a4063;
}

html[data-theme="light"] .nav-item.active {
  color: #ffffff;
}

html[data-theme="light"] .nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .side-cat .sc-count,
html[data-theme="light"] .nav-count {
  background: #efeaf9;
  color: #4a4063;
  border-color: rgba(91, 33, 182, 0.12);
}

html[data-theme="light"] .side-cat.active {
  background: rgba(147, 51, 234, 0.14);
  border-color: rgba(126, 34, 206, 0.35);
  color: #3b0764;
}

html[data-theme="light"] .side-cat.active .sc-left svg {
  color: #6d28d9;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .side-cat:hover,
html[data-theme="light"] .side-help:hover {
  background: rgba(147, 51, 234, 0.08);
  color: #18112b;
}

html[data-theme="light"] .stepper {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(255, 255, 255, 0.92));
  border-color: rgba(126, 34, 206, 0.25);
}

html[data-theme="light"] .st-head b {
  color: #18112b;
}

html[data-theme="light"] .st-all {
  background: #ffffff;
  color: #4a4063;
  border-color: rgba(91, 33, 182, 0.18);
}

html[data-theme="light"] .st-all.active {
  background: var(--purple-btn);
  color: #130d26;
}

html[data-theme="light"] .st-line:before {
  background: rgba(91, 33, 182, 0.16);
}

html[data-theme="light"] .st {
  color: #2e2348;
}

html[data-theme="light"] .st-n {
  background: #ffffff;
  border-color: rgba(91, 33, 182, 0.25);
  color: #3b0764;
}

html[data-theme="light"] .st small {
  color: #655b80;
}

html[data-theme="light"] .st.active .st-n {
  background: #7e22ce;
  border-color: #7e22ce;
  color: #ffffff;
}

html[data-theme="light"] .counter-clear {
  background: rgba(147, 51, 234, 0.12);
  color: #4c1d95;
  border-color: rgba(126, 34, 206, 0.3);
}

html[data-theme="light"] .btn2 {
  background: #f3effc;
  color: #251c3d;
  border-color: rgba(91, 33, 182, 0.18);
}

html[data-theme="light"] .faq p {
  color: #4a4063;
}

html[data-theme="light"] .topbar {
  background: rgba(245, 242, 252, 0.85);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .iconbtn,
html[data-theme="light"] .close {
  background: #fff;
  color: #3b3154;
}

html[data-theme="light"] .hero-left h1 {
  color: #18112b;
}

html[data-theme="light"] .grad-title {
  background: linear-gradient(90deg, #6d28d9 0%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .hero-left p {
  color: #5b5275;
}

html[data-theme="light"] .search input {
  background: #fff;
  color: #18112b;
  border-color: rgba(126, 34, 206, 0.25);
}

html[data-theme="light"] .media-seg,
html[data-theme="light"] .tl {
  background: #fff;
  color: #4a4063;
}

html[data-theme="light"] .m-btn {
  color: #4a4063;
}

html[data-theme="light"] .welcome-banner {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(255, 255, 255, 0.9));
}

html[data-theme="light"] .wb-text b {
  color: #18112b;
}

html[data-theme="light"] .wb-text small {
  color: #5b5275;
}

html[data-theme="light"] .modal-box {
  background: #fff;
  color: #18112b;
}

html[data-theme="light"] pre,
html[data-theme="light"] .modal-cfg {
  background: #f6f3fc;
  color: #251c3d;
}

html[data-theme="light"] .modal-req {
  color: #4c1d95;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1280px) {
  .cg-divider {
    display: none;
  }
  .welcome-slot {
    width: 100%;
    margin-left: 0;
  }
  .welcome-banner {
    width: 100%;
    justify-content: space-between;
  }
  .wb-text {
    flex: 1 1 auto;
  }
}

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
  .hero-showcase {
    transform: scale(0.8);
    transform-origin: right center;
  }
  .hero-glow {
    transform: scale(0.8);
    transform-origin: 732px center;
  }
}

@media (max-width: 1080px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .hero-showcase {
    transform: scale(0.72);
    transform-origin: right center;
  }
  main {
    padding: 18px 20px 56px;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
  }
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-width: 0;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
  }
  .sidebar-toggle,
  .topbar-left,
  .app-shell.sidebar-collapsed .topbar-left {
    display: none !important;
  }
  .brand {
    padding: 2px 4px 16px;
    padding-right: 250px;
  }
  .topbar {
    position: absolute;
    top: 10px;
    right: 0;
    height: 42px;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 0;
    z-index: 45;
  }
  .topbar-inner {
    padding: 0 18px;
  }
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .side-section-label {
    margin: 16px 4px 8px;
  }
  .side-formats {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    padding-right: 24px;
    scrollbar-width: none;
    min-width: 0;
    max-width: 100%;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
  }
  .side-formats::-webkit-scrollbar {
    display: none;
  }
  .side-cat {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    gap: 10px;
    background: #151026;
    border-color: var(--line);
  }
  html[data-theme="light"] .side-cat {
    background: #f3effc;
  }
  .side-footer {
    display: none;
  }
  main {
    padding: 18px 18px 52px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 0 16px;
  }
  .hero-showcase {
    display: none;
  }
  .hero-glow {
    transform: none;
    right: -40px;
    left: -40px;
    top: -16px;
    bottom: 0;
    width: auto;
    max-width: none;
    background:
      radial-gradient(320px 160px at 75% 35%, rgba(147, 51, 234, 0.24), transparent 72%),
      radial-gradient(240px 140px at 20% 50%, rgba(109, 40, 217, 0.16), transparent 70%);
  }
  .hero-glow svg {
    display: none;
  }
  .search {
    max-width: 100%;
  }
  .controls-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .control-group {
    width: 100%;
  }
  .tool-scroll {
    flex: 1 1 0%;
    padding-right: 24px;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .brand {
    font-size: 16px;
    gap: 8px;
    padding-right: 195px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  .eyebrow {
    font-size: 9.5px;
    padding: 5px 9px;
    gap: 4px;
  }
  .iconbtn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .top-actions {
    gap: 5px;
  }
  .hero-left h1 {
    font-size: 32px;
  }
  .hero-left p {
    font-size: 14px;
    margin-bottom: 14px;
  }
  .welcome-banner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }
  .wb-btn {
    width: 100%;
    height: 36px;
  }
  .st-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .st-line:before {
    display: none;
  }
  .st {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 8px;
  }
  .cover {
    padding: 11px;
  }
  .cover h3 {
    font-size: 15.5px;
  }
  .desc {
    font-size: 11.5px;
    margin-bottom: 9px;
  }
  .ctag {
    height: 24px;
    padding: 0 8px;
    font-size: 10px;
  }
  .card-copy-btn {
    height: 36px;
    font-size: 12px;
  }
  .modal {
    padding: 12px;
  }
  .modal-box {
    padding: 18px;
    border-radius: 18px;
    max-height: 90vh;
  }
  .modal-body-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .modal-media {
    max-height: 240px;
    aspect-ratio: 16 / 10;
  }
  .modal h2 {
    font-size: 20px;
  }
  pre {
    padding: 14px;
    font-size: 12px;
    max-height: 38vh;
  }
}

@media (max-width: 440px) {
  .sidebar {
    padding: 12px 14px;
  }
  .topbar-inner {
    padding: 0 14px;
  }
  main {
    padding: 14px 12px 44px;
  }
  .brand {
    padding-right: 115px;
  }
  .eyebrow {
    display: none;
  }
  .control-group {
    flex-wrap: wrap;
    gap: 6px;
  }
  .cg-label {
    width: 100%;
    font-size: 11.5px;
  }
  .media-seg {
    width: 100%;
  }
  .m-btn {
    flex: 1 1 0%;
    justify-content: center;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card {
    border-radius: 15px;
  }
  .cover {
    aspect-ratio: 3 / 4.35;
    padding: 10px;
  }
  .badge {
    top: 8px;
    left: 8px;
    padding: 4px 7px;
    font-size: 8.5px;
    gap: 4px;
  }
  .novo-badge {
    top: 34px;
    left: 8px;
    font-size: 8px;
    padding: 3px 6px;
  }
  .card-actions {
    top: 8px;
    right: 8px;
  }
  .icon-btn {
    width: 28px;
    height: 28px;
  }
  .icon-btn svg {
    width: 13px;
    height: 13px;
  }
  .step-tag {
    font-size: 8px;
    padding: 2px 6px;
    margin-bottom: 4px;
  }
  .cover h3 {
    font-size: 13.5px;
    line-height: 1.15;
    margin-bottom: 3px;
  }
  .desc {
    font-size: 10.5px;
    line-height: 1.28;
    margin-bottom: 7px;
  }
  .card-tags {
    gap: 4px;
    margin-bottom: 8px;
  }
  .ctag {
    height: 20px;
    padding: 0 6px;
    font-size: 9.5px;
    gap: 3px;
  }
  .ctag svg {
    width: 10px;
    height: 10px;
  }
  .card-copy-btn {
    height: 32px;
    border-radius: 8px;
    font-size: 11px;
    gap: 5px;
  }
  .card-copy-btn svg {
    width: 12px;
    height: 12px;
  }
}

/* ===== AUTENTICAÇÃO DE MEMBROS (SUPABASE OTP / MAGIC LINK) & PERFIL TOPBAR ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 250;
  background:
    radial-gradient(820px 440px at 50% 24%, rgba(168, 85, 247, 0.24), transparent 70%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-gate-theme {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 260;
}

.auth-gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 34px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.auth-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 18.5px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-loading p {
  margin: 0;
}

.auth-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(192, 132, 252, 0.22);
  border-top-color: #c084fc;
  animation: spinOnce 0.75s linear infinite;
}

.auth-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-step h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-step p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-sent-box {
  width: 100%;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.48;
  color: var(--text);
}

.auth-cpf-tip {
  width: 100%;
  background: rgba(168, 85, 247, 0.09);
  border: 1px dashed rgba(192, 132, 252, 0.34);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12.2px;
  line-height: 1.45;
  color: var(--text);
  text-align: left;
}

.auth-form input.auth-text-input {
  text-align: left;
}

.pwd-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.pwd-input-wrap input {
  padding-right: 44px !important;
  text-align: left;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}

.pwd-toggle-btn:hover {
  background: rgba(168, 85, 247, 0.14);
  color: var(--text);
}

.auth-step-links.single-center {
  justify-content: center;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.auth-form input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  padding: 0 14px;
  font-size: 14.5px;
  text-align: center;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-form input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.auth-form input.otp-code-input {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.24em;
  font-variant-numeric: tabular-nums;
}

.auth-form input.otp-code-input::placeholder {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: normal;
}

.auth-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-error {
  font-size: 12.5px;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.45;
}

.auth-submit-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--purple-btn);
  color: #150e28;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.26);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.auth-submit-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.auth-step-links {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.auth-link-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  color: #fff;
}

.auth-link-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.top-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(192, 132, 252, 0.42);
  background: rgba(168, 85, 247, 0.18);
  color: #f3e8ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.top-admin-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
  transform: translateY(-1px);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  max-width: 170px;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple-nav);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

html[data-theme="light"] .auth-gate-card {
  background: #ffffff;
  border-color: rgba(109, 40, 217, 0.25);
  box-shadow: 0 20px 52px rgba(91, 33, 182, 0.12);
}

html[data-theme="light"] .auth-gate-brand,
html[data-theme="light"] .auth-step h2 {
  color: #18112b;
}

html[data-theme="light"] .auth-step p,
html[data-theme="light"] .auth-hint,
html[data-theme="light"] .auth-loading {
  color: #5b5275;
}

html[data-theme="light"] .auth-sent-box,
html[data-theme="light"] .auth-cpf-tip {
  background: #f6f3fc;
  border-color: rgba(109, 40, 217, 0.24);
  color: #18112b;
}

html[data-theme="light"] .pwd-toggle-btn {
  color: #5b5275;
}

html[data-theme="light"] .pwd-toggle-btn:hover {
  background: rgba(109, 40, 217, 0.1);
  color: #18112b;
}

html[data-theme="light"] .auth-form input {
  background: #faf8ff;
  color: #18112b;
  border-color: rgba(109, 40, 217, 0.28);
}

html[data-theme="light"] .auth-form input:focus {
  background: #ffffff;
  border-color: #6d28d9;
}

html[data-theme="light"] .auth-error {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
}

html[data-theme="light"] .auth-link-btn {
  color: #5b21b6;
}

html[data-theme="light"] .auth-link-btn:hover {
  background: rgba(109, 40, 217, 0.1);
  color: #3b0764;
}

html[data-theme="light"] .top-admin-btn {
  background: rgba(109, 40, 217, 0.12);
  border-color: rgba(109, 40, 217, 0.34);
  color: #4c1d95;
}

html[data-theme="light"] .top-admin-btn:hover {
  background: rgba(109, 40, 217, 0.2);
  color: #3b0764;
}

html[data-theme="light"] .user-badge {
  background: #ffffff;
  border-color: rgba(91, 33, 182, 0.16);
  color: #18112b;
}

html[data-theme="light"] .logout-btn:hover {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
}

@media (max-width: 920px) {
  .eyebrow,
  .user-badge {
    display: none !important;
  }
  }
