/* RankUp - Design System
   Linear/Vercel-inspired, balanced gamification */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  /* Brand */
  --brand-50: #eef0ff;
  --brand-100: #e0e3ff;
  --brand-200: #c5cbff;
  --brand-300: #a5acff;
  --brand-400: #8489ff;
  --brand-500: #6366f1;
  --brand-600: #5457e5;
  --brand-700: #4346c4;

  /* Sidebar */
  --side-bg: #ffffff;
  --side-bg-2: #f3f4f6;
  --side-line: #e5e7eb;
  --side-fg: #111827;
  --side-fg-2: #6b7280;
  --side-fg-3: #9ca3af;

  /* Content */
  --bg: #f7f6f2;
  --bg-2: #efeee9;
  --card: #ffffff;
  --card-bd: #d8d7d2;
  --line: #cecdc8;
  --line-2: #e4e3de;

  /* Text */
  --ink: #0a0f1c;
  --ink-2: #1e2738;
  --ink-3: #3d4660;
  --ink-4: #606879;
  --ink-5: #96a0b0;

  /* Status */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --info: #3b82f6;

  /* Medals */
  --gold-1: #fde68a;
  --gold-2: #f59e0b;
  --gold-3: #b45309;
  --silver-1: #f1f5f9;
  --silver-2: #94a3b8;
  --silver-3: #475569;
  --bronze-1: #fbcaa3;
  --bronze-2: #c2602f;
  --bronze-3: #7a3a12;

  /* Live */
  --live: #22c55e;

  /* Data viz
     Categorical slots are assigned in fixed order and never cycled. This order
     was validated for colorblind separation against the white card surface:
     worst adjacent pair 9.1 (CVD) and 19.6 (normal vision). Slot 6 is the
     neutral used by the "Other" bucket, it is not a category color. */
  --viz-1: #5457e5;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-4: #eda100;
  --viz-5: #e87ba4;
  --viz-6: #94a1b2;

  /* Passo claro do slot 1, para marcas recessivas ao lado da marca em destaque */
  --viz-1-soft: #c3c5f6;

  /* Chart chrome: everything that is not data stays recessive */
  --viz-surface: #ffffff;
  --viz-grid: #ebeae5;
  --viz-axis: #8b93a3;
  --viz-label: #606879;
  --viz-prev: #b3bac6;
  --viz-track: #eeedea;

  /* Shape */
  --r-sm: 6px;
  --r: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-xs: 0 1px 0 rgba(12, 17, 29, 0.04);
  --shadow-sm: 0 1px 2px rgba(12, 17, 29, 0.05), 0 1px 0 rgba(12, 17, 29, 0.03);
  --shadow-md: 0 4px 14px rgba(12, 17, 29, 0.06), 0 1px 2px rgba(12, 17, 29, 0.04);
  --shadow-lg: 0 12px 40px rgba(12, 17, 29, 0.1), 0 2px 6px rgba(12, 17, 29, 0.06);

  --side-w: 260px;
  --side-w-collapsed: 68px;
  --topbar-h: 64px;

  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(12, 17, 29, 0.12);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 17, 29, 0.22);
  background-clip: content-box;
  border: 2px solid transparent;
}

/* ─── APP LAYOUT ─── */
.app {
  display: block;
  min-height: 100vh;
  padding-left: var(--side-w);
  transition: padding-left 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app.collapsed {
  padding-left: var(--side-w-collapsed);
}
.app.tv-mode {
  padding-left: 0;
}

/* ─── SIDEBAR ─── */
.sidebar {
  background: var(--side-bg);
  color: var(--side-fg);
  border-right: 1px solid var(--side-line);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--side-w);
  height: 100dvh;
  overflow: visible;
  z-index: 80;
  transition: width 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app.collapsed .sidebar {
  width: var(--side-w-collapsed);
}
.app.tv-mode .sidebar {
  display: none;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: 64px;
  border-bottom: 1px solid var(--side-line);
  flex-shrink: 0;
  position: relative;
}

.side-logo-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
  gap: 0;
}
.side-logo-full {
  width: auto;
  max-width: 155px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.side-logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: none;
  flex-shrink: 0;
}

.side-toggle {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--side-line);
  color: var(--side-fg-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.side-toggle i {
  font-size: 11px;
}
.side-toggle:hover {
  background: var(--side-bg-2);
  color: var(--side-fg);
  border-color: var(--side-line);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}
.side-nav::-webkit-scrollbar {
  width: 4px;
}
.side-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.side-group {
  margin-bottom: 6px;
}

.side-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--side-fg-3);
  padding: 14px 14px 6px;
  margin: 0;
  display: block;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--side-fg-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.12s,
    color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.side-item:hover {
  background: var(--side-bg-2);
  color: var(--side-fg);
  text-decoration: none;
}
.side-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}
.side-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-500);
}
.side-item.active .side-ic {
  color: var(--brand-600);
}

.side-ic {
  font-size: 15.5px;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
}
.side-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.app.collapsed .side-brand {
  padding: 0 10px;
  gap: 0;
  justify-content: space-between;
}
.app.collapsed .side-logo-full {
  display: none;
}
.app.collapsed .side-logo-icon {
  display: block;
  margin: 0 auto;
}
.app.collapsed .side-toggle {
  position: absolute;
  right: -18px;
  top: 16px;
  z-index: 140;
  margin-left: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.app.collapsed .side-toggle:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.app.collapsed .side-section-label {
  display: none;
}
.app.collapsed .side-group {
  margin-bottom: 0;
}
.app.collapsed .side-item {
  justify-content: center;
  padding: 10px;
  gap: 0;
}
.app.collapsed .side-item::before {
  display: none;
}
.app.collapsed .side-lbl {
  display: none;
}

.side-tv {
  padding: 4px 10px 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--side-line);
  margin-top: 4px;
}
.side-tv-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--side-fg-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.12s,
    color 0.12s;
  white-space: nowrap;
  overflow: hidden;
}
.side-tv-link:hover {
  background: var(--side-bg-2);
  color: var(--side-fg);
  text-decoration: none;
}
.app.collapsed .side-tv-link {
  justify-content: center;
  padding: 10px;
  gap: 0;
}
.app.collapsed .side-tv-link .side-lbl {
  display: none;
}

.side-user {
  padding: 10px;
  border-top: 1px solid var(--side-line);
  flex-shrink: 0;
}
.side-user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  min-width: 0;
}
.side-user-btn:hover {
  background: var(--side-bg-2);
}

.side-av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.side-user-info {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
}
.side-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--side-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.side-user-role {
  font-size: 12px;
  color: var(--side-fg-3);
  line-height: 1.4;
  margin-top: 1px;
}
.side-user-caret {
  font-size: 10px;
  color: var(--side-fg-3);
  flex-shrink: 0;
}

.app.collapsed .side-user-btn {
  justify-content: center;
  padding: 10px;
}
.app.collapsed .side-user-info,
.app.collapsed .side-user-caret {
  display: none;
}

/* ─── MAIN ─── */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: rgba(247, 246, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
}
.topbar .crumb {
  color: var(--ink-3);
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .crumb b {
  color: var(--ink);
  font-weight: 600;
}
.topbar .right {
  margin-left: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}
.icon-btn:hover {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink-5);
}
.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 2px var(--bg);
}
.language-switcher {
  flex-shrink: 0;
}
.language-current {
  min-height: 34px;
  max-width: 190px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.language-current:hover {
  background: var(--card);
  border-color: var(--ink-5);
  color: var(--ink);
}
.language-current span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.language-current i {
  color: var(--ink-4);
  font-size: 10px;
  flex-shrink: 0;
}
.language-menu {
  min-width: 190px;
}
.language-form {
  margin: 0;
}
.language-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.language-option.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 700;
}
.language-flag {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}

/* ─── PAGE ─── */
.page {
  width: min(100%, 1560px);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 32px);
}

.page-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}
.page-h h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.1;
}
.page-h .sub {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 14.5px;
}
.page-h .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .page-h {
    align-items: flex-start;
  }
  .page-h .actions {
    justify-content: flex-end;
  }
}

