@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==============================
   DESIGN TOKENS
   ============================== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.2);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.2);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.2);
  --accent-purple: #8b5cf6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================
   LIGHT THEME
   ============================== */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(241, 245, 249, 0.9);
  --bg-glass: rgba(0, 0, 0, 0.02);
  --bg-input: rgba(0, 0, 0, 0.04);
  --border-color: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(59, 130, 246, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.1);
}

/* ==============================
   THEME TOGGLE
   ============================== */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle::before {
  content: '🌙';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  transition: var(--transition);
}

[data-theme="light"] .theme-toggle::before {
  content: '☀️';
  left: 21px;
}

[data-theme="light"] .theme-toggle {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

/* ==============================
   NOTES
   ============================== */
.notes-section {
  margin-top: 16px;
}

.notes-section label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.87rem;
  resize: vertical;
  transition: var(--transition);
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.notes-saved {
  font-size: 0.75rem;
  color: var(--accent-green);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.notes-saved.show {
  opacity: 1;
}

/* ==============================
   ADMIN DASHBOARD
   ============================== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.admin-stat-card .admin-stat-number {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.admin-stat-card .admin-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.admin-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

[data-theme="light"] .admin-table td {
  border-bottom-color: rgba(0,0,0,0.05);
}

.admin-table tr:hover td {
  background: var(--bg-glass);
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-badge.admin { background: var(--accent-blue-glow); color: var(--accent-blue); }
.admin-badge.user { background: var(--bg-input); color: var(--text-muted); }

/* ==============================
   COMPARISON VIEW
   ============================== */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: var(--transition);
}

.compare-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.compare-card.cheapest {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px var(--accent-green-glow);
}

.compare-card.cheapest::after {
  content: '🏆 Miglior Prezzo';
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-green);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.compare-card-name {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.compare-card-site {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.compare-card-price {
  font-size: 1.5rem;
  font-weight: 800;
}

.compare-card-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Group selector */
.group-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.group-selector select {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
}

.group-selector .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-2%, -2%) rotate(2deg); }
}

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

/* ==============================
   SCROLLBAR
   ============================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ==============================
   APP LAYOUT
   ============================== */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ==============================
   NAVBAR
   ============================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.9);
}

/* Hamburger button - hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
}

.navbar-brand .logo-icon {
  font-size: 1.5rem;
}

.navbar-brand span {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.navbar-user .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: white;
}

/* ==============================
   MAIN CONTENT
   ============================== */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ==============================
   AUTH PAGE
   ============================== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: slideUp 0.5s ease-out;
}

.auth-card h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-logo {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

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

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-toggle a {
  color: var(--accent-blue);
  font-weight: 500;
  cursor: pointer;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* ==============================
   FORMS
   ============================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

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

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.2;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* ==============================
   DASHBOARD HEADER
   ============================== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.dashboard-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stat-chip .stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

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

.product-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-card), 0 0 20px var(--accent-blue-glow);
  transform: translateY(-2px);
}

.product-card.has-deal {
  border-color: rgba(16, 185, 129, 0.4);
}

.product-card.has-deal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.product-card.has-error {
  border-color: rgba(239, 68, 68, 0.3);
}

.product-card.is-paused {
  opacity: 0.6;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.product-card-image {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}

.product-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

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

.product-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.price-display {
  display: flex;
  flex-direction: column;
}

.price-current {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.price-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2px;
}

.price-change.down { color: var(--accent-green); }
.price-change.up { color: var(--accent-red); }
.price-change.same { color: var(--text-muted); }

.price-target {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.product-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-stock {
  background: var(--accent-green-glow);
  color: var(--accent-green);
}

.badge-outstock {
  background: var(--accent-red-glow);
  color: var(--accent-red);
}

.badge-deal {
  background: var(--accent-green-glow);
  color: var(--accent-green);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px var(--accent-green-glow); }
  50% { box-shadow: 0 0 15px var(--accent-green-glow); }
}

.badge-error {
  background: var(--accent-red-glow);
  color: var(--accent-red);
}

.badge-paused {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
}

.last-checked {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ==============================
   MODAL
   ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ==============================
   DETAIL VIEW
   ============================== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-header .back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: none;
  border: none;
  font-family: var(--font);
}

.detail-header .back-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

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

.detail-top {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.detail-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}

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

.detail-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-word;
}

