:root {
  /* Paleta de Cores - Profissional e Moderna (Inspirada em Apps de Trading/Sports) */
  --primary: #10b981; /* Verde Esmeralda (Sucesso/Green) */
  --primary-hover: #059669;
  --secondary: #6366f1; /* Indigo */
  --danger: #ef4444; /* Vermelho (Red) */
  --warning: #f59e0b; /* Âmbar */
  --info: #3b82f6; /* Azul */
  
  /* Tons de Cinza / Superfícies */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a; /* Azul Marinho Escuro */
  --shell-bg: radial-gradient(1200px 420px at 10% -10%, rgba(16, 185, 129, 0.1), transparent 55%),
    radial-gradient(900px 400px at 105% 0%, rgba(59, 130, 246, 0.12), transparent 52%),
    linear-gradient(180deg, #f4f8ff 0%, #edf3fb 100%);
  --topbar-bg: rgba(255, 255, 255, 0.72);
  --topbar-border: rgba(148, 163, 184, 0.25);
  --sidebar-bg:
    radial-gradient(120% 55% at 14% 100%, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0) 60%),
    radial-gradient(95% 65% at 100% 0%, rgba(59, 130, 246, 0.11) 0%, rgba(59, 130, 246, 0) 58%),
    linear-gradient(170deg, #eaf2ff 0%, #dde8fb 48%, #d4e1f7 100%);
  --sidebar-border: rgba(100, 116, 139, 0.22);
  --sidebar-brand-border: rgba(100, 116, 139, 0.18);
  --sidebar-fg: #0f2540;
  --sidebar-title: #0f2540;
  --sidebar-subtitle: #4f6b8a;
  --sidebar-nav-text: #27405f;
  --sidebar-nav-bg: rgba(255, 255, 255, 0.35);
  --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.6);
  --sidebar-nav-hover-border: rgba(59, 130, 246, 0.25);
  --sidebar-nav-hover-text: #17324f;
  --sidebar-nav-active-bg: linear-gradient(135deg, #20bb86, #0b9e77);
  --sidebar-nav-active-border: rgba(255, 255, 255, 0.5);
  --sidebar-nav-active-shadow: 0 8px 18px rgba(16, 185, 129, 0.26);
  --sidebar-icon-bg: rgba(37, 99, 235, 0.14);
  --sidebar-icon-active-bg: rgba(255, 255, 255, 0.24);
  --sidebar-fx-bottom:
    linear-gradient(150deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.03) 55%, rgba(16, 185, 129, 0) 100%),
    repeating-linear-gradient(157deg, rgba(30, 64, 175, 0.08) 0 2px, transparent 2px 22px);
  --sidebar-fx-corner: radial-gradient(circle at center, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0));
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Sombras e Bordas */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

/* GreenHunter premium landing */
.ghx-landing {
  --ghx-bg: #121414;
  --ghx-panel: rgba(23, 28, 28, 0.72);
  --ghx-panel-strong: rgba(27, 34, 34, 0.88);
  --ghx-line: rgba(73, 232, 212, 0.18);
  --ghx-line-strong: rgba(73, 232, 212, 0.48);
  --ghx-text: #f6fbff;
  --ghx-muted: rgba(218, 244, 241, 0.62);
  --ghx-cyan: #49e8d4;
  --ghx-blue: #69d9ff;
  --ghx-aqua: #49e8d4;
  --ghx-green: #49e8d4;
  --ghx-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 0;
  color: var(--ghx-text);
  background:
    radial-gradient(1100px 520px at 76% 8%, rgba(73, 232, 212, 0.18), transparent 56%),
    radial-gradient(900px 500px at 14% 20%, rgba(73, 232, 212, 0.1), transparent 54%),
    linear-gradient(180deg, #121414 0%, #0d1111 48%, #080a0a 100%);
  font-family: "Hanken Grotesk", "DM Sans", system-ui, -apple-system, sans-serif;
}

body:has(.ghx-landing) {
  background: #121414;
  overflow-x: hidden;
}

body:has(.ghx-auth-shell) {
  background: #121414;
  overflow-x: hidden;
}

.ghx-landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 78%);
}

.ghx-landing > * {
  position: relative;
  z-index: 1;
}

.ghx-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 222, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 10, 24, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-brand,
.ghx-nav-links,
.ghx-nav-actions,
.ghx-hero-actions,
.ghx-trust-row,
.ghx-logo-strip,
.ghx-dashboard-top,
.ghx-score-line,
.ghx-tech-list,
.ghx-result-row {
  display: flex;
  align-items: center;
}

.ghx-brand {
  gap: 10px;
  color: var(--ghx-text);
}

.ghx-brand:hover {
  color: #fff;
}

.ghx-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #02110c;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 34px rgba(45, 212, 191, 0.45);
  overflow: hidden;
}

.ghx-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ghx-brand strong,
.ghx-brand small {
  display: block;
  line-height: 1.05;
}