/* ─── LIVE DOT ─── */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.22);
}
.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* ─── TOOLBAR ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── BUTTONS ─── */
.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary,
a.btn-primary {
  background: var(--brand-500);
  color: #fff !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 10px rgba(99, 102, 241, 0.3);
  border-color: transparent;
}
.btn-primary:hover,
a.btn-primary:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 6px 14px rgba(99, 102, 241, 0.4);
  color: #fff !important;
}
.btn-ghost,
.btn-light,
a.btn-ghost,
a.btn-light {
  background: var(--card);
  color: var(--ink-2) !important;
  border-color: var(--line);
}
.btn-ghost:hover,
.btn-light:hover,
a.btn-ghost:hover,
a.btn-light:hover {
  background: var(--card);
  color: var(--ink) !important;
  border-color: var(--ink-5);
}
.btn-dark,
a.btn-dark {
  background: var(--ink);
  color: #fff !important;
}
.btn-dark:hover,
a.btn-dark:hover {
  background: #000;
  color: #fff !important;
}
.btn-danger,
a.btn-danger {
  background: var(--danger);
  color: #fff !important;
  border-color: transparent;
}
.btn-danger:hover,
a.btn-danger:hover {
  background: #dc2626;
}
.btn-outline-secondary {
  background: var(--card);
  color: var(--ink-2) !important;
  border-color: var(--line);
}
.btn-outline-secondary:hover {
  border-color: var(--ink-5);
  color: var(--ink) !important;
}
.btn-sm,
a.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 7px;
}
.btn-link,
a.btn-link {
  background: transparent;
  border: none;
  color: var(--brand-600) !important;
  padding: 0;
  height: auto;
  font-size: 13px;
  font-weight: 600;
}
.btn-link:hover {
  color: var(--brand-700) !important;
  text-decoration: underline;
}
.btn.disabled,
.btn:disabled,
a.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* ─── DROPDOWN ─── */
.dropdown-menu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.1s;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-2);
  color: var(--ink);
}
.dropdown-item.text-danger {
  color: var(--danger) !important;
}
.dropdown-item.text-danger:hover {
  background: var(--danger-bg);
}
.dropdown-divider {
  border-color: var(--line);
  margin: 4px 0;
}

/* ─── STATS CARDS ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-md);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-value .cur {
  color: var(--ink-4);
  font-size: 16px;
  font-weight: 500;
  margin-right: 3px;
}
.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  margin-top: 8px;
}
.stat-delta.down {
  color: var(--danger);
}
.stat-icon-bg {
  position: absolute;
  right: -8px;
  bottom: -8px;
  font-size: 64px;
  opacity: 0.04;
  pointer-events: none;
  color: var(--ink);
}

/* ─── EMPTY STATE / FOOTER ─── */
.empty-state {
  padding: 60px 24px;
  text-align: center;
}
.empty-state-icon {
  font-size: 2.5rem;
  color: var(--ink-5);
  display: block;
}
.empty-state-text {
  color: var(--ink-4);
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 13px;
}
.empty-state-action {
  margin-top: 16px;
}
.app-footer {
  padding: 24px;
  margin-top: auto;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
}
.app-footer a {
  color: var(--ink-4);
  text-decoration: none;
}
.app-footer a:hover {
  color: var(--brand-500);
}
.app-footer-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
}
.stat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  text-decoration: none;
  transition: color 0.12s;
}
.stat-link i {
  font-size: 11px;
  transition: transform 0.12s ease;
}
.stat-link:hover {
  color: var(--brand-600);
  text-decoration: none;
}
.stat-link:hover i {
  transform: translateX(3px);
}
.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.stat-foot .stat-link {
  margin-top: 0;
  padding-top: 0;
}

/* ─── CARD ─── */
.card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: none;
}
.card-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-h h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.card-h .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.card-body {
  padding: 20px;
}
.card-form-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-form-footer .footer-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .card-form-footer {
    padding: 12px;
    gap: 6px;
  }
  .card-form-footer .footer-right {
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
    gap: 6px;
  }
  .card-form-footer .btn {
    padding: 0 9px;
  }
}

/* ─── FILTER CARD ─── */
.filter-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.filter-hd {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.filter-hd:hover {
  background: var(--bg-2);
}
.filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.filter-title > i {
  color: var(--ink-4);
  font-size: 13px;
}
.filter-toggle-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-4);
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-chev {
  font-size: 11px;
  transition: transform 0.2s ease;
}
.filter-card.open .filter-chev {
  transform: rotate(180deg);
}
.show-lbl {
  display: inline;
}
.hide-lbl {
  display: none;
}
.filter-card.open .show-lbl {
  display: none;
}
.filter-card.open .hide-lbl {
  display: inline;
}
.filter-body {
  display: none;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.filter-card.open .filter-body {
  display: block;
}
.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.filter-actions .btn {
  flex: 0 0 auto;
}

/* ─── SEARCH ─── */
.search {
  position: relative;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: all 0.12s;
}
.search input:focus {
  background: var(--card);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  pointer-events: none;
}

/* ─── TABLES ─── */
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl th,
.tbl td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}
.tbl th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.tbl td {
  font-size: 14.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}
.tbl tr:last-child td {
  border-bottom: none;
}
.tbl tr:hover td {
  background: var(--bg);
}

/* Bootstrap table bridge */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--bg);
  width: 100%;
}
.table > thead > tr > th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: transparent;
}
.table > tbody > tr > td {
  padding: 13px 16px;
  font-size: 14.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.table > tbody > tr:last-child > td {
  border-bottom: none;
}
.table-hover > tbody > tr:hover > td {
  background: var(--bg);
}
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: transparent;
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-name .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}
.cell-name b {
  color: var(--ink);
  font-weight: 600;
}
.cell-name .em {
  font-size: 12px;
  color: var(--ink-4);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge.no-dot::before,
.badge.bg-primary::before {
  display: none;
}
.badge.success,
.badge.bg-success {
  color: #047857 !important;
  background: var(--success-bg) !important;
}
.badge.danger,
.badge.bg-danger {
  color: #b91c1c !important;
  background: var(--danger-bg) !important;
}
.badge.warn,
.badge.bg-warning {
  color: #b45309 !important;
  background: var(--warn-bg) !important;
}
.badge.info,
.badge.bg-info {
  color: #1e40af !important;
  background: #eff6ff !important;
}
.badge.muted {
  color: var(--ink-3);
  background: var(--bg-2);
}
.badge.bg-primary {
  color: #fff !important;
  background: var(--brand-500) !important;
}

.tbl .num,
.table .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
.actions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--ink-4);
  cursor: pointer;
}
.actions-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
}

/* ─── PAGINATION ─── */
.pagination-wrap {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}
.pagination-info {
  font-size: 12px;
  color: var(--ink-4);
}
.page-link,
.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.page-link:hover,
.page-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.page-item.active .page-link,
.page-btn.active {
  background: var(--brand-500);
  color: #fff !important;
  border-color: var(--brand-500);
}
.page-item.disabled .page-link,
.page-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
/* Bootstrap pagination bridge */
.pagination {
  gap: 4px;
}
.pagination .page-link {
  border-radius: 6px !important;
}
.pagination .page-item.active .page-link {
  background: var(--brand-500) !important;
  border-color: var(--brand-500) !important;
  color: #fff !important;
}

