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

:root {
  --primary: #C62828;
  --primary-light: #EF5350;
  --primary-dark: #8E0000;
  --primary-glow: rgba(198, 40, 40, 0.15);
  --accent: #FFB300;
  --accent-light: #FFD54F;
  --accent-dark: #FF8F00;
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface2: #F0F0F5;
  --surface-glass: rgba(255,255,255,0.72);
  --text: #1A1A2E;
  --text2: #6B7280;
  --text-light: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.2s var(--transition);
}

.header-logo:hover { opacity: 0.9; }

.header-logo i {
  font-size: 26px;
  color: var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-logo span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 3px;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.25s var(--transition);
  letter-spacing: 0.2px;
}

.nav-btn i { font-size: 20px; }

.nav-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.95);
}

.nav-btn.active {
  background: rgba(255,255,255,0.18);
  color: white;
  font-weight: 600;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--transition), box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.auth-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.25s var(--transition);
  letter-spacing: 0.1px;
}

.auth-btn.login {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.auth-btn.login:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}

.auth-btn.register {
  background: var(--accent);
  color: var(--primary-dark);
  border: none;
}

.auth-btn.register:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,179,0,0.35);
}

/* ========== MOBILE NAV ========== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  z-index: 100;
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 2px;
  background: none;
  color: var(--text2);
  font-size: 8px;
  font-weight: 500;
  transition: color 0.25s var(--transition);
  position: relative;
  border-radius: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav-btn i { font-size: 18px; transition: transform 0.2s var(--transition); }

.mobile-nav-btn.active {
  color: var(--primary);
}

.mobile-nav-btn.active i { transform: scale(1.1); }

.mobile-nav-btn .badge {
  position: absolute;
  top: 0;
  right: 4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 60%, #5C0000 100%);
  color: white;
  padding: 30px 0 32px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,179,0,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
}

.hero-bg { position: absolute; inset: 0; }

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-photo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 16px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 8px 18px;
  min-width: 80px;
}

.hero-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.hero-stat-label {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 1px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ========== SECTIONS ========== */
.section {
  padding: 28px 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.section-title i { color: var(--primary); font-size: 22px; }

/* ========== CATEGORIES GRID ========== */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s var(--transition);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.category-row:hover {
  background: var(--bg-hover, #f0f0f2);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.category-row:active {
  transform: translateX(2px);
}

.category-row-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-row-info {
  flex: 1;
  min-width: 0;
}

.category-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-row-count {
  font-size: 11px;
  color: var(--text2);
  margin-top: 1px;
  font-weight: 500;
}

.category-row-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.category-row-arrow {
  font-size: 18px;
  color: var(--text2);
  opacity: 0.4;
  transition: opacity 0.2s;
}

.category-row:hover .category-row-arrow {
  opacity: 0.8;
}

/* ========== PRODUCT DETAIL ========== */
.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
}

.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: all 0.2s var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.back-btn:hover {
  background: var(--surface2);
  transform: translateX(-2px);
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
  letter-spacing: -0.3px;
}

.product-list { display: flex; flex-direction: column; gap: 10px; }

.product-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--transition);
}

.product-card:hover { box-shadow: var(--shadow); }

.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.product-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.product-status.ok { background: var(--success-bg); color: var(--success); }
.product-status.warning { background: var(--warning-bg); color: var(--warning); }
.product-status.danger { background: var(--danger-bg); color: var(--danger); }

.product-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
}

.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s var(--transition);
}

.qty-btn:hover { background: var(--border); }
.qty-btn:active { background: var(--border); transform: scale(0.95); }

.qty-value {
  width: 42px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border: none;
  outline: none;
  background: white;
  height: 34px;
}

.input-sm {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 80px;
  outline: none;
  transition: all 0.2s var(--transition);
  background: white;
}

.input-sm:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.product-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s var(--transition);
}

