/* ============================================
   REDRAGON PARTNER LINEUP PORTAL — STYLES v2
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ---- Design Tokens ---- */
:root {
  --bg-primary:    #0A0A0A;
  --bg-card:       #111111;
  --bg-elevated:   #1A1A1A;
  --bg-hover:      #1E1E1E;
  --border:        #2A2A2A;
  --border-subtle: #1E1E1E;
  --accent:        #E31E24;
  --accent-hover:  #c41a1f;
  --accent-glow:   rgba(227,30,36,0.2);
  --gold:          #FFD700;
  --gold-dim:      rgba(255,215,0,0.12);
  --blue:          #60A5FA;
  --blue-dim:      rgba(96,165,250,0.12);
  --green:         #22C55E;
  --green-dim:     rgba(34,197,94,0.12);
  --orange:        #F59E0B;
  --orange-dim:    rgba(245,158,11,0.12);
  --red-dark:      #991B1B;
  --red-dark-dim:  rgba(153,27,27,0.25);
  --text-primary:  #FFFFFF;
  --text-secondary:#9CA3AF;
  --text-muted:    #4B5563;
  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 4px 20px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.4);
  --transition:    0.18s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle dot grid on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rajdhani', 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: background var(--transition), opacity var(--transition);
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(227,30,36,0.2);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
select option { background: var(--bg-elevated); }

/* ============================================
   SKIP LINK (Accesibilidad)
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  top: 0;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(227,30,36,0.1) 0%, transparent 70%);
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.login-logo-img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

.login-logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.login-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 32px;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.btn-login {
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  width: 100%;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn-login:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(227,30,36,0.3);
}
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error {
  display: none;
  background: rgba(153,27,27,0.2);
  border: 1px solid var(--red-dark);
  color: #FCA5A5;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.login-error.visible { display: block; }

.login-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   HERO HEADER
   ============================================ */
.hero-header {
  position: relative;
  background: linear-gradient(160deg, #0f0505 0%, #140a0a 40%, #0A0A0A 100%);
  border-bottom: 1px solid var(--border);
  padding: 52px 28px 48px;
  overflow: hidden;
  z-index: 1;
}

/* Hex pattern decoration */
.hero-header::before {
  content: '';
  position: absolute;
  right: -50px;
  top: 50%;
  width: 480px;
  height: 480px;
  background-image: url('../img/panal.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: grayscale(1) invert(1);
  opacity: 0.11;
  pointer-events: none;
  transform: translateY(-50%) rotate(15deg);
}

/* Red atmospheric glow */
.hero-header::after {
  content: '';
  position: absolute;
  top: -80%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse 55% 45% at 50% 0%, rgba(227,30,36,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero-header-inner {
  position: relative;
  z-index: 2;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-logo {
  height: 60px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 0 24px rgba(227,30,36,0.35));
  flex-shrink: 0;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1;
  text-transform: uppercase;
}

.hero-region {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  background: rgba(227,30,36,0.12);
  border: 1px solid rgba(227,30,36,0.28);
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 14px 5px 6px;
  border-radius: 100px;
}

.region-flag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(227,30,36,0.3);
}

/* ============================================
   STICKY NAV BAR
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition);
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

.btn-admin-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition);
}
.btn-admin-link:hover { border-color: var(--border); color: var(--text-secondary); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding: 32px 28px 60px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard { margin-bottom: 32px; }

/* Dashboard header row */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-accent-bar {
  width: 4px;
  height: 28px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(227,30,36,0.5);
  flex-shrink: 0;
}

.dashboard-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.dashboard-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition), box-shadow var(--transition);
}
.dashboard-toggle:hover {
  border-color: rgba(227,30,36,0.4);
  color: var(--text-primary);
  background: rgba(227,30,36,0.06);
  box-shadow: 0 0 12px rgba(227,30,36,0.1);
}
.dashboard-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dashboard-toggle .toggle-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.9rem;
}
.dashboard-toggle.collapsed .toggle-icon { transform: rotate(-90deg); }

