:root {
  --bg-primary: #f2f2f7;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-secondary: #ffffff;
  --text-primary: #000000;
  --text-secondary: #6e6e73;
  --text-tertiary: #8e8e93;
  --border-color: rgba(0, 0, 0, 0.08);

  --accent: #007aff;
  --accent-light: rgba(0, 122, 255, 0.12);
  --danger: #ff3b30;
  --danger-light: rgba(255, 59, 48, 0.12);
  --warning: #ff9500;
  --warning-light: rgba(255, 149, 0, 0.12);
  --success: #34c759;
  --success-light: rgba(52, 199, 89, 0.12);
  --freezer: #5856d6;
  --fridge: #007aff;
  --pantry: #ff9500;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-card: rgba(28, 28, 30, 0.85);
  --bg-secondary: #1c1c1e;
  --text-primary: #ffffff;
  --text-secondary: #98989d;
  --text-tertiary: #636366;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* Outer Wrapper */
.app-outer-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
}

/* Web App Main Container (Pure Web - No Phone Frame) */
.web-app-container,
.simulator-container {
  width: 100%;
  max-width: 620px;
  min-height: 100vh;
  background: var(--bg-primary);
  border: none;
  border-radius: 0;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 621px) {
  .web-app-container,
  .simulator-container {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
}

.notif-toast-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

[data-theme="dark"] .brand-logo-img {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.brand-row:hover .brand-logo-img {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.brand-text-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin: 0;
}

[data-theme="dark"] .brand-name {
  background: linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tab-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 122, 255, 0.2);
  line-height: 1.4;
  transition: all 0.2s ease;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  transition: all 0.2s ease;
  font-size: 16px;
}

.icon-btn:hover {
  transform: scale(1.05);
}

/* In-App Notification Toast */
.notif-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  width: calc(100% - 32px);
  max-width: 560px;
  background: rgba(30, 30, 32, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 350;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.notif-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a1a1a6;
}

.notif-title {
  font-weight: 600;
  font-size: 14px;
}

.notif-body {
  font-size: 13px;
  color: #d1d1d6;
}

.notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.notif-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: background 0.2s;
}

.notif-btn.consumed {
  background: var(--success);
}

/* App Scrollable Content */
.content-area {
  flex: 1;
  width: 100%;
  padding: 14px 16px 86px;
  box-sizing: border-box;
}

/* Dashboard Summary Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.metric-card:active {
  transform: translateY(0) scale(0.98);
}

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

.metric-3d-icon-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.metric-card:hover .metric-3d-icon-wrap {
  transform: scale(1.15) rotate(-3deg);
}

.metric-3d-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.metric-count {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card.expired { color: var(--danger); }
.metric-card.expired.active {
  border-color: #FF3B30;
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.12) 0%, rgba(255, 59, 48, 0.04) 100%);
  box-shadow: 0 4px 14px rgba(255, 59, 48, 0.25);
}

.metric-card.expiring { color: var(--warning); }
.metric-card.expiring.active {
  border-color: #FF9500;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12) 0%, rgba(255, 149, 0, 0.04) 100%);
  box-shadow: 0 4px 14px rgba(255, 149, 0, 0.25);
}

.metric-card.fresh { color: var(--success); }
.metric-card.fresh.active {
  border-color: #34C759;
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(52, 199, 89, 0.04) 100%);
  box-shadow: 0 4px 14px rgba(52, 199, 89, 0.25);
}

.chip-3d-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

/* Storage Filter Chips */
.storage-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.storage-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Search Bar */
.search-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Food Items List */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.food-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

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

/* Storage Card & Long-Press Styles */
.storage-card {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.storage-card:active {
  transform: scale(0.98);
  background-color: rgba(0, 122, 255, 0.06);
  border-color: var(--accent);
}

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

.storage-hint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 122, 255, 0.07);
  border: 1px dashed rgba(0, 122, 255, 0.3);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.food-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.food-icon:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.food-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.food-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.food-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.expired { background: var(--danger-light); color: var(--danger); }
.status-badge.expiring { background: var(--warning-light); color: var(--warning); }
.status-badge.fresh { background: var(--success-light); color: var(--success); }

/* Card Action Buttons */
.card-actions {
  display: flex;
  gap: 6px;
}

.action-pill-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: transform 0.15s;
}

.action-pill-btn:hover {
  transform: scale(1.1);
}

.btn-consume { background: var(--success-light); color: var(--success); }
.btn-discard { background: var(--danger-light); color: var(--danger); }
.btn-cart { background: var(--warning-light); color: var(--warning); }

