/* ==========================================================
   Smart Pantry - Modern Dashboard & UI Design System
   Matches Figma / UI Mockup Specification
   ========================================================== */

:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --accent-green: #10b981;
  --bg-page: #f4f6f8;
  --card-bg: #ffffff;
  --border-color: #f1f5f9;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --sidebar-w: 240px;
  --right-col-w: 300px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.02);
}

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Base App Shell */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================
   TOPBAR
   ========================================== */
.main-topbar {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: var(--sidebar-w);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f7ee;
  color: #10b981;
}

.brand-info h1 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-info p {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 1px;
}

/* Center Search */
.topbar-search {
  flex: 1;
  max-width: 580px;
  margin: 0 24px;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 9px 18px;
  transition: all 0.2s ease;
}

.search-pill:focus-within {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.search-pill input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
}

.search-pill input::placeholder {
  color: #94a3b8;
}

/* Topbar User & Actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.noti-btn {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: all 0.2s ease;
}

.noti-btn:hover {
  background: #f1f5f9;
}

.noti-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.user-profile:hover {
  background: #f8fafc;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #065f46;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.user-details .user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.user-details .user-role {
  font-size: 11px;
  color: #94a3b8;
}

.user-chevron {
  color: #94a3b8;
  font-size: 14px;
}

/* ==========================================
   PAGE LAYOUT (SIDEBAR + MAIN + RIGHT COL)
   ========================================== */
.dashboard-grid {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 24px;
  gap: 24px;
  align-items: flex-start;
}

/* Left Sidebar */
.left-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-link.active {
  background: #e8f7ee;
  color: #059669;
  font-weight: 700;
}

.nav-link svg, .nav-link i {
  width: 18px;
  height: 18px;
}

/* Recipe Kitchen Card (100% Free) */
.recipe-kitchen-card {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 18px;
  padding: 16px;
  margin-top: 10px;
}

.recipe-kitchen-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.recipe-kitchen-icon {
  font-size: 18px;
}

.recipe-kitchen-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e392a;
}

.recipe-kitchen-card p {
  font-size: 11.5px;
  color: #526357;
  line-height: 1.4;
  margin-bottom: 12px;
}

.recipe-kitchen-btns {
  display: flex;
  gap: 8px;
}

.recipe-k-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
}

.recipe-k-btn.primary {
  background: #1e392a;
  color: #ffffff;
}

.recipe-k-btn.primary:hover {
  background: #162c20;
}

.recipe-k-btn.secondary {
  background: #ffffff;
  color: #1e392a;
  border: 1px solid #d1fae5;
}

.recipe-k-btn.secondary:hover {
  background: #e6f4ea;
}

.sidebar-footer {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  padding-left: 8px;
}

/* ==========================================
   CENTER CONTENT
   ========================================== */
.center-content {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero Banner (Compact & Sleek) */
.hero-banner {
  background: linear-gradient(105deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.hero-text {
  max-width: 520px;
  z-index: 2;
}

.hero-text h2 {
  font-size: 19px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-text p {
  font-size: 12.5px;
  color: #166534;
  font-weight: 500;
  line-height: 1.4;
}

.hero-graphic {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 32%;
  background-image: url('https://images.unsplash.com/photo-1540420773420-3366772f4999?auto=format&fit=crop&w=600&q=80');
  background-size: cover;
  background-position: center;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.7) 30%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.7) 30%, rgba(0,0,0,0) 100%);
  opacity: 0.65;
}

.hero-badge-tag {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  z-index: 3;
  white-space: nowrap;
}

/* Metric Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-green { background: #e8f7ee; color: #10b981; }
.metric-icon-amber { background: #fef3c7; color: #f59e0b; }
.metric-icon-rose  { background: #fee2e2; color: #ef4444; }
.metric-icon-blue  { background: #e0f2fe; color: #0284c7; }

.metric-data h3 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.metric-data .metric-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 3px;
}

.metric-data .metric-sub {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
}

/* ==========================================
   QUICK ACTIONS ROW (Matches Mockup)
   ========================================== */
.quick-actions-section {
  margin-top: 24px;
}

.quick-actions-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e2823;
  margin-bottom: 12px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.quick-action-card-btn {
  background: #ffffff;
  border: 1.5px solid #eae7de;
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.quick-action-card-btn:hover {
  border-color: #1e392a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 57, 42, 0.08);
}

.quick-action-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4f8f5;
  color: #1e392a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 18px;
}

.quick-action-card-btn h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e2823;
  margin-bottom: 2px;
}