.dashboard-body {
  animation: dashboardEnter 0.3s ease forwards;
}
.dashboard-body.hidden {
  animation: dashboardExit 0.3s ease forwards;
}
@keyframes dashboardEnter {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 800px; }
}
@keyframes dashboardExit {
  from { opacity: 1; max-height: 800px; }
  to { opacity: 0; max-height: 0; }
}

/* ---- Stat Grid (grouped layout) ---- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  border-color: #3A3A3A;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
/* Subtle top accent line */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: background var(--transition);
}
.stat-card:hover::before { background: var(--accent); }

/* Prominent total card */
.stat-card--total {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(227,30,36,0.04) 100%);
  border-color: rgba(227,30,36,0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}
.stat-card--total:hover { border-color: rgba(227,30,36,0.4); }
.stat-card--total::before { background: var(--accent); }

.stat-value--accent {
  font-size: 3rem !important;
  color: var(--accent) !important;
}

/* Stat group wrapper */
.stat-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-group-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-left: 2px;
}

.stat-group-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Charts */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color var(--transition);
}
.chart-card:hover { border-color: #3A3A3A; }

.chart-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.chart-card canvas { max-height: 160px; }

/* ============================================
   FAMILY TABS
   ============================================ */
.tabs-wrapper {
  position: sticky;
  top: 52px;
  z-index: 90;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin: 0 -28px;
  padding: 0 28px;
  display: flex;
  align-items: stretch;
}

.tab-arrow {
  flex-shrink: 0;
  width: 44px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), opacity var(--transition), background-color var(--transition);
  opacity: 1;
  z-index: 2;
}
.tab-arrow:hover {
  color: var(--accent);
  background: rgba(227,30,36,0.08);
}
.tab-arrow:active { transform: scale(0.95); }
.tab-arrow.hidden { opacity: 0; pointer-events: none; }

.tab-arrow-left  { background: linear-gradient(to right, rgba(10,10,10,0.98) 70%, transparent 100%); padding-left: 8px; }
.tab-arrow-right { background: linear-gradient(to left,  rgba(10,10,10,0.98) 70%, transparent 100%); padding-right: 8px; }

.tabs-bar {
  position: relative;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.tabs-bar::-webkit-scrollbar { display: none; }

/* Fade overlay para indicar que hay más contenido */
.tabs-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, rgba(10,10,10,0.6) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tabs-bar.has-scroll-right::after {
  opacity: 1;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 16px 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-count {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  transition: background var(--transition), color var(--transition);
}
.tab-btn.active .tab-count {
  background: rgba(227,30,36,0.15);
  color: var(--accent);
}

/* ============================================
   LINEUP CONTENT
   ============================================ */
.lineup-content { margin-top: 32px; }

.family-panel { display: none; }
.family-panel.active { display: block; }

/* Tier sections */
.tier-section {
  margin-bottom: 48px;
}
.tier-section:last-child { margin-bottom: 0; }

.tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Gradient accent on tier header bottom border */
.tier-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100px;
  height: 1px;
  transition: width var(--transition);
}
.tier-section:hover .tier-header::after { width: 140px; }

.tier-section:has(.tier-label.top) .tier-header::after   { background: linear-gradient(90deg, var(--gold), transparent); }
.tier-section:has(.tier-label.mid) .tier-header::after   { background: linear-gradient(90deg, var(--blue), transparent); }
.tier-section:has(.tier-label.entry) .tier-header::after { background: linear-gradient(90deg, var(--green), transparent); }

.tier-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tier-label.top   { color: var(--gold); }
.tier-label.mid   { color: var(--blue); }
.tier-label.entry { color: var(--green); }

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tier-dot.top   { background: var(--gold);  box-shadow: 0 0 8px rgba(255,215,0,0.7); }
.tier-dot.mid   { background: var(--blue);  box-shadow: 0 0 8px rgba(96,165,250,0.7); }
.tier-dot.entry { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.7); }

.tier-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
}

