/* LottoMais — Design Token System
   Ported from Next.js globals.css
   Dark + Light themes with HSL-based variables */

/* ─── BASE: Light Theme  ·  Creme #F7F5F0  ·  Noir #1A1814  ·  Ouro #C9B97A ── */
:root {
  /* ── Backgrounds ─────────────────────────────────────────────── */
  --background: 43 31% 95%;           /* #F7F5F0  creme                   */
  --foreground: 40 13% 9%;            /* #1A1814  noir                    */

  --card: 40 20% 99%;                 /* branco quente                    */
  --card-foreground: 40 13% 9%;

  --popover: 40 20% 99%;
  --popover-foreground: 40 13% 9%;

  /* ── Accents primário / secundário ───────────────────────────── */
  --primary: 48 42% 63%;              /* #C9B97A  ouro apagado            */
  --primary-foreground: 40 13% 9%;    /* noir sobre ouro                  */

  --secondary: 42 50% 42%;            /* bronze dourado escuro            */
  --secondary-foreground: 43 31% 95%; /* creme                            */

  /* ── Muted / Accent ──────────────────────────────────────────── */
  --muted: 40 18% 90%;                /* creme escurecido                 */
  --muted-foreground: 40 10% 45%;     /* noir atenuado                    */

  --accent: 40 15% 92%;               /* hover sutil                      */
  --accent-foreground: 40 13% 9%;

  /* ── Semânticas ──────────────────────────────────────────────── */
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --warning: 45 100% 45%;
  --success: 135 60% 35%;

  /* ── Bordas / Inputs / Ring ──────────────────────────────────── */
  --border: 40 15% 84%;               /* borda creme quente               */
  --input: 40 18% 92%;
  --ring: 48 42% 63%;                  /* ouro                             */

  --radius: 0.375rem;

  /* ── Sidebar ─────────────────────────────────────────────────── */
  --sidebar-background: 40 20% 97%;
  --sidebar-foreground: 40 10% 40%;
  --sidebar-primary: 48 42% 63%;
  --sidebar-accent: 40 15% 93%;
  --sidebar-border: 40 15% 88%;

  /* ── Heatmap ─────────────────────────────────────────────────── */
  --heat-cold: 40 15% 88%;
  --heat-cool: 45 30% 72%;
  --heat-warm: 48 38% 58%;
  --heat-hot: 48 42% 63%;

  /* ── Glows ───────────────────────────────────────────────────── */
  --glow-cyan: 0 0 15px hsl(48 42% 63% / 0.3);
  --glow-green: 0 0 15px hsl(42 50% 42% / 0.3);
  --glow-subtle: 0 0 8px hsl(48 42% 63% / 0.15);

  /* ── Lottery Balls ───────────────────────────────────────────── */
  --ball-active-bg: 42 45% 52%;
  --ball-active-text: 40 13% 9%;       /* noir                            */
  --ball-active-border: 42 40% 45%;
  --ball-inactive-bg: 40 10% 88%;
  --ball-inactive-text: 40 10% 35%;
  --ball-inactive-border: 40 8% 80%;
}

