/* ============================================================
   Univey — main.css
   Source order:
     1. Shared styles  (extracted from base.html)
     2. Index page     (extracted from index.html)
     3. Owner dashboard(extracted from owner_dashboard.html)
     4. Admin          (extracted from admin.html)
   ============================================================ */

/* ── CSS Variables (Brand Colors) ────────────────────────────── */
:root {
  --color-primary: #002868;      /* Primary blue */
  --color-accent: #BF0A30;       /* Accent red */
  --color-background: #FFFFFF;   /* Background white */
  --color-text: #333333;         /* Text dark gray */
  --color-text-light: #6b7280;   /* Light gray text */
  --color-border: #e5e7eb;       /* Light border */
  --color-bg-light: #f3f4f6;     /* Light background */
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  padding: 0 1.5rem;
  position: relative;
}
.site-header .container {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand img {
  height: 32px; width: 32px; object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.3));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1rem; font-weight: 700; color: #fff; }
.brand-tag  { font-size: 0.65rem; color: rgba(255,255,255,.8); letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 0.5rem; align-items: center; }
.nav-link {
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  padding: 0.4rem 0.8rem; border-radius: 6px;
  transition: background 0.15s;
  border: none; background: none; cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-cta {
  background: transparent; color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 6px;
}
.nav-cta:hover { background: rgba(255,255,255,.12) !important; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 1.5rem;
  cursor: pointer;
  padding: .4rem .5rem;
  border-radius: 6px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.nav-toggle:hover { background: rgba(255,255,255,.12); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links  { display: none; }
  .nav-links.nav-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e3a5f;
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 200;
    padding: .5rem 0;
  }
  .nav-links.nav-open .nav-link {
    padding: .85rem 1.5rem;
    border-radius: 0;
    width: 100%;
    text-align: left;
    font-size: .9375rem;
  }
  .nav-links.nav-open .nav-cta {
    margin: .5rem 1rem .75rem;
    width: calc(100% - 2rem);
    text-align: center;
    border-radius: 8px;
  }
  .site-header .container { height: 64px; padding: 0 1rem; }
}

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-header { padding: 2.5rem 0 1.5rem; }
.page-header h1 {
  font-size: 1.85rem; font-weight: 800;
  margin: 0 0 0.4rem; color: #1a1a2e;
}
.page-header p { color: #64748b; margin: 0; font-size: 0.95rem; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1.25rem; border-radius: 8px;
  margin-bottom: 1rem; font-size: 0.9rem;
}
.alert-error  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success{ background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── Offer cards grid ────────────────────────────────────────── */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 2rem;
}
.offer-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
@media (hover: hover) {
  .offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  }
}
.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #fff; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: auto;
}
.restaurant-name {
  font-size: 1.1rem; font-weight: 700;
  color: #1a1a2e; margin: 0 0 0.2rem;
}
.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
  min-height: 28px;
}
.card-deal {
  background: #f0f6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: .9rem 1.05rem;
  margin: .65rem 0 .5rem;
}
.card-deal-title {
  font-size: .95rem; font-weight: 700;
  color: #1e40af; margin: 0 0 .35rem;
  line-height: 1.4;
}
.card-deal-price {
  font-size: 1.55rem; font-weight: 900;
  color: #16a34a; line-height: 1;
}
.card-deal-price--na {
  font-size: .85rem; font-weight: 500;
  color: #6b7280; font-style: italic;
}
.card-description {
  font-size: .875rem; color: #4a5568;
  margin: .3rem 0 0; line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-expiry { margin: .4rem 0 0; }
.offer-card .btn-group { margin-top: auto; padding-top: .85rem; }
.meta-row {
  display: flex; flex-wrap: wrap;
  gap: 0.6rem; margin: 0.5rem 0 0.75rem;
  align-items: center;
}
.rating { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.stars   { color: #f59e0b; letter-spacing: -1px; }
.rating-count { color: #9ca3af; font-size: 0.78rem; }

/* ── Score badge ─────────────────────────────────────────────── */
.score-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem; border-radius: 99px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.score-high { background: #d1fae5; color: #065f46; }
.score-mid  { background: #fef3c7; color: #92400e; }
.score-low  { background: #fee2e2; color: #991b1b; }
.score-none { background: #f1f5f9; color: #64748b; font-style: italic; font-weight: 400; }

.market-rank { font-size: 0.8rem; color: #6b7280; }
.short-insight {
  font-size: 0.85rem; color: #4a5568;
  font-style: italic; margin: 0.6rem 0 1rem;
  padding: 0.65rem 0.9rem;
  background: #f8fafc;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 6px 6px 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-group { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1.05rem; border-radius: 10px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; border: none;
  transition: background-color .15s, box-shadow .15s, transform .1s; line-height: 1;
}
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0,40,104,.15);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover  { background: #001f4d; box-shadow: 0 4px 12px rgba(0,40,104,.25); }
.btn-primary:active { background: #001a40; box-shadow: none; transform: scale(.97); }
.btn-outline { background: transparent; color: var(--color-primary); border: 1.5px solid #c4d2f0; }
.btn-outline:hover  { background: #eef3ff; border-color: var(--color-primary); }
.btn-secondary { background: var(--color-accent); color: #fff; }
.btn-secondary:hover  { background: #9d081f; box-shadow: 0 4px 12px rgba(191,10,48,.25); }
.btn-secondary:active { background: #7a0618; box-shadow: none; transform: scale(.97); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover  { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.22); }
.btn-success:active { background: #166534; box-shadow: none; transform: scale(.97); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: #9ca3af;
}
.empty-state h2 { font-size: 1.15rem; margin: 0 0 0.4rem; color: #64748b; }

/* ── Subscribe modal ─────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 14px;
  padding: 2rem; max-width: 420px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-box h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 0.3rem; }
.modal-box p  { color: #64748b; font-size: 0.88rem; margin: 0 0 1.25rem; }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.modal-input {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  font-size: 1rem; margin-top: 0.75rem;
  font-family: inherit;
}
.modal-input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30,75,184,.1);
}

/* ── Form page ───────────────────────────────────────────────── */
.form-wrap { max-width: 620px; margin: 0 auto; }
.form-card {
  background: #fff; border: 1px solid #e8edf3;
  border-radius: 14px; padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.form-card h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.3rem; }
.form-card .subtitle { color: #64748b; margin: 0 0 1.75rem; font-size: 0.9rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 0.4rem; color: #374151;
}
.required-mark { color: #dc2626; }
.form-group input,
.form-group textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  font-size: 1rem; font-family: inherit;
  color: #1a1a2e; transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30,75,184,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.8rem; color: #4b5563; margin-top: 0.3rem; }
.submit-btn { width: 100%; margin-top: 0.5rem; padding: 0.75rem; font-size: 1rem; }

/* ── Detail page ─────────────────────────────────────────────── */
.detail-header {
  background: #fff; border: 1px solid #e8edf3;
  border-radius: 14px; padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.detail-header h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 0.3rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.detail-section {
  background: #fff; border: 1px solid #e8edf3;
  border-radius: 14px; padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.detail-section-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #4b5563; margin: 0 0 0.75rem;
}
.score-display { display: flex; align-items: center; gap: 1rem; }
.score-number {
  font-size: 3.5rem; font-weight: 900; line-height: 1;
}
.score-number.score-high { color: #16a34a; }
.score-number.score-mid  { color: #d97706; }
.score-number.score-low  { color: #dc2626; }
.score-number.score-none { font-size: 1rem; font-weight: 400; color: #9ca3af; }
.score-meta p { margin: 0; color: #64748b; font-size: 0.9rem; }
.score-meta strong { color: #374151; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: #6b7280; text-decoration: none; font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--color-primary); }
.address-text { color: #64748b; font-size: 0.9rem; }
/* ── Cuisine accent system ────────────────────────────────────── */
[data-cuisine="american"] { --c-bg: #fff8f1; --c-fg: #c2410c; }
[data-cuisine="italian"]  { --c-bg: #fff1f2; --c-fg: #be123c; }
[data-cuisine="bbq"]      { --c-bg: #fffbeb; --c-fg: #a16207; }
[data-cuisine="cafe"]     { --c-bg: #fdf4e3; --c-fg: #92400e; }
[data-cuisine="dessert"]  { --c-bg: #fdf2f8; --c-fg: #9d174d; }
[data-cuisine="mexican"]  { --c-bg: #f1fdf1; --c-fg: #166534; }
[data-cuisine="asian"]    { --c-bg: #eff9fe; --c-fg: #0c4a6e; }
[data-cuisine="seafood"]  { --c-bg: #f0fdfa; --c-fg: #0f5649; }
[data-cuisine="generic"]  { --c-bg: #eef2ff; --c-fg: #1e40af; }

.type-tag {
  display: inline-block;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.2rem 0.65rem; border-radius: 99px;
}

/* ── Offer avatar ─────────────────────────────────────────────── */
.offer-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800;
  flex-shrink: 0;
  user-select: none;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.09);
}
.offer-avatar--lg {
  width: 52px; height: 52px; border-radius: 14px;
  font-size: 1.45rem;
}
.offer-photo {
  width: 40px; height: 40px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0; display: block;
  border: 1.5px solid rgba(0,0,0,.09);
}
.offer-photo--lg {
  width: 52px; height: 52px; border-radius: 14px;
}
.restaurant-identity {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0.2rem;
}
.restaurant-identity > div { min-width: 0; }
.offer-box {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.offer-box .offer-title-big {
  font-size: 1.15rem; font-weight: 700; color: #1e40af; margin: 0 0 0.4rem;
}
.offer-box .price-big {
  font-size: 2rem; font-weight: 900; color: #16a34a;
}

/* ── Owner CTA section ───────────────────────────────────────── */
.owner-cta-section {
  margin: 2.5rem 0 1rem;
}
.owner-cta-box {
  display: flex; gap: 1.25rem; align-items: flex-start;
  background: linear-gradient(135deg, #1e3a5f 0%, var(--color-primary) 100%);
  border-radius: 16px; padding: 2rem 2rem;
  box-shadow: 0 4px 20px rgba(30,58,95,.18);
}
.owner-cta-icon {
  font-size: 2.5rem; flex-shrink: 0; margin-top: .1rem;
}
.owner-cta-body { flex: 1; }
.owner-cta-heading {
  font-size: 1.2rem; font-weight: 800; color: #fff;
  margin: 0 0 .4rem;
}
.owner-cta-text {
  font-size: .9rem; color: rgba(255,255,255,.85);
  margin: 0 0 1.1rem; line-height: 1.6;
}
.owner-cta-actions {
  display: flex; gap: .75rem; flex-wrap: wrap;
}
.owner-cta-actions .btn-primary {
  background: #fff; color: #1e3a5f; border-color: #fff;
}
.owner-cta-actions .btn-primary:hover {
  background: #f0f4ff; border-color: #f0f4ff;
}
.owner-cta-actions .btn-outline {
  color: #fff; border-color: rgba(255,255,255,.6);
}
.owner-cta-actions .btn-outline:hover {
  background: rgba(255,255,255,.12); border-color: #fff;
}
@media (max-width: 500px) {
  .owner-cta-box { flex-direction: column; gap: .75rem; padding: 1.5rem 1.25rem; }
  .owner-cta-actions { flex-direction: column; }
  .owner-cta-actions .btn-primary,
  .owner-cta-actions .btn-outline { text-align: center; }
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid #e2e8f0; margin-top: 2rem;
  background: #f8fafc; padding: 2rem 1rem;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  text-align: center;
}
.footer-tagline {
  color: #4b5563; font-size: .875rem; margin: 0;
}
.footer-links {
  display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center;
}
.footer-links a {
  color: var(--color-primary); font-size: .83rem; text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-legal {
  color: #9ca3af; font-size: .78rem; margin: 0;
}

/* ── Responsive — shared ─────────────────────────────────────── */
@media (max-width: 640px) {
  .offers-grid    { grid-template-columns: 1fr; }
  .form-row       { grid-template-columns: 1fr; }
  .page-header    { padding: 1rem 0 .75rem; }
  .page-header h1 { font-size: 1.3rem; }
  .page-header p  { font-size: .875rem; }
  .container      { padding: 0 1rem; }
  .form-card      { padding: 1.25rem; }
  .detail-header  { padding: 1.25rem; }
  .detail-section { padding: 1.25rem; }
  .score-display  { flex-direction: column; align-items: flex-start; }
  .score-number   { font-size: 2.5rem; }
  .detail-header h1 { font-size: 1.3rem; }
  .offer-card     { padding: 1rem; }
  .card-deal      { padding: .7rem .85rem; }
}

/* ── Index page ──────────────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-items: flex-end;
  background: #fff; border: 1px solid #e8edf3;
  border-radius: 12px; padding: 1rem 1.25rem;
  margin: 1.5rem 0 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.filter-group { display: flex; flex-direction: column; gap: .25rem; }
.filter-label { font-size: .72rem; font-weight: 700; color: #4b5563; text-transform: uppercase; letter-spacing: .04em; }
.filter-bar select,
.filter-bar input[type="text"] {
  padding: .4rem .7rem; border: 1.5px solid #d1d5db; border-radius: 8px;
  font-size: 1rem; font-family: inherit; color: #1a1a2e;
  min-width: 130px; min-height: 40px;
}
.filter-bar select:focus,
.filter-bar input:focus { outline: none; border-color: var(--color-primary); }
.filter-actions { display: flex; gap: .4rem; align-items: flex-end; margin-left: auto; }
@media (max-width: 640px) {
  .filter-bar { padding: .75rem; }
  .filter-group { width: 100%; }
  .filter-bar select,
  .filter-bar input[type="text"] { width: 100%; min-width: unset; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .btn { flex: 1; justify-content: center; }
  .card-deal-price { font-size: 1.35rem; }
}
.expiry-badge { display:inline-block; font-size:.75rem; font-weight:600; color:#d97706; background:#fef3c7; padding:.1rem .45rem; border-radius:99px; }
.location-text { font-size:.78rem; color:#6b7280; margin:.15rem 0 0; }

/* ── Upload area ──────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.upload-area:focus-within {
  border-color: var(--color-primary);
  background: #eef3ff;
}

/* ── Card image (marketplace) ─────────────────────────────────── */
.card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  margin: .6rem 0 .65rem;
  flex-shrink: 0;
  position: relative;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}
.results-count { font-size:.8rem; color:#9ca3af; margin:.35rem 0 0; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 0 2.5rem;
}
.pagination-info { font-size:.875rem; color:#6b7280; font-weight:500; }

/* ── Filter toggle (mobile collapsible) ──────────────────────── */
.filter-toggle-bar { display: none; }
@media (max-width: 640px) {
  .filter-toggle-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin: .75rem 0 .4rem;
  }
  .filter-panel { display: none; }
  .filter-panel--open { display: block; }
}
.filter-toggle-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600;
  border: 1.5px solid #d1d5db; background: #fff;
  color: #374151; cursor: pointer; font-family: inherit;
}
.filter-toggle-btn:active { background: #f1f5f9; }
.filter-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 1;
}

/* ── Detail page top actions bar ─────────────────────────────── */
.detail-top-actions {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem; margin-bottom: .5rem;
}

/* ── Owner dashboard ─────────────────────────────────────────── */
.dash-stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:1rem; margin-bottom:2rem; }
.dash-stat { background:#fff; border:1px solid #e8edf3; border-radius:12px; padding:1.1rem; text-align:center; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.dash-stat-num { font-size:2rem; font-weight:900; line-height:1; }
.dash-stat-lbl { font-size:.72rem; color:#9ca3af; margin-top:.3rem; text-transform:uppercase; letter-spacing:.04em; }
.offers-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.offers-table th { text-align:left; padding:.55rem .75rem; background:#f8fafc; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:#6b7280; border-bottom:2px solid #e2e8f0; white-space:nowrap; }
.offers-table td { padding:.65rem .75rem; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.offers-table tr:last-child td { border-bottom:none; }

/* Status badges — shared between owner dashboard and admin.
   Note: original owner_dashboard.html used padding:.18rem .6rem;
   original admin.html used padding:.15rem .55rem. Consolidated to
   dashboard's values (.18rem .6rem). Admin badges gain ~0.5px
   vertical padding — visually imperceptible. */
.badge { display:inline-block; padding:.18rem .6rem; border-radius:99px; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.badge-pending  { background:#fef3c7; color:#92400e; }
.badge-approved { background:#d1fae5; color:#065f46; }
.badge-rejected { background:#fee2e2; color:#991b1b; }

/* ── Admin ───────────────────────────────────────────────────── */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:1rem; margin-bottom:2rem; }
.stat-box  { background:#fff; border:1px solid #e8edf3; border-radius:12px; padding:1.1rem; text-align:center; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.stat-num  { font-size:2rem; font-weight:900; line-height:1; }
.stat-lbl  { font-size:.72rem; color:#9ca3af; margin-top:.3rem; text-transform:uppercase; letter-spacing:.04em; }
.section-card { background:#fff; border:1px solid #e8edf3; border-radius:14px; padding:1.5rem; margin-bottom:2rem; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.section-title { font-size:1rem; font-weight:800; margin:0 0 1.25rem; }
.atw { overflow-x:auto; }
.at { width:100%; border-collapse:collapse; font-size:.83rem; }
.at th { text-align:left; padding:.55rem .75rem; background:#f8fafc; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:#6b7280; border-bottom:2px solid #e2e8f0; white-space:nowrap; }
.at td { padding:.6rem .75rem; border-bottom:1px solid #f1f5f9; vertical-align:top; max-width:180px; word-break:break-word; }
.at tr:last-child td { border-bottom:none; }
.at tr:hover td { background:#fafbfc; }
.af { display:inline; }
.ab { padding:.22rem .6rem; font-size:.75rem; border-radius:6px; border:none; cursor:pointer; font-weight:600; line-height:1.4; margin-right:.2rem; }
.ab-approve { background:#d1fae5; color:#065f46; }
.ab-approve:hover { background:#a7f3d0; }
.ab-reject  { background:#fee2e2; color:#991b1b; }
.ab-reject:hover  { background:#fecaca; }
.ab-pending { background:#f1f5f9; color:#475569; }
.ab-pending:hover { background:#e2e8f0; }

/* Reject form — always-visible block inside the actions cell */
.reject-form {
  display: block;
  margin-top: .3rem;
  white-space: normal;
}
/* Reason text input inside the reject form */
.reject-reason-input {
  display: block;
  width: 100%;
  min-width: 140px;
  padding: .25rem .5rem;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  font-size: .75rem;
  font-family: inherit;
  margin-bottom: .25rem;
  box-sizing: border-box;
}
.reject-reason-input:focus {
  outline: none;
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248,113,113,.2);
}

/* ── Owner dashboard — rejection feedback ────────────────────── */
/* Rejection reason shown to owner under the rejected badge */
.rejection-reason-text {
  font-size: .72rem;
  color: #991b1b;
  font-style: italic;
  margin: .25rem 0 .1rem;
}

/* ── Food Transparency — offer form fieldset ─────────────────── */
.transparency-fieldset {
  border: 1px solid #d1fae5;
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  background: #f0fdf4;
  margin: 1.5rem 0 1.25rem;
}
.transparency-fieldset-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #166534;
  margin: 0 0 .35rem;
}

/* ── Food Transparency — detail page display ─────────────────── */
.transparency-intro {
  font-size: .82rem;
  color: #6b7280;
  margin: 0 0 1rem;
  font-style: italic;
}
.transparency-row {
  padding: .75rem 0;
  border-top: 1px solid #e5e7eb;
}
.transparency-row--last { border-bottom: none; }
.transparency-row-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #4b5563;
  margin: 0 0 .25rem;
}
.transparency-row-value {
  font-size: .9rem;
  color: #374151;
  margin: 0;
  line-height: 1.6;
  white-space: pre-line;
}

/* ── Food Transparency badge — listing card ──────────────────── */
.card-ft-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .5rem;
  padding: .4rem .65rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  margin-top: .55rem;
}
.card-ft-score {
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}
.card-ft-label {
  font-size: .72rem;
  color: #6b7280;
}
/* colour variants — reuses same nova-* classes */
.card-ft-badge.nova-high     { background: #f0fdf4; border-color: #bbf7d0; }
.card-ft-badge.nova-high     .card-ft-score { color: #16a34a; }
.card-ft-badge.nova-mid      { background: #fffbeb; border-color: #fde68a; }
.card-ft-badge.nova-mid      .card-ft-score { color: #d97706; }
.card-ft-badge.nova-moderate { background: #fff7ed; border-color: #fed7aa; }
.card-ft-badge.nova-moderate .card-ft-score { color: #ea580c; }
.card-ft-badge.nova-low      { background: #fef2f2; border-color: #fecaca; }
.card-ft-badge.nova-low      .card-ft-score { color: #dc2626; }
.card-ft-badge.nova-ultra    { background: #fef2f2; border-color: #fecaca; }
.card-ft-badge.nova-ultra    .card-ft-score { color: #991b1b; }

/* ── NOVA processing score — detail page ─────────────────────── */
.nova-score-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .85rem;
  background: #f8fafc;
}
.nova-score-left {
  display: flex;
  align-items: baseline;
  gap: .15rem;
  flex-shrink: 0;
}
.nova-score-number {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1;
  color: #374151;
}
.nova-score-denom {
  font-size: 1rem;
  font-weight: 600;
  color: #9ca3af;
  align-self: flex-end;
  margin-bottom: .2rem;
}
.nova-score-right  { flex: 1; min-width: 0; }
.nova-score-label  { font-size: .95rem; font-weight: 700; color: #374151; margin: 0 0 .2rem; }
.nova-score-sublabel {
  font-size: .72rem; color: #9ca3af; margin: 0;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Score colour variants — applied to the card AND the progress fill */
.nova-high     .nova-score-number { color: #16a34a; }
.nova-mid      .nova-score-number { color: #d97706; }
.nova-moderate .nova-score-number { color: #ea580c; }
.nova-low      .nova-score-number { color: #dc2626; }
.nova-ultra    .nova-score-number { color: #991b1b; }

.nova-score-card.nova-high     { background: #f0fdf4; border-color: #bbf7d0; }
.nova-score-card.nova-mid      { background: #fffbeb; border-color: #fde68a; }
.nova-score-card.nova-moderate { background: #fff7ed; border-color: #fed7aa; }
.nova-score-card.nova-low      { background: #fef2f2; border-color: #fecaca; }
.nova-score-card.nova-ultra    { background: #fef2f2; border-color: #fecaca; }

/* Progress bar */
.nova-progress-wrap  { margin-bottom: 1rem; }
.nova-progress-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .35rem;
}
.nova-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: #9ca3af;
  transition: width .4s ease;
}
.nova-progress-fill.nova-high     { background: #16a34a; }
.nova-progress-fill.nova-mid      { background: #d97706; }
.nova-progress-fill.nova-moderate { background: #ea580c; }
.nova-progress-fill.nova-low      { background: #dc2626; }
.nova-progress-fill.nova-ultra    { background: #991b1b; }

.nova-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: #9ca3af;
}

/* Disclaimer */
.nova-disclaimer {
  font-size: .75rem;
  color: #9ca3af;
  font-style: italic;
  line-height: 1.55;
  margin: 1rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid #e5e7eb;
}

/* ── AI analysis panel ────────────────────────────────────────── */
.ai-panel {
  border-radius: 10px;
  padding: .75rem 1rem;
  margin: .75rem 0;
  font-size: .875rem;
  line-height: 1.5;
}
.ai-panel--loading {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.ai-panel--done {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.ai-panel--error {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
}
.ai-status {
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.ai-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .45rem;
}
.ai-tag {
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

/* Spinner */
.ai-spinner {
  display: inline-block;
  width: .9rem;
  height: .9rem;
  border: 2px solid #bfdbfe;
  border-top-color: #1e40af;
  border-radius: 50%;
  animation: ai-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* ── Transparency confirmation group ──────────────────────────── */
.transparency-confirm-group {
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: .85rem 1rem;
  background: #f0fdf4;
  margin-top: .5rem;
}

/* ── Meal score questions ─────────────────────────────────────── */
.meal-score-questions {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .85rem 1rem;
  background: #f8fafc;
  margin: .75rem 0;
}
.meal-score-questions-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin: 0 0 .75rem;
}
.msq-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .6rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.msq-row:last-child { border-bottom: none; }
.msq-question {
  font-size: .875rem;
  color: #1e293b;
  line-height: 1.45;
}
.msq-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.msq-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
}
.msq-label input[type="radio"] {
  accent-color: var(--color-primary);
  width: .95rem;
  height: .95rem;
}

/* ── About score expandable ───────────────────────────────────── */
.about-score {
  margin: .85rem 0 .5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.about-score summary {
  padding: .6rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.about-score summary::-webkit-details-marker { display: none; }
.about-score summary::before {
  content: '▸ ';
  font-size: .75rem;
}
.about-score[open] summary::before { content: '▾ '; }
.about-score-body {
  padding: .1rem .85rem .75rem;
  font-size: .8rem;
  color: #4b5563;
  line-height: 1.55;
}
.about-score-body p { margin: .45rem 0; }
.about-score-body ul {
  margin: .35rem 0 .45rem 1.1rem;
  padding: 0;
}
.about-score-body li { margin-bottom: .2rem; }

/* ── Trust indicators ─────────────────────────────────────────── */
.trust-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .85rem;
  margin: .6rem 0 0;
}
.trust-indicator {
  font-size: .78rem;
  color: #166534;
  font-weight: 600;
}

/* ── Card badge disclaimer line ───────────────────────────────── */
.card-ft-disclaimer {
  display: block;
  font-size: .68rem;
  color: #9ca3af;
  margin-top: .2rem;
  font-style: italic;
}

/* ── Transparency intro preamble ──────────────────────────────── */
.transparency-intro {
  font-size: .83rem;
  color: #4b5563;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: .65rem .85rem;
  margin: 0 0 .85rem;
  line-height: 1.5;
}

/* ── Card transparency strip (no score) ───────────────────────── */
.card-transparency-strip {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .55rem .7rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  margin: .4rem 0;
}
.card-transparency-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #0369a1;
  margin-bottom: .1rem;
}
.card-transparency-item {
  font-size: .78rem;
  color: #0c4a6e;
}

/* ── Detail page: transparency subtitle ──────────────────────── */
.transparency-subtitle {
  font-size: .8rem;
  color: #6b7280;
  margin: -.4rem 0 .85rem;
  font-style: italic;
}

/* ── Detail page: TMR trust bar ──────────────────────────────── */
.tmr-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .85rem;
  padding: .5rem .7rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: .85rem;
}
.tmr-trust-item {
  font-size: .8rem;
  color: #166534;
  font-weight: 600;
}

/* ── AI insights list ─────────────────────────────────────────── */
.ai-insights-list {
  margin: .25rem 0 0 1.1rem;
  padding: 0;
  font-size: .875rem;
  color: #374151;
  line-height: 1.6;
}
.ai-insights-list li {
  margin-bottom: .2rem;
}

/* ── Reaction buttons ─────────────────────────────────────────── */
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .12s, box-shadow .12s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.reaction-btn:hover:not(:disabled):not(.reacted) {
  transform: scale(1.05);
}
.reaction-btn:active:not(:disabled) {
  transform: scale(.96);
}
.reaction-emoji { font-size: .9rem; line-height: 1; }
.reaction-label {
  font-size: .72rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.reaction-count {
  font-size: .68rem;
  font-weight: 700;
  color: #6b7280;
  min-width: .7rem;
}
.reaction-btn.reacted .reaction-label { color: #92400e; }
.reaction-btn.reacted .reaction-count { color: #a16207; }

/* Food reaction — overlaps bottom of image via negative margin */
.reaction-btn--food {
  display: flex;
  margin-top: -.6rem;
  margin-left: .5rem;
  margin-bottom: .3rem;
  padding: .28rem .6rem .28rem .45rem;
  background: rgba(255,255,255,.95);
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
  position: relative;
  z-index: 1;
}
.reaction-btn--food:hover:not(:disabled):not(.reacted) {
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
}
.reaction-btn--food.reacted {
  background: #fef9c3;
}
/* Price reaction — inline with price */
.card-deal-price-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.reaction-btn--price {
  padding: .2rem .55rem .2rem .4rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.reaction-btn--price:hover:not(:disabled):not(.reacted) {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.reaction-btn--price.reacted {
  background: #fef9c3;
  border-color: #fde68a;
}

/* Ingredients reaction — outlined, detail page */
.reaction-btn--ingredients {
  display: flex;
  padding: .38rem .8rem;
  background: #fff;
  border: 1.5px solid #d1d5db;
  margin-top: .5rem;
}
.reaction-btn--ingredients .reaction-label { font-size: .8rem; }
.reaction-btn--ingredients:hover:not(:disabled):not(.reacted) {
  border-color: #86efac;
  background: #f0fdf4;
}
.reaction-btn--ingredients.reacted {
  border-color: #86efac;
  background: #f0fdf4;
}

@media (max-width: 480px) {
  .reaction-btn--food   { padding: .3rem .55rem .3rem .4rem; }
  .reaction-btn--price  { padding: .22rem .5rem .22rem .38rem; }
  .reaction-btn--ingredients { padding: .4rem .75rem; }
  .reaction-label { font-size: .7rem; }
}