/* Staggered animation delays for product cards */
.product-card:nth-child(1) { animation-delay: 0ms; }
.product-card:nth-child(2) { animation-delay: 40ms; }
.product-card:nth-child(3) { animation-delay: 80ms; }
.product-card:nth-child(4) { animation-delay: 120ms; }
.product-card:nth-child(5) { animation-delay: 160ms; }
.product-card:nth-child(6) { animation-delay: 200ms; }
.product-card:nth-child(n+7) { animation-delay: 240ms; }

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background-color var(--transition);
  display: flex;
  flex-direction: column;
  animation: cardEnter 0.4s ease backwards;
}
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(227,30,36,0.2), 0 0 0 1px rgba(227,30,36,0.15);
  background: rgba(227,30,36,0.02);
}

.card-image-wrap {
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.25s ease;
}
.product-card:hover .card-image-wrap img { transform: scale(1.06); }

/* Subtle gradient overlay on image bottom */
.card-image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(17,17,17,0.4), transparent);
  pointer-events: none;
}

.flagship-star {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.1rem;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(255,215,0,0.7));
  line-height: 1;
  z-index: 2;
  cursor: help;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-sku {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 8px;
}

/* ============================================
   BADGES + TOOLTIPS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
  position: relative;
}

/* Tier badges */
.badge-top   { background: var(--gold-dim);   color: var(--gold);   border: 1px solid rgba(255,215,0,0.22); }
.badge-mid   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(96,165,250,0.22); }
.badge-entry { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(34,197,94,0.22); }

/* Status badges */
.badge-activo      { background: var(--green-dim);    color: var(--green);  border: 1px solid rgba(34,197,94,0.22); }
.badge-proximo     { background: var(--orange-dim);   color: var(--orange); border: 1px solid rgba(245,158,11,0.22); }
.badge-discontinuar{ background: var(--red-dark-dim); color: #FCA5A5;       border: 1px solid rgba(153,27,27,0.4); }

/* Tooltip trigger ? */
.badge-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}

.badge-help::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  line-height: 1.45;
}

.badge-help::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 501;
}

.badge-help:hover::after,
.badge-help:hover::before { opacity: 1; }

/* Flagship star tooltip */
.flagship-star[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  max-width: 180px;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  line-height: 1.45;
}
.flagship-star[data-tip]:hover::after { opacity: 1; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 0;
  background: var(--bg-elevated);
  z-index: 2;
}

.btn-modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }

.modal-image-wrap {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  min-height: 240px;
}

.modal-image-wrap img {
  max-height: 240px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.modal-body {
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-sku {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.modal-flagship {
  font-size: 1.3rem;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(255,215,0,0.55));
  cursor: help;
  position: relative;
}
.modal-flagship[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: normal;
  max-width: 200px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.modal-flagship[data-tip]:hover::after { opacity: 1; }

.modal-divider {
  height: 1px;
  background: var(--border-subtle);
  border: none;
}

.modal-specs-section { }
.modal-specs-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.btn-specs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.btn-specs:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}

.no-specs {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   ADMIN PAGE
   ============================================ */
.admin-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

.admin-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.admin-content { padding: 28px; max-width: 1400px; margin: 0 auto; position: relative; z-index: 1; }

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.admin-section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: #4A4A4A; color: var(--text-primary); }

.btn-danger {
  background: var(--red-dark-dim);
  border: 1px solid var(--red-dark);
  color: #FCA5A5;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(153,27,27,0.4); }

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }

.admin-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-search { flex: 1; min-width: 200px; padding: 8px 14px; }
.admin-filter-select { padding: 8px 14px; min-width: 140px; }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }

.admin-table input[type="text"] {
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  min-width: 160px;
  padding: 4px 8px;
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.admin-table input[type="text"]:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--text-primary);
}

.admin-table select {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  font-size: 0.82rem;
  border-radius: 3px;
  color: var(--text-secondary);
}
.admin-table select:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.admin-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.sku-cell {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.modified-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.password-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.password-row { display: flex; flex-direction: column; gap: 6px; }

.password-row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.password-input-row { display: flex; gap: 8px; }
.password-input-row input { flex: 1; font-size: 0.85rem; }

.btn-save-pwd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-save-pwd:hover { border-color: var(--green); color: var(--green); }
.btn-save-pwd.saved { border-color: var(--green); color: var(--green); }

/* Admin login modal */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 2000;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red-dark); }

/* ============================================
   EMPTY / LOADING STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3A3A3A; }

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