/* ─── DARK THEME  ·  Azul Noite #1E2D3A  ·  Areia #EDE9E0  ·  Prata #B0B0AA ── */
.dark {
  /* ── Backgrounds ─────────────────────────────────────────────── */
  --background: 204 31% 17%;          /* #1E2D3A  azul noite              */
  --foreground: 41 30% 90%;           /* #EDE9E0  areia                   */

  --card: 204 28% 21%;                /* ~#253A49  card um degrau acima   */
  --card-foreground: 41 30% 90%;      /* areia                            */

  --popover: 204 28% 21%;
  --popover-foreground: 41 30% 90%;

  /* ── Accents primário / secundário ───────────────────────────── */
  --primary: 185 100% 48%;            /* ciano vibrante (mantido)         */
  --primary-foreground: 204 31% 17%;  /* fundo azul noite                 */

  --secondary: 135 100% 50%;          /* verde vibrante (mantido)         */
  --secondary-foreground: 204 31% 17%;

  /* ── Muted / Accent ──────────────────────────────────────────── */
  --muted: 204 22% 24%;              /* azul-noite mais claro             */
  --muted-foreground: 60 3% 68%;     /* #B0B0AA  prata                   */

  --accent: 204 22% 27%;             /* hover-accent sutil                */
  --accent-foreground: 41 30% 90%;   /* areia                            */

  /* ── Semânticas ──────────────────────────────────────────────── */
  --destructive: 0 72% 51%;
  --destructive-foreground: 41 30% 95%;
  --warning: 45 100% 50%;
  --success: 135 100% 50%;

  /* ── Bordas / Inputs / Ring ──────────────────────────────────── */
  --border: 204 18% 28%;             /* borda azul-noite suave            */
  --input: 204 25% 22%;              /* input levemente acima do card     */
  --ring: 185 100% 48%;              /* ciano (mantido)                   */

  /* ── Sidebar ─────────────────────────────────────────────────── */
  --sidebar-background: 204 33% 14%; /* mais escuro que o background      */
  --sidebar-foreground: 60 3% 68%;   /* prata                            */
  --sidebar-primary: 185 100% 48%;
  --sidebar-accent: 204 25% 22%;
  --sidebar-border: 204 22% 22%;

  /* ── Heatmap ─────────────────────────────────────────────────── */
  --heat-cold: 204 25% 22%;
  --heat-cool: 200 50% 35%;
  --heat-warm: 185 70% 38%;
  --heat-hot: 185 100% 48%;

  /* ── Glows ───────────────────────────────────────────────────── */
  --glow-cyan: 0 0 20px hsl(185 100% 48% / 0.5);
  --glow-green: 0 0 20px hsl(135 100% 50% / 0.5);
  --glow-subtle: 0 0 10px hsl(185 100% 48% / 0.25);

  /* ── Lottery Balls ───────────────────────────────────────────── */
  --ball-active-bg: 204 25% 30%;
  --ball-active-text: 0 0% 92%;
  --ball-active-border: 204 30% 40%;
  --ball-inactive-bg: 204 20% 20%;
  --ball-inactive-text: 60 3% 55%;
  --ball-inactive-border: 204 15% 28%;
}

