/* =========================================================
   GLOBAL / RESET
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dark-primary: #1a2332;
  --dark-secondary: #2a3441;
  --dark-tertiary: #374151;

  --cyan-primary: #2DD4BF;
  --cyan-secondary: #14B8A6;
  --cyan-dark: #0D9488;
  --cyan-glow: rgba(45, 212, 191, 0.3);

  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;

  /* Ultra compact radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--dark-primary) 0%, #0f1419 100%);
  color: var(--text-primary);
  overflow-x: hidden;
  font-size: 11px; /* Ultra small base - simulates 80% zoom */
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--dark-primary); }
::-webkit-scrollbar-thumb { background: var(--dark-tertiary); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-primary); }

/* =========================================================
   GLOBAL / APP SHELL (Main Sidebar + Topbar)
   ========================================================= */

/* Sidebar - ULTRA COMPACT */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 180px; /* Reduced from 220px */
  height: 100vh;
  background: linear-gradient(180deg, var(--dark-secondary) 0%, var(--dark-primary) 100%);
  border-right: 1px solid rgba(45, 212, 191, 0.1);
  padding: 0.75rem 0; /* Reduced from 1rem */
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--cyan-primary) 50%, transparent 100%);
  opacity: 0.3;
  animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Logo - ULTRA COMPACT */
.logo-section {
  padding: 0 0.75rem 0.75rem; /* Reduced */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Reduced */
}

.logo-icon {
  width: 28px; /* Reduced from 36px */
  height: 28px;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px var(--cyan-glow);
}

.logo-icon svg {
  width: 16px; /* Reduced from 22px */
  height: 16px;
  fill: white;
}

.logo-title {
  font-size: 0.9rem; /* Reduced from 1.05rem */
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan-primary), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 0.55rem; /* Reduced from 0.65rem */
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Nav - ULTRA COMPACT */
.nav-menu { padding: 0 0.5rem; } /* Reduced from 0.75rem */
.nav-item { margin-bottom: 0.2rem; } /* Reduced from 0.25rem */

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Reduced from 0.75rem */
  padding: 0.5rem 0.65rem; /* Reduced from 0.65rem 0.85rem */
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--r-lg);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  font-size: 0.8rem; /* Reduced from 0.9rem */
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-primary), transparent);
  transition: width 0.25s ease;
  opacity: 0.12;
}

.nav-link:hover::before { width: 100%; }

.nav-link:hover {
  background: rgba(45, 212, 191, 0.08);
  color: var(--text-primary);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.18) 0%, rgba(45, 212, 191, 0.05) 100%);
  color: var(--cyan-primary);
  border-left: 2px solid var(--cyan-primary);
}