/* ─── FORMS ─── */
.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
  display: block;
}
.form-hint {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 5px;
}
.form-control,
.form-select {
  height: 42px;
  padding: 0 12px;
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink) !important;
  outline: none;
  transition: all 0.12s;
  width: 100%;
}
.form-control:focus,
.form-select:focus {
  background: var(--card) !important;
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none;
}
textarea.form-control {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
.form-text {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 4px;
}
.form-check-input:checked {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.file-picker {
  position: relative;
  width: 100%;
}
.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-picker-control {
  min-height: 42px;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.file-picker-control:hover {
  background: var(--card);
  border-color: var(--ink-5);
}
.file-picker-input:focus + .file-picker-control,
.file-picker-input:focus-visible + .file-picker-control {
  background: var(--card);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.file-picker-button {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.file-picker-button i {
  color: var(--brand-600);
  font-size: 14px;
}
.file-picker-name {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: var(--ink-4);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .file-picker-control {
    flex-direction: column;
  }
  .file-picker-button {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .file-picker-name {
    min-height: 38px;
  }
}

/* ─── RANKING CARDS ─── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.seller-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  position: relative;
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    border-color 0.18s;
  overflow: hidden;
}
.seller-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink-5);
}
.seller-card.rank-1 {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.25),
    0 12px 40px rgba(245, 158, 11, 0.18);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(245, 158, 11, 0.1), transparent 50%), var(--card);
}
.seller-card.rank-1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}

.rank-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}
.rank-badge.gold {
  background:
    radial-gradient(circle at 30% 25%, #fef3c7, transparent 40%),
    radial-gradient(circle at 70% 80%, #b45309, transparent 50%),
    linear-gradient(135deg, #fbbf24, #f59e0b 50%, #d97706);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(245, 158, 11, 0.4);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.rank-badge.silver {
  background:
    radial-gradient(circle at 30% 25%, #ffffff, transparent 40%),
    radial-gradient(circle at 70% 80%, #475569, transparent 50%),
    linear-gradient(135deg, #e2e8f0, #94a3b8 50%, #64748b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(100, 116, 139, 0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.rank-badge.bronze {
  background:
    radial-gradient(circle at 30% 25%, #fde6cf, transparent 40%),
    radial-gradient(circle at 70% 80%, #7a3a12, transparent 50%),
    linear-gradient(135deg, #fb923c, #c2602f 50%, #92400e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(194, 96, 47, 0.35);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.rank-badge.plain {
  background: var(--bg-2);
  color: var(--ink-3);
  border: 1px solid var(--line);
  font-size: 14px;
}

.seller-body {
  min-width: 0;
}
.seller-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.seller-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.seller-av.ring-gold {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--gold-2);
}
.seller-av.ring-silver {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--silver-2);
}
.seller-av.ring-bronze {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--bronze-2);
}

/* Name block has to be shrinkable, otherwise a long name pushes the actions
   menu out of the card and overflow-wrap breaks the name mid-word. */
.seller-ident {
  flex: 1;
  min-width: 0;
}
.seller-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.seller-role {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seller-revenue {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.seller-revenue .cur {
  color: var(--ink-4);
  font-weight: 500;
  font-size: 16px;
  margin-right: 4px;
}

.seller-progress {
  margin-top: 14px;
}
.progress-h {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.progress-h b {
  color: var(--ink-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shine 2.4s ease-in-out infinite;
}
.seller-card.rank-1 .progress-fill {
  background: linear-gradient(90deg, var(--gold-2), #fbbf24);
}
@keyframes shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
.progress-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 6px;
}
.progress-foot b {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fire {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 18px;
  animation: float 2.4s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-3px) rotate(5deg);
  }
}

/* ─── LEADERBOARD ROW VIEW ─── */
.leaderboard {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.lb-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto 32px;
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
  transition: background 0.12s;
}
.lb-row:last-child {
  border-bottom: none;
}
.lb-row:hover {
  background: var(--bg);
}
.lb-row.lb-1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 40%), var(--card);
}
.lb-row.lb-1:hover {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent 40%), var(--bg);
}
.lb-rank {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--ink-5);
  letter-spacing: -0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lb-row.lb-1 .lb-rank,
.lb-row.lb-2 .lb-rank,
.lb-row.lb-3 .lb-rank {
  color: transparent;
}
.lb-row.lb-1 .lb-rank {
  background: linear-gradient(180deg, #fcd34d, #b45309);
  -webkit-background-clip: text;
  background-clip: text;
}
.lb-row.lb-2 .lb-rank {
  background: linear-gradient(180deg, #e2e8f0, #475569);
  -webkit-background-clip: text;
  background-clip: text;
}
.lb-row.lb-3 .lb-rank {
  background: linear-gradient(180deg, #fb923c, #7a3a12);
  -webkit-background-clip: text;
  background-clip: text;
}

.lb-person {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.lb-person .av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.lb-row.lb-1 .av {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--gold-2);
}
.lb-row.lb-2 .av {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--silver-2);
}
.lb-row.lb-3 .av {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--bronze-2);
}
.lb-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
/* Os badges passaram a ser texto, entao viram chips no lugar dos icones. */
.lb-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 4px;
  cursor: default;
}
.lb-badges span {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Dashboard onboarding checklist ── */
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
}
.onboarding-step i {
  color: var(--brand-500);
  font-size: 15px;
}
.onboarding-step:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.onboarding-step .onboarding-step-go {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-4);
}
.onboarding-step.done {
  color: var(--ink-4);
}
.onboarding-step.done i {
  color: var(--success);
}
.onboarding-step.done span {
  text-decoration: line-through;
}

/* ── Dashboard daily revenue chart ── */
.chart-bars-wrap {
  padding-bottom: 22px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  min-width: 0;
}
.chart-bar {
  background: var(--brand-500);
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.chart-bar-col:hover .chart-bar {
  opacity: 1;
}
.chart-bar.empty {
  height: 2px !important;
  background: var(--border);
}
.chart-bar.today {
  background: var(--warn);
}
.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-4);
}
.lb-meta {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 2px;
}
.lb-progress {
  width: 180px;
}
.lb-rev {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.lb-rev .cur {
  color: var(--ink-4);
  font-weight: 500;
  font-size: 14px;
}
.lb-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--success);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
}
.lb-trend.down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.view-toggle {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 3px;
}
.view-toggle button {
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.view-toggle button.active {
  background: var(--brand-500);
  color: #fff;
}

/* ─── TV MODE ─── */
.tv-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #fff;
}
/* Os temas so pintam o degrade decorativo (background-image).
   A cor base vem inline da configuracao, senao o shorthand `background`
   sobrescrevia a cor escolhida pelo usuario e o seletor nao servia. */
.tv-stage.theme-midnight {
  background-image:
    radial-gradient(80% 50% at 50% 0%, var(--tv-accent-soft), transparent 60%),
    radial-gradient(60% 40% at 50% 100%, var(--tv-accent-faint), transparent 60%);
}
.tv-stage.theme-midnight::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.6;
}
.tv-stage.theme-stadium {
  background-image:
    radial-gradient(60% 60% at 50% 30%, var(--tv-accent-soft), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
}
.tv-stage.theme-aurora {
  background-image:
    radial-gradient(40% 60% at 20% 30%, var(--tv-accent-soft), transparent 60%),
    radial-gradient(50% 60% at 80% 40%, var(--tv-accent-faint), transparent 60%),
    radial-gradient(40% 50% at 50% 100%, var(--tv-accent-faint), transparent 60%);
}
.tv-stage.theme-aurora::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 30%, rgba(99, 102, 241, 0.1) 50%, transparent 70%),
    linear-gradient(60deg, transparent 30%, rgba(34, 197, 94, 0.08) 50%, transparent 70%);
  animation: aurora-shift 12s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
  0% {
    transform: translateX(-5%) translateY(-2%);
  }
  100% {
    transform: translateX(5%) translateY(2%);
  }
}

.tv-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: clamp(12px, 2.4vh, 26px) clamp(20px, 3vw, 40px);
}
.tv-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.tv-title .accent {
  color: var(--tv-accent, var(--brand-300));
}
.tv-period {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}
.tv-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 12px;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tv-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 12px var(--live);
  animation: pulse-bright 1.4s ease-in-out infinite;
}
@keyframes pulse-bright {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}
.tv-back {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.tv-back:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Seletor de idioma da vitrine publica: as opcoes nativas abrem em fundo
   claro no Windows, entao a cor e forcada nelas tambem. */
.tv-demo-lang {
  appearance: none;
  padding-right: 28px;
}
.tv-demo-lang option {
  background: #0f0f1a;
  color: #fff;
}

.tv-theme-switcher {
  display: flex;
  gap: 6px;
}
.tv-theme-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tv-theme-btn.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.tv-theme-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.podium-wrap {
  flex: 1;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: clamp(6px, 1vw, 16px);
  padding: 0 clamp(12px, 4vw, 56px) clamp(16px, 5.5vh, 60px);
  min-height: 0;
  overflow: hidden;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.podium-av {
  width: clamp(60px, 10vh, 120px);
  height: clamp(60px, 10vh, 120px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3.3vh, 40px);
  margin-bottom: clamp(6px, 1.4vh, 16px);
  position: relative;
}
.podium-av.gold {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.15),
    0 0 0 8px var(--gold-2),
    0 0 50px rgba(245, 158, 11, 0.6);
}
.podium-av.silver {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.15),
    0 0 0 8px var(--silver-2),
    0 0 30px rgba(148, 163, 184, 0.4);
}
.podium-av.bronze {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.15),
    0 0 0 8px var(--bronze-2),
    0 0 30px rgba(194, 96, 47, 0.4);
}
.podium-place.p1 .podium-av {
  width: clamp(80px, 13vh, 150px);
  height: clamp(80px, 13vh, 150px);
  font-size: clamp(26px, 4.2vh, 50px);
}