/* ─── GLOBAL STYLES ────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ─── UTILITIES ────────────────────────────────────────────────── */
.bg-background { background-color: hsl(var(--background)); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-destructive { background-color: hsl(var(--destructive)); }
.bg-sidebar { background-color: hsl(var(--sidebar-background)); }

.text-foreground { color: hsl(var(--foreground)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-secondary { color: hsl(var(--secondary)); }
.text-card { color: hsl(var(--card-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }

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

.glass-effect {
  background-color: hsl(var(--card) / 0.5);
  backdrop-filter: blur(24px);
  border: 1px solid hsl(var(--border) / 0.5);
}
.glass-effect-strong {
  background-color: hsl(var(--card) / 0.8);
  backdrop-filter: blur(48px);
  border: 1px solid hsl(var(--border) / 0.6);
}

.gradient-text {
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift {
  transition: all 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px -4px hsl(var(--primary) / 0.2);
}

/* ─── LAYOUT ───────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 2.5rem;
}

/* ─── HEADER ───────────────────────────────────────────────────── */
.header {
  height: 4rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo-icon-img {
  height: 2.25rem;
  width: 2.25rem;
  object-fit: contain;
  border-radius: 0.375rem;
}

.header-logo-img {
  height: 6rem;
  width: auto;
  object-fit: contain;
  margin: -1rem 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  min-height: 100vh;
  border-right: 1px solid hsl(var(--sidebar-border));
  background-color: hsl(var(--sidebar-background));
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.expanded { width: 16rem; }
.sidebar.collapsed { width: 3.5rem; }

.sidebar-header {
  padding: 0.5rem;
}

.sidebar-section-title {
  padding: 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav { padding: 0 0.5rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: hsl(var(--sidebar-foreground));
  transition: all 0.15s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--accent-foreground));
}

.sidebar-link.active {
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-weight: 500;
}

/* ─── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: var(--glow-cyan);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.btn-outline:hover {
  background-color: hsl(var(--accent));
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}
.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-icon {
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
}

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

/* ─── CARDS ────────────────────────────────────────────────────── */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ─── FORM INPUTS ──────────────────────────────────────────────── */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 0.375rem;
}

.form-group { margin-bottom: 1rem; }

/* ─── TABLES ───────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  border-top: 1px solid hsl(var(--border) / 0.6); /* Borda superior para fechar a 'faixa' */
  /* Fundo sutilmente translúcido criando a clássica faixa destacada (SaaS Stripe-like) */
  background-color: hsl(var(--foreground) / 0.03); 
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  color: hsl(var(--card-foreground));
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.data-table tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02);
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.06);
}

/* ─── DATA TABLE MODIFIERS (DENSITY & BORDERS) ─────────────────── */
.data-table.table-compact th {
  padding: 0.5rem 0.75rem;
}

.data-table.table-compact td {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.data-table.table-vertical-lines th,
.data-table.table-vertical-lines td {
  border-right: 1px solid hsl(var(--border) / 0.4);
}
.data-table.table-vertical-lines th:last-child,
.data-table.table-vertical-lines td:last-child {
  border-right: none; /* Não queremos borda grudada no fim da direita nula */
}
/* ─── INTERACTIVE TABLE HEADERS ────────────────────────────────── */
.th-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.th-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.th-title-row:hover {
  color: hsl(var(--foreground));
}

.th-title-text {
  flex: 1;
}

.th-sort-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

.th-filter-btn {
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-filter-btn:hover {
  background-color: hsl(var(--accent));
  opacity: 1 !important;
}

.popover-filter {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 200px;
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border) / 0.8);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  z-index: 50;
  cursor: default;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

/* Prevent clipped popover horizontal scroll by reversing position on the last 2 columns */
th:nth-last-child(-n+2) .popover-filter {
  left: auto;
  right: 0;
}

/* ─── TABS ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn:hover { color: hsl(var(--foreground)); }
.tab-btn.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
}

/* ─── BADGES ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.badge-secondary {
  background-color: hsl(var(--secondary) / 0.15);
  color: hsl(var(--secondary));
}

.badge-destructive {
  background-color: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
}

/* ─── LOTTERY BALLS ────────────────────────────────────────────── */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) + 2px);
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.ball-active {
  background-color: hsl(var(--ball-active-bg));
  color: hsl(var(--ball-active-text));
  border: 1px solid hsl(var(--ball-active-border));
}

.ball-inactive {
  background-color: hsl(var(--ball-inactive-bg));
  color: hsl(var(--ball-inactive-text));
  border: 1px solid hsl(var(--ball-inactive-border));
}

.ball-sm { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.ball-lg { width: 3rem; height: 3rem; font-size: 1rem; }

/* ─── HEATMAP ──────────────────────────────────────────────────── */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.375rem;
}

.heatmap-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.heat-cold { background-color: hsl(var(--heat-cold)); color: hsl(var(--muted-foreground)); }
.heat-cool { background-color: hsl(var(--heat-cool)); color: hsl(var(--foreground)); }
.heat-warm { background-color: hsl(var(--heat-warm)); color: white; }
.heat-hot  { background-color: hsl(var(--heat-hot));  color: hsl(var(--primary-foreground)); box-shadow: var(--glow-cyan); }

/* ─── DROPDOWN ─────────────────────────────────────────────────── */
.dropdown-menu {
  position: absolute;
  z-index: 50;
  min-width: 10rem;
  padding: 0.25rem;
  background-color: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.15);
  animation: fade-in 0.15s ease-out;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--popover-foreground));
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.dropdown-item:hover {
  background-color: hsl(var(--accent));
}

/* ─── SEPARATOR ────────────────────────────────────────────────── */
.separator {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 0.75rem 0;
}

/* ─── SKELETON LOADING ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 25%,
    hsl(var(--muted) / 0.5) 50%,
    hsl(var(--muted)) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── PAYWALL ──────────────────────────────────────────────────── */