.detail-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 12px;
}

.detail-price-big {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.detail-stat {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.detail-stat .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-stat .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-stat .stat-value.green { color: var(--accent-green); }
.detail-stat .stat-value.red { color: var(--accent-red); }
.detail-stat .stat-value.amber { color: var(--accent-amber); }

/* ==============================
   CHART
   ============================== */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.chart-container h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

.chart-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
}

/* ==============================
   PRICE TABLE
   ============================== */
.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.price-table td {
  padding: 10px 14px;
  font-size: 0.87rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.price-table tr:hover td {
  background: var(--bg-glass);
}

/* ==============================
   TOAST NOTIFICATIONS
   ============================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.87rem;
  animation: slideInRight 0.3s ease-out;
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }

/* ==============================
   SKELETON LOADER
   ============================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  height: 160px;
  border-radius: var(--radius-md);
}

/* ==============================
   LOADER
   ============================== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loader-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ==============================
   DETAIL ACTIONS
   ============================== */
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ==============================
   NAVBAR LINKS (LANDING)
   ============================== */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-link {
  padding: 7px 16px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  font-family: var(--font);
}

.navbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.navbar-link.active {
  color: var(--accent-blue);
}

/* ==============================
   LANDING PAGE
   ============================== */
.landing {
  width: 100%;
}

.main-content.landing-mode {
  max-width: 100%;
  padding: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  text-align: center;
  padding: 100px 24px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 20px;
  animation: slideUp 0.4s ease-out;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
  animation: slideUp 0.5s ease-out;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
  animation: slideUp 0.6s ease-out;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: slideUp 0.7s ease-out;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* --- Hero Chart Demo --- */
.hero-visual-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 48px;
  animation: slideUp 0.9s ease-out;
}

.hero-chart-demo {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.chart-demo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-demo-product {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-demo-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chart-demo-site {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-demo-price {
  text-align: right;
}

.chart-demo-current {
  font-size: 1.4rem;
  font-weight: 700;
  display: block;
}

.chart-demo-change {
  font-size: 0.75rem;
  font-weight: 600;
}

.chart-demo-change.down { color: var(--accent-green); }
.chart-demo-change.up { color: var(--accent-red); }

.chart-demo-svg {
  width: 100%;
  height: 120px;
  display: block;
}

.chart-dot-pulse {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { r: 4; opacity: 1; }
  50% { r: 7; opacity: 0.6; }
}

.chart-demo-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 4px;
}

.chart-demo-labels span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-demo-footer {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.chart-demo-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-demo-stat .label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.chart-demo-stat .value {
  font-size: 0.95rem;
  font-weight: 700;
}

.chart-demo-stat .value.good {
  color: var(--accent-green);
}

/* --- Social Proof --- */
.social-proof {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 32px 24px;
  flex-wrap: wrap;
}

.proof-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.proof-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.proof-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.proof-sep {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

/* --- Section Shared --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 12px;
}

.landing-section {
  padding: 64px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.landing-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.feature-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: rgba(99,102,241,0.1);
  color: #6366f1;
}

.feature-card:nth-child(2) .feature-icon-wrap { background: rgba(16,185,129,0.1); color: #10b981; }
.feature-card:nth-child(3) .feature-icon-wrap { background: rgba(245,158,11,0.1); color: #f59e0b; }
.feature-card:nth-child(4) .feature-icon-wrap { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.feature-card:nth-child(5) .feature-icon-wrap { background: rgba(236,72,153,0.1); color: #ec4899; }
.feature-card:nth-child(6) .feature-icon-wrap { background: rgba(6,182,212,0.1); color: #06b6d4; }

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- How it works --- */
.steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  transition: var(--transition);
  position: relative;
}

.step-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.step-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  display: block;
  line-height: 1;
}

.step-number {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 12px;
  opacity: 0.6;
}

.step-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.step-badge-soon {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-purple);
}

/* --- Hero Trust Badges --- */
.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
  animation: slideUp 0.8s ease-out;
}

.hero-trust span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Section Subtitle --- */
.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 8px auto 48px;
  line-height: 1.6;
}

/* --- Chart Demo Section --- */
.chart-demo-section {
  max-width: 900px;
}

.hero-visual-section-inner {
  max-width: 680px;
  margin: 0 auto;
  animation: slideUp 0.7s ease-out;
}

/* --- CTA Bottom --- */
.cta-section {
  text-align: center;
  padding: 48px 24px 40px;
}

.cta-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.cta-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.cta-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.92rem;
}