.podium-crown {
  position: absolute;
  top: clamp(-48px, -3.5vh, -26px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(22px, 3.3vh, 42px);
  filter: drop-shadow(0 4px 16px rgba(245, 158, 11, 0.6));
  animation: bounce 2.2s ease-in-out infinite;
}
@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

.podium-name {
  font-size: clamp(13px, 2vh, 24px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
}
.podium-place.p1 .podium-name {
  font-size: clamp(16px, 2.5vh, 30px);
}
.podium-role {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  margin-top: 4px;
}
.podium-revenue {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.8vh, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: clamp(5px, 1.1vh, 13px);
  margin-bottom: clamp(6px, 1.6vh, 18px);
  font-variant-numeric: tabular-nums;
}
.podium-place.p1 .podium-revenue {
  font-size: clamp(22px, 3.9vh, 48px);
  background: linear-gradient(180deg, #fff 30%, var(--gold-1) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(245, 158, 11, 0.4));
}
.podium-place.p2 .podium-revenue {
  color: #e2e8f0;
}
.podium-place.p3 .podium-revenue {
  color: #fdba74;
}

.pedestal {
  width: 100%;
  max-width: 280px;
  min-height: clamp(50px, 11vh, 130px);
  border-radius: 14px 14px 0 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(8px, 1.6vh, 20px);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 5.5vh, 68px);
  color: rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: -0.04em;
  overflow: hidden;
}
.pedestal::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.pedestal.gold {
  height: clamp(100px, 20vh, 250px);
  background: linear-gradient(180deg, #fcd34d, #f59e0b 50%, #b45309);
  box-shadow:
    0 -12px 40px rgba(245, 158, 11, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.pedestal.silver {
  height: clamp(75px, 15vh, 185px);
  background: linear-gradient(180deg, #e2e8f0, #94a3b8 50%, #475569);
  box-shadow:
    0 -8px 30px rgba(148, 163, 184, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
.pedestal.bronze {
  height: clamp(60px, 12vh, 150px);
  background: linear-gradient(180deg, #fb923c, #c2602f 50%, #7a3a12);
  box-shadow:
    0 -8px 30px rgba(194, 96, 47, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.pedestal.fourth {
  height: clamp(46px, 9vh, 112px);
  background: linear-gradient(180deg, #818cf8, #4f46e5 50%, #2e1065);
  box-shadow:
    0 -6px 24px rgba(99, 102, 241, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.25);
}
.pedestal.fifth {
  height: clamp(36px, 7vh, 88px);
  background: linear-gradient(180deg, #94a3b8, #64748b 50%, #334155);
  box-shadow:
    0 -4px 18px rgba(100, 116, 139, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.tv-also {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.2vh, 14px);
  padding: 0 clamp(16px, 3vw, 40px) clamp(8px, 1.6vh, 18px);
}
.tv-also-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(7px, 1.1vh, 13px) clamp(10px, 1.2vw, 16px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.tv-also-row .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(14px, 2vh, 24px);
  color: rgba(255, 255, 255, 0.45);
  width: clamp(22px, 3vh, 34px);
}
.tv-also-row .av {
  width: clamp(28px, 3.9vh, 46px);
  height: clamp(28px, 3.9vh, 46px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: clamp(10px, 1.3vh, 15px);
}
.tv-also-row .nm {
  flex: 1;
}
.tv-also-row .nm b {
  font-size: clamp(10px, 1.4vh, 17px);
  font-weight: 700;
  color: #fff;
}
.tv-also-row .nm small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.tv-also-row .rv {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12px, 1.7vh, 20px);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.tv-ticker {
  background: #050810;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  height: 56px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.tv-ticker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(90deg, #050810, transparent);
  z-index: 2;
}
.tv-ticker::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(270deg, #050810, transparent);
  z-index: 2;
}
.ticker-label {
  flex-shrink: 0;
  padding: 0 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-300);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 3;
  background: #050810;
}
.ticker-track {
  display: flex;
  gap: 50px;
  animation: ticker 38s linear infinite;
  white-space: nowrap;
  padding-left: 30px;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}
.ticker-item .ic {
  color: var(--success);
}
.ticker-item .ic.up {
  color: var(--brand-300);
}
.ticker-item b {
  color: #fff;
  font-weight: 700;
}
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ─── MODAL ─── */
.modal-content {
  border-radius: var(--r-lg);
  border: none;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border: none;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}
.modal-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 0%, rgba(255, 255, 255, 0.25), transparent 70%);
}
.modal-header .modal-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  position: relative;
}
.modal-header .btn-close {
  filter: brightness(0) invert(1);
  position: relative;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.confirm-action-modal .modal-dialog {
  max-width: 440px;
}
.confirm-action-modal .modal-content {
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.confirm-action-modal .confirm-action-header {
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
}
.confirm-action-modal .confirm-action-header::before {
  display: none;
}
.confirm-action-modal .confirm-action-header .modal-title {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.25;
}
.confirm-action-modal .confirm-action-header .btn-close {
  filter: none;
  opacity: 0.58;
  margin-left: auto;
}
.confirm-action-modal .confirm-action-header .btn-close:hover {
  opacity: 0.9;
}
.confirm-action-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.22);
  flex-shrink: 0;
}
.confirm-action-icon i {
  font-size: 18px;
  line-height: 1;
}
.confirm-action-kicker {
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}
.confirm-action-modal .modal-body {
  padding: 20px;
}
.confirm-action-message {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.confirm-action-note {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink-4);
  display: flex;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.45;
}
.confirm-action-note i {
  color: var(--brand-600);
  flex-shrink: 0;
  margin-top: 1px;
}
.confirm-action-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
}
.confirm-action-modal #confirmActionSubmit {
  min-width: 122px;
  justify-content: center;
}

/* ─── INTEGRATIONS ─── */
.integ-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.integ-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  padding: 18px;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.integ-card:hover {
  border-color: var(--ink-5);
  box-shadow: var(--shadow-sm);
}
.integ-card .top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.integ-title-wrap {
  min-width: 0;
  flex: 1;
}
.integ-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-display);
  background: #6366f1;
}
.integ-logo.integ-logo-img {
  background: transparent;
  overflow: hidden;
}
.integ-logo.integ-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.integ-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.integ-cat {
  font-size: 11px;
  color: var(--ink-4);
}
.integ-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  min-height: 58px;
}
.integ-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}
.integ-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 10px;
}
.integ-url-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 11.5px;
}
.webhook-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 28px;
}
.webhook-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
}
.webhook-card-body {
  padding: 18px;
}
.webhook-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.webhook-card-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.webhook-url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}
.webhook-url-box code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 12px;
}
.webhook-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.webhook-meta-item {
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--card);
  min-width: 0;
}
.webhook-meta-label {
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.webhook-meta-value {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.webhook-payload {
  background: #111827;
  color: #e5e7eb;
  border-radius: var(--r);
  padding: 14px;
  margin: 0;
  max-height: 258px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
}
.integration-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.integration-side-panel {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  padding: 18px;
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
}
.connection-summary {
  display: grid;
  gap: 10px;
}
.connection-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg);
}
.connection-summary-item i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--brand-600);
}
.connection-summary-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.connection-summary-sub {
  color: var(--ink-4);
  font-size: 12px;
}
.integration-platform-panel {
  display: none;
}
.endpoint-field {
  display: flex;
  align-items: stretch;
}
.endpoint-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--r) 0 0 var(--r);
  background: var(--bg);
  color: var(--ink-4);
  font-size: 13px;
  white-space: nowrap;
}
.endpoint-field .form-control {
  border-radius: 0 var(--r) var(--r) 0;
}
.webhook-preview-url {
  display: block;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1450px) {
  .integ-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .webhook-panel,
  .integration-editor {
    grid-template-columns: 1fr;
  }
  .integration-side-panel {
    position: static;
  }
}
@media (max-width: 700px) {
  .integ-grid,
  .webhook-meta-grid {
    grid-template-columns: 1fr;
  }
  .webhook-panel {
    gap: 12px;
  }
  .webhook-url-box {
    grid-template-columns: 1fr;
  }
  .endpoint-field {
    display: grid;
  }
  .endpoint-prefix,
  .endpoint-field .form-control {
    border-radius: var(--r);
    border: 1px solid var(--line);
  }
  .endpoint-prefix {
    border-bottom: none;
    justify-content: center;
  }
}