.paywall-overlay {
  position: relative;
  padding: 3rem;
  text-align: center;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background-color: hsl(var(--card));
}

.paywall-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.05), hsl(var(--secondary) / 0.05));
  border-radius: inherit;
  pointer-events: none;
}

/* ─── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; border-radius: 4px; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.3);
}

/* ─── ANIMATIONS ───────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px hsl(var(--primary) / 0.3); }
  50%      { box-shadow: 0 0 40px hsl(var(--primary) / 0.6); }
}

.animate-fade-in { animation: fade-in 0.4s ease-out; }
.animate-scale-in { animation: scale-in 0.3s ease-out; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ─── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; z-index: 40; left: 0; top: 3.5rem; bottom: 0; width: 16rem; }
  .hide-mobile { display: none !important; }
  .heatmap-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ─── STAT CARD ────────────────────────────────────────────────── */
.stat-card {
  padding: 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--primary));
}

.stat-card-label {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* ─── GRID UTILITIES ───────────────────────────────────────────── */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── AUTH PAGE ────────────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, hsl(var(--background)), hsl(var(--card)));
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 8px 32px -8px hsl(var(--primary) / 0.15);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: hsl(var(--border));
}

.oauth-btn {
  width: 100%;
  padding: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.oauth-btn:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.3);
}

/* ─── PRICING CARDS ────────────────────────────────────────────── */
.pricing-card {
  padding: 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  background-color: hsl(var(--card));
  text-align: center;
  transition: all 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -8px hsl(var(--primary) / 0.2);
  border-color: hsl(var(--primary) / 0.3);
}

.pricing-card.featured {
  border-color: hsl(var(--primary));
  position: relative;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: hsl(var(--primary));
  line-height: 1;
}

.pricing-features {
  list-style: none;
  padding: 0;
  text-align: left;
}

.pricing-features li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.pricing-features li::before {
  content: "✓";
  color: hsl(var(--success));
  font-weight: 700;
}

/* ─── FOOTER ───────────────────────────────────────────────────── */
.footer {
  padding: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.5);
  text-align: center;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

/* ─── TOOLTIP ──────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.625rem;
  background-color: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── MISCELLANEOUS ────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: calc(var(--radius) + 2px); }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.hidden { display: none; }

/* Table Aesthetic Modifiers */
.data-table.table-compact th { padding: 0.4rem 0.75rem !important; }
.data-table.table-compact td { padding: 0.35rem 0.75rem !important; font-size: 0.75rem; }
.data-table.table-vertical-lines th, .data-table.table-vertical-lines td { border-right: 1px solid hsl(var(--border) / 0.4) !important; }
.data-table.table-vertical-lines th:last-child, .data-table.table-vertical-lines td:last-child { border-right: none !important; }

.data-table.table-header-align-left th { text-align: left !important; }
.data-table.table-header-align-center th { text-align: center !important; }
.data-table.table-header-align-right th { text-align: right !important; }

.data-table.table-body-align-left td { text-align: left !important; }
.data-table.table-body-align-center td { text-align: center !important; }
.data-table.table-body-align-right td { text-align: right !important; }

.data-table.table-vertical-lines-medium th, .data-table.table-vertical-lines-medium td { border-right: 2px solid hsl(var(--border) / 0.6) !important; }
.data-table.table-vertical-lines-medium th:last-child, .data-table.table-vertical-lines-medium td:last-child { border-right: none !important; }
.data-table.table-vertical-lines-thick th, .data-table.table-vertical-lines-thick td { border-right: 3px solid hsl(var(--border) / 0.9) !important; }
.data-table.table-vertical-lines-thick th:last-child, .data-table.table-vertical-lines-thick td:last-child { border-right: none !important; }
.data-table.table-horizontal-lines-medium th, .data-table.table-horizontal-lines-medium td { border-bottom: 2px solid hsl(var(--border) / 0.7) !important; }
.data-table.table-horizontal-lines-thick th, .data-table.table-horizontal-lines-thick td { border-bottom: 3px solid hsl(var(--border) / 1.0) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LUA E DEZENAS — Dashboard Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Dashboard Container ──────────────────────────────────────── */
.lua-dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ─── Section Headers ──────────────────────────────────────────── */
.lua-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lua-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lua-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.lua-section-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.lua-section-subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  text-align: left;
}