/* --- Footer --- */
.landing-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer-brand {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-up { animation: slideUp 0.4s ease-out; }

/* Staggered animations */
.feature-card:nth-child(1) { animation: slideUp 0.4s ease-out 0.1s both; }
.feature-card:nth-child(2) { animation: slideUp 0.4s ease-out 0.15s both; }
.feature-card:nth-child(3) { animation: slideUp 0.4s ease-out 0.2s both; }
.feature-card:nth-child(4) { animation: slideUp 0.4s ease-out 0.25s both; }
.feature-card:nth-child(5) { animation: slideUp 0.4s ease-out 0.3s both; }
.feature-card:nth-child(6) { animation: slideUp 0.4s ease-out 0.35s both; }

.step-card:nth-child(1) { animation: slideUp 0.5s ease-out 0.2s both; }
.step-card:nth-child(2) { animation: slideUp 0.5s ease-out 0.4s both; }
.step-card:nth-child(3) { animation: slideUp 0.5s ease-out 0.6s both; }

/* ==============================
   COOKIE BANNER
   ============================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-text {
  flex: 1;
}

.cookie-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.cookie-text a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ==============================
   FOOTER LINKS & AFFILIATE
   ============================== */
.footer-affiliate {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-blue);
}

/* ==============================
   LEGAL PAGES
   ============================== */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

.legal-page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.legal-page .legal-update {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.legal-page p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-page ul {
  margin: 8px 0 16px 24px;
}

.legal-page li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--accent-blue);
}

.legal-page code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}

.legal-table th,
.legal-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.legal-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-table td {
  color: var(--text-secondary);
}

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

/* --- Tablet & small desktop --- */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  /* Navbar becomes fixed height with hamburger */
  .navbar {
    padding: 0 14px;
    height: 52px;
    flex-wrap: nowrap;
    position: relative;
  }

  .navbar-brand {
    font-size: 1rem;
    gap: 6px;
  }

  .navbar-brand .logo-icon {
    font-size: 1.2rem;
  }

  /* Mobile dropdown menu */
  .navbar-actions {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 20px 24px;
    flex-direction: column;
    gap: 8px;
    z-index: 105;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  }

  [data-theme="light"] .navbar-actions {
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  }

  .navbar-actions.open {
    display: flex;
  }

  .navbar-links {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .navbar-link {
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-align: left;
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
  }

  .navbar-link:hover, .navbar-link.active {
    background: var(--bg-input);
  }

  /* Make "Registrati" button prominent in mobile menu */
  .navbar-links .btn.btn-primary {
    margin-top: 8px;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    min-height: 52px;
    border-radius: var(--radius-md);
    justify-content: center;
  }

  .navbar-user {
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
    justify-content: flex-start;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
  }

  .theme-toggle {
    width: 48px;
    height: 26px;
    align-self: flex-start;
    margin-top: 8px;
  }

  .theme-toggle::before {
    font-size: 12px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    top: 3px;
    left: 4px;
  }

  [data-theme="light"] .theme-toggle::before {
    left: 24px;
  }

  #btn-logout, .navbar-actions .btn:not(.btn-primary) {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    font-size: 1rem;
    min-height: 50px;
  }

  /* Layout */
  .main-content { padding: 16px 12px; }
  .product-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .dashboard-header > div { flex-wrap: wrap; gap: 8px; }
  .dashboard-stats { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; max-width: 100%; }
  .auth-container { padding: 12px; }
  .detail-top { flex-direction: column; }
  .detail-stats-row { grid-template-columns: repeat(2, 1fr); }
  .detail-actions { flex-wrap: wrap; }
  .modal { margin: 10px; }
  .modal-body { max-height: 70vh; }

  /* Landing responsive */
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 1.8rem; line-height: 1.2; }
  .hero p { font-size: 0.95rem; padding: 0 8px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; }
  .mockup-grid { grid-template-columns: 1fr; }
  .hero-visual { margin-top: 24px; }
  .hero-mockup { margin: 0 -12px; border-radius: var(--radius-md); }
  .landing-stats { gap: 16px; flex-wrap: wrap; padding: 32px 16px; }
  .landing-stat .stat-number { font-size: 1.6rem; }
  .landing-stat .stat-desc { font-size: 0.75rem; }
  .steps-container { grid-template-columns: 1fr; gap: 16px; }
  .steps-container::before { display: none; }
  .step-card { padding: 24px 20px; }
  .step-icon { font-size: 2.2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 24px 20px; }
  .landing-section { padding: 48px 16px; }
  .landing-section h2 { font-size: 1.5rem; }
  .section-subtitle { font-size: 0.88rem; margin: -20px auto 32px; padding: 0 8px; }
  .cta-card { padding: 32px 20px; }
  .cta-card h2 { font-size: 1.3rem; }
  .cta-section { padding: 32px 16px; }
  .hero-trust { gap: 12px; }
  .hero-trust span { font-size: 0.75rem; }

  /* Cookie banner mobile */
  .cookie-banner { flex-direction: column; padding: 14px 16px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }

  /* Legal pages mobile */
  .legal-page { padding: 16px; }
  .legal-page h1 { font-size: 1.4rem; }
  .legal-table { font-size: 0.75rem; }
  .legal-table th, .legal-table td { padding: 6px 8px; }

  /* Social proof mobile */
  .social-proof { gap: 16px; }
  .proof-sep { display: none; }

  /* Admin / Compare responsive */
  .admin-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .admin-stat-card { padding: 14px; }
  .admin-stat-card .admin-stat-number { font-size: 1.6rem; }
  .admin-section { padding: 14px; }
  .admin-table { font-size: 0.75rem; }
  .admin-table th, .admin-table td { padding: 6px 5px; }
  .compare-grid { grid-template-columns: 1fr; }

  /* Group selector */
  .group-selector { flex-direction: column; align-items: stretch; }
  .group-selector select { width: 100%; }

  /* Chart */
  .chart-container { padding: 16px 12px; }

  /* Notes */
  .notes-textarea { min-height: 60px; }
}