.icon-btn.cart { background: #EFF6FF; color: #2563EB; }
.icon-btn.cart:hover { background: #DBEAFE; transform: scale(1.05); }
.icon-btn.cart.in-cart { background: #2563EB; color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.icon-btn.save { background: var(--success-bg); color: var(--success); }
.icon-btn.save:hover { background: #D1FAE5; transform: scale(1.05); }

/* ========== ALERTS ========== */
.alert-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  border-left: 4px solid;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.alert-card:hover { box-shadow: var(--shadow); }

.alert-card.expiry { border-left-color: var(--danger); }
.alert-card.low-stock { border-left-color: var(--warning); }

.alert-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.alert-icon.expiry { background: var(--danger-bg); color: var(--danger); }
.alert-icon.low-stock { background: var(--warning-bg); color: var(--warning); }

.alert-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.alert-desc { font-size: 13px; color: var(--text2); line-height: 1.5; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}

.empty-state i {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.25;
  display: block;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p { font-size: 14px; line-height: 1.6; }

/* ========== SHOPPING LIST ========== */
.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  transition: all 0.2s var(--transition);
}

.shopping-item:hover { box-shadow: var(--shadow); }

.shopping-item .item-info { flex: 1; }
.shopping-item .item-name { font-size: 14px; font-weight: 600; }
.shopping-item .item-category { font-size: 12px; color: var(--text2); margin-top: 2px; }

.shopping-item .remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s var(--transition);
}

.shopping-item .remove-btn:hover { background: #FEE2E2; transform: scale(1.05); }

/* ========== DEALS ========== */
.tabs {
  display: flex;
  gap: 0;
  background: white;
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: transparent;
  color: var(--text2);
  transition: all 0.25s var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); background: var(--surface2); }

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(198,40,40,0.25);
}

.deal-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s var(--transition);
}

.deal-card:hover { box-shadow: var(--shadow); }

.deal-card.completed { opacity: 0.55; }
.deal-card.completed .deal-name { text-decoration: line-through; }

.deal-check {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--transition);
  flex-shrink: 0;
  background: white;
  font-size: 12px;
  color: transparent;
}

.deal-check:hover { border-color: var(--success); }

.deal-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.deal-info { flex: 1; }
.deal-name { font-weight: 600; font-size: 14px; }
.deal-meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.deal-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.market-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s var(--transition);
  margin-bottom: 10px;
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.market-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.market-info { flex: 1; }
.market-name { font-weight: 700; font-size: 16px; }
.market-links { display: flex; gap: 10px; margin-top: 6px; }
.market-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.market-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ========== FORMS / MODALS ========== */
.form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--transition);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.form-modal {
  background: white;
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--transition);
}

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

.form-modal h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.3px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all 0.2s var(--transition);
  background: white;
}

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

select.form-control { cursor: pointer; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s var(--transition);
  width: 100%;
  letter-spacing: 0.1px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(198,40,40,0.3);
}

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

.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border);
}

.btn-outline:hover { border-color: var(--text2); background: var(--surface2); }

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

.btn-accent:hover {
  background: var(--accent-dark);
  color: white;
  transform: translateY(-1px);
}

.form-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.form-footer .btn { flex: 1; }

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

.form-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text2);
}

.form-link a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.form-link a:hover { text-decoration: underline; }

/* ========== USER DROPDOWN ========== */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  z-index: 200;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--border-light);
  animation: slideDown 0.2s var(--transition);
}

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

.user-dropdown-header {
  padding: 16px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.user-dropdown-name { font-weight: 600; font-size: 14px; }
.user-dropdown-email { font-size: 12px; color: var(--text2); margin-top: 2px; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s var(--transition);
  background: none;
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover { background: var(--surface2); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: var(--danger-bg); }

/* ========== FAB ========== */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(198,40,40,0.35);
  z-index: 90;
  transition: all 0.25s var(--transition);
}

.fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 28px rgba(198,40,40,0.45);
}