/* Bottom Tab Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 620px;
  height: 70px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 8px;
  z-index: 90;
  box-sizing: border-box;
}

[data-theme="dark"] .tab-bar {
  background: rgba(28, 28, 30, 0.92);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-item .tab-icon-3d {
  width: 28px;
  height: 28px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  filter: grayscale(35%) opacity(0.72);
}

.tab-item:hover .tab-icon-3d {
  transform: translateY(-2px) scale(1.08);
  filter: grayscale(10%) opacity(0.95);
}

.tab-item.active {
  color: var(--accent);
  font-weight: 700;
}

.tab-item.active .tab-icon-3d {
  transform: translateY(-3px) scale(1.15);
  filter: grayscale(0%) opacity(1) drop-shadow(0 4px 10px rgba(0, 122, 255, 0.35));
}

/* Modals / Action Sheets */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open,
.modal-overlay.show {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 620px;
  background: var(--bg-secondary);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 34px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

/* Food Icon Selector Row */
.icon-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.current-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.15);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.current-icon-box:hover {
  transform: scale(1.05);
}

.icon-selector-info {
  flex: 1;
}

.icon-selector-btn {
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

/* Icon Picker Modal / Drawer */
.icon-categories-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.icon-categories-tabs::-webkit-scrollbar { display: none; }

.icon-category-tab {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.icon-category-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-primary);
  border-radius: 14px;
  margin-bottom: 12px;
}

.icon-grid-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.icon-grid-btn:hover {
  transform: scale(1.18);
  border-color: var(--accent);
  background: var(--accent-light);
}

.custom-emoji-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-primary);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.custom-emoji-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.quick-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.quick-tool-card {
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.quick-tool-card:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

/* Statistics Tab Styling */
.stats-banner {
  background: linear-gradient(135deg, #34c759, #30b0c7);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(52, 199, 89, 0.25);
}

.stats-saved-amount {
  font-size: 36px;
  font-weight: 800;
  margin: 6px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.stats-card-val {
  font-size: 24px;
  font-weight: 700;
}

/* Shopping List Styles */
.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.shopping-item.done span {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* User Profile & Authentication Styles */
.user-profile-btn {
  font-size: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.user-profile-btn.logged-in {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(88, 86, 214, 0.15));
  border-color: var(--accent);
}

.auth-sheet {
  max-height: 88vh;
  overflow-y: auto;
}

.auth-tabs {
  display: flex;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.social-login-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.social-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.social-auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.social-auth-btn:active {
  transform: translateY(1px);
}

.social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-line {
  background: #06C755;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.25);
}

.btn-facebook {
  background: #1877F2;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

.btn-apple {
  background: #000000;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-apple {
  background: #ffffff;
  color: #000000;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-error-msg {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.12);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-demo-auth {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.btn-guest-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

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

/* User Profile Modal & Cards */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.profile-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.profile-user-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-user-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.sync-status-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-radius: 10px;
  font-size: 12px;
  margin-top: 8px;
}

.btn-logout {
  width: 100%;
  padding: 12px;
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
}

/* App Outer Wrapper */
.app-outer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Android Simulator Mode */
.simulator-container.android-mode {
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 10px #2a2c30, 0 0 0 12px rgba(255, 255, 255, 0.15);
}

.simulator-container.android-mode .status-bar {
  height: 42px;
  padding: 0 20px;
  font-size: 13px;
  font-family: "Roboto", sans-serif;
}

/* Punch-hole camera instead of dynamic island */
.simulator-container.android-mode .dynamic-island {
  width: 14px;
  height: 14px;
  top: 14px;
  background: #000000;
  border-radius: 50%;
  padding: 0;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3);
}

.simulator-container.android-mode .dynamic-island span {
  display: none;
}

/* Android Material 3 Navigation Bar adaptation */
.simulator-container.android-mode .tab-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 6px 12px;
}

.simulator-container.android-mode .tab-item {
  border-radius: 16px;
}

.simulator-container.android-mode .tab-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.android-nav-pill-wrapper {
  height: 18px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
}

.android-nav-pill {
  width: 72px;
  height: 4px;
  background: var(--text-secondary);
  border-radius: 4px;
  opacity: 0.6;
}

/* Multi-pack Badge in Food List */
.badge-multi-pack {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 11px;
}

/* Consume Food Modal Styles */
.consume-sheet {
  max-width: 440px;
}

.consume-item-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-primary);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.stock-pill {
  display: inline-block;
  background: rgba(52, 199, 89, 0.12);
  color: #34C759;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
}

.consume-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.consume-quick-chips .chip {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consume-quick-chips .chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.consume-quick-chips .chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.consume-stepper-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px 14px;
  margin-top: 10px;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.08);
}

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

.stepper-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 50px;
  justify-content: center;
}

.stepper-number {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.stepper-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.consume-summary-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="dark"] .consume-summary-card {
  background: rgba(255, 255, 255, 0.03);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.highlight-deduct {
  font-weight: 700;
  color: #FF9500;
}

.highlight-remain {
  font-weight: 700;
  color: #34C759;
}

.highlight-remain.empty {
  color: var(--danger);
}

.btn-confirm-consume {
  background: linear-gradient(135deg, #34C759 0%, #28A745 100%);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(40, 167, 69, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-confirm-consume:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(40, 167, 69, 0.45);
}

.action-text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  transition: color 0.2s;
}

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

/* ============================================================
   PIN Lock & Security System Styles
============================================================ */
.pin-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 48px 24px 28px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 0;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease;
}

[data-theme="dark"] .pin-unlock-overlay {
  background: rgba(22, 22, 26, 0.96);
}

.pin-unlock-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 6px;
}