/* --- Phone --- */
@media (max-width: 480px) {
  .navbar {
    padding: 6px 10px;
    gap: 4px;
  }

  .navbar-brand span:not(.logo-icon) {
    font-size: 0.85rem;
  }

  .navbar-actions {
    gap: 4px;
  }

  .navbar-user span.username-text { display: none; }
  .navbar-user { padding: 3px 6px; }
  .navbar-user .user-avatar { width: 22px; height: 22px; font-size: 0.6rem; }

  .navbar-link {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  #btn-logout, .btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .stat-chip { font-size: 0.72rem; padding: 3px 8px; }
  .product-card { padding: 14px; }
  .product-card-name { font-size: 0.85rem; }
  .price-current { font-size: 1.2rem; }
  .price-target { font-size: 0.72rem; }

  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.88rem; }
  .hero-badge { font-size: 0.75rem; padding: 6px 14px; }
  .btn-lg { padding: 12px 20px; font-size: 0.9rem; }
  .landing-stats { gap: 12px; padding: 24px 12px; }
  .landing-stat .stat-number { font-size: 1.4rem; }

  .admin-grid { grid-template-columns: 1fr; }
  .admin-stat-card .admin-stat-number { font-size: 1.4rem; }
  .admin-stat-card .admin-stat-label { font-size: 0.7rem; }

  .detail-price-big { font-size: 1.8rem; }
  .detail-stat { padding: 12px 8px; }
  .detail-stat .stat-value { font-size: 1rem; }
  .detail-stat .stat-label { font-size: 0.65rem; }
  .detail-actions .btn { font-size: 0.75rem; padding: 6px 10px; }

  .auth-card { padding: 24px 16px; }
  .auth-card h2 { font-size: 1.3rem; }
  .auth-logo { font-size: 2.5rem; }
  .form-control { padding: 10px 12px; font-size: 0.85rem; }

  .main-content { padding: 12px 10px; }
  h1 { font-size: 1.3rem; }

  /* Modal mobile */
  .modal { margin: 5px; border-radius: var(--radius-md); }
  .modal-header h3 { font-size: 1rem; }
  .modal-body { padding: 16px; max-height: 65vh; }

  .compare-card-name { font-size: 0.82rem; }
  .compare-card-price { font-size: 1.2rem; }

  .notes-textarea { font-size: 0.82rem; }
}