/* ─── OVERVIEW HEADER ──────────────────────────────────────────── */
.lua-overview-card {
  background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--muted) / 0.5));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem 2rem;
}

.lua-overview-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.lua-overview-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lua-phase-icon-wrap {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
}

.lua-phase-icon {
  width: 2.75rem;
  height: 2.75rem;
}

.lua-overview-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.lua-overview-phase {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.lua-realtime-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  background-color: hsl(var(--muted)/0.3);
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)/0.5);
  display: inline-flex;
  align-items: center;
}

.lua-overview-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.lua-overview-balls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lua-rec-ball {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.875rem;
}

/* ─── Phase Schedule Timeline ──────────────────────────────── */
.lua-schedule-strip {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
  overflow-x: auto;
}

.lua-schedule-card {
  flex: 1;
  min-width: 10rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.4);
  background-color: hsl(var(--muted) / 0.15);
  transition: all 0.15s ease;
}

.lua-schedule-card--current {
  border-color: hsl(var(--primary) / 0.5);
  background-color: hsl(var(--primary) / 0.06);
}

.lua-schedule-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.lua-schedule-phase-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lua-schedule-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: hsl(var(--foreground));
}

.lua-schedule-phase-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.lua-schedule-badge {
  font-size: 0.5625rem;
  padding: 0.1rem 0.4rem;
}

.lua-schedule-dates {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

/* Progress bar */
.lua-schedule-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lua-schedule-progress-track {
  width: 100%;
  height: 3px;
  background-color: hsl(var(--muted) / 0.5);
  border-radius: 2px;
  overflow: hidden;
}

.lua-schedule-progress-fill {
  height: 100%;
  border-radius: 2px;
  background-color: hsl(var(--primary));
  transition: width 0.5s ease;
}

.lua-schedule-countdown {
  font-size: 0.6875rem;
  color: hsl(var(--primary));
  font-weight: 600;
}

.lua-schedule-future {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

/* ─── PÓDIO ────────────────────────────────────────────────────── */
.lua-podio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.lua-podio-card {
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.lua-podio-card--active {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.2);
}

.lua-podio-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lua-podio-phase-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.lua-podio-phase-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: hsl(var(--foreground));
}

.lua-podio-phase-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.lua-podio-phase-draws {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lua-badge-hoje {
  font-size: 0.625rem;
  padding: 0.1rem 0.5rem;
}

/* ─── Rankings (Top/Bottom bars) ───────────────────────────────── */
.lua-ranking-section {
  margin-top: 1rem;
}

.lua-ranking-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed hsl(var(--border));
  padding-bottom: 0.375rem;
}

.lua-ranking-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.lua-ranking-pos {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  width: 1.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.lua-ball-top {
  background: hsl(var(--foreground));
  color: hsl(var(--card));
  font-weight: 700;
}

.lua-ball-bottom {
  background: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
  font-weight: 700;
  border: 1px solid hsl(var(--destructive) / 0.3);
}

.lua-ranking-bar-wrap {
  flex: 1;
  height: 4px;
  background-color: hsl(var(--muted) / 0.5);
  border-radius: 2px;
  overflow: hidden;
}

.lua-ranking-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.lua-ranking-bar--top {
  background-color: hsl(var(--foreground) / 0.6);
}

.lua-ranking-bar--bottom {
  background-color: hsl(var(--destructive) / 0.5);
}

.lua-ranking-score {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  width: 2.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ─── DRILL-DOWN ───────────────────────────────────────────────── */
.lua-drilldown-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.lua-drilldown-grid-wrap {
  position: sticky;
  top: 5rem;
}

.lua-drilldown-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lua-drilldown-row {
  display: flex;
  gap: 0.25rem;
}

.lua-drilldown-cell {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.lua-drilldown-cell:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--primary) / 0.5);
}

.lua-drilldown-cell--active {
  background-color: hsl(var(--primary) / 0.15) !important;
  border-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.2);
}