.nav-icon {
  width: 15px; /* Reduced from 18px */
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* Main content - ADJUSTED MARGIN */
.main-content {
  margin-left: 180px; /* Adjusted from 220px */
  min-height: 100vh;
  padding: 1rem; /* Reduced from 1.25rem */
}

/* Top bar - ULTRA COMPACT */
.top-bar {
  background: rgba(42, 52, 65, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-xl);
  padding: 0.65rem 1rem; /* Reduced from 0.85rem 1.25rem */
  margin-bottom: 1rem; /* Reduced from 1.25rem */
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.page-title {
  font-size: 0.85rem; /* Reduced from 0.95rem */
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title::before {
  content: '';
  width: 3px;
  height: 16px; /* Reduced from 18px */
  background: linear-gradient(180deg, var(--cyan-primary), var(--cyan-secondary));
  border-radius: 2px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Reduced from 0.6rem */
  padding: 0.35rem; /* Reduced from 0.4rem */
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-lg);
}

.user-avatar {
  width: 26px; /* Reduced from 32px */
  height: 26px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.65rem; /* Reduced from 0.75rem */
  box-shadow: 0 2px 6px var(--cyan-glow);
}

/* Coming soon card */
.coming-soon {
  background: linear-gradient(135deg, rgba(42, 52, 65, 0.6) 0%, rgba(26, 35, 50, 0.6) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-xl);
  padding: 2rem 1.25rem; /* Reduced */
  text-align: center;
  margin-top: 0.6rem;
}

.coming-title {
  font-size: 1.3rem; /* Reduced from 1.5rem */
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.coming-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem; /* Reduced from 0.9rem */
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* =========================================================
   PAGE: OEM SEARCH (index.html)
   ========================================================= */

/* Layout */
.oem-layout {
  display: grid;
  grid-template-columns: 240px 1fr; /* Reduced from 280px */
  gap: 0.85rem; /* Reduced from 1rem */
  align-items: start;
}

/* Filters panel - ULTRA COMPACT */
.filters-panel {
  background: linear-gradient(135deg, rgba(42, 52, 65, 0.6) 0%, rgba(26, 35, 50, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-xl);
  padding: 0.85rem; /* Reduced from 1rem */
  position: sticky;
  top: 0.85rem;
  height: fit-content;
}

.filters-header {
  margin-bottom: 0.7rem; /* Reduced */
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.filters-title {
  font-size: 0.8rem; /* Reduced from 0.9rem */
  font-weight: 800;
  color: var(--text-primary);
}

.filters-group {
  margin-top: 0.7rem; /* Reduced */
}

.field-label {
  display: block;
  font-size: 0.65rem; /* Reduced from 0.72rem */
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Inputs - ULTRA COMPACT */
.input-with-icon {
  display: flex;
  gap: 0.35rem; /* Reduced */
  align-items: center;
}

.input-with-icon input {
  flex: 1;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  padding: 0.55rem 0.65rem; /* Reduced from 0.65rem 0.75rem */
  outline: none;
  transition: all 0.2s ease;
  font-size: 0.75rem; /* Reduced */
}

.input-with-icon input:focus {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* Icon mini button - ULTRA COMPACT */
.icon-mini-btn {
  width: 32px; /* Reduced from 38px */
  height: 32px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-mini-btn svg {
  width: 15px; /* Reduced from 18px */
  height: 15px;
  fill: var(--text-secondary);
}

.icon-mini-btn:hover:not(:disabled) {
  border-color: rgba(45, 212, 191, 0.6);
  background: rgba(45, 212, 191, 0.10);
  transform: translateY(-1px);
}

.icon-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Selects - ULTRA COMPACT */
.filters-panel select {
  width: 100%;
  background: rgba(15, 20, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  padding: 0.55rem 0.65rem; /* Reduced */
  outline: none;
  appearance: none;
  font-size: 0.75rem; /* Reduced */
}

.filters-panel select:focus {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.filters-panel select option {
  background: #0f1419;
  color: var(--text-primary);
}

.filters-panel select option[value=""] {
  color: var(--text-muted);
}

.hint-text {
  margin-top: 0.35rem;
  font-size: 0.62rem; /* Reduced */
  color: var(--text-muted);
}

/* Action buttons - ULTRA COMPACT */
.filters-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem; /* Reduced */
  margin-top: 0.85rem;
}

.btn-primary {
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 0.6rem 0.7rem; /* Reduced from 0.75rem 0.85rem */
  border-radius: var(--r-lg);
  font-weight: 800;
  font-size: 0.75rem; /* Reduced */
  color: #071a17;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.18);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-secondary {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  padding: 0.6rem 0.7rem; /* Reduced */
  border-radius: var(--r-lg);
  font-weight: 800;
  font-size: 0.75rem; /* Reduced */
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 191, 0.35);
}

.filters-status {
  margin-top: 0.7rem;
  font-size: 0.65rem; /* Reduced */
  color: var(--text-muted);
  min-height: 0.9rem;
}

.filters-status.warn { color: #F59E0B; }
.filters-status.error { color: #EF4444; }

/* Results - ULTRA COMPACT */
.results-panel { min-width: 0; }

.results-toolbar {
  background: rgba(42, 52, 65, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-xl);
  padding: 0.6rem 0.85rem; /* Reduced */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.results-title {
  font-size: 0.8rem; /* Reduced */
  font-weight: 800;
}

.results-meta {
  color: var(--text-muted);
  font-size: 0.68rem; /* Reduced */
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Reduced from 260px */
  gap: 0.7rem; /* Reduced */
}

/* Cards - ULTRA COMPACT */
.color-card {
  background: linear-gradient(135deg, rgba(42, 52, 65, 0.55) 0%, rgba(26, 35, 50, 0.55) 100%);
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.chip-img {
  height: 90px; /* Reduced from 110px */
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.chip-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip-fallback {
  color: var(--text-muted);
  font-size: 0.65rem; /* Reduced */
}

.card-body { padding: 0.6rem 0.7rem 0.7rem; } /* Reduced */

.card-title {
  font-weight: 800;
  font-size: 0.75rem; /* Reduced from 0.85rem */
  color: var(--text-primary);
  line-height: 1rem;
}

.card-divider {
  height: 2px;
  background: rgba(45, 212, 191, 0.7);
  opacity: 0.55;
  margin: 0.5rem 0 0.55rem; /* Reduced */
}

.card-meta {
  display: grid;
  gap: 0.25rem; /* Reduced */
  font-size: 0.68rem; /* Reduced from 0.75rem */
  color: var(--text-secondary);
}

.meta-row {
  display: grid;
  grid-template-columns: 50px 1fr; /* Reduced from 58px */
  gap: 0.35rem;
}

.meta-k {
  color: var(--text-muted);
  font-weight: 800;
}

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

/* Empty + Skeleton */
.empty-state {
  padding: 1.75rem 0.75rem; /* Reduced */
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--r-xl);
  font-size: 0.75rem;
}

.color-card.skeleton {
  border-color: rgba(255, 255, 255, 0.05);
}

.color-card.skeleton .chip-img,
.color-card.skeleton .sk-line {
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.color-card.skeleton .chip-img::after,
.color-card.skeleton .sk-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.sk-line {
  height: 8px; /* Reduced from 10px */
  border-radius: 4px;
  margin-top: 6px;
}

.sk-title {
  height: 11px; /* Reduced from 14px */
  width: 80%;
  margin-top: 5px;
  border-radius: 4px;
}

/* OEM Search responsive */
@media (max-width: 1024px) {
  .oem-layout { grid-template-columns: 1fr; }
  .filters-panel { position: relative; top: auto; }
}

/* =========================================================
   ENHANCED SKELETON STYLES
   ========================================================= */

/* Shimmer effect */
.sk-shimmer {
  position: relative;
  overflow: hidden;
}

.sk-shimmer::after,
.sk-line::after,
.sk-title::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(45, 212, 191, 0.08) 25%,
    rgba(45, 212, 191, 0.15) 50%,
    rgba(45, 212, 191, 0.08) 75%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-input {
  position: relative;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sk-text {
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.sk-text::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.color-card.skeleton {
  animation: skeletonFadeIn 0.4s ease forwards;
  opacity: 0;
}

@keyframes skeletonFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.chip-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.color-card:hover .chip-image {
  transform: scale(1.05);
}

.chip-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.85rem;
  text-align: center;
}

@media (max-width: 768px) {
  .empty-state {
    min-height: 150px;
    padding: 1.5rem 0.75rem;
  }
  
  .empty-state svg {
    width: 40px !important;
    height: 40px !important;
  }
}

.color-card:not(.skeleton):hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.color-card:not(.skeleton):hover .card-divider {
  opacity: 0.8;
  box-shadow: 0 0 8px var(--cyan-glow);
}


/* =========================================================
   PAGE: SPLASH (splash.html)
   ========================================================= */

.splash-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(900px 500px at 50% 30%, rgba(45, 212, 191, 0.08), transparent 60%),
              linear-gradient(135deg, var(--dark-primary) 0%, #0f1419 100%);
}

.splash-wrap {
  width: 100%;
  max-width: 520px;
}

.splash-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  backdrop-filter: none;
  box-shadow: none;
}

.splash-logo {
  width: min(320px, 75vw);
  height: auto;
  display: block;
  margin: 0 auto 1.25rem;
}

.splash-brand {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.3rem;
  color: rgba(45, 212, 191, 0.85);
  margin-top: 0.25rem;
}

.splash-tagline {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  letter-spacing: 0.18rem;
  color: var(--text-muted);
}

.splash-progress {
  margin: 1.75rem auto 0.9rem;
  width: 100%;
  max-width: 280px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.splash-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-primary), var(--cyan-secondary));
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.18);
  transition: width 0.35s ease;
}

.splash-status {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}


/* =========================================================
   PAGE: LOGIN (login.html)
   ========================================================= */

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(900px 500px at 50% 30%, rgba(45, 212, 191, 0.08), transparent 60%),
              linear-gradient(135deg, var(--dark-primary) 0%, #0f1419 100%);
}

.auth-wrap {
  width: 100%;
  max-width: 980px;
}

.auth-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: rgba(42, 52, 65, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

/* Left media */
.auth-media {
  position: relative;
  min-height: 560px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}

.auth-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 14, 18, 0.35), rgba(10, 14, 18, 0.78));
}

.auth-media-badge {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(10px);
}

.auth-media-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.22rem;
  color: rgba(45, 212, 191, 0.9);
}

.auth-media-subtitle {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.12rem;
  color: var(--text-muted);
}

/* Right form */
.auth-form {
  padding: 2.25rem 2.25rem 2rem;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-brand {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
}

.auth-subtitle {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-fields {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.5rem;
}

.auth-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  padding: 0.85rem 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 18px var(--cyan-glow);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  user-select: none;
}

.auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan-primary);
}

.auth-link {
  color: rgba(45, 212, 191, 0.9);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-btn {
  margin-top: 0.5rem;
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 0.95rem 1rem;
  border-radius: var(--r-lg);
  font-weight: 900;
  color: #071a17;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
  box-shadow: 0 10px 26px rgba(45, 212, 191, 0.16);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-btn:hover {
  transform: translateY(-2px);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-status {
  min-height: 1.1rem;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-status.info { color: var(--text-secondary); }
.auth-status.error { color: #EF4444; }

/* Responsive */
@media (max-width: 920px) {
  .auth-body {
    padding: 0;
  }
  .auth-wrap {
    max-width: 100%;
  }
  .auth-card {
    grid-template-columns: 1fr;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
  }
  .auth-media {
    min-height: 200px;
    border-radius: 0;
  }
  .auth-media img {
    border-radius: 0;
  }
  .auth-media-badge {
    left: 1rem;
    bottom: 1rem;
    right: 1rem;
    padding: 0.7rem 0.85rem;
  }
  .auth-media-title {
    font-size: 1rem;
  }
  .auth-media-subtitle {
    font-size: 0.7rem;
  }
  .auth-form {
    padding: 1.25rem 1.25rem 2rem;
  }
  .auth-header {
    margin-bottom: 1rem;
  }
  .auth-brand {
    font-size: 1.3rem;
  }
  .auth-subtitle {
    font-size: 0.8rem;
    margin-top: 0.2rem;
  }
  .auth-label {
    font-size: 0.75rem;
  }
  .auth-input {
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
  }
  .auth-fields {
    gap: 0.75rem;
  }
  .auth-row {
    margin-top: 0.1rem;
  }
  .auth-check {
    font-size: 0.78rem;
  }
  .auth-link {
    font-size: 0.78rem;
  }
  .auth-btn {
    padding: 0.8rem;
    font-size: 0.85rem;
  }
  .auth-footer {
    font-size: 0.78rem;
    margin-top: 0.5rem;
  }
  .auth-status {
    font-size: 0.78rem;
  }
}


/* =========================================================
   GLOBAL: Splash overlay integration (index.html)
   ========================================================= */

.splash-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  z-index: 5000;
  background: radial-gradient(900px 500px at 50% 30%, rgba(45, 212, 191, 0.08), transparent 60%),
              linear-gradient(135deg, var(--dark-primary) 0%, #0f1419 100%);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.splash-overlay.splash-overlay-hide {
  opacity: 0;
}

/* =========================================================
   GLOBAL: Logout button in top bar
   ========================================================= */
.top-logout-btn {
  margin-left: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  padding: 0.55rem 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.top-logout-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.35);
}


/* =========================
   OEM Formula Page
   ========================= */
.formula-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}

.formula-panel {
  background: linear-gradient(135deg, rgba(42, 52, 65, 0.55) 0%, rgba(26, 35, 50, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.formula-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.formula-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

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

.formula-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.meta-pill {
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.formula-table-wrap {
  overflow: auto;
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.formula-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(20, 24, 30, 0.65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  padding: 0.75rem 0.9rem;
}

.formula-table tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.83rem;
  vertical-align: top;
}

.formula-table tbody tr:hover {
  background: rgba(45, 212, 191, 0.06);
}

.td-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chip-dot {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  /* border: 1px solid rgba(255, 255, 255, 0.12); */
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.toner-code {
  color: var(--text-secondary);
  font-weight: 800;
}

.toner-name {
  font-weight: 900;
}

.toner-feature {
  color: var(--text-secondary);
  line-height: 1.2rem;
}

.formula-footer {
  padding: 0.85rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.mix-panel {
  position: sticky;
  top: 1.25rem;
  background: linear-gradient(135deg, rgba(42, 52, 65, 0.55) 0%, rgba(26, 35, 50, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
  height: fit-content;
}

.mix-title {
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.mix-group {
  margin-top: 0.9rem;
}

.mix-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 800;
}

.mix-input, .mix-select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  outline: none;
}

.mix-input:focus, .mix-select:focus {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 18px var(--cyan-glow);
}

.mix-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.mix-check input {
  transform: translateY(1px);
}

.mix-hint {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mix-apply {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  color: #071a17;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
  box-shadow: 0 8px 22px rgba(45, 212, 191, 0.18);
}

.mix-apply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.mix-status {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .formula-layout { grid-template-columns: 1fr; }
  .mix-panel { position: relative; top: auto; }
  .formula-table { min-width: 860px; }
}


/* OEM result cards: clickable + shadow + no hard border */
.color-card.clickable {
  cursor: pointer;
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.color-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
}

.color-card.clickable:focus {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 2px;
}

/* Remove the internal divider line for OEM cards */
.results-grid .color-card .card-divider {
  display: none;
}


/* =========================================================
   FORMULA PAGE ADDITIONS
   Add this to your styles.css or include as separate file
   ========================================================= */

/* Top bar layout adjustment */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-radius: var(--r-lg);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
  color: var(--cyan-primary);
  transform: translateX(-2px);
}

.back-btn:active {
  transform: translateX(-1px);
}

.back-btn svg {
  transition: transform 0.2s ease;
}

.back-btn:hover svg {
  transform: translateX(-2px);
}

/* =========================================================
   VERSION SELECTOR
   ========================================================= */

.version-selector {
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.version-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}

.version-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.version-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.version-radio:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.version-radio.selected {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.4);
}

.version-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: var(--cyan-primary);
  cursor: pointer;
}

.version-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.version-layer {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.version-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.version-pnt {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: monospace;
  padding: 0.15rem 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.version-loading,
.version-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

/* =========================================================
   TABLE LOADING STATE
   ========================================================= */

.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(45, 212, 191, 0.15);
  border-top-color: var(--cyan-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */

@media (max-width: 768px) {
  .version-options {
    flex-direction: column;
  }

  .version-radio {
    width: 100%;
  }

  .back-btn span {
    display: none;
  }

  .back-btn {
    padding: 0.5rem;
  }
}

/* =========================================================
   VERSION SELECTOR ANIMATIONS
   ========================================================= */

.version-radio {
  animation: fadeInScale 0.3s ease forwards;
  opacity: 0;
}

.version-radio:nth-child(1) { animation-delay: 0.05s; }
.version-radio:nth-child(2) { animation-delay: 0.1s; }
.version-radio:nth-child(3) { animation-delay: 0.15s; }
.version-radio:nth-child(4) { animation-delay: 0.2s; }
.version-radio:nth-child(5) { animation-delay: 0.25s; }

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

/* =========================================================
   ENHANCED FORMULA META PILLS
   ========================================================= */

.meta-pill {
  transition: all 0.2s ease;
}

.meta-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(45, 212, 191, 0.3);
}

/* Cost pill special styling */
#metaCost {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #10B981;
  font-weight: 700;
}

/* =========================================================
   SEARCHABLE SELECT DROPDOWN
   ========================================================= */
.searchable-select {
  position: relative;
  width: 100%;
}

.ss-display {
  width: 100%;
  background: rgba(15, 20, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  padding: 0.55rem 0.65rem;
  outline: none;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  transition: all 0.2s ease;
  user-select: none;
}

.ss-display:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.ss-display:focus,
.searchable-select.open .ss-display {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.ss-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-value.placeholder {
  color: var(--text-muted);
}

.ss-arrow {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.searchable-select.open .ss-arrow {
  transform: rotate(180deg);
}

.ss-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(15, 20, 25, 0.98);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.searchable-select.open .ss-panel {
  display: block;
  animation: ssSlideDown 0.15s ease;
}

@keyframes ssSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ss-search-wrap {
  padding: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ss-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  border-radius: var(--r-md);
  padding: 0.45rem 0.55rem;
  outline: none;
  font-size: 0.72rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.ss-search:focus {
  border-color: rgba(45, 212, 191, 0.5);
}

.ss-search::placeholder {
  color: var(--text-muted);
}

.ss-options {
  max-height: 200px;
  overflow-y: auto;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 191, 0.2) transparent;
}

.ss-options::-webkit-scrollbar {
  width: 4px;
}
.ss-options::-webkit-scrollbar-track {
  background: transparent;
}
.ss-options::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.2);
  border-radius: 4px;
}

.ss-option {
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-option:hover,
.ss-option.highlighted {
  background: rgba(45, 212, 191, 0.1);
  color: var(--text-primary);
}

.ss-option.selected {
  color: var(--cyan);
  font-weight: 600;
}

.ss-option.ss-placeholder-opt {
  color: var(--text-muted);
  font-style: italic;
}

.ss-no-results {
  padding: 0.6rem 0.65rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Disabled / loading state */
.searchable-select.disabled .ss-display {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.searchable-select.skeleton .ss-display {
  animation: pulse 1.5s ease-in-out infinite;
}

/* =========================================================
   SHOW MORE / PAGINATION
   ========================================================= */
.show-more-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 1.2rem 0 0.5rem;
}

.btn-show-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 2.5rem;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12) 0%, rgba(45, 212, 191, 0.06) 100%);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: var(--r-xl);
  color: var(--cyan);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-show-more:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.2) 0%, rgba(45, 212, 191, 0.1) 100%);
  border-color: rgba(45, 212, 191, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.15);
}

.btn-show-more:active:not(:disabled) {
  transform: translateY(0);
}

.btn-show-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-show-more.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.1), transparent);
  animation: buttonShimmer 1.2s infinite;
}

.show-more-text {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.show-more-info {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

.all-loaded-msg {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--r-lg);
  opacity: 0.7;
}