.ghx-brand strong {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.ghx-brand small {
  margin-top: 3px;
  color: var(--ghx-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ghx-nav-links {
  gap: 22px;
}

.ghx-nav-links a,
.ghx-link-btn {
  color: rgba(235, 247, 255, 0.74);
  font-size: 0.92rem;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.ghx-nav-links a:hover,
.ghx-link-btn:hover {
  color: #fff;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

.ghx-nav-actions {
  gap: 10px;
}

.ghx-primary-btn,
.ghx-secondary-btn,
.ghx-price-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ghx-primary-btn {
  gap: 10px;
  color: #071312;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: #49e8d4;
  box-shadow: 0 0 28px rgba(73, 232, 212, 0.26), 0 16px 48px rgba(73, 232, 212, 0.14);
}

.ghx-primary-btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.ghx-secondary-btn {
  color: #eaffff;
  border: 1px solid rgba(150, 226, 255, 0.24);
  background: rgba(255, 255, 255, 0.055);
}

.ghx-primary-btn:hover,
.ghx-secondary-btn:hover,
.ghx-price-card a:hover {
  transform: translateY(-2px);
  color: #fff;
}

.ghx-primary-btn:hover {
  color: #071312;
  box-shadow: 0 0 42px rgba(73, 232, 212, 0.38), 0 24px 58px rgba(73, 232, 212, 0.18);
}

.ghx-hero {
  min-height: min(820px, 92svh);
  margin-top: -74px;
  padding: 145px 0 70px;
  background:
    linear-gradient(90deg, rgba(18, 20, 20, 0.98) 0%, rgba(18, 20, 20, 0.9) 35%, rgba(18, 20, 20, 0.18) 78%),
    linear-gradient(180deg, rgba(18, 20, 20, 0.08) 0%, #121414 100%),
    var(--ghx-hero-image) center right / min(1040px, 78vw) auto no-repeat;
}

.ghx-particles {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 22%, rgba(73, 232, 212, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 31% 72%, rgba(73, 232, 212, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 24%, rgba(170, 255, 245, 0.44) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 62%, rgba(73, 232, 212, 0.62) 0 1px, transparent 2px);
  background-size: 240px 240px, 300px 300px, 270px 270px, 320px 320px;
  animation: ghxDrift 18s linear infinite;
}

.ghx-hero-grid,
.ghx-section,
.ghx-final-cta {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.ghx-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(320px, 0.86fr);
  gap: 56px;
  align-items: center;
}

.ghx-hero-copy {
  min-width: 0;
  max-width: 735px;
}

.ghx-kicker,
.ghx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ghx-cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ghx-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 22px var(--ghx-green);
}

.ghx-hero h1,
.ghx-section-head h2,
.ghx-dashboard-copy h2,
.ghx-tech-copy h2,
.ghx-telegram-copy h2,
.ghx-final-cta h2 {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  color: #f8fdff;
}

.ghx-hero h1 {
  margin: 22px 0 20px;
  max-width: 760px;
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: clamp(3.15rem, 5.7vw, 5.2rem);
  font-weight: 700;
  line-height: 0.98;
  text-wrap: balance;
  letter-spacing: -0.015em;
  text-shadow: 0 0 36px rgba(160, 230, 255, 0.12);
}

.ghx-hero h1 em {
  font-style: normal;
  font-weight: 800;
  color: transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 50%),
    linear-gradient(92deg, #f8fffd 0%, #49e8d4 52%, #9df7ee 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 16px rgba(73, 232, 212, 0.22));
}

.ghx-hero-copy > p,
.ghx-section-head p,
.ghx-dashboard-copy p,
.ghx-tech-copy p,
.ghx-telegram-copy p,
.ghx-final-cta p,
.ghx-glass-card p,
.ghx-step p,
.ghx-price-card p,
.ghx-faq-item p {
  color: var(--ghx-muted);
}

.ghx-hero-copy > p {
  max-width: 640px;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.75;
}

.ghx-hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.ghx-trust-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.ghx-trust-row span {
  padding: 8px 12px;
  border: 1px solid rgba(148, 222, 255, 0.15);
  border-radius: 999px;
  color: rgba(238, 251, 255, 0.78);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
}

.ghx-hero-stage {
  position: relative;
  min-height: 450px;
}

.ghx-floating-panel {
  position: absolute;
  border: 1px solid var(--ghx-line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(7, 18, 39, 0.72), rgba(13, 39, 66, 0.46));
  box-shadow: var(--ghx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-panel-a {
  right: 12%;
  top: 16%;
  width: 190px;
  padding: 18px;
  animation: ghxFloat 5.2s ease-in-out infinite;
}

.ghx-panel-b {
  right: 2%;
  bottom: 26%;
  gap: 10px;
  padding: 13px 16px;
  color: #d9fffb;
  animation: ghxFloat 6.1s ease-in-out infinite reverse;
}

.ghx-panel-c {
  left: 10%;
  bottom: 12%;
  width: 170px;
  padding: 16px;
  animation: ghxFloat 5.7s ease-in-out infinite;
}

.ghx-panel-label {
  display: block;
  color: var(--ghx-muted);
  font-size: 0.78rem;
}

.ghx-floating-panel strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
}

.ghx-mini-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 46px;
  align-items: end;
  margin-top: 18px;
}

.ghx-mini-bars i,
.ghx-chart-card span {
  display: block;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--ghx-cyan), var(--ghx-green));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.ghx-mini-bars i:nth-child(1) { height: 48%; }
.ghx-mini-bars i:nth-child(2) { height: 70%; }
.ghx-mini-bars i:nth-child(3) { height: 92%; }
.ghx-mini-bars i:nth-child(4) { height: 58%; }

.ghx-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 24px var(--ghx-green);
}

.ghx-section {
  padding: 92px 0;
}

.ghx-section-head {
  max-width: 820px;
  margin-bottom: 34px;
}

.ghx-section-head h2,
.ghx-dashboard-copy h2,
.ghx-tech-copy h2,
.ghx-telegram-copy h2,
.ghx-final-cta h2 {
  margin: 12px 0 12px;
  font-size: clamp(2.1rem, 4.8vw, 4.4rem);
  line-height: 1.02;
}

.ghx-section-head p,
.ghx-dashboard-copy p,
.ghx-tech-copy p,
.ghx-telegram-copy p,
.ghx-final-cta p {
  max-width: 680px;
  font-size: 1.06rem;
  line-height: 1.72;
}

.ghx-logo-strip {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ghx-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.ghx-logo-strip span {
  color: rgba(239, 250, 255, 0.48);
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.ghx-card-grid {
  display: grid;
  gap: 18px;
}

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

.ghx-glass-card,
.ghx-dashboard,
.ghx-neural-card,
.ghx-price-card,
.ghx-stat-card,
.ghx-faq-item,
.ghx-final-cta,
.ghx-phone {
  border: 1px solid var(--ghx-line);
  background: linear-gradient(145deg, rgba(255,255,255,0.085), rgba(255,255,255,0.028));
  box-shadow: var(--ghx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-glass-card {
  min-height: 250px;
  padding: 26px;
  border-radius: 24px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.ghx-glass-card:hover,
.ghx-price-card:hover,
.ghx-faq-item:hover,
.ghx-result-row:hover {
  transform: translateY(-4px);
  border-color: var(--ghx-line-strong);
  box-shadow: 0 26px 90px rgba(34, 211, 238, 0.12), var(--ghx-shadow);
}

.ghx-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 18px;
  color: var(--ghx-cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.14);
}

.ghx-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ghx-glass-card h3,
.ghx-step h3 {
  margin: 0 0 10px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.28rem;
}

.ghx-glass-card p,
.ghx-step p {
  margin: 0;
  line-height: 1.7;
}

.ghx-dashboard-wrap,
.ghx-split,
.ghx-telegram {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1fr);
  gap: 28px;
  align-items: center;
}

.ghx-dashboard {
  padding: 16px;
  border-radius: 30px;
  background: rgba(5, 12, 28, 0.74);
}

.ghx-dashboard-top {
  gap: 7px;
  padding: 8px 8px 14px;
  color: rgba(237, 250, 255, 0.62);
}

.ghx-dashboard-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.ghx-dashboard-top strong {
  margin-left: auto;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.ghx-dashboard-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.ghx-signal-card,
.ghx-chart-card,
.ghx-metric-stack div {
  border: 1px solid rgba(148, 222, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.ghx-signal-card {
  grid-row: span 2;
  padding: 22px;
}

.ghx-signal-card small,
.ghx-metric-stack small {
  display: block;
  color: var(--ghx-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.ghx-signal-card strong {
  display: block;
  margin: 8px 0 20px;
  color: #fff;
  font-size: 2rem;
}

.ghx-score-line {
  justify-content: space-between;
  gap: 10px;
  color: #d9eefe;
}

.ghx-score-line b {
  color: var(--ghx-green);
  white-space: nowrap;
}

.ghx-progress {
  height: 10px;
  margin-top: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ghx-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.42);
}

.ghx-chart-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 156px;
  padding: 18px;
}

.ghx-chart-card span:nth-child(1) { height: 38%; }
.ghx-chart-card span:nth-child(2) { height: 68%; }
.ghx-chart-card span:nth-child(3) { height: 54%; }
.ghx-chart-card span:nth-child(4) { height: 88%; }
.ghx-chart-card span:nth-child(5) { height: 72%; }

.ghx-metric-stack {
  display: grid;
  gap: 10px;
}

.ghx-metric-stack div {
  padding: 14px;
}

.ghx-metric-stack strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 1.24rem;
}

.ghx-timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.ghx-timeline::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: linear-gradient(var(--ghx-cyan), var(--ghx-green));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.4);
}

.ghx-step {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--ghx-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
}

.ghx-step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #00110d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.42);
}

.ghx-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ghx-stat-card {
  min-height: 188px;
  padding: 24px;
  border-radius: 24px;
}

.ghx-stat-card strong {
  display: block;
  color: transparent;
  background: linear-gradient(120deg, #fff, var(--ghx-cyan), var(--ghx-green));
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1;
}

.ghx-stat-card span {
  display: block;
  margin-top: 14px;
  color: var(--ghx-muted);
}

.ghx-tech-list {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.ghx-tech-list span {
  padding: 9px 12px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 999px;
  color: #dffcff;
  background: rgba(34, 211, 238, 0.06);
}

.ghx-neural-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 28px;
  border-radius: 30px;
}

.ghx-neural-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    linear-gradient(rgba(34, 211, 238, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.1) 1px, transparent 1px);
  background-size: 34px 34px;
}

.ghx-neural-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin: 28px auto 46px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 36px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(45, 212, 191, 0.12));
  box-shadow: 0 0 70px rgba(34, 211, 238, 0.32);
  transform: rotate(45deg);
}

.ghx-neural-core::first-letter {
  transform: rotate(-45deg);
}

.ghx-neural-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 222, 255, 0.14);
  border-radius: 16px;
  background: rgba(5, 8, 22, 0.54);
}

.ghx-neural-row span {
  color: var(--ghx-muted);
}

.ghx-neural-row strong {
  color: var(--ghx-green);
}

.ghx-results {
  display: grid;
  gap: 10px;
}

.ghx-result-row {
  grid-template-columns: 110px 1fr 90px 110px 70px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ghx-line);
  border-radius: 18px;
  color: #eafcff;
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-result-row span {
  color: var(--ghx-muted);
}

.ghx-result-status {
  justify-content: center;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.ghx-result-green { color: #022016 !important; background: var(--ghx-green); }
.ghx-result-pending { color: #041520 !important; background: var(--ghx-cyan); }
.ghx-result-red { color: #fff !important; background: #ef4444; }

.ghx-telegram {
  grid-template-columns: minmax(320px, 0.76fr) minmax(0, 1fr);
}

.ghx-phone {
  width: min(390px, 100%);
  min-height: 560px;
  margin-inline: auto;
  padding: 18px;
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    #071021;
}

.ghx-phone-top {
  width: 92px;
  height: 8px;
  margin: 0 auto 54px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.ghx-message {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 22px 22px 22px 6px;
  background: rgba(34, 211, 238, 0.09);
}

.ghx-message-alt {
  margin-left: 58px;
  border-radius: 22px 22px 6px 22px;
  background: rgba(49, 246, 164, 0.09);
}

.ghx-message small {
  color: var(--ghx-cyan);
}

.ghx-message strong {
  display: block;
  margin: 5px 0;
  color: #fff;
}

.ghx-message p {
  margin: 0;
  color: #cfe8f5;
}

.ghx-testimonial {
  min-height: 220px;
}

.ghx-testimonial p {
  margin-bottom: 24px;
  color: #dceefa;
}

.ghx-testimonial strong,
.ghx-testimonial span {
  display: block;
}

.ghx-testimonial span {
  color: var(--ghx-muted);
}

.ghx-pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.ghx-price-card {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  padding: 28px;
  border-radius: 28px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-price-featured {
  border-color: rgba(49, 246, 164, 0.58);
  box-shadow: 0 0 60px rgba(45, 212, 191, 0.15), var(--ghx-shadow);
}

.ghx-price-card > span {
  color: var(--ghx-cyan);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ghx-price-card h3 {
  margin: 18px 0 12px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  font-size: 3rem;
}

.ghx-price-card ul {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  color: #d9eef7;
  list-style: none;
}

.ghx-price-card li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 12px var(--ghx-green);
}

.ghx-price-card a {
  margin-top: auto;
  color: #eaffff;
  border: 1px solid rgba(148, 222, 255, 0.22);
  background: rgba(255,255,255,0.06);
}

.ghx-price-featured a {
  color: #02110d;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
}

.ghx-faq {
  display: grid;
  gap: 12px;
}

.ghx-faq-item {
  padding: 20px 22px;
  border-radius: 20px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-faq-item summary {
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.ghx-faq-item p {
  margin: 14px 0 0;
}

.ghx-final-cta {
  margin-bottom: 76px;
  padding: 58px;
  border-radius: 34px;
  text-align: center;
  background:
    radial-gradient(560px 220px at 50% 0%, rgba(34, 211, 238, 0.22), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
}

.ghx-final-cta p {
  margin-inline: auto;
}

.ghx-final-cta .ghx-primary-btn {
  margin-top: 18px;
}

.ghx-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.ghx-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ghx-hero .ghx-reveal {
  opacity: 1;
  transform: none;
}

@keyframes ghxDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-90px, 60px, 0); }
}

@keyframes ghxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (max-width: 1040px) {
  .ghx-nav-links {
    display: none;
  }

  .ghx-hero {
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.72), #121414 88%),
      var(--ghx-hero-image) center 74px / min(820px, 120vw) auto no-repeat;
  }

  .ghx-hero-grid,
  .ghx-dashboard-wrap,
  .ghx-split,
  .ghx-telegram {
    grid-template-columns: 1fr;
  }

  .ghx-hero-copy {
    padding-top: 180px;
  }

  .ghx-hero-stage {
    min-height: 260px;
  }

  .ghx-card-grid-3,
  .ghx-pricing,
  .ghx-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ghx-nav {
    top: 8px;
    width: calc(100% - 18px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .ghx-brand small,
  .ghx-nav .ghx-primary-btn-sm {
    display: none;
  }

  .ghx-brand {
    min-width: 0;
    max-width: calc(100% - 88px);
  }

  .ghx-brand strong {
    font-size: 0.96rem;
  }

  .ghx-nav-actions {
    display: flex;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    justify-content: flex-end;
  }

  .ghx-nav .ghx-link-btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(73, 232, 212, 0.22);
    border-radius: 999px;
    color: #effffd;
    background: rgba(255, 255, 255, 0.045);
  }

  .ghx-primary-btn-sm {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.86rem;
  }

  .ghx-hero {
    min-height: auto;
    padding: 118px 0 58px;
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.58), #121414 76%),
      var(--ghx-hero-image) center 74px / 720px auto no-repeat;
  }

  .ghx-hero-copy {
    padding-top: 220px;
  }

  .ghx-hero h1 {
    max-width: 100%;
    font-size: clamp(2.15rem, 10.4vw, 2.7rem);
    line-height: 1;
    overflow-wrap: break-word;
  }

  .ghx-hero h1 em {
    display: block;
  }

  .ghx-hero-copy > p {
    max-width: min(342px, 100%);
    font-size: 1rem;
  }

  .ghx-hero-stage {
    display: none;
  }

  .ghx-section {
    padding: 64px 0;
  }

  .ghx-card-grid-3,
  .ghx-pricing,
  .ghx-stats,
  .ghx-dashboard-body {
    grid-template-columns: 1fr;
  }

  .ghx-logo-strip {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .ghx-result-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ghx-final-cta {
    padding: 34px 20px;
  }
}

.theme-dark {
  --bg-body: #020617;
  --bg-card: #0f172a;
  --bg-sidebar: #020617;
  --shell-bg: radial-gradient(1200px 420px at 10% -10%, rgba(16, 185, 129, 0.08), transparent 55%),
    radial-gradient(900px 400px at 105% 0%, rgba(59, 130, 246, 0.12), transparent 52%),
    linear-gradient(180deg, #050b18 0%, #070f20 100%);
  --topbar-bg: rgba(15, 23, 42, 0.75);
  --topbar-border: rgba(148, 163, 184, 0.16);
  --sidebar-bg:
    radial-gradient(120% 55% at 14% 100%, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0) 60%),
    radial-gradient(95% 65% at 100% 0%, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0) 58%),
    linear-gradient(170deg, #121c2e 0%, #0c1528 48%, #081122 100%);
  --sidebar-border: rgba(148, 163, 184, 0.16);
  --sidebar-brand-border: rgba(148, 163, 184, 0.16);
  --sidebar-fg: #f8fafc;
  --sidebar-title: #f8fafc;
  --sidebar-subtitle: #94a3b8;
  --sidebar-nav-text: #c8d4e4;
  --sidebar-nav-bg: rgba(15, 23, 42, 0.2);
  --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.07);
  --sidebar-nav-hover-border: rgba(148, 163, 184, 0.2);
  --sidebar-nav-hover-text: #ffffff;
  --sidebar-nav-active-bg: linear-gradient(135deg, #20bb86, #0b9e77);
  --sidebar-nav-active-border: rgba(255, 255, 255, 0.14);
  --sidebar-nav-active-shadow: 0 8px 18px rgba(16, 185, 129, 0.3);
  --sidebar-icon-bg: rgba(148, 163, 184, 0.2);
  --sidebar-icon-active-bg: rgba(255, 255, 255, 0.2);
  --sidebar-fx-bottom:
    linear-gradient(150deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.03) 55%, rgba(16, 185, 129, 0) 100%),
    repeating-linear-gradient(157deg, rgba(148, 163, 184, 0.1) 0 2px, transparent 2px 22px);
  --sidebar-fx-corner: radial-gradient(circle at center, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0));
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

.theme-dark .text-muted,
.theme-dark .text-body-secondary,
.theme-dark .form-label,
.theme-dark .table thead th,
.theme-dark .table tbody td,
.theme-dark .btn-outline-secondary,
.theme-dark .btn-outline-secondary:hover {
  color: var(--text-muted) !important;
}

.theme-dark .card,
.theme-dark .topbar,
.theme-dark .form-control,
.theme-dark .form-select {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.theme-dark .form-control::placeholder,
.theme-dark .form-select::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.theme-dark .bg-light,
.theme-dark .bg-white {
  background-color: var(--bg-card) !important;
  color: var(--text-main);
}

.theme-dark .border,
.theme-dark .border-top,
.theme-dark .border-bottom,
.theme-dark .border-start,
.theme-dark .border-end {
  border-color: var(--border-color) !important;
}

.theme-dark .card-header {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-bottom-color: var(--border-color);
}

.theme-dark .table {
  color: var(--text-main);
}

.theme-dark .table tbody tr,
.theme-dark .table tbody td {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.theme-dark .alert {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .badge.bg-light {
  background-color: #1f2937 !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

.theme-dark .nav-tabs .nav-link {
  color: var(--text-muted);
  border-color: var(--border-color);
}

.theme-dark .nav-tabs .nav-link.active {
  color: var(--text-main);
  border-color: var(--primary);
  background-color: transparent;
}

.theme-dark .stat-condition-block {
  background-color: #1a2332 !important;
  border-color: var(--border-color) !important;
}

.theme-dark .stat-condition-block .bg-white {
  background-color: #0f172a !important;
}

.theme-dark .table thead th {
  background-color: #0b1220;
  border-bottom-color: var(--border-color);
}

.theme-dark .table-clean tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

.theme-dark .modal-content,
.theme-dark .modal-header,
.theme-dark .modal-footer {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .dropdown-menu {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .page-link {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .page-link:hover {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .input-group-text,
.theme-dark .message-preview,
.theme-dark code {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .landing-hero {
  background: linear-gradient(120deg, #0b1220 0%, #0f172a 55%, #111827 100%);
  border-color: var(--border-color);
}

.theme-dark .landing-hero::before {
  opacity: 0.35;
}

.theme-dark .landing-card,
.theme-dark .landing-metric {
  background: #0b1220;
  border-color: var(--border-color);
  color: var(--text-main);
}

.theme-dark .landing-step {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* Reset e Base */
* {
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Inter', 'Manrope', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--shell-bg);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  left: -22%;
  bottom: -20%;
  width: 138%;
  height: 46%;
  background: var(--sidebar-fx-bottom);
  opacity: 0.6;
  pointer-events: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: var(--sidebar-fx-corner);
  pointer-events: none;
}

.sidebar-brand {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sidebar-brand-border);
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 1.2rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--sidebar-title);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--sidebar-subtitle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 0.85rem 0.8rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  color: var(--sidebar-nav-text);
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 0.36rem;
  border: 1px solid transparent;
  background-color: var(--sidebar-nav-bg);
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: var(--sidebar-nav-hover-bg);
  border-color: var(--sidebar-nav-hover-border);
  color: var(--sidebar-nav-hover-text);
}

.sidebar .nav-link.active {
  background: var(--sidebar-nav-active-bg);
  border-color: var(--sidebar-nav-active-border);
  color: white;
  box-shadow: var(--sidebar-nav-active-shadow);
}

.sidebar .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 1;
  border-radius: 999px;
  background-color: var(--sidebar-icon-bg);
}

.sidebar .nav-link.active .nav-icon {
  background-color: var(--sidebar-icon-active-bg);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-brand-border);
}

/* Main Area */
.main-area {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  background-color: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 999px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 95;
}

.content {
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

/* Stats Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-card-kpi {
  gap: 0.7rem;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-chip {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.18);
}

.mini-sparkline {
  height: 38px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.mini-sparkline span {
  flex: 1 1 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.55), rgba(59, 130, 246, 0.22));
}

.mini-sparkline.spark-success span {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.7), rgba(16, 185, 129, 0.25));
}

.mini-sparkline.spark-danger span {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.7), rgba(239, 68, 68, 0.25));
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-sub {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-body);
  border-color: var(--text-muted);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
}

.btn-outline-info {
  border-color: var(--info);
  color: var(--info);
}

.btn-outline-info:hover {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: var(--info);
}

.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

.btn-success {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-success:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: var(--bg-body);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-clean tbody tr:hover {
  background-color: rgba(16, 185, 129, 0.02);
}

/* Badges */
.badge-status {
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-on {
  background-color: #10b981;
  color: #ffffff;
}

.badge-off {
  background-color: #ef4444;
  color: #ffffff;
}

.badge-wait {
  background-color: #f59e0b;
  color: #ffffff;
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-control-lg, .form-select-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  outline: none;
}

.form-check-input {
  border-color: var(--border-color);
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.25em;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.form-switch .form-check-input {
  width: 2.5em;
}

/* Status Pill */
.status-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-on { background-color: #10b981; color: white; }
.status-off { background-color: #ef4444; color: white; }
.status-wait { background-color: #64748b; color: white; }

/* Auth Shell */
.auth-shell {
  max-width: 450px;
  margin: 10vh auto;
  padding: 2rem;
}

.ghx-auth-shell {
  --ghx-auth-text: #f7fcff;
  --ghx-auth-muted: #9fb4c9;
  --ghx-auth-cyan: #49e8d4;
  --ghx-auth-green: #49e8d4;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 96px 24px;
  overflow: hidden;
  color: var(--ghx-auth-text);
  background:
    linear-gradient(rgba(73, 232, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 232, 212, 0.035) 1px, transparent 1px),
    radial-gradient(900px 440px at 72% 18%, rgba(73, 232, 212, 0.18), transparent 60%),
    radial-gradient(760px 380px at 12% 80%, rgba(73, 232, 212, 0.09), transparent 60%),
    linear-gradient(180deg, #121414 0%, #0d1111 100%);
  background-size: 64px 64px, 64px 64px, auto, auto, auto;
}

.ghx-auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(73, 232, 212, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 76%, rgba(73, 232, 212, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 42%, rgba(170, 255, 245, 0.42) 0 1px, transparent 2px);
  background-size: 230px 230px, 310px 310px, 270px 270px;
  animation: ghxDrift 18s linear infinite;
}

.ghx-auth-card {
  position: relative;
  width: min(470px, 100%);
  border: 1px solid rgba(148, 222, 255, 0.2);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.035));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.ghx-auth-glow {
  position: absolute;
  inset: -140px -110px auto auto;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.28);
  filter: blur(58px);
  pointer-events: none;
}

.ghx-auth-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(148, 222, 255, 0.14);
}

.ghx-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.ghx-auth-brand:hover {
  color: #fff;
}

.ghx-auth-brand span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #02110d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-auth-green), var(--ghx-auth-cyan));
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.38);
}

.ghx-auth-brand strong {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.ghx-auth-kicker {
  color: var(--ghx-auth-cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ghx-auth-body {
  position: relative;
  padding: 34px;
}

.ghx-auth-logo {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(34, 211, 238, 0.16);
}

.ghx-auth-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ghx-auth-body h2 {
  margin: 0 0 8px;
  color: #fff;
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.ghx-auth-body p,
.ghx-auth-footer {
  color: var(--ghx-auth-muted);
}

.ghx-auth-body .form-label {
  color: #dff7ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.ghx-auth-input {
  min-height: 54px;
  border: 1px solid rgba(148, 222, 255, 0.18) !important;
  border-radius: 16px;
  color: #fff !important;
  background: rgba(5, 12, 28, 0.64) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.ghx-auth-input:focus {
  color: #fff !important;
  background: rgba(6, 15, 33, 0.78) !important;
  border-color: rgba(34, 211, 238, 0.68) !important;
  box-shadow: 0 0 0 0.22rem rgba(34, 211, 238, 0.12), 0 0 28px rgba(34, 211, 238, 0.14) !important;
}

.ghx-auth-input::placeholder {
  color: rgba(195, 218, 232, 0.55) !important;
}

.ghx-auth-submit {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  color: #02110d;
  font-weight: 900;
  background: #49e8d4;
  box-shadow: 0 0 30px rgba(73, 232, 212, 0.28), 0 16px 46px rgba(73, 232, 212, 0.14);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ghx-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(73, 232, 212, 0.38), 0 22px 56px rgba(73, 232, 212, 0.18);
}

.ghx-auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.92rem;
}

.ghx-auth-footer a {
  color: var(--ghx-auth-cyan);
  font-weight: 900;
}

@media (max-width: 560px) {
  .ghx-auth-shell {
    place-items: start center;
    min-height: 100vh;
    padding: 84px 16px 32px;
    background:
      linear-gradient(rgba(73, 232, 212, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(73, 232, 212, 0.035) 1px, transparent 1px),
      radial-gradient(520px 300px at 80% 0%, rgba(73, 232, 212, 0.16), transparent 70%),
      linear-gradient(180deg, #121414 0%, #0d1111 100%);
    background-size: 48px 48px, 48px 48px, auto, auto;
  }

  .ghx-auth-card {
    width: 100%;
    border-radius: 26px;
  }

  .ghx-auth-header {
    padding: 18px;
  }

  .ghx-auth-kicker {
    display: none;
  }

  .ghx-auth-body {
    padding: 26px 18px 24px;
  }

  .ghx-auth-logo {
    width: 96px;
    height: 96px;
  }

  .ghx-auth-body h2 {
    font-size: 1.65rem;
  }

  .ghx-auth-body p {
    max-width: 290px;
    margin-inline: auto;
  }
}

.analysis-page {
  display: grid;
  gap: 18px;
}

.analysis-hero,
.analysis-live-band,
.analysis-group-card,
.analysis-panel,
.analysis-upgrade {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
  border-radius: 8px;
  box-shadow: var(--shadow-md, 0 12px 30px rgba(15, 23, 42, 0.06));
}

.analysis-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
}

.analysis-kicker {
  color: #0f8f61;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.analysis-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.2rem);
  font-weight: 850;
  color: var(--text-main, #0f172a);
}

.analysis-hero h1 span {
  color: var(--text-muted, #64748b);
  font-size: 0.75em;
}

.analysis-hero p,
.analysis-panel p,
.analysis-upgrade p {
  color: var(--text-muted, #64748b);
  margin: 8px 0 0;
}

.analysis-status {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.analysis-status a,
.analysis-upgrade a {
  text-decoration: none;
}

.analysis-live-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
}

.analysis-live-band > div,
.analysis-metrics > div,
.analysis-phase-row > div,
.analysis-mini-table > div {
  padding: 14px;
  background: color-mix(in srgb, var(--bg-card, #fff) 88%, var(--text-main, #0f172a) 4%);
}

.analysis-live-band span,
.analysis-metrics span,
.analysis-phase-row span,
.analysis-mini-table span,
.analysis-match-row span,
.analysis-match-row small {
  display: block;
  color: var(--text-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
}

.analysis-live-band strong,
.analysis-metrics strong,
.analysis-phase-row strong,
.analysis-mini-table strong {
  display: block;
  color: var(--text-main, #0f172a);
  font-size: 1.2rem;
  margin-top: 4px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.analysis-group-card,
.analysis-panel,
.analysis-upgrade {
  padding: 18px;
}

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

.analysis-card-head h2,
.analysis-upgrade h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 850;
}

.analysis-card-head span {
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
  font-weight: 800;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.analysis-phase-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analysis-phase-row > div {
  border: 1px solid rgba(15, 143, 97, 0.16);
  border-radius: 8px;
  background: rgba(15, 143, 97, 0.06);
}

.analysis-phase-row small {
  color: #0f8f61;
  font-weight: 850;
}

.analysis-mini-table {
  display: grid;
  gap: 1px;
  margin-top: 12px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  border-radius: 8px;
  overflow: hidden;
}

.analysis-mini-table > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analysis-mini-table strong {
  font-size: 0.95rem;
  text-align: right;
}

.analysis-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.analysis-match-list {
  display: grid;
  gap: 8px;
}

.analysis-match-row {
  display: grid;
  grid-template-columns: 88px 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.analysis-match-row:last-child {
  border-bottom: 0;
}

.analysis-empty {
  padding: 18px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-weight: 800;
}

.analysis-upgrade {
  max-width: 760px;
}

.analysis-loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  z-index: 3000;
}

.analysis-loading-overlay.is-visible {
  display: flex;
}

.analysis-loading-box {
  width: min(360px, 100%);
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(15, 143, 97, 0.18);
  background: var(--bg-card, #ffffff);
  box-shadow: var(--shadow-lg, 0 24px 70px rgba(15, 23, 42, 0.22));
  text-align: center;
}

.analysis-loading-spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(15, 143, 97, 0.18);
  border-top-color: #0f8f61;
  animation: analysis-spin 0.8s linear infinite;
  margin-bottom: 14px;
}

.analysis-loading-box strong {
  display: block;
  color: var(--text-main, #0f172a);
  font-size: 1.08rem;
  font-weight: 850;
}

.analysis-loading-box p {
  margin: 7px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
}

.theme-dark .analysis-hero,
.theme-dark .analysis-live-band,
.theme-dark .analysis-group-card,
.theme-dark .analysis-panel,
.theme-dark .analysis-upgrade,
.theme-dark .analysis-loading-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.theme-dark .analysis-live-band > div,
.theme-dark .analysis-metrics > div,
.theme-dark .analysis-mini-table > div {
  background: rgba(255, 255, 255, 0.035);
}

.theme-dark .analysis-phase-row > div {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.theme-dark .analysis-metrics,
.theme-dark .analysis-mini-table,
.theme-dark .analysis-match-row {
  border-color: var(--border-color);
}

.theme-dark .analysis-empty {
  background: rgba(245, 158, 11, 0.12);
  color: #ffd166;
}

@keyframes analysis-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .analysis-summary-grid,
  .analysis-detail-layout {
    grid-template-columns: 1fr;
  }

  .analysis-live-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analysis-hero {
    flex-direction: column;
  }

  .analysis-status {
    justify-content: flex-start;
  }

  .analysis-live-band,
  .analysis-metrics,
  .analysis-phase-row {
    grid-template-columns: 1fr;
  }

  .analysis-match-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Landing */
.landing-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.landing-brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-hero {
  position: relative;
  border-radius: 28px;
  padding: 3rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  background: linear-gradient(120deg, #ecfdf5 0%, #f0f9ff 45%, #ffffff 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.25), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.18), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(2, 132, 199, 0.16), transparent 50%);
  opacity: 0.9;
  z-index: 0;
}

.landing-hero-content,
.landing-hero-panel {
  position: relative;
  z-index: 1;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1rem 0;
}

.landing-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 2.25rem;
}

.landing-metrics {
  display: grid;
  gap: 0.75rem;
}

.landing-metric {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}

.landing-metric span {
  display: block;
}

.landing-metric-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.landing-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.landing-hero-panel {
  display: grid;
  gap: 1rem;
  align-content: center;
}

.landing-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
}

.landing-card-title {
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-card-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 3.5rem 0;
}

.landing-feature {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.landing-feature h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.landing-flow {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.landing-step {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed rgba(15, 23, 42, 0.15);
}

.landing-step span {
  font-weight: 800;
  font-size: 0.9rem;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-cta-panel {
  margin-top: 3.5rem;
  padding: 2.25rem;
  border-radius: 22px;
  background: linear-gradient(110deg, #0f172a, #0f766e);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-cta-panel p {
  color: rgba(248, 250, 252, 0.75);
  margin-bottom: 0;
}

.landing-animate {
  opacity: 0;
  animation: rise 0.7s ease forwards;
}

.landing-delay-1 { animation-delay: 0.1s; }
.landing-delay-2 { animation-delay: 0.2s; }
.landing-delay-3 { animation-delay: 0.3s; }
.landing-delay-4 { animation-delay: 0.4s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin: 0;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* NAV TABS - MELHORADO */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

.nav-tabs .nav-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: transparent;
}

/* TAB CONTENT */
.tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tab-pane {
  animation: fadeIn 0.2s ease;
}

/* STAT CONDITION BLOCK - NOVO COMPONENTE */
.stat-condition-block {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.stat-condition-block:hover {
  box-shadow: var(--shadow-sm);
}

.stat-condition-block .input-group {
  border-radius: 8px;
  overflow: hidden;
}

.stat-condition-block .input-group-text {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.stat-condition-block .form-control,
.stat-condition-block .form-select {
  border-color: var(--border-color);
}

.stat-condition-block .remove-stat-condition {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

/* ALERT CUSTOMIZADO */
.alert {
  border-radius: 10px;
  border-left: 4px solid;
  padding: 1rem 1.25rem;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.05);
  border-left-color: var(--info);
  color: var(--text-main);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.05);
  border-left-color: var(--warning);
  color: var(--text-main);
}

.alert-light {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* INPUT GROUP */
.input-group {
  border-radius: 8px;
  overflow: hidden;
}

.input-group-text {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

/* SEGMENTED BUTTONS */
.btn-group {
  gap: 0.25rem;
}

.btn-group .btn {
  border-radius: 8px;
  flex: 1;
}

.btn-check:checked + .btn {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* MESSAGE PREVIEW */
.message-preview {
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* CODE INLINE */
code {
  background-color: var(--bg-body);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--primary);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
  }
  .sidebar .brand-text, .sidebar .nav-link span:not(.nav-icon) {
    display: none;
  }
  .main-area {
    margin-left: 80px;
  }
  .sidebar-open .sidebar {
    width: 260px;
  }
  .sidebar-open .sidebar .brand-text,
  .sidebar-open .sidebar .nav-link span:not(.nav-icon) {
    display: inline;
  }
  .sidebar-open .main-area {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: flex;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 110;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .topbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .status-block {
    margin-left: auto;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .main-area {
    margin-left: 0;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .content {
    padding: 1.25rem;
  }
  .auth-shell {
    max-width: 100%;
    margin: 6vh auto;
    padding: 1rem;
  }
  .landing-shell {
    padding: 1.5rem;
  }
  .landing-hero {
    padding: 2rem 1.5rem;
  }
  .landing-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-body {
    padding: 1.25rem;
  }
  .topbar {
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .user-chip .user-name {
    display: none;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 1.5rem;
  }
  .page-subtitle {
    font-size: 0.95rem;
  }
  .btn-lg {
    padding: 0.65rem 1rem;
  }
  .table thead {
    display: none;
  }
  .table tbody td {
    display: block;
    width: 100%;
    padding: 0.75rem 0.75rem;
    border-bottom: 0;
  }
  .table tbody tr {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background-color: var(--bg-card);
  }
  .table-clean tbody tr:hover {
    background-color: var(--bg-card);
  }
  .table-responsive {
    overflow: visible;
  }

  /* Responsivo para abas */
  .nav-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-tabs .nav-link {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
  }

  /* Responsivo para stat condition block */
  .stat-condition-block {
    padding: 1rem;
  }

  .stat-condition-block .row {
    gap: 0.75rem !important;
  }

  .stat-condition-block .col-md-3,
  .stat-condition-block .col-md-2 {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1rem;
  }
  .card {
    border-radius: 10px;
  }
  .nav-link {
    padding: 0.65rem 0.75rem;
  }
  .form-control,
  .form-select {
    padding: 0.55rem 0.85rem;
  }

  .stat-condition-block {
    padding: 0.75rem;
  }

  .stat-condition-block .form-label {
    font-size: 0.8rem;
  }

  .stat-condition-block .form-control,
  .stat-condition-block .form-select {
    font-size: 0.9rem;
  }
}

/* Custom Chart Bars */
.chart-bar {
  background-color: var(--bg-body);
  border-radius: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.bar {
  width: 100%;
  transition: height 0.5s ease;
}

.weekly-chart {
  height: 220px;
  padding: 0.25rem 0 0.75rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: end;
}

.week-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.week-col .chart-bar {
  max-width: 58px;
  height: 100%;
  border: 1px solid var(--border-color);
}

.top-rule-item {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-card) 85%, var(--bg-body));
}

.top-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.top-rule-name {
  font-weight: 700;
  color: var(--text-main);
}

.top-rule-rate {
  font-weight: 800;
  color: var(--primary);
}

.top-rule-progress {
  height: 10px;
  background: rgba(148, 163, 184, 0.2);
  margin-bottom: 0.45rem;
}

.top-rule-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rules-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rule-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rule-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.rule-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.rule-dot-on {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.rule-dot-off {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.rule-name {
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.rule-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.rule-card-stats {
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rule-pill {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}

.rule-pill-green {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}

.rule-pill-red {
  background: rgba(239, 68, 68, 0.16);
  color: #dc2626;
}

.rule-pill-win {
  background: rgba(14, 165, 233, 0.16);
  color: #0284c7;
}

.rule-last {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rule-rank-list .list-group-item {
  border-color: rgba(73, 232, 212, 0.16);
  background: linear-gradient(135deg, rgba(18, 20, 20, 0.96), rgba(18, 34, 34, 0.9));
  color: #eafffb;
}

.rule-rank-list .list-group-item.text-muted {
  color: rgba(234, 255, 251, 0.58) !important;
}

.rule-rank-more summary {
  cursor: pointer;
  color: #49e8d4;
  font-weight: 800;
  font-size: 0.86rem;
}

.rule-rank-more summary:hover {
  text-decoration: underline;
}

.modal-content:has(.rule-rank-list) {
  color: #f4fffd;
  background: linear-gradient(145deg, #121414, #0c1616);
  border: 1px solid rgba(73, 232, 212, 0.24);
}

.modal-content:has(.rule-rank-list) .modal-header {
  border-bottom-color: rgba(73, 232, 212, 0.16);
}

.modal-content:has(.rule-rank-list) .btn-close {
  filter: invert(1);
}

.live-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 110px 110px 140px auto auto auto;
  gap: 0.5rem;
  align-items: center;
}

.live-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-card);
  white-space: nowrap;
}

.live-league-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  border: 1px solid rgba(14, 165, 233, 0.38);
  border-radius: 999px;
  padding: 0 0.85rem;
  color: var(--secondary);
  background: rgba(14, 165, 233, 0.1);
  font-weight: 800;
  white-space: nowrap;
}

.live-league-picker-btn:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: rgba(14, 165, 233, 0.18);
}

.live-league-picker-btn span {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #031016;
  background: var(--secondary);
  font-size: 0.72rem;
}

.live-league-chip {
  border: 1px solid rgba(73, 232, 212, 0.18);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  color: var(--text-main);
  background: color-mix(in srgb, var(--bg-card) 88%, #49e8d4 12%);
  font-weight: 700;
  font-size: 0.82rem;
}

.live-league-chip span {
  color: #49e8d4;
  margin-right: 0.35rem;
}

.live-league-chip.is-favorite {
  border-color: rgba(245, 158, 11, 0.42);
  color: #fff7ed;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(73, 232, 212, 0.1));
}

.live-league-modal {
  background:
    radial-gradient(700px 360px at 10% 0%, rgba(14, 165, 233, 0.16), transparent 58%),
    var(--bg-card);
  border: 1px solid rgba(73, 232, 212, 0.16);
  color: var(--text-main);
}

.live-league-modal .modal-header {
  border-bottom-color: rgba(73, 232, 212, 0.16);
}

.live-league-modal .btn-close {
  filter: invert(1);
}

.live-league-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 0.18rem;
}

.live-league-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
}

.live-league-modal-grid .live-league-chip {
  width: 100%;
  min-height: 42px;
  text-align: left;
}

.live-game-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 20, 20, 0.96), rgba(14, 39, 38, 0.9)),
    var(--bg-card);
  border: 1px solid rgba(73, 232, 212, 0.2) !important;
}

.live-game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(73, 232, 212, 0.32), transparent 45%);
  height: 3px;
}

.live-card-league {
  color: #49e8d4;
  font-size: 0.76rem;
  font-weight: 800;
}

.live-card-teams {
  color: #f6fffd;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}

.live-minute-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: #071312;
  background: #49e8d4;
  font-weight: 900;
  font-size: 0.78rem;
}

.live-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.6rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  color: rgba(234, 255, 251, 0.68);
  background: rgba(255, 255, 255, 0.055);
}

.live-score-row strong {
  color: #fff;
  font-size: 1.05rem;
}

@media (max-width: 992px) {
  .live-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .live-filter-bar {
    grid-template-columns: 1fr;
  }
}

.rule-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.rule-more-btn {
  border: 1px solid rgba(14, 165, 233, 0.36);
  background: rgba(14, 165, 233, 0.1);
  color: var(--secondary);
  font-weight: 800;
}

.rule-more-btn:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--secondary);
  color: #031016;
}

.system-status-card {
  background: color-mix(in srgb, var(--bg-card) 88%, #10b981 12%);
  border: 1px solid color-mix(in srgb, var(--border-color) 70%, #10b981 30%);
}

.status-on-text {
  color: var(--primary);
}

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

  .rule-card {
    padding: 0.85rem;
  }

  .rule-last {
    width: 100%;
    margin-left: 0;
  }

  .weekly-chart {
    gap: 0.5rem;
    height: 200px;
  }

  .week-col .chart-bar {
    max-width: 44px;
  }

  .stat-card-kpi {
    padding: 1rem;
  }
}

.bg-success { background-color: var(--primary) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
/* History Page - styled to match the provided mockup */
.history-page {
  --history-bg: #060a0f;
  --history-surface: #0d1520;
  --history-surface-2: #111d2e;
  --history-border: rgba(255, 255, 255, 0.08);
  --history-text: #e8f0fe;
  --history-muted: #8a9ab8;
  --history-muted-2: #5a6a82;
  --history-green: #00e5a0;
  --history-red: #ff4d6a;
  --history-accent: #00c3ff;

  background:
    radial-gradient(1100px 540px at 0% -15%, rgba(0, 229, 160, 0.12), transparent 58%),
    radial-gradient(800px 420px at 105% 0%, rgba(0, 195, 255, 0.12), transparent 52%),
    var(--history-bg);
  border: 1px solid var(--history-border);
  border-radius: 22px;
  padding: 1.5rem;
  color: var(--history-text);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.45);
}

.history-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.history-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--history-text);
}

.history-subtitle {
  margin: 0.35rem 0 0;
  color: var(--history-muted);
  font-size: 0.92rem;
}

.history-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.history-stat-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.history-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--history-accent);
}

.history-stat-card-green::before {
  background: var(--history-green);
}

.history-stat-card-red::before {
  background: var(--history-red);
}

.history-stat-card-winrate::before {
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
}

.history-stat-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
  color: var(--history-muted-2);
  margin-bottom: 0.5rem;
}

.history-stat-value {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 800;
  color: var(--history-text);
}

.history-stat-value-green {
  color: var(--history-green);
}

.history-stat-value-red {
  color: var(--history-red);
}

.history-stat-value-gradient {
  color: transparent;
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.history-winrate-track {
  margin-top: 0.7rem;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.history-winrate-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
}

.history-filters-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.1rem;
}

.history-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.history-filter-group {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-filter-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--history-muted-2);
}

.history-filter-control {
  border-radius: 10px;
  border: 1px solid var(--history-border);
  background: var(--history-bg);
  color: var(--history-text);
  min-height: 38px;
  padding: 0.45rem 0.68rem;
  font-size: 0.86rem;
}

.history-filter-control:focus {
  outline: none;
  border-color: rgba(0, 229, 160, 0.48);
  box-shadow: 0 0 0 0.18rem rgba(0, 229, 160, 0.12);
}

.history-filter-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.history-btn {
  border-radius: 10px;
  border: 1px solid transparent;
  min-height: 38px;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0.48rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.history-btn-primary {
  background: linear-gradient(135deg, var(--history-green), #00c896);
  color: #05110d;
}

.history-btn-primary:hover {
  color: #05110d;
  box-shadow: 0 8px 20px rgba(0, 229, 160, 0.25);
}

.history-btn-danger {
  background: rgba(255, 77, 106, 0.14);
  border-color: rgba(255, 77, 106, 0.38);
  color: var(--history-red);
}

.history-btn-danger:hover:enabled {
  color: #ffd9df;
  background: rgba(255, 77, 106, 0.25);
}

.history-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-btn-ghost {
  background: transparent;
  border-color: var(--history-border);
  color: var(--history-muted);
}

.history-btn-ghost:hover {
  color: var(--history-text);
  border-color: rgba(255, 255, 255, 0.2);
}

.history-btn-inline-danger {
  border-color: var(--history-border);
  background: transparent;
  color: var(--history-muted);
  min-height: 32px;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-danger:hover {
  color: var(--history-red);
  border-color: rgba(255, 77, 106, 0.35);
  background: rgba(255, 77, 106, 0.12);
}

.history-actions-col {
  width: 76px;
}

.history-actions-cell {
  white-space: nowrap;
}

.history-actions-group {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(42px, auto));
  gap: 0.4rem;
  justify-content: end;
  align-items: center;
}

.history-action-form {
  margin: 0;
}

.history-action-placeholder {
  display: inline-block;
  width: 42px;
}

.history-action-menu {
  display: inline-flex;
  justify-content: flex-end;
}

.history-action-menu-toggle {
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-color: var(--history-border);
  background: var(--history-surface-2);
  color: var(--history-text);
}

.history-action-menu-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.history-action-menu-toggle:hover,
.history-action-menu-toggle:focus {
  border-color: rgba(0, 229, 160, 0.36);
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.1);
}

.history-action-dropdown {
  min-width: 190px;
  padding: 0.4rem;
  border: 1px solid var(--history-border);
  border-radius: 10px;
  background: var(--history-surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.history-action-dropdown .dropdown-item {
  min-height: 36px;
  border-radius: 8px;
  color: var(--history-text);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.history-action-dropdown .dropdown-item:hover,
.history-action-dropdown .dropdown-item:focus {
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.1);
}

.history-action-dropdown .dropdown-divider {
  border-top-color: var(--history-border);
  margin: 0.35rem 0;
}

.history-dropdown-danger {
  color: var(--history-red) !important;
}

.history-dropdown-danger:hover,
.history-dropdown-danger:focus {
  color: var(--history-red) !important;
  background: rgba(255, 77, 106, 0.12) !important;
}

.history-btn-inline-view {
  border-color: rgba(0, 195, 255, 0.28);
  background: rgba(0, 195, 255, 0.08);
  color: var(--history-accent);
  min-height: 32px;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-view:hover {
  color: #031016;
  border-color: rgba(0, 195, 255, 0.52);
  background: var(--history-accent);
}

.history-btn-inline-money {
  border-color: rgba(0, 229, 160, 0.3);
  background: rgba(0, 229, 160, 0.1);
  color: var(--history-green);
  min-height: 32px;
  min-width: 36px;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-money:hover {
  color: #05110d;
  border-color: rgba(0, 229, 160, 0.52);
  background: var(--history-green);
}

.history-table-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  overflow: visible;
}

.history-color-bar {
  height: 3px;
  width: 100%;
  border-radius: 14px 14px 0 0;
}

.history-table-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--history-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.history-table-head h2 {
  margin: 0;
  color: var(--history-text);
  font-size: 0.93rem;
  font-weight: 700;
}

.history-table-head span {
  font-size: 0.77rem;
  color: var(--history-muted);
}

.history-table thead th {
  background: var(--history-surface);
  border-bottom: 1px solid var(--history-border);
  color: var(--history-muted-2);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.75rem 0.75rem;
}

.history-table tbody td {
  border-bottom: 1px solid var(--history-border);
  padding: 0.78rem 0.75rem;
  color: var(--history-text);
  font-size: 0.84rem;
  background: transparent;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-rule-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.52rem;
  border: 1px solid var(--history-border);
  background: var(--history-surface-2);
  border-radius: 8px;
  color: var(--history-text);
  font-size: 0.71rem;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-user-chip {
  color: var(--history-muted);
  font-size: 0.8rem;
}

.history-match-name {
  color: var(--history-text);
  font-size: 0.84rem;
  font-weight: 500;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.history-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.history-badge-green {
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.12);
  border-color: rgba(0, 229, 160, 0.3);
}

.history-badge-red {
  color: var(--history-red);
  background: rgba(255, 77, 106, 0.14);
  border-color: rgba(255, 77, 106, 0.3);
}

.history-badge-pending {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.history-mono,
.history-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--history-muted);
  font-size: 0.79rem;
}

.history-empty {
  text-align: center;
  color: var(--history-muted);
  padding: 1rem;
}

.history-pagination-wrap {
  border-top: 1px solid var(--history-border);
  padding: 0.82rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.history-pagination-info {
  color: var(--history-muted);
  font-size: 0.76rem;
}

.history-pagination-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.history-pag-btn {
  min-height: 32px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid var(--history-border);
  background: var(--history-surface-2);
  color: var(--history-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.66rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.history-pag-btn:hover {
  color: var(--history-green);
  border-color: rgba(0, 229, 160, 0.35);
}

.history-pag-btn-active {
  color: var(--history-green);
  border-color: rgba(0, 229, 160, 0.35);
  background: rgba(0, 229, 160, 0.12);
}

.history-pag-btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.history-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid var(--history-muted-2);
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.history-table input[type="checkbox"]:checked {
  border-color: var(--history-green);
  background: var(--history-green);
}

@media (max-width: 1200px) {
  .history-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .history-page {
    border-radius: 14px;
    padding: 1rem;
  }

  .history-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-stats-row {
    grid-template-columns: 1fr;
  }

  .history-filters-form {
    flex-direction: column;
    align-items: stretch;
  }

  .history-filter-group,
  .history-filter-actions {
    min-width: 100%;
    width: 100%;
    margin-left: 0;
  }

  .history-filter-actions {
    justify-content: stretch;
  }

  .history-filter-actions .history-btn {
    width: 100%;
  }

  .history-table-head,
  .history-pagination-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-table thead {
    display: none;
  }

  .history-table tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.45rem 0.55rem;
  }

  .history-actions-cell {
    text-align: left !important;
    white-space: nowrap;
  }

  .history-action-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .history-table tbody tr {
    display: block;
    margin: 0.6rem;
    border: 1px solid var(--history-border);
    border-radius: 10px;
  }

  .history-table tbody tr:last-child {
    margin-bottom: 0;
  }
}

/* Global Mockup Theme */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --secondary: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --gh-body: #f3f7fc;
  --gh-surface: #ffffff;
  --gh-surface-2: #eef4fd;
  --gh-border: rgba(15, 23, 42, 0.1);
  --gh-border-strong: rgba(15, 23, 42, 0.16);
  --gh-text: #12243b;
  --gh-muted: #556b86;
  --gh-muted-soft: #7389a4;

  --bg-body: var(--gh-body);
  --bg-card: var(--gh-surface);
  --bg-sidebar: var(--gh-surface);
  --border-color: var(--gh-border);
  --text-main: var(--gh-text);
  --text-muted: var(--gh-muted);

  --shell-bg:
    radial-gradient(1100px 480px at 0% -15%, rgba(16, 185, 129, 0.1), transparent 56%),
    radial-gradient(900px 460px at 100% 0%, rgba(14, 165, 233, 0.11), transparent 55%),
    var(--gh-body);

  --sidebar-bg: var(--gh-surface);
  --sidebar-border: var(--gh-border);
  --sidebar-brand-border: var(--gh-border);
  --sidebar-fg: var(--gh-text);
  --sidebar-title: var(--gh-text);
  --sidebar-subtitle: var(--gh-muted);
  --sidebar-nav-text: #2a3f5f;
  --sidebar-nav-bg: transparent;
  --sidebar-nav-hover-bg: rgba(14, 165, 233, 0.08);
  --sidebar-nav-hover-border: rgba(14, 165, 233, 0.18);
  --sidebar-nav-hover-text: #15304f;
  --sidebar-nav-active-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(14, 165, 233, 0.14));
  --sidebar-nav-active-border: rgba(16, 185, 129, 0.28);
  --sidebar-nav-active-shadow: 0 6px 20px rgba(16, 185, 129, 0.18);
  --sidebar-icon-bg: rgba(15, 23, 42, 0.08);
  --sidebar-icon-active-bg: rgba(16, 185, 129, 0.2);

  --topbar-bg: rgba(255, 255, 255, 0.78);
  --topbar-border: var(--gh-border);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 22px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.14);
  --radius: 14px;
}

.theme-dark {
  --primary: #00e5a0;
  --primary-hover: #00c896;
  --secondary: #00c3ff;
  --danger: #ff4d6a;
  --warning: #ffd166;
  --info: #00c3ff;

  --gh-body: #060a0f;
  --gh-surface: #0d1520;
  --gh-surface-2: #111d2e;
  --gh-border: rgba(255, 255, 255, 0.07);
  --gh-border-strong: rgba(255, 255, 255, 0.14);
  --gh-text: #e8f0fe;
  --gh-muted: #8a9ab8;
  --gh-muted-soft: #5a6a82;

  --bg-body: var(--gh-body);
  --bg-card: var(--gh-surface);
  --bg-sidebar: var(--gh-surface);
  --border-color: var(--gh-border);
  --text-main: var(--gh-text);
  --text-muted: var(--gh-muted);

  --shell-bg: var(--gh-body);
  --sidebar-bg: var(--gh-surface);
  --sidebar-border: var(--gh-border);
  --sidebar-brand-border: var(--gh-border);
  --sidebar-fg: var(--gh-text);
  --sidebar-title: var(--gh-text);
  --sidebar-subtitle: var(--gh-muted);
  --sidebar-nav-text: var(--gh-muted);
  --sidebar-nav-bg: transparent;
  --sidebar-nav-hover-bg: var(--gh-surface-2);
  --sidebar-nav-hover-border: rgba(255, 255, 255, 0.12);
  --sidebar-nav-hover-text: var(--gh-text);
  --sidebar-nav-active-bg: linear-gradient(135deg, rgba(0, 229, 160, 0.18), rgba(0, 195, 255, 0.12));
  --sidebar-nav-active-border: rgba(0, 229, 160, 0.25);
  --sidebar-nav-active-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  --sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --sidebar-icon-active-bg: rgba(0, 229, 160, 0.2);

  --topbar-bg: rgba(13, 21, 32, 0.84);
  --topbar-border: var(--gh-border);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 38px rgba(0, 0, 0, 0.45);
}

* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--shell-bg);
  color: var(--gh-text);
}

h1, h2, h3, h4, h5,
.page-title,
.topbar-title,
.card-title,
.brand-title,
.history-title {
  font-family: 'Syne', 'DM Sans', sans-serif;
}

.app-shell {
  background: var(--shell-bg);
}

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar::before,
.sidebar::after {
  display: none;
}

.sidebar-brand {
  padding: 1.1rem 1.05rem 1rem;
  border-bottom: 1px solid var(--sidebar-brand-border);
  margin-bottom: 0.45rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.brand-icon.brand-icon-image {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon.brand-icon-image img {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.brand-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.brand-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 1;
  opacity: 0.6;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sidebar-title);
}

.brand-sub {
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: var(--sidebar-subtitle);
  text-transform: uppercase;
}

.sidebar-brand-logo-only {
  display: block;
  padding: 0.9rem 0.9rem 0.8rem;
}

.brand-logo-hero {
  width: 100%;
  height: auto;
  max-height: 96px;
  display: block;
  object-fit: contain;
}

.sidebar-brand-logo-with-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 0.9rem 0.8rem;
}

.sidebar-brand-logo-with-text .brand-logo-hero {
  width: 42px;
  height: 42px;
  max-height: none;
  object-fit: contain;
  flex: 0 0 42px;
}

.sidebar-brand-logo-with-text .brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-brand-logo-with-text .brand-title {
  font-size: 0.96rem;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-brand-logo-with-text .brand-sub {
  font-size: 0.54rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 0.65rem 0.6rem 0.8rem;
}

.nav-section {
  display: block;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gh-muted-soft);
  padding: 0.85rem 0.7rem 0.45rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.55rem 0.72rem;
  border-radius: 10px;
  margin-bottom: 0.18rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sidebar-nav-text);
  border: 1px solid transparent;
  background: var(--sidebar-nav-bg);
}

.sidebar .nav-link:hover {
  color: var(--sidebar-nav-hover-text);
  background: var(--sidebar-nav-hover-bg);
  border-color: var(--sidebar-nav-hover-border);
}

.sidebar .nav-link.active {
  color: var(--primary);
  border-color: var(--sidebar-nav-active-border);
  background: var(--sidebar-nav-active-bg);
  box-shadow: var(--sidebar-nav-active-shadow);
}

.sidebar .nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--sidebar-icon-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar .nav-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar .nav-link.active .nav-icon {
  background: var(--sidebar-icon-active-bg);
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-brand-border);
  margin-top: 0.55rem;
  padding-top: 0.75rem;
}

.api-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.69rem;
  color: var(--gh-muted);
  border-radius: 8px;
  border: 1px solid var(--gh-border);
  background: var(--gh-surface-2);
  padding: 0.44rem 0.64rem;
  margin-bottom: 0.45rem;
}

.api-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.main-area {
  margin-left: 220px;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  padding: 0 1.4rem;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gh-text);
}

.status-pill {
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.3rem 0.56rem;
}

.status-on {
  background: rgba(0, 229, 160, 0.15);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 160, 0.3);
}

.status-off {
  background: rgba(255, 77, 106, 0.14);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.25);
}

.status-wait {
  background: rgba(148, 163, 184, 0.14);
  color: var(--gh-muted);
  border: 1px solid var(--gh-border);
}

.btn-theme-toggle {
  border-radius: 9px;
  border-color: var(--gh-border);
  color: var(--gh-muted);
  background: transparent;
  font-size: 0.74rem;
  padding: 0.4rem 0.66rem;
}

.btn-theme-toggle:hover {
  color: var(--gh-text);
  border-color: var(--gh-border-strong);
  background: transparent;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #04110b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.theme-dark .user-avatar {
  color: #03110a;
}

.user-name {
  color: var(--gh-muted);
  font-weight: 600;
}

.content {
  max-width: 100%;
  margin: 0;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.35rem;
}

.page-title {
  color: var(--gh-text);
  font-size: 1.65rem;
}

.page-subtitle {
  color: var(--gh-muted);
  font-size: 0.84rem;
}

.card,
.stat-card,
.filter-card,
.table-card {
  background: var(--gh-surface);
  border: 1px solid var(--gh-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 1rem;
}

.stat-label {
  color: var(--gh-muted-soft);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  color: var(--gh-text);
  font-family: 'Syne', 'DM Sans', sans-serif;
}

.btn {
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.8rem;
  min-height: 36px;
  padding: 0.45rem 0.82rem;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: transparent;
  color: #05120d;
}

.btn-primary:hover,
.btn-success:hover {
  color: #05120d;
  transform: translateY(-1px);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-info {
  background: transparent;
  border-color: var(--gh-border);
}

.btn-outline-secondary {
  color: var(--gh-muted);
}

.btn-outline-secondary:hover {
  color: var(--gh-text);
  border-color: var(--gh-border-strong);
}

.btn-danger,
.btn-outline-danger:hover {
  color: var(--danger);
}

.form-control,
.form-select,
textarea {
  border-radius: 10px;
  background: var(--gh-surface-2);
  border: 1px solid var(--gh-border);
  color: var(--gh-text);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(0, 229, 160, 0.4);
  box-shadow: 0 0 0 0.18rem rgba(0, 229, 160, 0.12);
  background: var(--gh-surface-2);
  color: var(--gh-text);
}

.form-label {
  color: var(--gh-muted);
  font-size: 0.75rem;
}

.table,
.table thead,
.table tbody,
.table tr,
.table td,
.table th {
  color: var(--gh-text);
}

.table thead th {
  background: transparent;
  color: var(--gh-muted-soft);
  border-bottom: 1px solid var(--gh-border);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
}

.table tbody td {
  border-bottom: 1px solid var(--gh-border);
  font-size: 0.84rem;
}

.table-clean tbody tr:hover {
  background: rgba(0, 229, 160, 0.06);
}

.badge-status {
  border-radius: 999px;
  font-size: 0.67rem;
  padding: 0.22rem 0.54rem;
}

.badge-on {
  background: rgba(0, 229, 160, 0.16);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 160, 0.25);
}

.badge-off {
  background: rgba(255, 77, 106, 0.16);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.25);
}

.badge-wait {
  background: rgba(255, 209, 102, 0.16);
  color: var(--warning);
  border: 1px solid rgba(255, 209, 102, 0.25);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--gh-muted);
  border: 1px solid var(--gh-border);
}

.admin-monitor {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(780px 300px at 0% 0%, rgba(73, 232, 212, 0.12), transparent 56%),
    radial-gradient(640px 300px at 100% 0%, rgba(14, 165, 233, 0.12), transparent 54%),
    var(--gh-surface);
  border: 1px solid rgba(73, 232, 212, 0.16);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.admin-health-card {
  min-height: 108px;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(73, 232, 212, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.admin-health-card span,
.admin-health-card small,
.admin-plan-list span {
  color: var(--gh-muted);
}

.admin-health-card span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.admin-health-card strong {
  display: block;
  margin: 0.35rem 0 0.18rem;
  color: var(--gh-text);
  font-size: 1.28rem;
  line-height: 1.15;
}

.admin-health-card small {
  font-size: 0.78rem;
}

.admin-plan-list {
  display: grid;
  gap: 0.65rem;
}

.admin-plan-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--gh-border);
  background: rgba(255, 255, 255, 0.03);
}

.admin-plan-list strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.alert {
  border-radius: 10px;
  border: 1px solid var(--gh-border);
  background: var(--gh-surface);
  color: var(--gh-text);
}

.pagination .page-link,
.page-link {
  border-radius: 8px;
  border-color: var(--gh-border);
  background: var(--gh-surface-2);
  color: var(--gh-muted);
}

.pagination .page-link:hover,
.page-link:hover {
  color: var(--primary);
  border-color: rgba(0, 229, 160, 0.32);
  background: var(--gh-surface-2);
}

/* History page follows global light/dark variables */
.history-page {
  --history-bg: var(--gh-body);
  --history-surface: var(--gh-surface);
  --history-surface-2: var(--gh-surface-2);
  --history-border: var(--gh-border);
  --history-text: var(--gh-text);
  --history-muted: var(--gh-muted);
  --history-muted-2: var(--gh-muted-soft);
  --history-green: var(--primary);
  --history-red: var(--danger);
  --history-accent: var(--secondary);
}

@media (max-width: 1024px) {
  .sidebar {
    width: 78px;
  }

  .sidebar .brand-text,
  .sidebar .nav-link span:not(.nav-icon),
  .sidebar .nav-section,
  .sidebar .api-badge {
    display: none;
  }

  .main-area {
    margin-left: 78px;
  }

  .sidebar-open .sidebar {
    width: 220px;
  }

  .sidebar-open .sidebar .brand-text,
  .sidebar-open .sidebar .nav-link span:not(.nav-icon),
  .sidebar-open .sidebar .nav-section,
  .sidebar-open .sidebar .api-badge {
    display: block;
  }

  .sidebar-open .main-area {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    height: auto;
    padding: 0.75rem 0.95rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .user-name,
  #api-status {
    display: none;
  }

  .content {
    padding: 1rem;
  }
}

@media (max-width: 560px) {
  .ghx-auth-shell.auth-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 84px 0 32px !important;
  }

  .ghx-auth-card {
    width: calc(100vw - 32px) !important;
    max-width: 358px !important;
    justify-self: start;
    margin-left: 16px;
    margin-right: 16px;
    box-sizing: border-box;
  }

  .ghx-auth-submit,
  .ghx-auth-input {
    width: 100%;
  }

  .ghx-auth-footer {
    padding-inline: 8px;
    line-height: 1.6;
  }
}

/* Responsive hardening */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.content,
.main-area,
.page-header,
.page-actions,
.topbar,
.topbar-left,
.topbar-right,
.card,
.table-card,
.history-page,
.analysis-page,
.admin-monitor {
  min-width: 0;
}

.page-actions,
.topbar-left,
.topbar-right {
  flex-wrap: wrap;
}

.page-title,
.page-subtitle,
.topbar-title,
.history-match-name,
.history-rule-chip,
.history-user-chip,
.analysis-hero h1,
.analysis-card-head h2,
.admin-health-card strong,
.admin-plan-list span,
.admin-plan-list strong,
.table td,
.table th {
  overflow-wrap: anywhere;
}

.btn,
.history-btn,
.dropdown-item,
.badge,
.status-pill {
  white-space: normal;
}

.table-responsive {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.history-page .table-responsive {
  overflow: visible;
}

.theme-dark .history-action-dropdown {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--history-surface);
  border-color: var(--history-border);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

@media (max-width: 768px) {
  .content {
    width: 100%;
    padding: 0.9rem;
  }

  .page-header {
    align-items: stretch;
    gap: 0.8rem;
    margin-bottom: 1rem;
  }

  .page-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .page-actions > * {
    flex: 1 1 150px;
  }

  .topbar {
    width: 100%;
  }

  .topbar-left,
  .topbar-right {
    gap: 0.5rem !important;
  }

  .topbar-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-title {
    max-width: 100%;
    line-height: 1.25;
  }

  .btn-theme-toggle {
    flex: 0 1 auto;
  }

  .card-body,
  .analysis-group-card,
  .analysis-panel,
  .analysis-upgrade,
  .admin-monitor {
    padding: 1rem;
  }

  .admin-monitor-head,
  .admin-plan-list div {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-health-grid {
    grid-template-columns: 1fr;
  }

  .history-page {
    width: 100%;
    padding: 0.85rem;
  }

  .history-table-card {
    overflow: visible;
  }

  .history-table tbody tr {
    width: auto;
  }

  .history-rule-chip {
    max-width: 100%;
    white-space: normal;
  }

  .history-action-dropdown {
    min-width: min(210px, calc(100vw - 32px));
  }

  .analysis-hero,
  .analysis-card-head,
  .analysis-mini-table > div {
    align-items: flex-start;
  }

  .analysis-mini-table > div {
    flex-direction: column;
    gap: 0.35rem;
  }

  .analysis-mini-table strong {
    text-align: left;
  }
}

@media (max-width: 992px) {
  .history-table thead {
    display: none;
  }

  .history-table tbody tr {
    display: block;
    margin: 0.6rem;
    border: 1px solid var(--history-border);
    border-radius: 10px;
  }

  .history-table tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.5rem 0.6rem;
  }

  .history-actions-cell {
    text-align: left !important;
    white-space: nowrap;
  }

  .history-action-menu {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 0.75rem;
  }

  .page-title {
    font-size: 1.32rem;
    line-height: 1.15;
  }

  .page-subtitle {
    font-size: 0.86rem;
  }

  .topbar {
    padding: 0.7rem 0.75rem;
  }

  .user-chip {
    gap: 0 !important;
  }

  .btn,
  .history-btn,
  .form-control,
  .form-select {
    max-width: 100%;
  }

  .history-table tbody tr {
    margin: 0.5rem 0;
  }

  .history-table tbody td {
    padding-inline: 0.45rem;
  }

  .analysis-live-band > div,
  .analysis-metrics > div,
  .analysis-phase-row > div,
  .analysis-mini-table > div {
    padding: 0.85rem;
  }
}

/* Project-wide responsive polish */
html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
}

.app-shell,
.ghx-landing,
.auth-shell {
  width: 100%;
  max-width: 100%;
}

.row {
  min-width: 0;
}

.row > * {
  min-width: 0;
}

.card-title,
.modal-title,
.fw-semibold,
.fw-bold,
.rule-name,
.top-rule-name,
.live-card-league,
.live-card-teams,
.history-date,
.analysis-match-row,
.list-group-item,
.form-text,
.text-muted,
code {
  overflow-wrap: anywhere;
}

.form-control,
.form-select,
textarea,
.input-group,
.input-group-text {
  max-width: 100%;
}

textarea {
  resize: vertical;
}

.modal-dialog {
  max-width: min(var(--bs-modal-width, 500px), calc(100vw - 1rem));
}

.modal-content {
  max-height: calc(100dvh - 1rem);
  overflow: hidden;
}

.modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-header,
.modal-footer {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table td,
.table th {
  vertical-align: middle;
}

.table-responsive .table {
  margin-bottom: 0;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.stat-card-kpi,
.stat-card,
.admin-health-card,
.rule-card,
.live-game-card {
  min-width: 0;
}

.builder-shell,
.rule-editor,
.rule-form,
.condition-group,
.condition-row,
.league-wrap {
  max-width: 100%;
  min-width: 0;
}

.condition-group > .d-flex,
.condition-row > .row,
.card-header.d-flex,
.top-rule-head,
.rule-card-top,
.rule-main,
.rule-card-actions,
.live-score-row {
  min-width: 0;
}

.league-options,
.league-wrap .d-flex,
.condition-group > .d-flex,
.card-header.d-flex,
.rule-card-actions,
.modal-body .d-flex,
.settings-step,
.top-rule-head {
  flex-wrap: wrap;
}

.live-filter-bar,
.history-filters-form {
  width: 100%;
}

.live-league-modal-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.live-league-chip,
.live-league-picker-btn,
.live-fav-toggle {
  max-width: 100%;
}

.live-game-card .table-responsive {
  overflow-x: auto;
}

.pagination {
  flex-wrap: wrap;
}

@media (max-width: 1040px) {
  .ghx-hero-grid,
  .ghx-dashboard-wrap,
  .ghx-split,
  .ghx-telegram {
    gap: 24px;
  }

  .rules-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ghx-landing {
    overflow-x: clip;
  }

  .ghx-nav {
    min-height: 58px;
  }

  .ghx-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .ghx-hero {
    padding-top: 104px;
  }

  .ghx-hero-copy {
    padding-top: 188px;
  }

  .ghx-hero h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1.08;
  }

  .ghx-hero-copy > p,
  .ghx-section-head p,
  .ghx-dashboard-copy p,
  .ghx-tech-copy p,
  .ghx-telegram-copy p,
  .ghx-final-cta p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .ghx-section-head h2,
  .ghx-dashboard-copy h2,
  .ghx-tech-copy h2,
  .ghx-telegram-copy h2,
  .ghx-final-cta h2 {
    font-size: clamp(1.72rem, 8vw, 2.45rem);
    line-height: 1.08;
  }

  .ghx-primary-btn,
  .ghx-secondary-btn,
  .ghx-price-card a {
    width: 100%;
    min-height: 46px;
  }

  .ghx-hero-actions {
    width: 100%;
  }

  .ghx-hero-actions > * {
    max-width: 100%;
  }

  .ghx-trust-row span,
  .ghx-logo-strip span {
    white-space: nowrap;
  }

  .page-actions .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin-right: 0 !important;
  }

  .page-actions .btn-group .btn,
  .page-actions > .btn,
  .page-actions > form,
  .page-actions > form .btn {
    width: 100%;
  }

  .live-filter-bar {
    grid-template-columns: 1fr;
  }

  .live-filter-bar > * {
    width: 100%;
  }

  .live-fav-toggle,
  .live-league-picker-btn {
    justify-content: center;
  }

  .rule-card-top,
  .rule-main,
  .rule-card-actions {
    width: 100%;
  }

  .rule-card-top {
    flex-direction: column;
  }

  .rule-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rule-card-actions .btn,
  .rule-card-actions form {
    width: 100%;
  }

  .rule-card-actions form .btn {
    width: 100%;
  }

  .weekly-chart {
    min-width: 0;
    gap: 0.45rem;
    height: 180px;
  }

  .card-body > .d-flex.justify-content-between,
  .admin-monitor-head {
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  .admin-monitor-head > *,
  .card-body > .d-flex.justify-content-between > * {
    min-width: 0;
  }

  .condition-group > .d-flex,
  .card-header.d-flex {
    align-items: flex-start !important;
    gap: 0.65rem;
  }

  .condition-group > .d-flex > .btn,
  .card-header.d-flex > .btn {
    width: 100%;
  }

  .condition-row .row > [class*="col-"] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    text-align: left !important;
  }

  .condition-row .remove-condition {
    width: 100%;
  }

  .league-wrap .d-flex > .btn,
  .modal-body .d-flex > .btn {
    flex: 1 1 160px;
  }

  .table:not(.history-table) thead {
    display: none;
  }

  .table:not(.history-table) tbody tr {
    display: block;
    border: 1px solid var(--gh-border, var(--border-color));
    border-radius: 10px;
    margin-bottom: 0.65rem;
    padding: 0.45rem;
    background: var(--gh-surface, var(--bg-card));
  }

  .table:not(.history-table) tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.42rem 0.55rem;
    text-align: left !important;
  }

  .table:not(.history-table) tbody td .d-flex {
    flex-wrap: wrap;
  }

  .modal-dialog {
    margin: 0.5rem auto;
  }

  .modal-footer > * {
    flex: 1 1 160px;
  }
}

@media (max-width: 560px) {
  .content {
    padding-inline: 0.7rem;
  }

  .topbar-right {
    align-items: stretch !important;
  }

  .btn-theme-toggle {
    min-width: 0;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .ghx-nav {
    width: calc(100vw - 14px);
    padding: 9px 10px;
  }

  .ghx-landing,
  .ghx-hero {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .ghx-hero-grid,
  .ghx-section,
  .ghx-final-cta {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .ghx-hero .ghx-hero-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 16px !important;
  }

  .ghx-hero-copy {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }

  .ghx-hero-actions {
    width: min(calc(100vw - 32px), 330px) !important;
    max-width: min(calc(100vw - 32px), 330px) !important;
  }

  .ghx-hero-copy > p {
    width: min(100%, 330px) !important;
    max-width: min(100%, 330px) !important;
  }

  .ghx-brand {
    max-width: calc(100% - 78px);
  }

  .ghx-brand strong {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ghx-nav .ghx-link-btn {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.84rem;
  }

  .ghx-hero {
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.45), #121414 70%),
      var(--ghx-hero-image) center 68px / 620px auto no-repeat;
  }

  .ghx-hero-copy {
    padding-top: 170px;
  }

  .ghx-kicker,
  .ghx-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .ghx-hero h1 {
    font-size: clamp(1.9rem, 8.6vw, 2.25rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .ghx-glass-card,
  .ghx-price-card,
  .ghx-faq-item,
  .ghx-dashboard,
  .ghx-neural-card,
  .ghx-phone,
  .ghx-final-cta {
    border-radius: 16px;
    padding: 18px;
  }

  .rule-card-actions {
    grid-template-columns: 1fr;
  }

  .weekly-chart {
    height: 160px;
  }

  .history-pagination-buttons,
  .history-pagination-wrap,
  .pagination {
    width: 100%;
    justify-content: center;
  }

  .modal-content {
    border-radius: 12px;
  }
}
.matchday-page {
  display: grid;
  gap: 1.25rem;
}

.matchday-hero,
.matchday-filters,
.matchday-meta,
.matchday-card-head,
.matchday-teams {
  display: flex;
  align-items: center;
}

.matchday-hero {
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.matchday-hero h1 {
  margin: .2rem 0 .4rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.matchday-hero-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.matchday-help {
  position: relative;
}

.matchday-help-trigger {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: help;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 800;
}

.matchday-help-trigger:hover,
.matchday-help-trigger:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.matchday-help-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + .55rem);
  right: 0;
  width: min(390px, calc(100vw - 36px));
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  pointer-events: none;
}

.matchday-help:hover .matchday-help-popover,
.matchday-help:focus-within .matchday-help-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.matchday-help-popover > strong {
  display: block;
  margin-bottom: .65rem;
  color: var(--text-main);
}

.matchday-help-popover dl {
  display: grid;
  gap: .42rem;
  margin: 0 0 .7rem;
}

.matchday-help-popover dl > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: .55rem;
}

.matchday-help-popover dt {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
}

.matchday-help-popover dd,
.matchday-help-popover small {
  margin: 0;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.35;
}

.matchday-hero p,
.matchday-meta,
.matchday-card small,
.matchday-caution {
  color: var(--text-muted, #66736c);
}

.matchday-market-title {
  margin: 1rem 0 .45rem;
  color: var(--text-muted, #66736c);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.matchday-unavailable {
  padding: .65rem .75rem;
  border: 1px dashed var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-muted, #66736c);
  font-size: .8rem;
}

.matchday-filters {
  gap: .75rem;
  flex-wrap: wrap;
}

.matchday-filters input[type="date"] {
  max-width: 190px;
}

.matchday-trend-filter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 1fr) minmax(145px, .8fr) minmax(118px, .65fr) 96px 96px auto auto;
  align-items: end;
  column-gap: 1rem;
  row-gap: .8rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(31, 166, 98, .25);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31, 166, 98, .1), rgba(31, 166, 98, .025) 38%, var(--bg-card) 75%);
  box-shadow: var(--shadow-sm);
}

.matchday-trend-filter::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--primary, #1fa662);
  content: "";
}

.matchday-trend-filter.is-active {
  border-color: rgba(31, 166, 98, .48);
  box-shadow: 0 8px 24px rgba(19, 112, 67, .09);
}

.matchday-trend-filter-title {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.matchday-trend-filter-title > div {
  display: grid;
  gap: .12rem;
}

.matchday-trend-filter-title strong {
  color: var(--text-main);
  font-family: "Syne", sans-serif;
  font-size: .9rem;
}

.matchday-trend-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary, #1fa662);
  font-family: "DM Mono", monospace;
  font-size: .9rem;
  font-weight: 800;
}

.matchday-trend-filter-title small,
.matchday-trend-result {
  color: var(--text-muted, #66736c);
  font-size: .7rem;
}

.matchday-mini-table tr.is-ticket-option {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.matchday-mini-table tr.is-ticket-option:hover td {
  background: rgba(31, 166, 98, .11);
}

.matchday-mini-table tr.is-ticket-option td:first-child::after {
  margin-left: .35rem;
  color: var(--primary, #168451);
  content: "+";
  font-weight: 900;
}

.matchday-mini-table td.is-ticket-cell {
  position: relative;
  color: var(--primary, #168451);
  font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.matchday-mini-table td.is-ticket-cell:hover {
  background: rgba(31, 166, 98, .14);
  box-shadow: inset 0 0 0 1px rgba(31, 166, 98, .25);
}

.matchday-mini-table td.is-ticket-cell::after {
  margin-left: .2rem;
  content: "+";
  font-size: .65rem;
  font-weight: 900;
}

.matchday-bet-ticket {
  position: fixed;
  z-index: 1090;
  right: 18px;
  bottom: 18px;
  width: min(340px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid rgba(31, 166, 98, .35);
  border-radius: 16px;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: 0 18px 48px rgba(14, 55, 36, .22);
}

.matchday-bet-ticket[hidden],
.matchday-bet-ticket-launcher[hidden] { display: none; }

.matchday-ticket-head {
  display: flex;
  padding: .85rem 1rem;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #168451, #24ad69);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.matchday-ticket-head:active { cursor: grabbing; }

.matchday-ticket-head > div {
  display: grid;
  gap: .08rem;
}

.matchday-ticket-head span {
  font-family: "Syne", sans-serif;
  font-size: .95rem;
  font-weight: 800;
}

.matchday-ticket-head small { color: rgba(255, 255, 255, .8); font-size: .67rem; }

.matchday-ticket-head button,
.matchday-ticket-item > button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: rgba(255, 255, 255, .14);
  font-size: 1.1rem;
  cursor: pointer;
}

.matchday-ticket-body {
  display: grid;
  max-height: 365px;
  padding: .7rem;
  overflow-y: auto;
  gap: .55rem;
}

.matchday-ticket-item {
  position: relative;
  display: grid;
  padding: .7rem 2.35rem .7rem .75rem;
  gap: .25rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 10px;
  background: rgba(31, 166, 98, .035);
}

.matchday-ticket-item > button {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 23px;
  height: 23px;
  color: var(--text-muted, #66736c);
  background: transparent;
  font-size: .95rem;
}

.matchday-ticket-item > button:hover { color: #b42318; background: rgba(239, 68, 68, .1); }
.matchday-ticket-item small { color: var(--text-muted, #66736c); font-size: .63rem; }
.matchday-ticket-item strong { font-size: .78rem; }
.matchday-ticket-item strong em { color: var(--text-muted, #66736c); font-size: .62rem; font-style: normal; text-transform: uppercase; }
.matchday-ticket-item > div { display: flex; align-items: center; justify-content: space-between; color: var(--primary, #168451); font-size: .75rem; font-weight: 800; }
.matchday-ticket-item > div b { font-family: "DM Mono", monospace; font-size: .9rem; }

.matchday-ticket-empty {
  padding: 1.25rem .8rem;
  color: var(--text-muted, #66736c);
  font-size: .75rem;
  text-align: center;
}

.matchday-bet-ticket footer { padding: .65rem .75rem; border-top: 1px solid var(--border-color, #dfe7e2); }
.matchday-ticket-clear { width: 100%; padding: .45rem; border: 1px solid rgba(180, 35, 24, .22); border-radius: 8px; color: #b42318; background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.matchday-ticket-clear:hover { background: rgba(239, 68, 68, .07); }

.matchday-bet-ticket-launcher {
  position: fixed;
  z-index: 1089;
  right: 18px;
  bottom: 18px;
  padding: .65rem .85rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary, #168451);
  box-shadow: 0 10px 28px rgba(14, 55, 36, .22);
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.matchday-bet-ticket-launcher span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: .3rem;
  padding: 0 .3rem;
  place-items: center;
  border-radius: 999px;
  color: var(--primary, #168451);
  background: #fff;
}

.matchday-trend-filter > label {
  display: grid;
  min-width: 0;
  min-width: 145px;
  gap: .25rem;
  color: var(--text-muted, #66736c);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-trend-filter .form-select,
.matchday-trend-filter .form-control {
  border-color: rgba(31, 166, 98, .2);
  color: var(--text-main);
  background-color: var(--bg-card);
}

.matchday-trend-filter .form-select:focus,
.matchday-trend-filter .form-control:focus {
  border-color: var(--primary, #1fa662);
  box-shadow: 0 0 0 3px rgba(31, 166, 98, .1);
}

.matchday-trend-filter .matchday-percent-field {
  position: relative;
  min-width: 96px;
  max-width: none;
}

.matchday-trend-samples {
  padding-right: .25rem;
}

.matchday-percent-field input {
  padding-right: 1.5rem;
}

.matchday-percent-field b {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  color: var(--text-muted, #66736c);
  font-size: .75rem;
}

.matchday-trend-result {
  grid-column: 1 / -1;
  min-height: 18px;
  padding-left: 46px;
  color: var(--primary, #168451);
  font-weight: 700;
}

@media (max-width: 1180px) {
  .matchday-trend-filter { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .matchday-trend-filter-title { grid-column: 1 / -1; }
}

.matchday-select-field {
  display: grid;
  min-width: 220px;
  max-width: 310px;
  flex: 1 1 240px;
  gap: .25rem;
}

.matchday-select-field > span {
  padding-left: .15rem;
  color: var(--text-muted, #66736c);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-select-field .form-select,
.matchday-search-select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-search-select {
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #738079 50%), linear-gradient(135deg, #738079 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.matchday-date-field {
  min-width: 180px;
  max-width: 190px;
  flex: 0 0 190px;
}

.matchday-live-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: .5rem;
  align-self: end;
  padding: .5rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}

.matchday-filter-picker {
  position: relative;
}

.matchday-combo-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 150px;
  padding: .55rem .8rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  text-align: left;
}

.matchday-multi-picker .matchday-combo-trigger {
  width: 100%;
  min-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-combo-trigger > [data-picker-summary] {
  display: inline-block;
  max-width: calc(100% - 26px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.matchday-combo-arrow {
  flex: 0 0 auto;
  color: var(--text-muted, #66736c);
  transition: transform .15s ease;
}

.matchday-combo-trigger[aria-expanded="true"] .matchday-combo-arrow { transform: rotate(180deg); }

.matchday-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + .35rem);
  left: 0;
  width: min(360px, 88vw);
  padding: .7rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.matchday-option-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  max-height: 290px;
  margin-top: .55rem;
  border: 1px solid var(--border-color, #e5ebe7);
  border-radius: 7px;
  overflow-y: auto;
}

.matchday-no-options {
  padding: .8rem .35rem;
  color: var(--text-muted, #66736c);
  font-size: .78rem;
  text-align: center;
}

.matchday-option-list label {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  margin: 0;
  padding: .5rem .65rem;
  border: 0;
  border-bottom: 1px solid var(--border-color, #e5ebe7);
  border-radius: 0;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
  font-size: .8rem;
}

.matchday-option-list > label {
  display: flex !important;
  float: none !important;
  clear: both;
}

.matchday-option-list > label[hidden] {
  display: none !important;
}

.matchday-option-list > label + label {
  margin-top: 0;
}

.matchday-option-list label:last-child { border-bottom: 0; }

.matchday-option-list label:hover { background: rgba(31, 166, 98, .08); }

.matchday-option-list label:has(input:checked) {
  background: rgba(31, 166, 98, .09);
}

.matchday-option-list label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-option-list .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.matchday-all-option {
  position: static;
  border-bottom: 1px solid var(--border-color, #dce5df) !important;
  font-weight: 800;
}

.matchday-option-search,
.matchday-date-field .form-control {
  color: var(--text-main);
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

.matchday-option-search::placeholder { color: var(--text-muted); }

.theme-dark .matchday-combo-trigger,
.theme-dark .matchday-picker-panel { background: var(--bg-card); }

.theme-dark .matchday-option-list label { background: var(--bg-card); }

.theme-dark .matchday-option-list label:has(input:checked) { background: rgba(0, 229, 160, .1); }

.matchday-meta,
.matchday-card-head {
  justify-content: space-between;
  gap: 1rem;
}

.matchday-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.matchday-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.matchday-card:hover {
  border-color: var(--gh-border-strong, var(--border-color));
  box-shadow: var(--shadow-md);
}

.matchday-card-summary {
  min-height: 174px;
}

.matchday-summary-loading,
.matchday-summary-error {
  display: flex;
  min-height: 174px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #66736c);
  font-size: .8rem;
  text-align: center;
}

.matchday-summary-state {
  display: flex;
  min-height: 174px;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .35rem;
  border: 1px dashed var(--border-color, #dfe7e2);
  border-radius: 10px;
  color: var(--text-muted, #66736c);
  background: rgba(31, 166, 98, .035);
  font-size: .76rem;
  text-align: center;
}

.matchday-summary-state strong {
  color: var(--text-main);
  font-size: .82rem;
}

.matchday-summary-state.is-error {
  background: rgba(196, 126, 34, .05);
}

.matchday-summary-retry {
  margin-top: .35rem;
  padding: .28rem .6rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 7px;
  color: var(--primary, #168653);
  background: var(--bg-card);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.matchday-page-sample {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .4rem .3rem .65rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-muted, #66736c);
  background: var(--bg-card);
  font-size: .76rem;
  font-weight: 700;
}

.matchday-page-sample select {
  min-width: 82px;
  padding: .3rem 1.6rem .3rem .45rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 7px;
  color: var(--text-main);
  background: var(--bg-card);
  font: inherit;
  cursor: pointer;
}

.matchday-mini-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-color, #dfe7e2);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  color: var(--text-main);
  background: var(--bg-card);
  font-size: .75rem;
}

.matchday-mini-table th,
.matchday-mini-table td {
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--border-color, #e8eeea);
  vertical-align: middle;
}

.matchday-mini-table th {
  background: rgba(31, 166, 98, .09);
  color: var(--text-muted, #66736c);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-mini-table th:nth-child(2),
.matchday-mini-table td:nth-child(2) {
  width: 62px;
  color: #168451;
  font-weight: 800;
  text-align: center;
}

.matchday-mini-table th:last-child,
.matchday-mini-table td:last-child {
  width: 72px;
  color: var(--text-muted, #66736c);
  text-align: right;
}

.matchday-mini-table tr:last-child td {
  border-bottom: 0;
}

.matchday-compare-table th:not(:first-child),
.matchday-compare-table td:not(:first-child) {
  width: 58px;
  padding-left: .65rem;
  padding-right: .65rem;
  color: #168451;
  font-weight: 800;
  text-align: center;
}

.matchday-compare-table th:first-child,
.matchday-compare-table td:first-child {
  padding-right: .75rem;
}

.matchday-compare-table th:last-child,
.matchday-compare-table td:last-child {
  color: #168451;
  text-align: center;
}

.matchday-compare-table .matchday-sample-row td {
  background: rgba(105, 120, 112, .06);
  color: var(--text-muted, #66736c);
  font-size: .66rem;
  font-weight: 700;
}

.matchday-sample-control {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  margin: 0;
  cursor: text;
}

.matchday-sample-control select {
  width: 40px;
  height: 24px;
  padding: 0 .15rem;
  border: 0;
  border-bottom: 1px dotted var(--text-muted);
  border-radius: 0;
  color: var(--text-main);
  background: transparent;
  font-size: .68rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.matchday-sample-control select:focus {
  border-bottom-color: var(--primary);
  outline: none;
}


.theme-dark .matchday-mini-table th {
  background: rgba(63, 201, 126, .1);
}

.matchday-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.matchday-card-head > span {
  padding: .3rem .55rem;
  border-radius: 8px;
  background: rgba(31, 166, 98, .12);
  color: #168451;
  font-weight: 800;
}

.matchday-card-head > span.is-live {
  color: #b42318;
  background: rgba(239, 68, 68, .12);
}

.matchday-live-score {
  margin-top: .35rem;
  color: var(--primary);
  font-family: "DM Mono", monospace;
  font-size: 1rem;
  font-weight: 800;
}

.matchday-card-head small {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-teams {
  min-height: 74px;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
  text-align: center;
}

.matchday-teams span {
  color: var(--text-muted, #66736c);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.matchday-teams strong { color: var(--text-main); }

.matchday-caution {
  margin-top: .75rem;
  padding: .6rem .75rem;
  border-radius: 9px;
  background: rgba(224, 164, 36, .12);
  font-size: .78rem;
}

.matchday-reading {
  margin-top: 1rem;
}

.theme-dark .matchday-hero,
.theme-dark .matchday-card {
  background: var(--bg-card);
}

@media (max-width: 1100px) {
  .matchday-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .matchday-hero,
  .matchday-filters { align-items: stretch; flex-direction: column; }
  .matchday-trend-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .matchday-trend-filter-title,
  .matchday-trend-filter > label:not(.matchday-percent-field) { grid-column: 1 / -1; min-width: 100%; max-width: none; }
  .matchday-trend-filter .matchday-percent-field { min-width: calc(50% - .4rem); }
  .matchday-trend-filter .btn { width: 100%; }
  .matchday-trend-result { padding-left: 0; }
  .matchday-filters input[type="date"] { max-width: none; }
  .matchday-select-field { width: 100%; max-width: none; }
  .matchday-date-field { flex-basis: auto; }
  .matchday-grid { grid-template-columns: 1fr; }
  .matchday-hero-actions { justify-content: space-between; }
  .matchday-help-popover { right: auto; left: 0; }
  .matchday-compare-table th:not(:first-child),
  .matchday-compare-table td:not(:first-child) {
    width: 52px;
    padding-left: .45rem;
    padding-right: .45rem;
  }
}