.quick-action-card-btn p {
  font-size: 11px;
  color: #7a857c;
  font-weight: 500;
}

/* ==========================================
   LESS WASTE PROMO BANNER (Matches Mockup)
   ========================================== */
.less-waste-promo-card {
  margin-top: 24px;
  background: linear-gradient(105deg, #f7f9f6 0%, #edf4ee 100%);
  border: 1.5px solid #dbe6dc;
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.promo-left-details {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
}

.promo-leaf-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  color: #1e392a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 57, 42, 0.06);
}

.promo-text-wrap h3 {
  font-size: 17px;
  font-weight: 800;
  color: #1e392a;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.promo-text-wrap p {
  font-size: 12px;
  color: #556258;
  font-weight: 600;
}

.promo-right-visual {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.promo-salad-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.promo-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e392a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.promo-arrow-btn:hover {
  transform: scale(1.1);
}


.sub-green { color: #10b981; }
.sub-amber { color: #d97706; }
.sub-rose  { color: #e11d48; }
.sub-blue  { color: #059669; }

/* Inventory Card Section */
.inventory-section {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
}

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

.inventory-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.view-all-link {
  color: #059669;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Category Filter Chips */
.category-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.chip-btn.active {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  font-weight: 700;
}

.status-filter-btn {
  background: #ffffff;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-filter-btn:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.status-filter-btn.active {
  background: #1e392a;
  color: #ffffff;
  border-color: #1e392a;
  font-weight: 700;
}

/* Inventory Table */
.table-container {
  overflow-x: auto;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.inv-table th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.inv-table td {
  padding: 14px 14px;
  font-size: 13.5px;
  color: #334155;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.inv-table tr:hover td {
  background: #fafbfc;
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: #0f172a;
}

.item-thumb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #f1f5f9;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
}

.status-fresh {
  background: #dcfce7;
  color: #15803d;
}

.status-expiring {
  background: #ffedd5;
  color: #c2410c;
}

.status-low {
  background: #fef3c7;
  color: #b45309;
}

.status-expired {
  background: #fee2e2;
  color: #b91c1c;
}

.expiry-urgent {
  color: #e11d48;
  font-weight: 700;
}

.action-dots-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.action-dots-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ==========================================
   RIGHT WIDGET COLUMN
   ========================================== */
.right-column {
  width: var(--right-col-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Real-Time Date, Day, Live Clock & Location Card */
.datetime-location-card, .weather-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dtl-header, .weather-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dtl-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dtl-day-badge {
  font-size: 11.5px;
  color: #059669;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dtl-full-date {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.dtl-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dtl-live-clock {
  font-size: 14.5px;
  font-weight: 800;
  color: #1e392a;
  font-variant-numeric: tabular-nums;
  background: #f4fbf7;
  border: 1px solid #d1fae5;
  padding: 3px 8px;
  border-radius: 8px;
}

.dtl-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.dtl-loc-badge:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.dtl-loc-badge .loc-icon {
  font-size: 12px;
}

.date-part .day-name {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.date-part .date-val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.temp-part {
  text-align: right;
}

.temp-part .temp-val {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.temp-part .loc-name {
  font-size: 10px;
  color: #94a3b8;
}

.quote-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-style: italic;
  color: #475569;
  line-height: 1.4;
}

.quote-box span:first-child {
  font-size: 18px;
  color: #10b981;
  font-style: normal;
  line-height: 1;
}

/* Big Scan Barcode Action Card */
.scan-action-card {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  width: 100%;
  text-align: left;
}

.scan-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(5, 150, 105, 0.35);
}

.scan-action-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scan-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.scan-action-text h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.scan-action-text p {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 1px;
}

.scan-arrow {
  font-size: 18px;
  color: #ffffff;
}

/* Quick Action Row Cards */
.quick-link-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.quick-link-card:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.quick-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #f8fafc;
  color: #334155;
}

.quick-link-text h5 {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.quick-link-text p {
  font-size: 11px;
  color: #94a3b8;
}

.quick-arrow {
  color: #94a3b8;
  font-size: 14px;
}

/* Banner / Tip Cards */
.promo-banner {
  border-radius: 18px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
}

.promo-img {
  width: 70px;
  height: 55px;
  border-radius: 12px;
  object-fit: cover;
}

.promo-info h5 {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.promo-info p {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  margin-top: 2px;
}

.tip-card {
  background: #edf9f2;
  border: 1px solid #d1fae5;
  border-radius: 18px;
  padding: 14px 16px;
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 4px;
}

.tip-card p {
  font-size: 11.5px;
  color: #047857;
  line-height: 1.4;
}

/* ==========================================
   MINIMALIST AI SCANNER MODAL & VIEWPORT
   ========================================== */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.camera-modal.active {
  display: flex;
}

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

.scanner-mini-card {
  width: 100%;
  max-width: 490px;
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

html.dark-theme .scanner-mini-card {
  background: #141f19;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

/* Minimalist Header */
.scanner-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

html.dark-theme .scanner-mini-header {
  background: #141f19;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.scanner-mini-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

html.dark-theme .scanner-mini-title {
  color: #f8fafc;
}

.scanner-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseLiveDot 2s infinite ease-in-out;
}

@keyframes pulseLiveDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px #10b981; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Segmented Mode Selector */
.scanner-segmented-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9999px;
  gap: 2px;
}

html.dark-theme .scanner-segmented-tabs {
  background: #1c2820;
}

.scanner-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.scanner-tab.active {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.scanner-tab:hover:not(.active) {
  color: #0f172a;
}

html.dark-theme .scanner-tab:hover:not(.active) {
  color: #f8fafc;
}

.scanner-mini-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.scanner-mini-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.06);
}

html.dark-theme .scanner-mini-close {
  background: #1e2a22;
  color: #94a3b8;
}

html.dark-theme .scanner-mini-close:hover {
  background: #2a3a30;
  color: #ffffff;
}

/* Viewport Area */
.scanner-viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000000;
  overflow: hidden;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#cameraCanvas {
  display: none;
}

/* Flashlight HUD Button */
.scanner-hud-flash {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: 9999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.scanner-hud-flash:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.03);
}

.scanner-hud-flash.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #000000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* Viewfinder Laser Frame */
.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-box {
  position: absolute;
  width: 76%;
  height: 64%;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scan-box.barcode-mode {
  width: 82%;
  height: 36%;
  border-radius: 12px;
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #10b981;
  border-style: solid;
}

.corner.tl { top: -2px; left: -2px; border-width: 3.5px 0 0 3.5px; border-radius: 8px 0 0 0; }
.corner.tr { top: -2px; right: -2px; border-width: 3.5px 3.5px 0 0; border-radius: 0 8px 0 0; }
.corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3.5px 3.5px; border-radius: 0 0 0 8px; }
.corner.br { bottom: -2px; right: -2px; border-width: 0 3.5px 3.5px 0; border-radius: 0 0 8px 0; }

.scan-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 2px;
  background: #10b981;
  box-shadow: 0 0 12px 1.5px #10b981;
  animation: scanLaserLine 2.2s ease-in-out infinite;
}

@keyframes scanLaserLine {
  0% { top: 8%; opacity: 0.3; }
  50% { top: 92%; opacity: 1; }
  100% { top: 8%; opacity: 0.3; }
}

/* Floating Status & Hint in Viewfinder */
.scanner-hud-bottom {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.scanner-mini-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 9999px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.scanner-mini-hint {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Minimalist Action Dock Bar */
.scanner-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 14px 20px 8px;
  background: #ffffff;
}

html.dark-theme .scanner-dock-bar {
  background: #141f19;
}

.dock-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all 0.18s ease;
  min-width: 64px;
}

.dock-action-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

html.dark-theme .dock-action-btn:hover {
  background: #1c2820;
  color: #f8fafc;
}

/* Shutter Button */
.dock-shutter-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #10b981;
  padding: 3px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.dock-shutter-btn:hover {
  transform: scale(1.06);
}

.dock-shutter-btn:active {
  transform: scale(0.94);
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.dock-shutter-btn:hover .shutter-inner {
  background: #059669;
}

/* Micro Tip */
.scanner-mini-footer-tip {
  text-align: center;
  padding: 2px 16px 14px;
  font-size: 11px;
  color: #94a3b8;
  background: #ffffff;
}

html.dark-theme .scanner-mini-footer-tip {
  background: #141f19;
  color: #64748b;
}

/* Permission / Processing Overlays */
.permission-screen, .processing-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 24px;
}

.permission-screen.active, .processing-screen.active {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin: 0 auto 14px;
}

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

/* Backward compatibility classes */
.camera-btn {
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.capture-btn { background: #10b981; color: white; }
.upload-btn { background: #262626; color: white; border: 1px solid #404040; }
.retry-btn { background: #2563eb; color: white; }
.stop-btn { background: #991b1b; color: white; }
.full-btn { grid-column: 1 / -1; background: #262626; color: white; }

/* OCR Results Modal */
.ocr-result-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ocr-result-modal.active {
  display: flex;
}

.ocr-card {
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

#ocrText {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 90px;
  max-height: 200px;
  overflow-y: auto;
  color: #334155;
  font-family: monospace;
}

.ocr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.ocr-action {
  border: 0;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

.ocr-action.primary { background: #059669; color: white; }
.ocr-action.secondary { background: #f1f5f9; color: #334155; }

.ai-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Modals & Dialog System */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.modal-overlay.active,
.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.modal-header p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-save-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Ensure inputs, selects, and buttons inside modal sections expand across their full grid column */
.modal-card input:not([type="checkbox"]):not([type="radio"]),
.modal-card select,
.modal-card textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.modal-card .grid > div {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Responsive grid collapse for form fields: 2 cols on desktop, 1 col on <= 768px */
@media (max-width: 768px) {
  #barcodeProductForm .grid-cols-2,
  .modal-card .grid-cols-2,
  .modal-dialog .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .modal-card {
    padding: 18px 16px;
    max-width: 100%;
  }

  .modal-actions-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================
   MOBILE & DESKTOP (WINDOWS/PC) RESPONSIVE SYSTEM
   ========================================== */

/* Mobile UI Elements (hidden on PC/Desktop) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: #1e293b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
}

.mobile-menu-btn:active {
  background: #f1f5f9;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #e2e8f0;
  z-index: 990;
  padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  flex: 1;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.mobile-nav-item.active {
  color: #059669;
}

.mobile-nav-item.active svg {
  transform: scale(1.1);
  stroke: #059669;
}

.mobile-nav-add-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-top: -12px;
}

.mobile-nav-add-btn:active {
  transform: scale(0.92);
}

.mobile-nav-add-btn svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

/* Tablet Layout (<= 1100px) */
@media (max-width: 1100px) {
  .dashboard-grid {
    flex-direction: column;
    padding: 16px;
    gap: 20px;
  }
  .left-sidebar {
    width: 100%;
    order: 1;
  }
  .nav-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-link {
    padding: 8px 14px;
    font-size: 13px;
  }
  .center-content {
    order: 2;
    width: 100%;
  }
  .right-column {
    order: 3;
    width: 100%;
  }
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .app-container {
    padding-bottom: 74px; /* Space for bottom nav */
  }

  .main-topbar {
    height: 60px;
    padding: 0 16px;
  }

  .mobile-menu-btn {
    display: block;
    margin-right: 6px;
  }

  .topbar-brand {
    min-width: auto;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-info h1 {
    font-size: 16px;
  }

  .brand-info p {
    display: none;
  }

  .topbar-search {
    display: none;
  }

  .user-details {
    display: none;
  }

  .user-profile {
    padding: 2px 4px;
  }

  /* Slide-out Sidebar Drawer on Mobile */
  .left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 999;
    padding: 24px 18px;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .left-sidebar.drawer-open {
    transform: translateX(0);
  }

  .nav-group {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Bottom Navigation Visible */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Hero Banner on Mobile */
  .hero-banner {
    padding: 20px 18px;
    min-height: auto;
    border-radius: 18px;
  }

  .hero-text h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  .hero-text p {
    font-size: 12.5px;
  }

  .hero-graphic {
    display: none;
  }

  .hero-badge-tag {
    position: static;
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    padding: 4px 10px;
  }

  /* Metrics 2x2 Grid on Mobile */
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-box {
    padding: 14px 12px;
    gap: 10px;
  }

  .metric-icon-wrap {
    width: 38px;
    height: 38px;
  }

  .metric-icon-wrap svg {
    width: 20px;
    height: 20px;
  }

  .metric-data h3 {
    font-size: 20px;
  }

  .metric-label {
    font-size: 11.5px;
  }

  .metric-sub {
    font-size: 10.5px;
  }

  /* Table on Mobile */
  .table-card {
    border-radius: 16px;
    padding: 16px 12px;
  }

  .table-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .table-actions .add-btn,
  .table-actions .scan-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
  }

  .category-chips {
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .category-chips::-webkit-scrollbar {
    display: none;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .pantry-table {
    min-width: 620px;
  }

  /* Modals on Mobile */
  .modal-dialog {
    padding: 20px 16px;
    border-radius: 20px;
    max-height: 85vh;
  }
}

/* Extra Small Phones (<= 420px) */
@media (max-width: 420px) {
  .metrics-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .metric-box {
    padding: 12px 10px;
  }
}


/* ==========================================
   CUSTOM CATEGORY SELECTOR & MOTION SYSTEM
   Matches user Image 1 with animated gliding motion
   ========================================== */
.category-picker-wrapper {
  position: relative;
  width: 100%;
}

.category-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.category-select-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.category-select-trigger.active {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.category-trigger-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-thumb-img {
  width: 34px;
  height: 30px;
  object-fit: contain;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-trigger-label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.category-chevron {
  font-size: 13px;
  color: #64748b;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-select-trigger.active .category-chevron {
  transform: rotate(180deg);
}

/* Category Dropdown List Card (matches Image 1) */
.category-dropdown-card {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #b9bdc3;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 1000;
  display: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 290px;
  overflow-y: auto;
}

.category-dropdown-card.open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Moving motion sliding highlight pill */
.category-sliding-highlight {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(180deg, #6c7278 0%, #52585e 100%);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.25, 1.3, 0.45, 1), opacity 0.2s ease, border-radius 0.2s ease;
  transform: translateY(0);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 3px 10px rgba(0, 0, 0, 0.12);
}

.category-options-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.category-row-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 48px;
  min-height: 48px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.18s ease;
  user-select: none;
}

.category-row-text {
  color: #1f2937;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.18s ease, transform 0.18s ease;
}

.category-row-img {
  width: 44px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Moving hover interaction */
.category-row-option:hover {
  transform: translateX(6px);
}

.category-row-option:hover .category-row-img {
  transform: scale(1.12) rotate(2deg);
}

/* Active / Selected state (matches Image 1) */
.category-row-option.selected .category-row-text {
  color: #ffffff !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.category-row-option.selected .category-row-img {
  transform: scale(1.06);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

/* Ripple click motion */
.category-row-option:active {
  transform: scale(0.97) translateX(3px);
}

/* Trigger bounce animation on update */
@keyframes triggerPop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.category-trigger-pop {
  animation: triggerPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   RECIPE KITCHEN & SMART MATCHING STYLES
   ========================================== */
.recipe-section {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  border: 1px solid #e6e3da;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-top: 24px;
  scroll-margin-top: 20px;
}

.recipe-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.recipe-title-group h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1e392a;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-title-group p {
  font-size: 13px;
  color: #6b756e;
  margin-top: 4px;
}

.recipe-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 18px;
}

.recipe-search-input-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.recipe-search-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.recipe-search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
}

.recipe-search-input:focus {
  background: #ffffff;
  border-color: #1e392a;
  box-shadow: 0 0 0 3px rgba(30, 57, 42, 0.08);
}

.recipe-quick-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.recipe-quick-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.recipe-quick-btn.pantry-btn {
  background: #1e392a;
  color: #ffffff;
  border-color: #1e392a;
}

.recipe-quick-btn.pantry-btn:hover {
  background: #162c20;
}

/* Expiring items flame banner */
.expiring-recipes-banner {
  display: none;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.expiring-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.expiring-flame {
  font-size: 26px;
}

.expiring-text-wrap h4 {
  font-size: 14px;
  font-weight: 800;
  color: #9a3412;
  margin: 0 0 2px;
}

.expiring-text-wrap p {
  font-size: 12.5px;
  color: #c2410c;
  margin: 0;
}

.expiring-banner-btn {
  background: #ea580c;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.expiring-banner-btn:hover {
  background: #c2410c;
}

/* Category Chips Carousel */
.recipe-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.recipe-chip-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.recipe-chip-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.recipe-chip-btn.active {
  background: #1e392a;
  color: #ffffff;
  border-color: #1e392a;
  box-shadow: 0 4px 12px rgba(30, 57, 42, 0.15);
}

.chip-emoji {
  font-size: 14px;
}

/* Match count row */
.recipe-meta-status-row {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

/* Recipe Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.recipe-card {
  background: #ffffff;
  border: 1px solid #e6e3da;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.recipe-img-container {
  position: relative;
  width: 100%;
  height: 170px;
  overflow: hidden;
  background: #f1f5f9;
}

.recipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-card-img {
  transform: scale(1.04);
}

.recipe-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.match-badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.match-badge.match-high {
  background: rgba(16, 185, 129, 0.92);
  color: #ffffff;
}

.match-badge.match-med {
  background: rgba(245, 158, 11, 0.92);
  color: #ffffff;
}

.match-badge.match-low {
  background: rgba(100, 116, 139, 0.9);
  color: #ffffff;
}

.expiring-badge {
  background: rgba(239, 68, 68, 0.92);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.recipe-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}

.recipe-fav-btn:hover {
  transform: scale(1.15);
  background: #ffffff;
}

.recipe-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.recipe-card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.recipe-cuisine-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diet-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.diet-pill.veg {
  background: #ecfdf5;
  color: #047857;
}

.diet-pill.non-veg {
  background: #fef2f2;
  color: #b91c1c;
}

.recipe-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 6px;
  line-height: 1.3;
}

.recipe-card-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-ingredient-summary {
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.have-summary {
  color: #059669;
  display: flex;
  align-items: center;
  gap: 4px;
}

.missing-summary {
  color: #94a3b8;
}

.ready-summary {
  color: #059669;
  font-weight: 800;
}

.recipe-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.recipe-time-info {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-view-btn {
  background: none;
  border: none;
  color: #1e392a;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
  transition: transform 0.2s ease;
}

.recipe-view-btn:hover {
  transform: translateX(3px);
}

/* ==========================================
   RECIPE DETAIL MODAL
   ========================================== */
.recipe-detail-modal-card {
  max-width: 680px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 0;
  background: #ffffff;
}

.recipe-detail-header-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  background: #0f172a;
}

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

.recipe-detail-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease;
}

.recipe-detail-close-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.recipe-detail-body {
  padding: 24px 28px;
}

.detail-meta-pill-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.recipe-detail-body h2 {
  font-size: 24px;
  font-weight: 800;
  color: #1e392a;
  margin: 0 0 8px;
  line-height: 1.25;
}

.recipe-detail-body p.detail-desc {
  font-size: 14px;
  color: #556258;
  line-height: 1.5;
  margin-bottom: 18px;
}

.detail-progress-container {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.detail-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.detail-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.detail-progress-bar {
  height: 100%;
  background: #10b981;
  transition: width 0.4s ease;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.detail-stat-box {
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.detail-stat-box span.label {
  display: block;
  font-size: 11px;
  color: #78716c;
  font-weight: 600;
}

.detail-stat-box span.val {
  font-size: 14px;
  font-weight: 800;
  color: #1e392a;
}

.detail-nutrition-row {
  display: flex;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 24px;
  justify-content: space-around;
  text-align: center;
  font-size: 12px;
}

.detail-nutrition-row strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.detail-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e392a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-ingredients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-ing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.detail-ing-item.available {
  background: #f0fdf4;
  color: #166534;
}

.detail-ing-item.missing {
  background: #f8fafc;
  color: #64748b;
}

.ing-status.have {
  color: #059669;
  font-size: 12px;
}

.ing-status.expiring {
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}

.ing-status.missing {
  color: #94a3b8;
  font-size: 12px;
}

.detail-instructions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.detail-step-item {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
}

.step-num {
  width: 26px;
  height: 26px;
  background: #1e392a;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.detail-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
}

.detail-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: none;
}

.detail-btn.cook {
  background: #1e392a;
  color: #ffffff;
}

.detail-btn.cook:hover {
  background: #162c20;
}

.detail-btn.shopping {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.detail-btn.shopping:hover {
  background: #e2e8f0;
}

.detail-btn.fav {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.detail-btn.share {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ==========================================
   SHOPPING LIST MODAL
   ========================================== */
.shopping-modal-card {
  max-width: 480px;
  width: 90%;
  border-radius: 20px;
  padding: 24px;
  background: #ffffff;
}

.shopping-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}

.shopping-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.shopping-item-text.completed {
  text-decoration: line-through;
  color: #94a3b8;
}

.shop-add-pantry-btn {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.shop-delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 13px;
}

.shop-delete-btn:hover {
  color: #ef4444;
}

/* ==========================================================
   REAL-TIME INSIGHTS & ANALYTICS DASHBOARD
   ========================================================== */
.insights-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeIn 0.25s ease-out;
}

.insights-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.insights-title-wrap h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1e392a;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insights-title-wrap p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.insights-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: #1e392a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(30, 57, 42, 0.25);
}

.filter-pill:hover:not(.active) {
  background: #e2e8f0;
  color: #1e293b;
}

/* Smart Insights Banner */
.smart-insights-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.05);
}

.smart-insights-icon {
  font-size: 24px;
  line-height: 1;
  background: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.smart-insights-body {
  flex: 1;
}

.smart-insights-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.smart-insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #166534;
  line-height: 1.45;
}

/* 6 Key Metrics Grid */
.insights-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.insight-metric-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insight-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insight-metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.insight-metric-value {
  font-size: 26px;
  font-weight: 800;
  color: #1e392a;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.insight-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.insight-metric-sub {
  font-size: 11px;
  font-weight: 600;
}

/* Structured Section Cards */
.insights-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .insights-grid-2col {
    grid-template-columns: 1fr;
  }
}

.insight-section-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.insight-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.insight-box-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #1e392a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-stat-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
}

/* Category Distribution Chart Wrap */
.chart-container-box {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Activity Feed */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.activity-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.activity-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.activity-product-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time-stamp {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

.activity-details-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* ==========================================================
   SETTINGS SECTION STYLES
   ========================================================== */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease-out;
}

.settings-header-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.settings-nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.settings-tab-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-tab-btn.active {
  background: #1e392a;
  color: #ffffff;
  border-color: #1e392a;
}

.settings-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.settings-card-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.settings-card-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #1e392a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card-header p {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f8fafc;
  gap: 16px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label-group h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}

.settings-label-group p {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Modern Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================
   REAL-TIME ALERT CENTER SLIDE-OVER DRAWER
   ========================================================== */
.alert-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.alert-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.alert-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.alert-drawer.active {
  transform: translateX(0);
}

.alert-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.alert-drawer-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.alert-tab-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.alert-tab-btn.active {
  background: #1e392a;
  color: #ffffff;
}

.alert-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-item-card {
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  display: flex;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

.alert-item-card.unread {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.alert-item-card:hover {
  border-color: #10b981;
}

.alert-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  position: absolute;
  top: 14px;
  right: 14px;
}

/* Dark Mode Overrides */
html.dark-theme {
  --bg-page: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: #334155;
  --border-color: #1e293b;
}

html.dark-theme body {
  background: #0f172a;
  color: #f8fafc;
}

html.dark-theme .main-topbar,
html.dark-theme .left-sidebar,
html.dark-theme .right-column,
html.dark-theme .insights-header-row,
html.dark-theme .insight-section-box,
html.dark-theme .insight-metric-card,
html.dark-theme .settings-card,
html.dark-theme .settings-header-box,
html.dark-theme .alert-drawer,
html.dark-theme .alert-drawer-header {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.dark-theme .search-pill,
html.dark-theme .activity-item,
html.dark-theme .settings-tab-btn,
html.dark-theme .alert-drawer-tabs {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

html.dark-theme .alert-item-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.dark-theme .alert-item-card.unread {
  background: #132e22;
  border-color: #059669;
}