.fab:active { transform: scale(1.02); }

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: all 0.35s var(--transition);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== LOADING ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ========== SEARCH ========== */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  font-size: 17px;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: white;
  transition: all 0.2s var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input::placeholder { color: #B0B0B0; }

/* ========== ADD DEAL / SHOPPING FORMS ========== */
.add-deal-form {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.add-deal-form h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.shopping-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.shopping-add select, .shopping-add input {
  flex: 1;
}

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

.member-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s var(--transition);
}

.member-card:hover { box-shadow: var(--shadow); }

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.member-info { flex: 1; }

.member-name { font-weight: 600; font-size: 15px; }
.member-profession { font-size: 13px; color: var(--primary); font-weight: 500; margin-top: 2px; }
.member-location { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ========== CONTENT CARDS ========== */
.content-list { display: flex; flex-direction: column; gap: 16px; }

.content-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.content-card:hover { box-shadow: var(--shadow); }

.content-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.content-site-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.content-site-badge i { font-size: 13px; }
.content-date { font-size: 11px; color: var(--text2); margin-left: auto; white-space: nowrap; }
.content-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); line-height: 1.35; }
.content-body { font-size: 14px; color: var(--text2); line-height: 1.65; margin-top: 4px; word-break: break-word; }
.content-image { width: 100%; border-radius: var(--radius-sm); margin-top: 14px; max-height: 400px; object-fit: cover; }

.content-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s var(--transition);
  margin-left: 6px;
  flex-shrink: 0;
}

.content-delete-btn:hover { background: #FEE2E2; transform: scale(1.05); }

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

.hidden { display: none !important; }

/* ========== RECIPES ========== */
.recipe-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #FFF3E0, #FFF8E1);
  border: 1px solid #FFE0B2;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.recipe-summary-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.recipe-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.recipe-summary-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

.recipe-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-section-title i {
  font-size: 18px;
}

.recipe-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}

.recipe-card:hover {
  box-shadow: var(--shadow);
}

.recipe-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recipe-card-icon {
  font-size: 28px;
  line-height: 1;
}

.recipe-card-title-area {
  flex: 1;
  min-width: 0;
}

.recipe-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text2);
}

.recipe-card-meta i {
  font-size: 12px;
  margin-right: 2px;
}

.recipe-cat-tag {
  background: #F3E5F5;
  color: #7B1FA2;
  padding: 1px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 10px;
}

.recipe-score {
  font-size: 20px;
  font-weight: 800;
  min-width: 50px;
  text-align: right;
}

.recipe-card-ingredients {
  margin-bottom: 10px;
}

.recipe-ing-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.recipe-ing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recipe-ing {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
}

.recipe-ing i {
  font-size: 10px;
}

.recipe-ing.have {
  background: #E8F5E9;
  color: #2E7D32;
}

.recipe-ing.miss {
  background: #FFF3E0;
  color: #E65100;
}

.recipe-steps {
  margin-bottom: 8px;
}

.recipe-steps summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.recipe-steps summary i {
  font-size: 14px;
}

.recipe-steps p {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  margin-top: 6px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}