/* Detail panel */
.lua-drilldown-detail {
  padding: 1.5rem;
}

.lua-drilldown-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.lua-detail-ball {
  flex-shrink: 0;
}

.lua-detail-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.lua-detail-subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

/* Detail bars */
.lua-detail-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.lua-detail-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lua-detail-bar-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 7rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.lua-detail-bar-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: hsl(var(--foreground));
}

.lua-detail-bar-track {
  flex: 1;
  height: 8px;
  background-color: hsl(var(--muted) / 0.5);
  border-radius: 4px;
  overflow: hidden;
}

.lua-detail-bar-fill {
  height: 100%;
  border-radius: 4px;
  background-color: hsl(var(--foreground) / 0.5);
  transition: width 0.4s ease;
}

.lua-detail-bar-fill--best {
  background-color: hsl(var(--foreground) / 0.7);
}

.lua-detail-bar-fill--worst {
  background: linear-gradient(90deg, hsl(var(--foreground) / 0.5), hsl(var(--destructive) / 0.6));
}

.lua-detail-bar-score {
  font-size: 0.8125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  width: 2.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.lua-badge-best, .lua-badge-worst {
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  width: 3.5rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.lua-badge-best {
  background-color: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.3);
}

.lua-badge-worst {
  background-color: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive) / 0.3);
}

/* Detail stats footer */
.lua-detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
}

.lua-subcard {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lua-subcard-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border) / 0.3);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

.lua-subcard-icon {
  color: hsl(var(--foreground));
}

