/**
 * Welcome Screen styles - Dark mode matching landing page
 */

.welcome {
  text-align: center;
  max-width: 550px;
  padding: var(--space-xl);
}

.welcome-decoration {
  margin-bottom: var(--space-xl);
}

.welcome-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 40px rgba(230, 57, 70, 0.3);
  animation: bounce 2s ease-in-out infinite;
  margin: 0 auto;
}

.welcome-title {
  margin-bottom: var(--space-sm);
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-tagline {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
  font-weight: 300;
}

/* Status Card */
.welcome-card {
  background: rgba(29, 53, 87, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: blur(10px);
}

/* Persona Badge */
.welcome-persona {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
}

.persona-badge {
  font-size: 1rem;
  color: var(--color-text);
}

.persona-badge strong {
  color: var(--color-primary-light);
}

.welcome-persona .persona-interests {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: rgba(13, 27, 42, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 57, 70, 0.3);
}

.feature-icon {
  font-size: 1.75rem;
}

.feature-text {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.welcome-cta {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.btn-arrow {
  margin-left: var(--space-sm);
  transition: transform var(--transition-fast);
}

.welcome-cta:hover .btn-arrow {
  transform: translateX(4px);
}

.welcome-hint {
  margin-top: var(--space-lg);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

@media (max-width: 600px) {
  .welcome-title {
    font-size: 2rem;
  }
  
  .welcome-features {
    grid-template-columns: 1fr;
  }
  
  .welcome-logo {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
}
.cluster-preview {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-preview-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted, #7a7a7a);
}

.cluster-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.cluster-preview-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border, #2f3542);
  border-radius: 10px;
  background: var(--color-bg-secondary, rgba(255, 255, 255, 0.03));
}

.cluster-preview-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cluster-preview-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text, #f5f5f5);
}

.cluster-preview-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted, #9aa0aa);
}

.cluster-preview-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.cluster-preview-chip {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(99, 102, 241, 0.14);
  color: var(--color-primary, #a5b4fc);
}

.cluster-preview-empty {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted, #7a7a7a);
}

.cluster-preview-compact .cluster-preview-list {
  grid-template-columns: 1fr;
}
/**
 * Question Screen styles - Dark mode
 */

.question-screen {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.question-progress {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.question-number {
  font-weight: 600;
  color: var(--color-accent);
}

.for-persona {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.9em;
}

.confidence-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  max-width: 200px;
}

.confidence-bar {
  flex: 1;
  height: 6px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-success) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.confidence-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.question-card {
  width: 100%;
  text-align: center;
  padding: var(--space-2xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.question-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
}

.question-theme-label {
  margin-bottom: var(--space-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.question-text {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2xl);
  line-height: 1.4;
}

.answer-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.answer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl);
  min-width: 100px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.answer-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.answer-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.answer-label {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Yes button */
.answer-yes {
  border-color: var(--color-success);
}

.answer-yes:hover {
  background: rgba(6, 214, 160, 0.15);
  border-color: var(--color-success);
}

.answer-yes .answer-icon {
  color: var(--color-success);
}

/* No button */
.answer-no {
  border-color: var(--color-error);
}

.answer-no:hover {
  background: rgba(239, 71, 111, 0.15);
  border-color: var(--color-error);
}

.answer-no .answer-icon {
  color: var(--color-error);
}

/* Unknown button */
.answer-unknown {
  border-color: var(--color-accent);
}

.answer-unknown:hover {
  background: rgba(255, 209, 102, 0.15);
  border-color: var(--color-accent);
}

.answer-unknown .answer-icon {
  color: var(--color-accent);
}

/* Graduated answer scale (5-point) */
.answer-buttons.graduated {
  gap: var(--space-sm);
}

.answer-buttons.graduated .answer-btn {
  min-width: 80px;
  padding: var(--space-md) var(--space-md);
}

.answer-definitely-yes {
  border-color: var(--color-success);
}
.answer-definitely-yes:hover {
  background: rgba(6, 214, 160, 0.2);
  border-color: var(--color-success);
}
.answer-definitely-yes .answer-icon {
  color: var(--color-success);
}

.answer-rather-yes {
  border-color: rgba(6, 214, 160, 0.5);
}
.answer-rather-yes:hover {
  background: rgba(6, 214, 160, 0.1);
  border-color: rgba(6, 214, 160, 0.7);
}
.answer-rather-yes .answer-icon {
  color: rgba(6, 214, 160, 0.7);
}

.answer-rather-no {
  border-color: rgba(239, 71, 111, 0.5);
}
.answer-rather-no:hover {
  background: rgba(239, 71, 111, 0.1);
  border-color: rgba(239, 71, 111, 0.7);
}
.answer-rather-no .answer-icon {
  color: rgba(239, 71, 111, 0.7);
}

.answer-definitely-not {
  border-color: var(--color-error);
}
.answer-definitely-not:hover {
  background: rgba(239, 71, 111, 0.2);
  border-color: var(--color-error);
}
.answer-definitely-not .answer-icon {
  color: var(--color-error);
}

/* Choice buttons for multiple choice questions */
.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

.choice-btn {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: left;
}

.choice-btn:hover {
  transform: translateX(4px);
  border-color: var(--color-primary);
  background: rgba(230, 57, 70, 0.1);
  box-shadow: var(--shadow-sm);
}

.choice-btn:active {
  transform: translateX(2px);
}

/* Progress indicators container */
.progress-indicators {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.matching-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.show-results-btn {
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.results-count {
  opacity: 0.7;
  font-size: 0.9em;
}

.remaining-estimate {
  color: var(--color-text-light);
  font-size: 0.8rem;
  font-weight: 400;
}

@media (max-width: 480px) {
  .question-card {
    padding: var(--space-xl);
  }
  
  .question-text {
    font-size: 1.25rem;
  }
  
  .answer-btn {
    padding: var(--space-md) var(--space-lg);
    min-width: 85px;
  }

  .answer-buttons.graduated {
    flex-direction: column;
  }
  .answer-buttons.graduated .answer-btn {
    min-width: unset;
    width: 100%;
    flex-direction: row;
    justify-content: center;
  }
  
  .confidence-indicator {
    display: none;
  }
}
/**
 * Results Screen styles - Dark mode
 */

.results-screen {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.results-header {
  text-align: center;
}

.results-title {
  margin-bottom: var(--space-sm);
}

.results-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.results-confidence {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.results-count {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.results-empty {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.results-empty h2 {
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-xl);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* Product Card */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.product-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-size: 1.5rem;
  z-index: 1;
}

.product-image-container {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.product-description-wrap {
  margin-bottom: var(--space-md);
  flex: 1;
  min-height: 0;
}

.product-description-wrap.collapsed .product-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.product-description-toggle {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.product-description-toggle:hover {
  color: var(--color-primary-hover, var(--color-primary));
}

/* Why Recommended tags */
.product-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.reason-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-primary);
  white-space: nowrap;
}

.reason-interest {
  background: rgba(76, 175, 80, 0.2);
  color: var(--color-success, #2e7d32);
  font-weight: 600;
}

.reason-style {
  background: rgba(158, 158, 158, 0.15);
  color: var(--color-text-light, #999);
  font-weight: 400;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
}

.product-price {
  color: var(--color-accent);
  font-weight: 600;
}

.product-score {
  color: var(--color-text-light);
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.product-cta {
  width: 100%;
}

.feedback-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.feedback-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.feedback-btn.active {
  opacity: 1;
  border-width: 2px;
}

.feedback-like.active {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.feedback-dislike.active {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.quiz-saved-badge {
  color: #4ade80;
  font-weight: 600;
  font-size: 0.9rem;
  padding: var(--space-sm) var(--space-md);
}

/* Show More */
.show-more-container {
  display: flex;
  justify-content: center;
}

.show-more-btn {
  min-width: 240px;
}

/* Inline Refinement Card */
.refine-card {
  padding: var(--space-lg);
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
}

.refine-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.refine-theme-label {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.refine-question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.refine-yesno {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
}

.refine-yesno .answer-btn {
  min-width: 90px;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
}

/* Actions */
.results-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .product-image-container {
    height: 180px;
  }
}
/**
 * Loading Spinner styles
 */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}

.loading-spinner {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 2s linear infinite;
}

.spinner-gift {
  font-size: 3rem;
  animation: pulse 1s ease-in-out infinite;
}

.loading-text {
  margin-top: var(--space-lg);
  color: var(--color-text-muted);
  font-size: 1rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/**
 * Auth Modal Styles
 */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: var(--space-2xl);
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.modal-title {
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 1.5rem;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  padding: var(--space-md);
  border: 2px solid var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
  background: var(--color-bg);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group input::placeholder {
  color: var(--color-text-light);
}

/* Checkbox */
.checkbox-group {
  margin-top: var(--space-sm);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-label a {
  color: var(--color-primary);
  text-decoration: underline;
}

.checkbox-label a:hover {
  color: var(--color-primary-dark);
}

/* Error */
.auth-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  text-align: center;
}

/* Submit Button */
.auth-submit {
  margin-top: var(--space-md);
  width: 100%;
}

/* Switch Mode */
.auth-switch {
  text-align: center;
  margin-top: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.link-button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-button:hover {
  color: var(--color-primary-dark);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: var(--space-xl);
  }
}
/**
 * Persona Manager Styles
 */

.persona-modal {
  max-width: 550px;
  max-height: 80vh;
  overflow-y: auto;
}

.persona-form h3 {
  margin-bottom: var(--space-lg);
  font-size: 1.125rem;
}

.persona-form select,
.persona-form textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--color-bg);
  transition: border-color var(--transition-fast);
}

.persona-form select:focus,
.persona-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.persona-form textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* Persona List */
.persona-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.persona-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-bg-secondary);
}

.persona-info h4 {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
}

.persona-relationship {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-right: var(--space-sm);
}

.persona-birthday {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.persona-interests {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  flex-wrap: wrap;
}

.interest-tag {
  font-size: 0.7rem;
  background: var(--color-primary-light);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.persona-actions {
  display: flex;
  gap: var(--space-xs);
}

/* States */
.persona-loading,
.persona-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--color-text-muted);
}

.persona-empty p:first-child {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.add-persona-btn {
  width: 100%;
}
/**
 * Header styles - Dark mode
 */

.header {
  background: rgba(13, 27, 42, 0.95);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.header-logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.language-toggle {
  font-weight: 500;
  color: var(--color-text-muted);
}

.language-toggle:hover {
  color: var(--color-text);
}

/* User Menu */
.user-menu-container {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-xs);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 200;
  animation: slideDown 0.15s ease;
}

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

.user-dropdown button {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text);
}

.user-dropdown button:hover {
  background: var(--color-bg-elevated);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

.logout-btn {
  color: var(--color-error) !important;
}

/* Admin Button */
.admin-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2)) !important;
  border: 1px solid rgba(139, 92, 246, 0.4) !important;
  color: var(--color-accent) !important;
  font-weight: 500;
}

.admin-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3)) !important;
  border-color: var(--color-accent) !important;
}

@media (max-width: 480px) {
  .header-logo-text {
    display: none;
  }
  
  .header-logo-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .user-button span:not(:first-child) {
    display: none;
  }
}
/**
 * Sidebar Styles
 */

.sidebar {
  position: fixed;
  left: 0;
  top: 60px; /* Below header */
  bottom: 0;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-bg-secondary);
  z-index: 50;
  transition: width var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  width: 280px;
}

.sidebar.collapsed {
  width: 40px;
}

.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 20px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 1px solid var(--color-bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  z-index: 10;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.sidebar-content {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.sidebar-content h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.sidebar-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.sidebar-loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-lg);
}

/* Persona List */
.persona-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.persona-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.persona-item:hover {
  background: var(--color-bg-secondary);
}

.persona-item.selected {
  border-color: var(--color-primary);
  background: rgba(232, 93, 93, 0.05);
}

.persona-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.persona-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.persona-name {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.persona-interests-preview {
  font-size: 0.7rem;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-birthday-alert {
  font-size: 0.7rem;
  color: var(--color-primary);
  font-weight: 500;
}

.selected-check {
  color: var(--color-primary);
  font-weight: bold;
}

/* Add Button */
.sidebar .add-persona-btn {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 2px dashed var(--color-bg-secondary);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  margin-top: var(--space-sm);
}

.sidebar .add-persona-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(232, 93, 93, 0.05);
}

/* Selected Persona Info */
.selected-persona-info {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-bg-secondary);
}

.selected-persona-info h4 {
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.selected-interests {
  margin-bottom: var(--space-sm);
}

.selected-interests .label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: var(--space-xs);
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.interest-tag {
  font-size: 0.7rem;
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.persona-hint {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* History section */
.sidebar-history-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border, #e0e0e0);
  padding-top: 0.75rem;
}

.sidebar-history-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.25rem 0;
  width: 100%;
  text-align: left;
}

.sidebar-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.history-entry {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface, #f9f9f9);
  border-radius: 8px;
  font-size: 0.8rem;
}

.history-persona {
  font-weight: 600;
  color: var(--color-text);
}

.history-meta {
  color: var(--color-text-light);
  font-size: 0.75rem;
}

.history-date {
  color: var(--color-text-light);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    top: 56px;
  }
  
  .sidebar.open {
    width: 100%;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.collapsed {
    width: 0;
    border: none;
  }
  
  .sidebar.collapsed .sidebar-toggle {
    right: -36px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}
/**
 * Cookie Banner Styles
 */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-bg-secondary);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 999;
  animation: slideUp 0.3s ease;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.cookie-text {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.cookie-icon {
  font-size: 2rem;
}

.cookie-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.cookie-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  max-width: 600px;
}

.cookie-description a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-text {
    flex-direction: column;
    align-items: center;
  }
  
  .cookie-actions {
    width: 100%;
    justify-content: center;
  }
}
/**
 * Product Management Styles
 */

.product-management {
  padding: 1rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: visible;
}

.pm-products-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: visible;
}

/* Tabs */
.pm-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}

.pm-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  margin-bottom: -2px;
}

.pm-tab:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.pm-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Toolbar (collapsible) */
.pm-toolbar-wrap {
  flex-shrink: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.pm-toolbar-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: left;
}

.pm-toolbar-toggle:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

.pm-toolbar-toggle-icon {
  font-size: 0.7rem;
  opacity: 0.8;
}

.pm-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pm-toolbar-wrap.collapsed .pm-toolbar-toggle {
  padding: 0.4rem 1rem;
  border: none;
}

.pm-toolbar-actions-collapsed {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.4rem 0;
  align-items: center;
}

.pm-toolbar-wrap.expanded .pm-toolbar-toggle {
  border-bottom: 1px solid var(--color-border);
}

.pm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
}

.pm-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pm-toolbar-row-tag {
  width: 100%;
  flex-basis: 100%;
}

.pm-filter-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.pm-toolbar-info {
  flex: 1;
  min-width: 200px;
}

.pm-toolbar-info p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.pm-search {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--color-background);
  transition: border-color 0.2s;
}

.pm-search:focus {
  outline: none;
  border-color: var(--color-primary);
}

.pm-tag-filter {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.pm-filter {
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--color-background);
  cursor: pointer;
}

/* Product List – no inner scroll; table height natural so admin content area scrolls */
.pm-list {
  overflow: visible;
  max-height: none;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.pm-loading,
.pm-empty {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pm-table th {
  text-align: left;
  padding: 1rem;
  background: var(--color-background);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.pm-table tr:hover {
  background: var(--color-hover);
}

.pm-table tr.inactive {
  opacity: 0.6;
}

.pm-cell-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.pm-th-tags {
  max-width: 220px;
}

.pm-cell-tags {
  max-width: 220px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.pm-tags-list {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-background);
}

/* Badges */
.pm-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.pm-badge.category {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.pm-badge.source {
  background: var(--color-secondary-bg);
  color: var(--color-secondary);
}

.pm-badge.price-budget {
  background: #dcfce7;
  color: #166534;
}

.pm-badge.price-medium {
  background: #dbeafe;
  color: #1e40af;
}

.pm-badge.price-premium {
  background: #fef3c7;
  color: #92400e;
}

.pm-badge.price-luxury {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Status */
.pm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.pm-status.active {
  background: #dcfce7;
  color: #166534;
}

.pm-status.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pm-status.inactive {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Actions */
.pm-actions {
  display: flex;
  gap: 0.25rem;
}

/* Sources Grid */
.pm-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.pm-source-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s;
}

.pm-source-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pm-source-card.inactive {
  opacity: 0.6;
}

.pm-source-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.pm-source-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.pm-source-type {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.pm-source-sync {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.pm-source-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

/* Modal */
.pm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.pm-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pm-modal h2 {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
}

.pm-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--color-background);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-group label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.pm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
}

/* Alerts */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #166534;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-secondary-bg);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-bg);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

.pm-asin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pm-asin-row .pm-asin-input {
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 100%;
}

.pm-batch-progress {
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.pm-batch-summary {
  margin-top: 0.5rem;
}

.pm-paste-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.pm-paste-url-row .pm-asin-input {
  flex: 1 1 200px;
  min-width: 200px;
}

.pm-paste-url-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  max-width: 520px;
}

.pm-v2-layers {
  margin: 0.75rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.pm-v2-layers summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.pm-v2-layers-content {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/**
 * User Management Styles
 */

.user-management {
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Toolbar */
.um-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.um-search {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--color-background);
}

.um-search:focus {
  outline: none;
  border-color: var(--color-primary);
}

.um-filter {
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--color-background);
  cursor: pointer;
}

/* User List */
.um-list {
  flex: 1;
  overflow: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.um-loading,
.um-empty {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.um-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.um-table th {
  text-align: left;
  padding: 1rem;
  background: var(--color-background);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.um-table tr:hover {
  background: var(--color-hover);
}

.um-table tr.inactive {
  opacity: 0.6;
}

.um-cell-username {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.um-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.um-cell-date {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* Badges */
.um-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.um-badge.role-admin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.um-badge.role-user {
  background: var(--color-secondary-bg);
  color: var(--color-text-secondary);
}

/* Status */
.um-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.um-status.active {
  background: #dcfce7;
  color: #166534;
}

.um-status.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.um-status.inactive {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Actions */
.um-actions {
  display: flex;
  gap: 0.25rem;
}

/* Modal */
.um-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.um-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.um-modal h2 {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
}

.um-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-group select {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--color-background);
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Permissions */
.um-permissions h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.um-admin-note {
  padding: 1rem;
  background: var(--color-info-bg);
  color: var(--color-info);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.um-permission-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.um-permission-group {
  background: var(--color-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.um-permission-group-header {
  padding: 0.875rem 1rem;
  background: var(--color-hover);
  border-bottom: 1px solid var(--color-border);
}

.um-permission-group-header .um-checkbox {
  font-weight: 600;
}

.um-group-title {
  flex: 1;
}

.um-group-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-left: 0.5rem;
}

.um-permission-list {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.um-checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.um-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.um-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-bg);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

/* Alerts */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #166534;
}
/* Settings Panel Styles */

.settings-panel {
  padding: 1rem;
}

.settings-panel h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.settings-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-card {
  background: rgba(13, 27, 42, 0.6);
  border: 1px solid rgba(241, 250, 238, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.setting-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
}

.setting-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 57, 70, 0.15);
  border-radius: 10px;
}

.setting-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.setting-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.setting-control {
  flex-shrink: 0;
}

.setting-input {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(241, 250, 238, 0.1);
  border-radius: 8px;
  background: rgba(13, 27, 42, 0.8);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  width: 200px;
}

.setting-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toggle Button */
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(13, 27, 42, 0.8);
  border: 2px solid rgba(241, 250, 238, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: rgba(241, 250, 238, 0.2);
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 30px;
  color: var(--text-secondary);
}

.toggle-btn.active .toggle-label {
  color: #4ade80;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: rgba(241, 250, 238, 0.1);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-btn.active .toggle-track {
  background: rgba(74, 222, 128, 0.3);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-btn.active .toggle-thumb {
  left: 22px;
  background: #4ade80;
}

/* Actions */
.settings-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(241, 250, 238, 0.1);
}

.settings-actions .btn {
  padding: 0.875rem 2rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: #ff6b6b;
}

.alert-success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

/* Responsive */
@media (max-width: 600px) {
  .setting-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .setting-control {
    width: 100%;
  }
  
  .setting-input {
    width: 100%;
  }
}
.analytics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.analytics-header h2 {
  margin: 0;
}

.analytics-loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-light);
}

.analytics-empty {
  color: var(--color-text-light);
  font-style: italic;
}

.analytics-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.analytics-table th,
.analytics-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--color-border, #e0e0e0);
  text-align: left;
}

.analytics-table th {
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--color-bg, #fff);
}

.analytics-table .num {
  text-align: right;
  white-space: nowrap;
}

.analytics-table .q-id {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-col {
  width: 30%;
  min-width: 120px;
}

.stacked-bar {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-surface, #f3f3f3);
}

.bar-yes {
  background: #4caf50;
  transition: width 0.3s;
}

.bar-no {
  background: #f44336;
  transition: width 0.3s;
}

.bar-skip {
  background: #9e9e9e;
  transition: width 0.3s;
}
.cluster-management {
  padding: 0.5rem;
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cluster-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.cluster-loading,
.cluster-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #666);
}

.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-topic-group {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
}

.cluster-topic-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
}

.cluster-topic-header:hover {
  background: var(--bg-hover, #ebebeb);
}

.cluster-topic-arrow {
  font-size: 0.8rem;
  width: 1rem;
  text-align: center;
}

.cluster-topic-name {
  flex: 1;
  text-transform: capitalize;
}

.cluster-topic-summary {
  font-size: 0.78rem;
  color: var(--text-secondary, #777);
}

.cluster-topic-badge {
  font-size: 0.75rem;
  background: var(--primary-color, #4a90d9);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

.cluster-topic-body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-card {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 0.75rem;
  background: var(--bg-primary, #fff);
  transition: opacity 0.2s;
}

.cluster-card.cluster-inactive {
  opacity: 0.5;
}

.cluster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.cluster-card-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cluster-badge-row {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
}

.badge-auto {
  background: #e0f0ff;
  color: #2672b0;
}

.badge-manual {
  background: #fff3cd;
  color: #856404;
}

.badge-count {
  background: #f0f0f0;
  color: #555;
}

.badge-type {
  background: #e8e3ff;
  color: #5a3fb6;
}

.badge-inactive {
  background: #f8d7da;
  color: #842029;
}

.cluster-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.cluster-question-preview {
  font-size: 0.85rem;
  color: var(--text-secondary, #666);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.cluster-subtopic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.subtopic-tag {
  font-size: 0.7rem;
  background: var(--bg-secondary, #f0f0f0);
  color: var(--text-primary, #333);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: monospace;
}

.subtopic-tag-unassigned {
  background: #fff3cd;
  color: #856404;
}

.cluster-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cluster-edit-row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
}

.cluster-edit-row input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.85rem;
}

.cluster-edit-row select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--bg-primary, #fff);
}

.cluster-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cluster-unassigned-topic {
  padding: 0.5rem;
}

.cluster-unassigned-topic h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  text-transform: capitalize;
  color: var(--text-secondary, #666);
}

.btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #bb2d3b;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.alert-error {
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.alert-success {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}
.dimension-browser {
  padding: 0.5rem;
}

.dimension-browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dimension-browser-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.dimension-browser-stats {
  font-size: 0.85rem;
  color: var(--text-secondary, #666);
}

.dimension-loading,
.dimension-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #666);
}

/* Active Filters Bar */
.dimension-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary, #f0f4ff);
  border-radius: 8px;
  border: 1px solid var(--color-primary-light, #c0d0ff);
}

.dimension-active-filters-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
}

.dimension-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: var(--color-primary, #4f7cff);
  color: white;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.dimension-filter-tag-type {
  opacity: 0.75;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.dimension-filter-tag button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0 0.125rem;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
}

.dimension-filter-tag button:hover {
  opacity: 1;
}

.dimension-clear-filters {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid var(--text-secondary, #999);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
  cursor: pointer;
}

.dimension-clear-filters:hover {
  background: var(--bg-hover, #eee);
}

/* Dimension Type Sections */
.dimension-types {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.dimension-type-section {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
}

.dimension-type-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: var(--bg-secondary, #f5f5f5);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
}

.dimension-type-header:hover {
  background: var(--bg-hover, #ebebeb);
}

.dimension-type-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary, #666);
}

.dimension-type-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Dimension Value Chips */
.dimension-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.dimension-chip:hover {
  border-color: var(--color-primary, #4f7cff);
  background: var(--bg-secondary, #f0f4ff);
}

.dimension-chip.active {
  background: var(--color-primary, #4f7cff);
  color: white;
  border-color: var(--color-primary, #4f7cff);
}

.dimension-chip-count {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 600;
}

/* Product Results */
.dimension-results {
  margin-top: 1rem;
}

.dimension-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dimension-results-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.dimension-results-count {
  font-size: 0.85rem;
  color: var(--text-secondary, #666);
}

.dimension-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.dimension-product-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  background: white;
  transition: box-shadow 0.15s ease;
}

.dimension-product-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dimension-product-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-secondary, #f5f5f5);
}

.dimension-product-info {
  flex: 1;
  min-width: 0;
}

.dimension-product-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dimension-product-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.dimension-product-dim-tag {
  display: inline-block;
  padding: 0.125rem 0.4rem;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary, #666);
}

.dimension-product-dim-tag.highlight {
  background: var(--color-primary-light, #dde6ff);
  color: var(--color-primary, #4f7cff);
  font-weight: 500;
}

/* Subject Groups Section */
.dimension-subject-section {
  margin-top: 0.5rem;
}

.dimension-subject-groups {
  display: flex;
  flex-direction: column;
}

.dimension-subject-group {
  border-bottom: 1px solid var(--border-color, #eee);
}

.dimension-subject-group:last-child {
  border-bottom: none;
}

.dimension-subject-group.has-active {
  background: var(--bg-secondary, #f0f4ff);
}

.dimension-subject-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
}

.dimension-subject-group-header:hover {
  background: var(--bg-hover, #f5f5f5);
}

.dimension-group-expand {
  color: var(--text-secondary, #999);
  font-size: 0.75rem;
  width: 0.75rem;
  flex-shrink: 0;
}

.dimension-group-label {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dimension-group-topic {
  font-size: 0.7rem;
  padding: 0.125rem 0.4rem;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 4px;
  color: var(--text-secondary, #666);
  white-space: nowrap;
}

.dimension-group-count {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  white-space: nowrap;
  margin-left: auto;
}

.dimension-subject-group-body {
  padding: 0.375rem 1rem 0.75rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
/**
 * Admin Panel Styles
 */

.admin-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
}

.admin-panel {
  background: var(--color-background);
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}


/* Header */
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-panel-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-user-badge {
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
}

.admin-panel-header .btn-ghost {
  color: white;
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: var(--radius-full);
}

.admin-panel-header .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.admin-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0 1rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.admin-nav-item {
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-nav-item:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

.admin-nav-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Content – only scroll area; product list grows, you scroll here to see more rows */
.admin-panel-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.admin-panel-content > .product-management {
  flex: 0 0 auto;
  min-height: 0;
}

.admin-loading {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
}

/* Access Denied */
.admin-access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 2rem;
  text-align: center;
}

.admin-access-denied .access-icon {
  font-size: 4rem;
}

.admin-access-denied p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 400px;
}

/* Overview */
.admin-overview {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.admin-stat-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
}

.admin-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin-top: 0.375rem;
}

/* Sections */
.admin-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}

.admin-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Quick Actions */
.admin-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Source Breakdown */
.admin-source-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.source-bar {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.source-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.source-bar-count {
  font-weight: 600;
  color: var(--color-primary);
}

.source-bar-track {
  height: 8px;
  background: var(--color-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.source-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Settings */
.admin-settings {
  padding: 1.5rem;
}

.admin-coming-soon {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.admin-empty {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-panel-overlay {
    padding: 0;
  }
  
  .admin-panel {
    border-radius: 0;
    max-width: 100%;
  }
  
  .admin-nav {
    padding: 0 0.5rem;
  }
  
  .admin-nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--color-secondary-bg);
  color: var(--color-text);
}

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

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--color-hover);
}

/* Alert */
.alert {
  margin: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}
/**
 * App-level styles
 */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-layout {
  flex: 1;
  display: flex;
  position: relative;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  padding-bottom: var(--space-3xl);
  transition: margin-left var(--transition-normal);
}

.app-main.with-sidebar {
  margin-left: 280px;
}

.app-footer {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.75rem;
}

.app-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.app-footer a:hover {
  color: var(--color-primary);
}

/* Error screen */
.error-screen {
  text-align: center;
  padding: var(--space-2xl);
}

.error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

.error-screen h2 {
  color: var(--color-error);
  margin-bottom: var(--space-md);
}

.error-screen p {
  margin-bottom: var(--space-xl);
}

/* Responsive */
@media (max-width: 768px) {
  .app-main.with-sidebar {
    margin-left: 0;
  }
}
/**
 * Shoppinate - Global Styles
 * Dark mode aesthetic matching landing page
 */

/* ============ CSS VARIABLES ============ */
:root {
  /* Primary palette - matching landing page */
  --color-primary: #e63946;
  --color-primary-dark: #c1121f;
  --color-primary-light: #ff6b6b;
  
  /* Accent - golden */
  --color-accent: #ffd166;
  --color-accent-dark: #f4c430;
  --color-accent-light: #ffe599;
  
  /* Dark theme colors */
  --color-bg: #0d1b2a;
  --color-bg-card: #1d3557;
  --color-bg-secondary: #15253b;
  --color-bg-elevated: #243b55;
  --color-text: #f1faee;
  --color-text-muted: rgba(241, 250, 238, 0.7);
  --color-text-light: rgba(241, 250, 238, 0.5);
  
  /* Borders */
  --color-border: rgba(241, 250, 238, 0.1);
  --color-border-hover: rgba(241, 250, 238, 0.2);
  
  /* Semantic */
  --color-success: #06d6a0;
  --color-error: #ef476f;
  
  /* Admin Panel Colors */
  --color-background: #0d1b2a;
  --color-surface: #1d3557;
  --color-hover: rgba(241, 250, 238, 0.05);
  --color-primary-hover: #c1121f;
  --color-secondary: #8b5cf6;
  --color-secondary-bg: rgba(139, 92, 246, 0.15);
  --color-text-secondary: rgba(241, 250, 238, 0.7);
  --color-text-tertiary: rgba(241, 250, 238, 0.5);
  --color-info: #60a5fa;
  --color-info-bg: rgba(96, 165, 250, 0.15);
  --color-error-bg: rgba(239, 71, 111, 0.15);
  --radius-xl: 24px;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Borders & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(230, 57, 70, 0.3);
  --shadow-glow-accent: 0 0 30px rgba(255, 209, 102, 0.2);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background pattern - matching landing */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 209, 102, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(29, 53, 87, 0.3) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============ FLOATING GIFTS ANIMATION ============ */
.floating-gifts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-gift {
  position: absolute;
  font-size: 2rem;
  opacity: 0;
  animation: floatUp 20s linear infinite;
}

.floating-gift:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.floating-gift:nth-child(2) { left: 25%; animation-delay: -5s; animation-duration: 20s; }
.floating-gift:nth-child(3) { left: 40%; animation-delay: -10s; animation-duration: 28s; }
.floating-gift:nth-child(4) { left: 55%; animation-delay: -3s; animation-duration: 22s; }
.floating-gift:nth-child(5) { left: 70%; animation-delay: -8s; animation-duration: 26s; }
.floating-gift:nth-child(6) { left: 85%; animation-delay: -12s; animation-duration: 24s; }

@keyframes floatUp {
  0% { 
    transform: translateY(100vh) rotate(0deg); 
    opacity: 0; 
  }
  10% { opacity: 0.12; }
  90% { opacity: 0.12; }
  100% { 
    transform: translateY(-100vh) rotate(360deg); 
    opacity: 0; 
  }
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(135deg, var(--color-text), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-text);
}

h3 {
  font-size: 1.25rem;
  color: var(--color-text);
}

p {
  color: var(--color-text-muted);
}

/* ============ UTILITY CLASSES ============ */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.text-center {
  text-align: center;
}

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

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md), 0 4px 15px rgba(230, 57, 70, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 8px 25px rgba(230, 57, 70, 0.5);
}

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

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-primary-light);
  background: var(--color-bg-elevated);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: var(--color-bg);
  box-shadow: var(--shadow-md), var(--shadow-glow-accent);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
}

/* ============ CARDS ============ */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  backdrop-filter: blur(10px);
}

.card-elevated {
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-lg);
}

.card:hover {
  border-color: var(--color-border-hover);
}

/* ============ FORMS ============ */
input, select, textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

input::placeholder {
  color: var(--color-text-light);
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

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

@keyframes glow {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: 0 0 40px rgba(230, 57, 70, 0.5); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) ease forwards;
}

.animate-slide-up {
  animation: slideUp var(--transition-slow) ease forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-accent {
  background: rgba(255, 209, 102, 0.15);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.badge-primary {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid var(--color-primary);
  color: var(--color-primary-light);
}

.badge-success {
  background: rgba(6, 214, 160, 0.15);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
  }
  
  .btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
  }
}