.recipe-add-btn {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.recipe-add-btn:hover {
  background: var(--primary-dark);
}

/* ========== ALL RECIPES / KITCHENS ========== */
.section-divider {
  display: flex;
  align-items: center;
  margin: 16px 0 8px;
  gap: 10px;
}
.section-divider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.add-kitchen-row {
  border: 2px dashed var(--primary-light);
  background: rgba(198, 40, 40, 0.04);
}
.add-kitchen-row:hover {
  background: rgba(198, 40, 40, 0.08);
}
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.color-option {
  cursor: pointer;
}
.color-option input[type="radio"] {
  display: none;
}
.color-option span {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.color-option input:checked + span {
  border-color: var(--text);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ========== MY RECIPES ========== */
.myrecipe-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.recipe-image-upload {
  margin-bottom: 10px;
}
.recipe-img-preview {
  margin-top: 8px;
}
.recipe-img-preview img {
  width: 100%;
  max-width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--border);
}
.ingredient-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ingredient-row input {
  flex: 1;
}
.user-recipe-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #5C6BC0;
  background: #E8EAF6;
  padding: 1px 7px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.recipe-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.recipe-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.recipe-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.recipe-filter-btn:hover:not(.active) {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-nav { display: block; }
  .hero { padding: 20px 0 24px; }
  .hero::after { height: 16px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 13px; margin-bottom: 12px; }
  .hero-photo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 8px; }
  .hero-stat { padding: 6px 14px; min-width: 75px; }
  .hero-stat-value { font-size: 18px; }
  .hero-stat-label { font-size: 9px; }
  .category-row { padding: 8px 12px; gap: 10px; }
  .category-row-icon { width: 32px; height: 32px; min-width: 32px; font-size: 15px; border-radius: 8px; }
  .category-row-name { font-size: 12px; }
  .category-list { gap: 4px; }
  .section { padding: 20px 0; }
  .section-title { font-size: 18px; }
  .product-controls { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .form-modal { padding: 24px; border-radius: var(--radius-lg); }
  .fab { bottom: 72px; }
  .toast { bottom: 90px; }
  body { padding-bottom: 70px; }
  .mobile-nav-btn { font-size: 9px; padding: 6px 3px; }
  .mobile-nav-btn i { font-size: 20px; }
  .content-card { padding: 16px; }
  .content-card-header { gap: 6px; margin-bottom: 10px; }
  .content-title { font-size: 15px; margin-bottom: 4px; }
  .content-body { font-size: 13px; }
  .content-site-badge { font-size: 10px; padding: 3px 8px; }
  .content-date { font-size: 10px; }
  .content-image { margin-top: 10px; max-height: 280px; }
}

@media (min-width: 769px) {
  .header-nav { display: flex; }
  .mobile-nav { display: none; }
  .category-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}

/* Priority select (shopping list) */
.priority-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  min-width: 95px;
  text-align: center;
}
.priority-select.priority-cok_acil { color: #D32F2F; border-color: #D32F2F; background: #FFEBEE; }
.priority-select.priority-acil { color: #E65100; border-color: #FF6F00; background: #FFF3E0; }
.priority-select.priority-normal { color: #2E7D32; border-color: #4CAF50; background: #E8F5E9; }

/* Sub-tabs (page-level navigation) */
.sub-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.sub-tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.sub-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.sub-tab-btn i { font-size: 16px; }

/* Calendar (Notlarım) */
.notes-calendar {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  padding: 4px 0;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text1);
  position: relative;
  transition: background 0.2s;
}
.cal-cell:hover { background: #f0f0f0; }
.cal-cell.empty { cursor: default; }
.cal-cell.empty:hover { background: transparent; }
.cal-cell.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.cal-cell.today:hover { background: #B71C1C; }
.cal-cell.has-notes::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1565C0;
}
.cal-cell.today.has-notes::after { background: #FFB300; }
.cal-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #1565C0;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell.today .cal-dot { background: #FFB300; color: #333; }

@media (max-width: 400px) {
  .hero-stats { gap: 8px; }
  .hero-stat { padding: 6px 10px; min-width: 70px; }
  .hero-stat-value { font-size: 18px; }
  .category-row { padding: 7px 10px; gap: 8px; }
  .category-row-icon { width: 28px; height: 28px; min-width: 28px; font-size: 13px; border-radius: 7px; }
  .category-row-name { font-size: 11.5px; }
  .category-row-count { font-size: 10px; }
  .members-grid { grid-template-columns: 1fr; }
  .content-card { padding: 14px; }
  .content-card-header { flex-wrap: wrap; }
  .cal-cell { font-size: 12px; }
  .cal-dot { width: 12px; height: 12px; font-size: 7px; }
}

/* ─── SMART ADD (AI) ─────────────────────────── */
.smart-add-btn {
  width: 44px; height: 44px; min-width: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 20px;
  background: linear-gradient(135deg, var(--primary), #E53935);
  box-shadow: 0 2px 8px rgba(198,40,40,0.3);
}
.smart-add-btn:hover { transform: scale(1.05); }
.smart-add-btn-sm {
  font-size: 12px; padding: 6px 12px; border-radius: 8px; gap: 4px;
  display: flex; align-items: center;
}
.smart-add-btn-sm i { font-size: 14px; }

.smart-add-modal { max-width: 500px; max-height: 85vh; overflow-y: auto; }
.close-modal-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg-secondary); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.close-modal-btn:hover { background: var(--border); }

.smart-tabs {
  display: flex; gap: 4px; background: var(--bg-secondary);
  border-radius: 10px; padding: 4px; margin-bottom: 16px;
}
.smart-tab {
  flex: 1; padding: 10px 8px; border: none; background: none;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); display: flex; align-items: center;
  justify-content: center; gap: 6px; transition: all 0.2s;
}
.smart-tab.active {
  background: #fff; color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.smart-tab i { font-size: 16px; }

.smart-tab-content { min-height: 120px; }

.smart-upload-area {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 32px 16px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg-secondary);
}
.smart-upload-area:hover {
  border-color: var(--primary); background: rgba(198,40,40,0.04);
}
.smart-upload-area i { font-size: 40px; color: var(--primary); margin-bottom: 8px; display: block; }
.smart-upload-area p { margin: 0; font-weight: 600; font-size: 14px; }
.smart-upload-area span { font-size: 12px; color: var(--text-secondary); }

.smart-preview-img {
  width: 100%; max-height: 200px; object-fit: contain;
  border-radius: 8px; margin-top: 12px;
}

.voice-record-area { text-align: center; padding: 24px 16px; }
.voice-record-btn {
  width: 72px; height: 72px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 28px;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(198,40,40,0.3);
}
.voice-record-btn:hover { transform: scale(1.08); }
.voice-record-btn.recording {
  background: #D32F2F; animation: pulse-record 1.5s infinite;
}
@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211,47,47,0.4); }
  50% { box-shadow: 0 0 0 16px rgba(211,47,47,0); }
}
.voice-record-area p { margin: 12px 0 4px; font-weight: 500; font-size: 14px; }
.voice-hint { font-size: 12px; color: var(--text-secondary); }

.smart-text-tab textarea {
  resize: vertical; min-height: 80px; font-size: 14px;
}

.smart-add-loading {
  text-align: center; padding: 32px 16px;
}
.smart-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.smart-add-loading p { color: var(--text-secondary); font-size: 14px; }

.smart-results { margin-top: 16px; }
.smart-results h4 {
  margin: 0 0 12px; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.smart-results-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto;
}
.smart-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-secondary);
  border-radius: 10px; transition: opacity 0.2s;
}
.smart-result-item.deselected { opacity: 0.45; }
.smart-check { display: flex; align-items: center; cursor: pointer; }
.smart-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.smart-result-info { flex: 1; min-width: 0; }
.smart-result-name { font-weight: 600; font-size: 13px; }
.smart-result-cat { font-size: 11px; color: var(--text-secondary); }
.smart-result-qty {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.smart-result-qty span { font-weight: 600; font-size: 14px; min-width: 16px; text-align: center; }

/* Smart Add Step Indicator */
.smart-step-indicator {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 16px; padding: 8px 0;
}
.smart-step {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
  white-space: nowrap;
}
.smart-step span {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 2px solid var(--border);
}
.smart-step.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.smart-step.active { color: var(--primary); font-weight: 600; }
.smart-step.done span { background: #4CAF50; color: #fff; border-color: #4CAF50; }
.smart-step.done { color: #4CAF50; }
.smart-step-line {
  flex: 1; height: 2px; background: var(--border);
  margin: 0 6px; min-width: 10px;
}

/* Smart Result Main layout */
.smart-result-main { flex: 1; min-width: 0; }
.smart-result-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: var(--bg-secondary);
  border-radius: 10px; transition: opacity 0.2s;
}

/* Stock Info Tags */
.smart-stock-info {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding-left: 16px;
}
.smart-stock-tag {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 3px; font-weight: 500;
}
.smart-stock-tag i { font-size: 10px; }
.smart-stock-tag.existing { background: #E3F2FD; color: #1565C0; }
.smart-stock-tag.add { background: #E8F5E9; color: #2E7D32; }
.smart-stock-tag.total { background: #FFF3E0; color: #E65100; font-weight: 700; }
.smart-stock-tag.min { background: #F3E5F5; color: #7B1FA2; }
.smart-stock-tag.new-product { background: #FCE4EC; color: #C62828; }
/* Smart Price Edit Row */
.smart-price-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; padding-left: 16px;
}
.smart-price-label {
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap; font-weight: 500;
}
.smart-price-label i { color: #E65100; font-size: 13px; }
.smart-price-input {
  width: 90px; padding: 4px 8px; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
  font-weight: 600; text-align: right;
  transition: border-color 0.2s;
}
.smart-price-input:focus {
  outline: none; border-color: #E65100;
  box-shadow: 0 0 0 2px rgba(230,81,0,0.12);
}
.smart-price-input::placeholder { color: #bbb; font-weight: 400; }

.smart-stock-tag.last-price { background: #EFEBE9; color: #5D4037; }
.smart-stock-tag.price-up { background: #FFEBEE; color: #D32F2F; font-weight: 700; }
.smart-stock-tag.price-down { background: #E8F5E9; color: #2E7D32; font-weight: 700; }

/* Smart Price/Weight Row */
.smart-price-weight-row {
  display: flex; gap: 8px; margin-top: 6px; padding-left: 16px;
}
.smart-field { display: flex; align-items: center; gap: 4px; flex: 1; }
.smart-field .smart-price-input { width: 100%; }

/* Unit Price Display */
.smart-unit-price-row {
  padding-left: 16px; margin-top: 4px;
}
.unit-price-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #1565C0;
  background: #E3F2FD; padding: 2px 8px; border-radius: 8px;
}
.unit-price-tag i { font-size: 12px; }
.comp-unit-price {
  font-size: 10px; color: #1565C0; font-weight: 600;
  display: flex; align-items: center; gap: 3px; margin-top: 2px;
}
.comp-unit-price i { font-size: 11px; }

/* Photo Buttons */
.smart-photo-buttons {
  display: flex; gap: 10px;
}
.smart-photo-buttons .smart-upload-area {
  flex: 1; min-height: auto; padding: 16px 8px;
}
.smart-photo-buttons .smart-upload-area i { font-size: 28px; }
.smart-photo-buttons .smart-upload-area p { font-size: 12px; margin: 6px 0 0; }

/* Saved Summary */
.smart-saved-summary { text-align: center; }
.smart-saved-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #E8F5E9; color: #4CAF50;
  display: flex; align-items: center; justify-content: center;
  margin: 16px auto 12px; font-size: 32px;
}
.smart-saved-summary h3 { margin: 0 0 16px; font-size: 16px; }

/* Shopping Comparison */
.comparison-section {
  text-align: left; margin-top: 16px;
  background: var(--bg); border-radius: 12px;
  border: 1px solid var(--border); overflow: hidden;
}
.comparison-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-weight: 700; font-size: 14px;
  background: #FFF3E0; border-bottom: 1px solid var(--border);
}
.comparison-totals { padding: 12px 14px; }
.comparison-total-row {
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
.comp-total-box {
  flex: 1; text-align: center; padding: 8px;
  border-radius: 8px; background: #F5F5F5;
}
.comp-total-box.current { background: #E8F5E9; }
.comp-total-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.comp-total-value { font-size: 18px; font-weight: 800; color: var(--text); }
.comp-total-arrow { color: var(--text-secondary); font-size: 18px; }
.comp-diff-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 4px 12px;
  border-radius: 20px; font-size: 13px; font-weight: 700;
  border: 1.5px solid; background: #fff;
}
.comparison-items-title {
  padding: 10px 14px 6px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
}
.comparison-items-list { padding: 0 14px 12px; }
.comp-item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #f0f0f0;
}
.comp-item-row:last-child { border-bottom: none; }
.comp-item-name { font-weight: 600; font-size: 13px; }
.comp-weight { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.comp-item-meta { font-size: 11px; color: var(--text-secondary); }
.comp-item-change {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 12px; gap: 2px; flex-shrink: 0;
}
.comp-change-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
}
.comp-change-badge.price-up { background: #FFEBEE; color: #D32F2F; }
.comp-change-badge.price-down { background: #E8F5E9; color: #2E7D32; }
.comp-change-badge.price-same { background: #F5F5F5; color: #757575; }
.comp-change-badge.price-new { background: #E3F2FD; color: #1565C0; }
.comp-item-change.price-up span:first-child { color: #D32F2F; }
.comp-item-change.price-down span:first-child { color: #2E7D32; }
.comp-item-change.price-new span:first-child { color: #1565C0; font-weight: 600; }

/* Cuisine filter tabs */
.cuisine-filter-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cuisine-filter-tabs::-webkit-scrollbar { display: none; }
.cuisine-filter-btn {
  padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px;
  background: var(--bg); color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.cuisine-filter-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.cuisine-filter-btn:hover:not(.active) {
  border-color: var(--primary); color: var(--primary);
}
.recipe-cuisine-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  background: #E8EAF6; color: #283593; font-size: 10px; font-weight: 600;
}
.recipe-region-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  background: #FFF3E0; color: #E65100; font-size: 10px; font-weight: 500;
}

/* Product highlight animation */
@keyframes highlightProduct {
  0% { box-shadow: 0 0 0 3px rgba(198,40,40,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(198,40,40,0.3); }
  100% { box-shadow: 0 0 0 3px rgba(198,40,40,0.5); }
}
.highlight-product {
  animation: highlightProduct 0.6s ease-in-out 3;
  border-color: var(--primary) !important;
}

/* Smart add editable row */
.smart-edit-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.smart-name-input {
  flex: 1; min-width: 100px; padding: 4px 8px; font-size: 13px;
  font-weight: 600; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
.smart-name-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(198,40,40,0.12);
}
.smart-cat-select {
  padding: 4px 6px; font-size: 11px; border: 1.5px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text);
  max-width: 120px; border-left: 3px solid var(--primary);
}
.smart-cat-select:focus { outline: none; border-color: var(--primary); }

/* Edit product icon button */
.icon-btn.edit {
  color: #1565C0; background: #E3F2FD;
}
.icon-btn.edit:hover { background: #BBDEFB; }

@media (max-width: 420px) {
  .comparison-total-row { flex-direction: column; gap: 4px; }
  .comp-total-arrow { transform: rotate(90deg); }
  .comp-item-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .comp-item-change { align-items: flex-start; flex-direction: row; gap: 6px; }
  .smart-price-weight-row { flex-direction: column; gap: 4px; }
  .smart-edit-row { flex-direction: column; align-items: stretch; }
  .smart-cat-select { max-width: 100%; }
}
.smart-saved-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 250px; overflow-y: auto; text-align: left;
}
.smart-saved-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg-secondary);
  border-radius: 8px;
}

/* Product Price Info */
.product-price-info {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 12px; font-size: 12px;
  color: #E65100; background: #FFF3E0;
  border-radius: 6px; margin: -2px 0 4px;
}
.product-price-info i { font-size: 13px; }
.product-price-info .price-date { color: #999; font-size: 11px; }

.product-weight-info {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 12px; font-size: 12px;
  color: #1565C0; background: #E3F2FD;
  border-radius: 6px; margin: -2px 0 4px;
}
.product-weight-info i { font-size: 13px; }

/* Voice Timer */
.voice-timer {
  font-size: 28px; font-weight: 700;
  color: var(--primary); font-variant-numeric: tabular-nums;
  margin: 8px 0 4px;
  animation: voicePulse 1.5s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.alert-price-tag, .shop-price-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: #FFF8E1; color: #F57F17;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  margin-left: 6px; white-space: nowrap;
  border: 1px solid #FFE082;
}
.alert-price-tag i, .shop-price-tag i {
  font-size: 10px;
}
.shop-price-tag {
  display: inline-flex; margin-left: 4px; margin-top: 2px;
}
.alert-price-tag.clickable, .shop-price-tag.clickable, .product-price-info.clickable {
  cursor: pointer; transition: all 0.15s;
}
.alert-price-tag.clickable:hover, .shop-price-tag.clickable:hover {
  background: #FFF3E0; border-color: #FFB74D; transform: scale(1.03);
}
.product-price-info.clickable:hover {
  opacity: 0.8;
}

.ph-product-name {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.ph-product-name i { font-size: 18px; }
.ph-product-name span { font-weight: 600; font-size: 15px; color: var(--text); }
.ph-product-name small { font-size: 12px; color: var(--text2); margin-left: auto; }

.price-history-stats {
  display: flex; gap: 8px; padding: 12px 0; margin-bottom: 8px;
}
.ph-stat {
  flex: 1; text-align: center; padding: 10px 6px;
  background: var(--surface2); border-radius: 10px;
}
.ph-stat-label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.ph-stat-value { font-size: 15px; font-weight: 700; }
.ph-low { color: #2E7D32; }
.ph-avg { color: #1565C0; }
.ph-high { color: #C62828; }

.price-history-list { display: flex; flex-direction: column; gap: 6px; }
.ph-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--surface2);
  border: 1px solid var(--border-light);
}
.ph-entry.ph-latest { background: #FFF8E1; border-color: #FFE082; }
.ph-entry-left { display: flex; align-items: center; gap: 8px; }
.ph-entry-right { display: flex; align-items: center; gap: 8px; }
.ph-price { font-weight: 700; font-size: 15px; color: var(--text); }
.ph-date { font-size: 12px; color: var(--text2); }
.ph-badge {
  font-size: 10px; font-weight: 700; color: #F57F17;
  background: #FFF3E0; padding: 2px 8px; border-radius: 8px;
}
.ph-change { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.ph-up { color: #C62828; background: #FFEBEE; }
.ph-down { color: #2E7D32; background: #E8F5E9; }
.ph-same { color: var(--text2); }

.lang-switcher {
  display: flex; gap: 4px; align-items: center; margin-right: 8px;
}
.lang-btn {
  background: none; border: 2px solid transparent; border-radius: 6px;
  font-size: 20px; cursor: pointer; padding: 2px 4px; line-height: 1;
  opacity: 0.5; transition: all 0.15s;
}
.lang-btn:hover { opacity: 0.8; }
.lang-btn.active { opacity: 1; border-color: var(--primary); background: var(--primary-glow); }

.custom-product-form {
  background: var(--surface2); border-radius: 12px; padding: 16px; margin-bottom: 16px;
  border: 2px dashed var(--border);
}
.custom-product-form h4 {
  margin: 0 0 12px; font-size: 14px; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.custom-product-form .form-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
}
.custom-product-form .form-group {
  flex: 1; min-width: 100px;
}
.custom-product-form label {
  display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; font-weight: 500;
}
.custom-product-form input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--surface);
}
.custom-product-btn {
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.product-card .product-delete-btn {
  background: none; border: none; color: #EF5350; cursor: pointer;
  font-size: 16px; padding: 4px; border-radius: 6px; transition: all 0.15s;
}
.product-card .product-delete-btn:hover { background: #FFEBEE; }
.product-card.custom-product { border-left: 3px solid var(--accent); }

@media (max-width: 768px) {
  .lang-switcher { margin-right: 4px; }
  .lang-btn { font-size: 16px; padding: 1px 2px; }
}