.lua-subcard-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lua-subcard-m {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lua-subcard-m-label {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.lua-subcard-m-val {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

.lua-subcard-lift-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: hsl(var(--foreground));
}

.lua-subcard--best {
  border-color: hsl(var(--primary) / 0.5);
  background: linear-gradient(to bottom right, hsl(var(--card)), hsl(var(--primary) / 0.05));
}

.lua-subcard--worst {
  border-color: hsl(var(--destructive) / 0.4);
  background: linear-gradient(to bottom right, hsl(var(--card)), hsl(var(--destructive) / 0.05));
}


/* Leaderboard Table Styles */
.lua-leaderboard-wrap {
  display: flex;
  flex-direction: column;
}

.lua-select {
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.lua-select:hover {
  border-color: hsl(var(--primary) / 0.5);
}

.lua-leaderboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 30rem; /* match approx 10 columns */
}



.lua-leaderboard-tier {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1;
}

.lua-leaderboard-tier[data-tier="S"] { color: hsl(var(--primary)); }
.lua-leaderboard-tier[data-tier="A"] { color: #4ade80; }
.lua-leaderboard-tier[data-tier="B"] { color: #60a5fa; }
.lua-leaderboard-tier[data-tier="C"] { color: #fbbf24; }
.lua-leaderboard-tier[data-tier="F"] { color: hsl(var(--destructive)); }

.lua-leaderboard-val {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.55rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  line-height: 1;
}

.lua-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 4px;
}

.lua-tier-badge[data-tier="S"] { background-color: hsl(var(--primary) / 0.2); color: hsl(var(--primary)); }
.lua-tier-badge[data-tier="A"] { background-color: #22c55e33; color: #4ade80; }
.lua-tier-badge[data-tier="B"] { background-color: #3b82f633; color: #60a5fa; }
.lua-tier-badge[data-tier="C"] { background-color: #eab30833; color: #fbbf24; }
.lua-tier-badge[data-tier="F"] { background-color: hsl(var(--destructive) / 0.2); color: hsl(var(--destructive)); }


/* Segmented Control - Phase Tabs */
.lua-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  background-color: hsl(var(--card) / 0.3);
  border: 1px solid hsl(var(--border) / 0.4);
  border-radius: calc(var(--radius) + 2px);
  margin-bottom: 1.5rem;
  width: fit-content;
  max-width: 100%;
}

.lua-segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lua-segmented-btn:hover {
  color: hsl(var(--foreground));
}

.lua-segmented-btn--active {
  background-color: hsl(var(--muted)/0.6);
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.lua-segmented-btn-icon {
  width: 0.875rem;
  height: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lua-segmented-today {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: hsl(var(--foreground));
  margin-left: 0.2rem;
  opacity: 0.5;
}
.lua-segmented-btn--active .lua-segmented-today {
  color: hsl(var(--primary));
  opacity: 1;
}

/* Tier Rows */
.lua-tier-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lua-tier-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  transition: all 0.15s ease;
}

.lua-tier-letter-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  width: 12.5rem;
  border-right: 1px solid hsl(var(--border) / 0.4);
}

.lua-tier-letter {
  font-size: 1.5rem;
  font-weight: 800;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.lua-tier-meta {
  display: flex;
  flex-direction: column;
}

.lua-tier-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.lua-tier-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

/* Tier colors — subtle background tints */
.lua-tier-row--s { background-color: hsl(var(--primary) / 0.06); border-color: hsl(var(--primary) / 0.2); }
.lua-tier-row--s .lua-tier-letter { background-color: hsl(var(--primary) / 0.2); color: hsl(var(--primary)); }

.lua-tier-row--a { background-color: hsl(var(--success) / 0.04); border-color: hsl(var(--success) / 0.15); }
.lua-tier-row--a .lua-tier-letter { background-color: hsl(var(--success) / 0.15); color: hsl(var(--success)); }

.lua-tier-row--b { background-color: hsl(var(--card)); }
.lua-tier-row--b .lua-tier-letter { background-color: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.lua-tier-row--c { background-color: hsl(var(--warning) / 0.04); border-color: hsl(var(--warning) / 0.15); }
.lua-tier-row--c .lua-tier-letter { background-color: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }

.lua-tier-row--f { background-color: hsl(var(--destructive) / 0.04); border-color: hsl(var(--destructive) / 0.15); }
.lua-tier-row--f .lua-tier-letter { background-color: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }

/* Tier number balls */
.lua-tier-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.lua-tier-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

/* ─── LUA DASHBOARD RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1280px) {
  .lua-podio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .lua-drilldown-layout { grid-template-columns: 1fr; }
  .lua-drilldown-grid-wrap { position: static; }
  .lua-detail-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .lua-podio-grid { grid-template-columns: 1fr; }
  .lua-overview-inner { flex-direction: column; align-items: flex-start; }
  .lua-overview-balls { margin-top: 0.5rem; }
  .lua-section-header { flex-direction: column; }
  .lua-section-subtitle { text-align: left; }
  .lua-tier-letter-wrap { min-width: 6rem; }
  .lua-drilldown-cell { width: 2.25rem; height: 2.25rem; font-size: 0.6875rem; }
}

/* ─── HEATMAP TICKET (SECTION 06) ──────────────────────────────── */
.lua-phase-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .lua-phase-grid-container {
    grid-template-columns: 1fr;
  }
}

.lua-ticket-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.lua-ticket-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lua-ticket-topline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lua-ticket-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lua-ticket-subtitle {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-family: monospace;
}

.lua-ticket-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  margin-left: auto;
}

.lua-ticket-grid {
  display: grid;
  gap: 0.35rem;
}

.lua-ticket-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted) / 0.2);
  border: 1px solid transparent;
  user-select: none;
}

/* Sugeridas (S/A Tiers) */
.lua-ticket-cell--sugerida {
  background-color: #6b7aa0;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.3);
  font-weight: 700;
}

/* Evitar (E/F Tiers) */
.lua-ticket-cell--evitar {
  background-color: hsl(var(--muted) / 0.1);
  color: #e57373;
  border-color: rgba(229, 115, 115, 0.3);
}

.lua-ticket-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-family: monospace;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border) / 0.5);
  padding-top: 0.75rem;
}

.lua-ticket-jogue {
  color: var(--theme-blue, #6b7aa0);
  font-weight: 600;
}

.lua-ticket-evite {
  color: #e57373;
  font-weight: 600;
}