/* --- Very small phones (320px) --- */
@media (max-width: 360px) {
  .navbar-brand span:not(.logo-icon) {
    display: none;
  }

  .navbar-link {
    font-size: 0.68rem;
    padding: 4px 5px;
  }

  .hero h1 { font-size: 1.3rem; }
  .hero-cta .btn { font-size: 0.82rem; }

  .landing-stats {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .dashboard-header h1 { font-size: 1.1rem; }
  .stat-chip { font-size: 0.68rem; padding: 2px 6px; }
}

/* ==============================
   AUTH DIVIDER
   ============================== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ==============================
   PLAN BADGES
   ============================== */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-badge.free {
  background: var(--bg-input);
  color: var(--text-muted);
}
.plan-badge.pro {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

/* ==============================
   USAGE BAR
   ============================== */
.usage-bar-wrap {
  margin-bottom: 20px;
}
.usage-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.usage-count {
  font-weight: 700;
  color: var(--text-primary);
}
.usage-count.full {
  color: var(--accent-red);
}
.usage-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.usage-bar-fill.full {
  background: linear-gradient(90deg, var(--accent-red), #f97316);
}
.usage-hint {
  font-size: 0.75rem;
  color: var(--accent-amber);
  margin-top: 6px;
}

/* ==============================
   UPGRADE CARD
   ============================== */
.upgrade-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.05));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-top: 24px;
}
.upgrade-card-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.upgrade-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.upgrade-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  max-width: 280px;
  margin: 0 auto 20px;
}
.upgrade-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}
.btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(245,158,11,0.4);
  color: white;
}

/* ==============================
   PRICING SECTION (LANDING)
   ============================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  transition: var(--transition);
}
.pricing-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}
.pricing-card.featured {
  border-color: rgba(245,158,11,0.4);
  box-shadow: 0 0 30px rgba(245,158,11,0.1);
}
.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-xl);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pricing-card-header {
  text-align: center;
  margin-bottom: 24px;
}
.pricing-card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.pricing-price {
  font-size: 2rem;
  font-weight: 800;
}
.pricing-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-features li {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ==============================
   DASHBOARD MOBILE-FIRST IMPROVEMENTS
   ============================== */
.dash-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dashboard-stats-mobile {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dash-groups {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.dash-groups h3 {
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.dash-groups-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Product card — mobile-first with better touch targets */
.product-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.product-card-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}
.product-card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

/* User avatar image for Google users */
.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Admin plan selector */
.plan-select {
  padding: 3px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
}

/* ==============================
   MOBILE: PRICING & NEW COMPONENTS
   ============================== */
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 16px; }
  .pricing-card { padding: 24px 20px; }
  .upgrade-card { padding: 20px 16px; }
  .upgrade-card h3 { font-size: 1rem; }
  .product-card-image { width: 52px; height: 52px; }
  .dashboard-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1; min-height: 44px; }
  .product-card { padding: 14px; }
  .detail-actions .btn { min-height: 44px; }
}

@media (max-width: 480px) {
  .product-card-image { width: 48px; height: 48px; }
  .pricing-price { font-size: 1.5rem; }
  .plan-badge { font-size: 0.6rem; padding: 1px 6px; }
  .usage-bar-header { font-size: 0.75rem; }
}

/* ======= ANOMALY SECTION ======= */
.anomaly-section {
  background: rgba(255, 59, 48, 0.05);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}
.anomaly-section h3 {
  color: var(--accent-red);
  margin-bottom: 16px;
}
.anomaly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.anomaly-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.anomaly-chip.warning {
  background: rgba(255, 179, 0, 0.15);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.3);
}
.anomaly-chip.danger {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.3);
}
.anomaly-chip.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.anomaly-details {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
}
.anomaly-details summary {
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
  transition: background 0.2s;
}
.anomaly-details summary:hover {
  background: rgba(255, 255, 255, 0.06);
}
.anomaly-details[open] summary {
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}
.anomaly-details .admin-table {
  margin-top: 0;
  border-radius: 0 0 10px 10px;
}
.plan-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

/* ==============================
   ACCOUNT SECTION (GDPR)
   ============================== */
.account-section {
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.account-section h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