.section-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
}
.section-h h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-h .sub {
  font-size: 12.5px;
  color: var(--ink-3);
}
.section-h .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: 14px 130px 130px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.log-row:last-child {
  border-bottom: none;
}
.log-row .dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.log-row .dot-status.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.log-row .dot-status.err {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.log-row .dot-status.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.log-row .ts {
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}
.log-row .ev {
  color: var(--ink);
  font-weight: 600;
}
.log-row .src {
  color: var(--ink-3);
}

/* ─── GOALS ─── */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.goal-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.goal-card .gtop {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.goal-card .icon-box {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.goal-card.g-success .icon-box {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.goal-card.g-warn .icon-box {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
.goal-card .gtitle {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.goal-card .gsub {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 2px;
}
.goal-card .big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.goal-card .big .of {
  font-size: 14px;
  color: var(--ink-4);
  font-weight: 500;
  margin-left: 4px;
}
.goal-card .pace {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  align-items: center;
}
.goal-card .pace b {
  color: var(--success);
}
.goal-card .pace.behind b {
  color: var(--danger);
}

/* ─── AI CARD ─── */
.ai-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
  position: relative;
  margin-bottom: 24px;
}
.ai-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), #ec4899, var(--brand-500));
  background-size: 200% 100%;
  animation: ai-shimmer 4s linear infinite;
}
@keyframes ai-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
.ai-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ai-spark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), #ec4899);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}
.ai-hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.ai-hd .sub {
  font-size: 11.5px;
  color: var(--ink-4);
}
.ai-bd {
  padding: 18px 20px;
}
.ai-bd p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.ai-bd p:last-child {
  margin-bottom: 0;
}

/* ─── LOGIN ─── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}
/*
 * Logged out pages: keep the copyright strip pinned to the bottom edge.
 * The page wrappers (.login-wrap, .error-page, .legal-page) each carry their
 * own min-height:100vh, which would push the footer past the fold, so the
 * shell drops it and lets flex do the filling instead.
 */
.guest-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.guest-shell > :first-child {
  flex: 1 0 auto;
  min-height: 0;
}
.guest-shell .app-footer {
  flex-shrink: 0;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-hd {
  padding: 32px 32px 24px;
  text-align: center;
}
.logo-login {
  width: 80%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  margin: 0 auto 16px;
}
.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 6px;
}
.login-sub {
  font-size: 14px;
  color: var(--ink-4);
  margin: 0;
}
.login-body {
  padding: 0 32px 32px;
}
.login-field {
  margin-bottom: 16px;
}
.login-card .form-label {
  color: var(--ink-2);
}
.login-card .form-control {
  background: #fafaff !important;
  border-color: var(--brand-100) !important;
}
.login-card .form-control::placeholder {
  color: #7c849b;
  opacity: 1;
}
.login-card .form-control:focus {
  background: #fff !important;
}
.login-body .btn-primary {
  width: 100%;
  justify-content: center;
  height: 42px;
  font-size: 14px;
  margin-top: 8px;
}
/* Link de esqueci a senha: fica na linha do rotulo, acima do campo.
   tabindex=-1 no HTML mantem o tab indo do e-mail direto para a senha. */
.login-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.login-label-row .form-label {
  margin-bottom: 0;
}
.login-forgot {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-600);
  text-decoration: none;
  white-space: nowrap;
}
.login-forgot:hover {
  text-decoration: underline;
}

/* Troca entre entrar e criar conta: uma linha discreta separada por um
   filete, em vez de um cartao colorido competindo com o botao principal. */
.auth-switch {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  text-align: center;
  font-size: 13px;
  color: var(--ink-4);
}
.auth-switch a {
  color: var(--brand-600);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.auth-switch a:hover {
  text-decoration: underline;
}

/* ─── ALERTS ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.25);
}
.alert-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.25);
}
.alert-warning {
  background: var(--warn-bg);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.25);
}
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.25);
}

/* ─── TABS ─── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 0;
  margin-bottom: 24px;
}
.tab-item {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-4);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    color 0.12s,
    border-color 0.12s;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-item:hover {
  color: var(--ink-2);
  text-decoration: none;
}
.tab-item.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-500);
}

/* ─── SELLERS FORM ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .lb-row {
    grid-template-columns: 44px 1fr auto 32px;
  }
  .lb-progress,
  .lb-trend {
    display: none;
  }
  .podium-wrap {
    padding: 0 30px 40px;
    gap: 16px;
  }
  .tv-also {
    padding: 0 20px 16px;
  }
}

/* ─── BOOTSTRAP BRIDGE UTILITIES ─── */
.text-muted {
  color: var(--ink-4) !important;
}
.text-dark {
  color: var(--ink) !important;
}
.border {
  border-color: var(--line) !important;
}
.bg-white {
  background: var(--card) !important;
}
.bg-light {
  background: var(--bg-2) !important;
}
.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}
.shadow {
  box-shadow: var(--shadow-md) !important;
}
.fw-bold {
  font-weight: 700 !important;
}
.fw-semibold {
  font-weight: 600 !important;
}
.fw-medium {
  font-weight: 500 !important;
}
.small,
small {
  font-size: 13px !important;
}
.rounded,
.rounded-lg,
.rounded-xl {
  border-radius: var(--r-md) !important;
}
.rounded-pill {
  border-radius: 999px !important;
}
.overflow-hidden {
  overflow: hidden !important;
}

/* ─── SIDEBAR DIVIDER ─── */
.side-divider {
  height: 1px;
  background: var(--side-line);
  margin: 8px 12px;
}

/* ─── HAMBURGER / MOBILE ─── */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: all 0.12s;
}
.hamburger-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open {
  display: block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  /* Layout */
  .app {
    padding-left: 0 !important;
    transition: none !important;
  }
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--side-w);
    z-index: 100;
    overflow: hidden;
    transform: translateX(-100%);
    transition:
      transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 260ms;
    height: 100dvh;
  }
  .app.collapsed .sidebar {
    width: var(--side-w);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .side-toggle {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
  /* Topbar + page */
  .topbar {
    padding: 0 16px;
    gap: 10px;
  }
  .language-current {
    max-width: 42px;
    padding: 0 8px;
  }
  .language-current span,
  .language-current i {
    display: none;
  }
  .page {
    padding: 16px;
  }
  /* Page header: title on the left, actions on the right */
  .page-h {
    align-items: flex-start;
    gap: 12px;
  }
  .page-h > div:first-child {
    flex: 1 1 160px;
    min-width: 0;
  }
  .page-h h1 {
    font-size: 24px;
  }
  .page-h .actions {
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* Tabs */
  .tab-bar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .tab-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Cards / grids */
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .integ-grid {
    grid-template-columns: 1fr;
  }
  .tv-also {
    grid-template-columns: 1fr;
  }
  .card-h {
    flex-wrap: wrap;
  }
  .card-h .right {
    margin-left: auto;
  }
  /* Forms */
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  .form-grid .full {
    grid-column: 1 !important;
  }
  /* Leaderboard rows - flexbox so empty placeholder divs don't create broken implicit grid columns */
  .lb-row {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    align-items: center;
  }
  .lb-row > .lb-rank {
    width: 32px;
    text-align: center;
    flex-shrink: 0;
  }
  .lb-row > .lb-person {
    flex: 1;
    min-width: 0;
  }
  .lb-row > .lb-rev {
    flex-shrink: 0;
    font-size: 13px;
  }
  .lb-row > div:empty {
    display: none;
  }
  .lb-progress {
    display: none;
  }
  .lb-trend {
    display: none;
  }
  /* Hide view toggle on mobile - saves row space in page-h actions */
  .view-toggle {
    display: none;
  }
  /* Section headers: stack title+subtitle above action buttons on mobile */
  .section-h {
    flex-wrap: wrap;
  }
  .section-h .right {
    margin-left: auto;
    justify-content: flex-end;
  }
  /* Goals grid: force single column on narrow phones */
  .goals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ── Billing ─────────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .stat-row.cols-3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1100px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .stat-row {
    grid-template-columns: 1fr;
  }
}

.stat-sub {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 6px;
}

.page-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.billing-period-selector {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--brand-200);
  border-radius: 12px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
  max-width: 1040px;
  padding: 16px 18px;
}
.billing-period-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.billing-period-description {
  color: var(--ink-4);
  font-size: 12px;
  margin-top: 2px;
}
.billing-period-switch {
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-shrink: 0;
  padding: 4px;
}
.billing-period-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
}
.billing-period-option span {
  background: var(--success-bg);
  border-radius: 999px;
  color: #047857;
  font-size: 10px;
  padding: 4px 6px;
}
.billing-period-option.active {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 3px 9px rgba(67, 70, 196, 0.24);
}
.billing-period-option.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.billing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
  max-width: 1040px;
  align-items: stretch;
}
.billing-plan-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  min-height: 100%;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.billing-plan-card::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--line-2);
}
.billing-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.billing-plan-card.featured {
  border-color: var(--brand-200);
  box-shadow:
    0 10px 28px rgba(67, 70, 196, 0.12),
    var(--shadow-sm);
}
.billing-plan-card.featured::before {
  background: var(--brand-500);
}
.billing-plan-card.current {
  border-color: rgba(16, 185, 129, 0.45);
}
.billing-plan-card.current::before {
  background: var(--success);
}
.billing-plan-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 0;
}
.billing-plan-kicker {
  color: var(--ink-5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.billing-plan-badges {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.billing-plan-badge {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.billing-plan-badge.current-badge {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}
.billing-plan-badge.annual-badge {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}
.billing-plan-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.billing-plan-price {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.05;
  padding: 20px 22px 10px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.billing-plan-price span {
  font-size: 14px;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--ink-4);
}
.billing-plan-price-value {
  font: inherit;
}
.billing-plan-price-support,
.billing-plan-per-seller {
  color: var(--ink-4);
  font-size: 12px;
  line-height: 1.4;
  padding: 0 22px;
}
.billing-plan-price-support {
  min-height: 34px;
}
.billing-plan-per-seller {
  margin-top: 3px;
}
.billing-plan-desc {
  font-size: 13.5px;
  color: var(--ink-4);
  line-height: 1.5;
  min-height: 42px;
  margin: 0;
  padding: 0 22px 18px;
}
.billing-plan-features {
  list-style: none;
  padding: 18px 22px 0;
  margin: 0 0 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line-2);
}
.billing-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-3);
}
.billing-feature-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success-bg);
  color: #047857;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  margin-top: 1px;
}
.billing-plan-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding: 0 22px 22px;
}
.billing-plan-actions form,
.billing-plan-actions .btn {
  width: 100%;
}
.billing-plan-actions .btn {
  justify-content: center;
}
.billing-active-label {
  align-items: center;
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  color: #047857;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
}
.billing-cancel-form {
  margin: 0;
}
.billing-cancel-button {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger) !important;
}
.billing-cancel-button:hover {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.65);
  color: #b91c1c !important;
}
.billing-payment-banner {
  margin-bottom: 24px;
}
.billing-pending-card {
  background: var(--card);
  border: 1.5px solid var(--card-bd);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.billing-pix-icon {
  font-size: 22px;
  margin-right: 6px;
}
.billing-pix-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.billing-pix-desc {
  font-size: 13.5px;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.billing-trial-banner {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid #f59e0b;
  color: #92400e;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.badge.warning {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #92400e;
}
.badge.danger {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #991b1b;
}

@media (max-width: 768px) {
  .billing-plans {
    grid-template-columns: 1fr;
  }
}

/* ─── TOGGLE SWITCH ─── */
.sw-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sw-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sw-slider {
  display: inline-block;
  width: 40px;
  height: 22px;
  background: var(--line);
  border-radius: 11px;
  transition: background 0.2s;
  position: relative;
}
.sw-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.sw-toggle input:checked + .sw-slider {
  background: var(--brand-500);
}
.sw-toggle input:checked + .sw-slider::after {
  transform: translateX(18px);
}

/* Setting row: label on left, toggle on right */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.setting-row:first-child {
  padding-top: 0;
}
.setting-row-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.setting-row-sub {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 2px;
}

/* ─── RESPONSIVE GRID UTILITIES ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.col-2-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .col-2-editor {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Scrollable overflow wrapper for tables */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* Goal hero card: ring + details stack vertically */
  .goal-card-hero {
    flex-direction: column !important;
    padding: 24px !important;
    gap: 20px !important;
    align-items: flex-start !important;
  }

  /* Webhook log rows: 6 cols → dot | event | chevron, hide ts/src/payload */
  .log-row {
    grid-template-columns: 10px 1fr 28px;
    gap: 8px;
    padding: 10px 12px;
  }
  .log-row .ts,
  .log-row .src,
  .log-row > div:nth-child(5) {
    display: none;
  }
}

/* Admin mobile hardening */
.main,
.page,
.page-h,
.page-h > div,
.page-h .actions,
.card,
.card-h,
.card-body,
.stat-card,
.seller-card,
.goal-card,
.integ-card,
.billing-plan-card,
.integration-editor,
.integration-side-panel,
.webhook-card,
.connection-summary-item {
  min-width: 0;
}

.btn i,
a.btn i,
.dropdown-item i,
.tab-item i {
  flex-shrink: 0;
}

.page-h .sub,
.card-h h3,
.section-h .sub,
.connection-summary-title,
.connection-summary-sub,
.webhook-meta-value,
.seller-name,
.lb-name,
.lb-rev,
.goal-card .gtitle,
.goal-card .big {
  overflow-wrap: anywhere;
}

.page-h .actions > form,
.card-h > form {
  min-width: 0;
}

.card > [style*="overflow-x:auto"],
.card > [style*="overflow-x: auto"],
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cell-name {
  min-width: 0;
}
.cell-name > div:last-child {
  min-width: 0;
}
.lb-person > div:last-child {
  min-width: 0;
}
.cell-name b,
.cell-name .em,
.lb-name,
.lb-meta {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-menu {
  max-width: calc(100vw - 24px);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.pill:hover {
  border-color: var(--ink-5);
  color: var(--ink);
}
.pill.active {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

@media (max-width: 1180px) {
  .col-2-editor {
    grid-template-columns: 1fr;
  }
  .col-2-editor > div[style*="position:sticky"],
  .col-2-editor > div[style*="position: sticky"] {
    position: static !important;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 14px;
  }
  .topbar {
    padding: 0 12px;
  }
  .topbar .right {
    gap: 6px;
  }
  .page-h {
    margin-bottom: 18px;
  }
  .page-h .sub {
    line-height: 1.45;
  }
  .page-h .actions {
    justify-content: flex-end;
  }
  .card-body {
    padding: 16px;
  }
  .card-h {
    padding: 14px 16px;
    align-items: flex-start;
  }
  .card-h .right {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .table,
  .tbl {
    min-width: 680px;
  }
  .tbl th,
  .tbl td,
  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding: 11px 12px;
    white-space: nowrap;
  }
  .stat-card {
    padding: 15px;
  }
  .stat-value {
    font-size: 24px;
    line-height: 1.12;
  }
  .seller-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .rank-badge {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .seller-revenue {
    font-size: 25px;
    overflow-wrap: anywhere;
  }
  .billing-pending-card {
    padding: 18px;
  }
  .billing-period-selector {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .billing-period-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .billing-period-option {
    justify-content: center;
    padding: 0 8px;
  }
  .billing-plan-top {
    padding: 18px 18px 0;
    flex-direction: column;
  }
  .billing-plan-badges {
    justify-content: flex-start;
  }
  .billing-plan-price {
    font-size: 32px;
    padding: 18px 18px 10px;
  }
  .billing-plan-price-support,
  .billing-plan-per-seller {
    padding-left: 18px;
    padding-right: 18px;
  }
  .billing-plan-desc {
    padding: 0 18px 16px;
  }
  .billing-plan-features {
    padding: 16px 18px 0;
  }
  .billing-plan-actions {
    padding: 0 18px 18px;
  }
  .webhook-card-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .webhook-url-box code,
  .webhook-preview-url,
  .connection-summary-sub {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .endpoint-prefix {
    white-space: normal;
    overflow-wrap: anywhere;
    justify-content: flex-start;
  }
  .cfg-footer {
    flex-wrap: wrap;
    gap: 12px;
  }
  .cfg-footer-right {
    margin-left: auto;
    justify-content: flex-end !important;
  }
  .cfg-footer .btn {
    flex: 0 0 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .topbar .crumb {
    font-size: 12px;
  }
  .icon-btn,
  .hamburger-btn {
    width: 34px;
    height: 34px;
  }
  .page-h h1 {
    font-size: 22px;
    line-height: 1.15;
  }
  .btn,
  a.btn {
    min-height: 36px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  .btn-sm,
  a.btn-sm {
    min-height: 34px;
  }
  .page-h .actions > form {
    flex-wrap: wrap;
  }
  .page-h .actions > form .form-select,
  .page-h .actions > form .form-control {
    min-width: 0;
  }
  .pagination-wrap {
    padding: 12px 16px;
  }
  .modal-dialog {
    max-width: calc(100% - 24px);
    margin: 12px auto;
  }
  .modal-content {
    max-height: calc(100dvh - 24px);
  }
  .modal-body {
    padding: 18px;
    overflow: auto;
  }
  .modal-header,
  .modal-footer {
    padding: 16px 18px;
  }
  .modal-footer {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .billing-pending-card {
    flex-direction: column;
  }
  .billing-pix-icon {
    margin-right: 0;
  }
  .setting-row {
    align-items: flex-start;
  }
  .pill {
    min-height: 38px;
  }
  .goal-card .big {
    font-size: 26px;
    line-height: 1.15;
  }
  .goal-card .big .of {
    display: block;
    margin: 6px 0 0;
  }
  .goal-card-hero [style*="font-size:36px"] {
    font-size: 26px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }
  .log-row .badge,
  .log-row .btn {
    justify-self: end;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px;
  }
  .topbar .crumb {
    max-width: calc(100vw - 132px);
  }
  .page-h .actions,
  .cfg-footer-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .stat-card,
  .card-body,
  .webhook-card-body,
  .integration-side-panel {
    padding: 14px;
  }
  .table,
  .tbl {
    min-width: 620px;
  }
  .dropdown-menu {
    min-width: min(220px, calc(100vw - 24px));
  }
}

/* ─── HELP CENTER ─── */
.help-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.help-hero-main {
  min-width: 0;
}

.help-kicker {
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.help-hero h2 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.12;
  margin: 0;
  max-width: 760px;
}

.help-hero p {
  color: var(--ink-4);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 620px;
}

.help-hero-panel {
  display: grid;
  gap: 10px;
}

.help-hero-stat {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  display: flex;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
}

.help-hero-stat span {
  align-items: center;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 7px;
  color: var(--brand-700);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 42px;
}

.help-hero-stat strong {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.25;
}

.help-card-grid,
.help-integration-grid,
.help-faq-grid {
  display: grid;
  gap: 14px;
}

.help-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.help-card,
.help-integration-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  color: inherit;
  min-width: 0;
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}

.help-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 16px;
}

.help-card:hover,
.help-integration-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.help-card-icon,
.help-tutorial-icon,
.help-side-icon {
  align-items: center;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 8px;
  color: var(--brand-600);
  display: inline-flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.help-card-label {
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: 14px;
  text-transform: uppercase;
}

.help-card h3,
.help-tutorial h3,
.help-integration-card h3,
.help-faq-card h3 {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  margin: 6px 0 0;
}

.help-card p,
.help-integration-card p,
.help-faq-card p,
.help-side-copy {
  color: var(--ink-4);
  font-size: 13px;
  line-height: 1.55;
  margin: 10px 0 0;
}

.help-card span {
  align-items: center;
  color: var(--brand-600);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.help-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.help-main,
.help-side {
  min-width: 0;
}

.help-side {
  display: grid;
  gap: 14px;
}

.help-tutorial-list {
  display: grid;
  gap: 14px;
}

.help-tutorial {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  padding: 16px;
}

.help-tutorial-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.help-tutorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.help-tutorial-meta span {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
}

.help-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding-left: 22px;
}

.help-steps li {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
  padding-left: 3px;
}

.help-side-icon.success {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--success);
}

.help-checklist {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-checklist li {
  align-items: center;
  color: var(--ink-3);
  display: flex;
  font-size: 13px;
  gap: 8px;
}

.help-checklist i {
  align-items: center;
  background: var(--success-bg);
  border-radius: 6px;
  color: var(--success);
  display: inline-flex;
  flex-shrink: 0;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.help-integration-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.help-integration-card {
  display: flex;
  flex-direction: column;
  min-height: 186px;
  padding: 16px;
}

.help-integration-top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.help-integration-top h3 {
  margin-top: 0;
}

.help-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.help-chip-row span {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.help-faq-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-faq-card .card-body {
  height: 100%;
}

.help-faq-card h3 {
  margin-top: 0;
}

@media (max-width: 1180px) {
  .help-card-grid,
  .help-integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .help-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .help-hero h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .help-card-grid,
  .help-integration-grid,
  .help-side {
    grid-template-columns: 1fr;
  }

  .help-card,
  .help-integration-card {
    min-height: 0;
  }

  .help-tutorial-head {
    align-items: flex-start;
  }
}

/* Alert components */
.alert-error-custom {
    background-color: #fef2f2;
    border-color: #fecaca !important;
}
.alert-error-custom .alert-heading { font-size: 0.875rem; font-weight: 600; color: #dc2626; }
.alert-error-custom p { font-size: 0.875rem; color: #991b1b; }
.alert-icon-error { background-color: #fee2e2 !important; }
.alert-icon-error i { color: #dc2626 !important; }

.alert-success-custom {
    background-color: #f0fdf4;
    border-color: #bbf7d0 !important;
}
.alert-success-custom .alert-heading { font-size: 0.875rem; font-weight: 600; color: #16a34a; }
.alert-success-custom p { font-size: 0.875rem; color: #15803d; }
.alert-icon-success { background-color: #dcfce7 !important; }
.alert-icon-success i { color: #16a34a !important; }

.alert-warning-custom {
    background-color: #fffbeb;
    border-color: #fde68a !important;
}
.alert-warning-custom .alert-heading { font-size: 0.875rem; font-weight: 600; color: #d97706; }
.alert-warning-custom p { font-size: 0.875rem; color: #b45309; }
.alert-icon-warning { background-color: #fef3c7 !important; }
.alert-icon-warning i { color: #d97706 !important; }

/* Avatar upload preview */
.avatar-preview-img { width: 120px; height: 120px; object-fit: cover; }
.avatar-preview-placeholder { width: 120px; height: 120px; color: var(--ink-4); background: var(--bg-2); }

/* Legal pages */
.legal-page {
    background: var(--bg);
    min-height: 100vh;
    padding: 48px 20px;
}

.app .legal-page {
    min-height: auto;
    padding: 28px;
}

.legal-document {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    color: var(--ink-2);
    margin: 0 auto;
    max-width: 900px;
    padding: 34px;
}

.legal-document h1 {
    color: var(--ink);
    font-size: 30px;
    line-height: 1.2;
    margin: 4px 0 8px;
}

.legal-document h2 {
    color: var(--ink);
    font-size: 18px;
    margin: 28px 0 10px;
}

.legal-document p,
.legal-document li {
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.75;
}

.legal-document ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.legal-document a {
    color: var(--brand-500);
    font-weight: 600;
}

.legal-kicker {
    color: var(--brand-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.legal-updated {
    margin-bottom: 24px;
}

.legal-login-links {
    color: var(--ink-5);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.legal-login-links a {
    color: var(--brand-500);
    text-decoration: none;
}

@media (max-width: 700px) {
    .legal-page {
        padding: 20px 12px;
    }

    .legal-document {
        padding: 22px;
    }

    .legal-document h1 {
        font-size: 25px;
    }
}

/* Seta do select.
   A regra .form-select acima usa o atalho `background` com !important,
   que apaga a imagem de seta que o Bootstrap coloca. Sem ela nenhum
   select do painel mostra o indicador de abrir. Reposta aqui, depois
   da regra original, para vencer na ordem. */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23606879' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
  background-size: 14px 14px !important;
}
.form-select::-ms-expand {
  display: none;
}

/* Acao em lote: fica acima do card da tabela, separada dele, entao nao
   parece parte da listagem. So o select, alinhado a esquerda. */
.bulk-bar {
  display: flex;
  align-items: center;
  margin: 0 0 14px;
}
.bulk-bar[hidden] {
  display: none;
}
.bulk-bar .form-select {
  max-width: 230px;
}

/* Entrar com Google */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--ink-5);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
}
.btn-google {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn-google:hover {
  background: #f7f8f8;
  border-color: var(--ink-5);
}
.btn-google:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, .25);
}

/* Identidade confirmada pelo Google no passo final do cadastro */
.google-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg-2);
}
.google-identity > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.google-identity strong {
  font-size: 13.5px;
  color: var(--ink);
}
.google-identity span {
  font-size: 12.5px;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
}
.google-identity-ok {
  color: var(--success, #16a34a);
}
.company-identity-hint {
  color: var(--ink-4);
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
}

/* ─── PLAN LIMIT NOTICE ─── */
.plan-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.plan-notice.near {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.plan-notice.reached {
  align-items: flex-start;
  border-color: var(--warn);
  background: var(--warn-bg);
}
.plan-notice-icon {
  font-size: 16px;
  color: var(--warn);
  flex: none;
  margin-top: 2px;
}
.plan-notice-body {
  flex: 1;
  min-width: 0;
}
.plan-notice-body > b {
  font-size: 13.5px;
  color: var(--ink);
}
.plan-notice-text {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
}
.plan-notice-meter {
  display: block;
  height: 6px;
  max-width: 320px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.plan-notice-fill {
  display: block;
  height: 100%;
  background: var(--brand-500);
  border-radius: 3px;
}
.plan-notice.near .plan-notice-fill,
.plan-notice.reached .plan-notice-fill {
  background: var(--warn);
}
.plan-notice-usage {
  font-size: 12px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.plan-notice-cta {
  flex: none;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .plan-notice {
    flex-direction: column;
    align-items: flex-start;
  }
  .plan-notice-cta {
    justify-content: center;
  }
}

/* ─── CHOOSE PLAN (signup step) ─── */
.choose-plan-page {
  max-width: 1100px;
  margin: 0 auto;
}
.choose-plan-head {
  text-align: center;
  margin: 28px 0 24px;
}
.choose-plan-head h1 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.choose-plan-head p {
  margin: 0;
  color: var(--ink-4);
  font-size: 14.5px;
}
.choose-plan-terms {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
}
.choose-plan-term {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-4);
}
.choose-plan-term i {
  color: var(--success);
  font-size: 14px;
}
@media (max-width: 700px) {
  .choose-plan-terms {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Error pages (403 / 404 / 500) */
.error-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.app .error-page {
  min-height: calc(100vh - var(--topbar-h));
  padding: 28px;
}
.error-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-width: 520px;
  padding: 40px 34px;
  text-align: center;
  width: 100%;
}
.error-icon {
  align-items: center;
  background: var(--brand-50);
  border-radius: 50%;
  color: var(--brand-500);
  display: inline-flex;
  font-size: 30px;
  height: 72px;
  justify-content: center;
  margin-bottom: 18px;
  width: 72px;
}
.error-code {
  color: var(--ink-5);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.error-title {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
  margin: 6px 0 10px;
}
.error-message {
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 6px;
}
.error-hint {
  color: var(--ink-5);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
@media (max-width: 700px) {
  .error-page {
    padding: 20px 12px;
  }
  .error-card {
    padding: 28px 20px;
  }
}

/* ─── DASHBOARD ─── */
.dash-section {
  margin-bottom: 16px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
}
.dash-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-card-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dash-card-meta {
  font-size: 11.5px;
  color: var(--viz-axis);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dash-plot {
  position: relative;
  height: 268px;
}
.dash-plot.sm {
  height: 232px;
}
.dash-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}

/* ── Legend: the key repeats the shape of the mark it names ── */
.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}
.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-4);
}
.dash-legend-key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--viz-1);
  flex-shrink: 0;
}
.dash-legend-key.prev {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--viz-prev) 0 5px, transparent 5px 9px);
}

/* ── Donut plus its readable key list ── */
.dash-split {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  flex: 1;
}
.dash-donut {
  position: relative;
  height: 168px;
}
/* O buraco da rosca carrega o total, para a soma nao virar uma conta de cabeca */
.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  text-align: center;
  padding: 0 34px;
}
.dash-donut-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--viz-axis);
}
.dash-donut-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.dash-keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.dash-key-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.dash-key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--viz-6);
}
.dash-key.slot-1 {
  background: var(--viz-1);
}
.dash-key.slot-2 {
  background: var(--viz-2);
}
.dash-key.slot-3 {
  background: var(--viz-3);
}
.dash-key.slot-4 {
  background: var(--viz-4);
}
.dash-key.slot-5 {
  background: var(--viz-5);
}
.dash-key.slot-6 {
  background: var(--viz-6);
}
.dash-key-name {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-key-value {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash-key-share {
  color: var(--viz-axis);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* Month over month delta shown on the revenue stat card */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  white-space: nowrap;
}
.stat-trend.up {
  color: var(--success);
}
.stat-trend.down {
  color: var(--danger);
}

/* Goal attainment */
.goal-track-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.goal-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
}
.goal-track-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goal-track-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.goal-track-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 4px;
  background: var(--viz-track);
  overflow: hidden;
}
.goal-track-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--viz-1);
}
.goal-track.reached .goal-track-fill {
  background: var(--success);
}
.goal-track.reached .goal-track-pct {
  color: var(--success);
}
.goal-track-sub {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .dash-split {
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 16px;
  }
  .dash-donut {
    height: 148px;
  }
}
@media (max-width: 768px) {
  .dash-card {
    padding: 16px;
  }
  .dash-plot {
    height: 230px;
  }
  .dash-plot.sm {
    height: 220px;
  }
  .dash-card-h {
    flex-wrap: wrap;
  }
  .dash-split {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .dash-keys {
    width: 100%;
  }
}