.pin-brand {
  margin-bottom: 12px;
}

.pin-brand-img {
  width: 130px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.22);
  background: #ffffff;
  padding: 6px;
  display: block;
  margin: 0 auto;
}

.pin-app-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.pin-app-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.pin-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.pin-avatar {
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.pin-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.pin-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.pin-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin: 16px 0 8px;
  justify-content: center;
}

.pin-dots .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.pin-dots .dot.filled {
  background: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
}

.pin-dots .dot.error {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.pin-dots.shake {
  animation: pinShake 0.4s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-12px); }
  40%, 80% { transform: translateX(12px); }
}

.pin-error-text {
  min-height: 20px;
  font-size: 12px;
  color: var(--danger);
  font-weight: 600;
  text-align: center;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.pin-key {
  aspect-ratio: 1;
  max-width: 66px;
  max-height: 66px;
  margin: 0 auto;
  width: 100%;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(0.92);
}

.pin-key.pin-action-key {
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}

.pin-key.pin-action-key:active {
  color: var(--text-primary);
  background: rgba(0,0,0,0.06);
}

.pin-footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.pin-text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s;
}

.pin-text-btn:hover {
  color: var(--danger);
}

.pin-setup-sheet {
  max-width: 440px;
}

.pin-setup-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pin-setup-prompt {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 10px;
  line-height: 1.4;
}

.security-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.security-status-badge.enabled {
  background: rgba(52, 199, 89, 0.14);
  color: #34C759;
}

.security-status-badge.disabled {
  background: rgba(142, 142, 147, 0.14);
  color: var(--text-secondary);
}

/* ==========================================================================
   MINIMUM STOCK ALERT & LOW STOCK BADGES
   ========================================================================== */

/* Low Stock Warning Badge on Food Item Card */
.badge-low-stock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 149, 0, 0.15);
  color: #D97706;
  border: 1px solid rgba(255, 149, 0, 0.35);
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 11px;
  animation: pulse-subtle 2s infinite ease-in-out;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

/* Low Stock Alert Banner on Dashboard */
.low-stock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 59, 48, 0.08));
  border: 1px solid rgba(255, 149, 0, 0.3);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.low-stock-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
  border-color: rgba(255, 149, 0, 0.5);
}

.low-stock-banner.active {
  background: linear-gradient(135deg, #FF9500, #F59E0B);
  color: #FFFFFF;
  border-color: #D97706;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.low-stock-banner.active .low-stock-title,
.low-stock-banner.active .low-stock-sub {
  color: #FFFFFF;
}

.low-stock-banner.active .low-stock-count-badge {
  background: #FFFFFF;
  color: #D97706;
}

.low-stock-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.low-stock-icon {
  font-size: 22px;
  line-height: 1;
}

.low-stock-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.low-stock-title {
  font-size: 13px;
  font-weight: 700;
  color: #B45309;
}

.low-stock-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.low-stock-count-badge {
  background: #FF9500;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Consume Modal Min-Stock Settings & Alert */
.min-stock-setting-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.low-stock-alert-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 149, 0, 0.12);
  border: 1px solid rgba(255, 149, 0, 0.3);
  color: #D97706;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}

.min-stock-field-group {
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
}




