:root {
  --xf-bg: #f5f7fb;
  --xf-surface: #ffffff;
  --xf-text: #1f2937;
  --xf-muted: #6b7280;
  --xf-border: #d9e0ea;
  --xf-primary: #2563eb;
  --xf-primary-dark: #1d4ed8;
  --xf-friendly: #0f766e;
}

.app-body {
  background: var(--xf-bg);
  color: var(--xf-text);
}

.app-navbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--xf-border);
  backdrop-filter: blur(10px);
}

.app-main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.btn {
  border-radius: 8px;
}

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

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

.page-header {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header.compact {
  margin-bottom: 1rem;
}

.page-header h1 {
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  font-weight: 750;
  margin: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--xf-friendly);
  font-size: 0.76rem;
  font-weight: 750;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.surface,
.metric-card {
  background: var(--xf-surface);
  border: 1px solid var(--xf-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  padding: 1.25rem;
}

.surface h2,
.surface-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

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

.metric-card span {
  color: var(--xf-muted);
  display: block;
  font-size: 0.85rem;
}

.metric-card strong {
  display: block;
  font-size: 1.8rem;
}

.empty-state {
  background: #f8fafc;
  border: 1px dashed var(--xf-border);
  border-radius: 8px;
  color: var(--xf-muted);
  padding: 1.25rem;
  text-align: center;
}

.list-title {
  color: var(--xf-text);
  font-size: 1.05rem;
  font-weight: 650;
  text-decoration: none;
}

.shopping-shell {
  display: grid;
  gap: 1rem;
}

.quick-add {
  position: sticky;
  top: 4.25rem;
  z-index: 5;
}

.shopping-list {
  display: grid;
  gap: 0.65rem;
}

.shopping-item {
  align-items: start;
  background: #fff;
  border: 1px solid var(--xf-border);
  border-radius: 8px;
  display: flex;
  gap: 0.8rem;
  padding: 0.85rem;
}

.shopping-item.is-complete {
  opacity: 0.68;
}

.shopping-item.is-complete .shopping-item-main span {
  color: var(--xf-muted);
  text-decoration: line-through;
}

.check-button {
  align-items: center;
  background: #fff;
  border: 2px solid var(--xf-friendly);
  border-radius: 8px;
  color: var(--xf-friendly);
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 800;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.shopping-item-body {
  flex: 1;
  min-width: 0;
}

.shopping-item-main {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.shopping-item-main span {
  font-size: 1.1rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.shopping-notes,
.loyalty-notes {
  color: var(--xf-muted);
  margin: 0.35rem 0 0;
  white-space: pre-line;
}

.wallet-card {
  color: var(--xf-text);
  overflow: hidden;
  text-decoration: none;
}

.wallet-card img {
  aspect-ratio: 16 / 9;
  background: #f8fafc;
  object-fit: contain;
  padding: 0.75rem;
}

.wallet-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.wallet-card p {
  color: var(--xf-muted);
  margin: 0;
}

.loyalty-display {
  background: #111827;
  border-radius: 8px;
  color: #fff;
  min-height: 70vh;
  padding: 1rem;
  text-align: center;
}

.loyalty-display img {
  background: #fff;
  border-radius: 8px;
  cursor: zoom-in;
  display: block;
  margin: 1rem auto;
  max-height: 72vh;
  max-width: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.loyalty-display img.zoomed {
  cursor: zoom-out;
  max-height: none;
  width: min(1400px, 140vw);
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-link {
  color: var(--xf-text);
  min-height: 150px;
  text-decoration: none;
}

.dashboard-link h2 {
  margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
  .page-header {
    display: block;
  }

  .page-actions {
    justify-content: stretch;
    margin-top: 1rem;
  }

  .page-actions .btn {
    flex: 1;
  }

  .quick-add {
    top: 3.8rem;
  }
}
