/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brown-dark:   #2c1810;
  --brown-mid:    #6f4e37;
  --brown-light:  #9b6b47;
  --beige-bg:     #faf8f5;
  --beige-card:   #ffffff;
  --beige-border: #f0ebe5;
  --text-main:    #2c1810;
  --text-muted:   #777;
  --text-subtle:  #aaa;
  --chip-high-bg: #2c1810;
  --chip-high-fg: #f5e6d3;
  --chip-mid-bg:  #9b6b47;
  --chip-mid-fg:  #ffffff;
  --chip-low-bg:  #e8e0d8;
  --chip-low-fg:  #999;
}

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--beige-bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brown-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--brown-dark);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-brand {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px;
  color: #f5e6d3;
  font-weight: 600;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-brand:hover { text-decoration: none; color: #fff; }

.site-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 7px;
}

.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a { color: #b89070; font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: #f5e6d3; text-decoration: none; }

/* ─── Main & Footer ─────────────────────────────────────────────────────── */
.site-main { flex: 1; padding: 40px 24px 60px; }

.site-footer {
  background: var(--brown-dark);
  color: #6b4f3a;
  font-size: 12px;
  text-align: center;
  padding: 20px 24px;
}
.site-footer a { color: #9b6b47; }

.appstore-badge { display: inline-block; margin-bottom: 12px; opacity: 1; transition: opacity .15s; }
.appstore-badge:hover { opacity: .8; text-decoration: none; }
.appstore-badge-img { height: 44px; display: block; }

/* ─── Landing ───────────────────────────────────────────────────────────── */
.landing-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 180px);
  padding: 20px;
}

.landing-card {
  background: var(--beige-card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(44,24,16,.09);
  padding: 56px 48px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.landing-icon { margin-bottom: 16px; line-height: 1; }

.landing-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
}

.landing-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--brown-dark);
  line-height: 1.2;
  margin-bottom: 20px;
}

.landing-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}
.landing-tagline--subtle { font-size: 13px; color: var(--text-subtle); margin-bottom: 28px; }

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--brown-dark);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  text-decoration: none;
}
.btn-google:hover {
  box-shadow: 0 2px 8px rgba(44,24,16,.12);
  border-color: #bbb;
  text-decoration: none;
}

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

.gsi-wrapper { display: flex; justify-content: center; margin-bottom: 12px; }
.auth-error { background: #fee2e2; color: #7f1d1d; font-size: 13px; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-subtle); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--beige-border);
}

.email-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.email-input, .otp-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 15px; font-family: inherit; outline: none; transition: border-color .15s;
}
.email-input:focus, .otp-input:focus { border-color: var(--brown-mid); }
.otp-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-family: monospace; }
.btn-email {
  width: 100%; padding: 10px 14px; background: var(--brown-dark); color: #f5e6d3;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: opacity .15s;
}
.btn-email:hover { opacity: .85; }
.otp-form { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 0; }
.landing-fine-print { margin-top: 4px; font-size: 12px; color: var(--text-subtle); }

/* ─── Status Pages (pending / declined) ─────────────────────────────────── */
.status-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 180px);
}

.status-card {
  background: var(--beige-card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(44,24,16,.09);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.status-icon { font-size: 40px; margin-bottom: 16px; }

.status-card h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 24px;
  color: var(--brown-dark);
  margin-bottom: 16px;
}

.status-card p { font-size: 15px; color: var(--text-muted); margin-bottom: 12px; }
.status-subtle { font-size: 13px; color: var(--text-subtle); }

/* ─── Brand Hero (picks page) ───────────────────────────────────────────── */
.brand-hero {
  background: linear-gradient(135deg, var(--brown-dark) 0%, #542e1a 100%);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-hero-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
}

.brand-hero-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--brown-light);
  margin: 0 0 2px;
}

.decaf-badge {
  display: inline-block;
  background: rgba(245, 230, 211, .16);
  color: #f5e6d3;
  padding: 1px 8px;
  border-radius: 10px;
  letter-spacing: .04em;
}

.brand-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: #f5e6d3;
  margin: 0 0 5px;
  line-height: 1.2;
}

.brand-hero-desc {
  font-size: 13px;
  color: rgba(245, 230, 211, .72);
  line-height: 1.5;
  margin: 0;
}

/* ─── Picks Page ────────────────────────────────────────────────────────── */
.picks-page { max-width: 760px; margin: 0 auto; }

.picks-header { margin-bottom: 32px; }
.picks-header h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 28px;
  color: var(--brown-dark);
}
.picks-subtitle { font-size: 13px; color: var(--text-subtle); margin-top: 4px; }

/* Latest edition */
.edition { margin-bottom: 32px; }

.edition-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.edition-date {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  color: var(--brown-dark);
}

.edition-badge {
  background: var(--brown-mid);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.edition-timestamp {
  font-size: 12px;
  color: var(--text-subtle);
  margin-left: auto;
}

/* Older editions accordion */
.edition--older {
  border: 1px solid var(--beige-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.edition-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  background: var(--beige-card);
  user-select: none;
}
.edition-summary::-webkit-details-marker { display: none; }
.edition-summary:hover { background: var(--beige-bg); }

.edition-summary .edition-date { font-size: 16px; }

.edition-count {
  font-size: 13px;
  color: var(--text-subtle);
}

.edition--older .picks-grid { padding: 0 20px 20px; }

/* Picks grid */
.picks-grid {
  display: grid;
  gap: 16px;
}

.no-picks { color: var(--text-subtle); font-size: 15px; padding: 40px 0; text-align: center; }

.edition-cost {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: -12px;
  margin-bottom: 20px;
}

.edition-cost--older {
  padding: 0 20px 4px;
  margin-top: 0;
  margin-bottom: 4px;
}

/* ─── Pick Card ─────────────────────────────────────────────────────────── */
.pick-card {
  background: var(--beige-card);
  border: 1px solid var(--beige-border);
  border-radius: 10px;
  padding: 20px 22px;
}

.pick-merchant {
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.merchant-badge {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  overflow: hidden;
  flex: none;
  background: rgba(155, 107, 71, .16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.merchant-monogram {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--brown-mid);
  letter-spacing: 0;
}

/* Sits on top of the monogram; removes itself when the favicon is missing
   (error) or when Google serves its generic 16px globe placeholder. */
.merchant-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  border: 1px solid var(--beige-border);
  background: #fff;
  object-fit: contain;
  padding: 2px;
}

/* Hand-curated brand logos are mostly light-on-transparent — show them on
   the espresso tile instead of white. */
.merchant-logo--brand {
  background: #2c1810;
  border-color: #2c1810;
}

.pick-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 6px;
}
.pick-name a { color: var(--brown-mid); }
.pick-name a:hover { color: var(--brown-dark); }

.pick-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.pick-meta span:not(:last-child)::after { content: '·'; margin-left: 10px; color: var(--beige-border); }
.pick-price { font-weight: 500; color: var(--brown-light); }

/* Rubric bar */
.rubric-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.rubric-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-right: 4px;
}

.rubric-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  transition: opacity .12s ease;
}
a.rubric-chip:hover { text-decoration: none; opacity: .78; }
.chip--high { background: var(--chip-high-bg); color: var(--chip-high-fg); }
.chip--mid  { background: var(--chip-mid-bg);  color: var(--chip-mid-fg);  }
.chip--low  { background: var(--chip-low-bg);  color: var(--chip-low-fg);  }

.pick-reason-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brown-light);
  margin-bottom: 4px;
  font-weight: 600;
}

.pick-reason {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* ─── Approvals Page ────────────────────────────────────────────────────── */
.approvals-page { max-width: 900px; margin: 0 auto; }

.approvals-section { margin-bottom: 48px; }

.approvals-section h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  background: var(--brown-mid);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.approvals-section--others { opacity: .85; }

.add-user-form { display: flex; gap: 10px; align-items: center; }
.add-user-input { flex: 1; max-width: 320px; padding: 8px 12px; border: 1px solid var(--brown-light); border-radius: 6px; font-size: 14px; }
.add-user-input:focus { outline: none; border-color: var(--brown-mid); }

.approvals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--beige-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(44,24,16,.06);
}

.approvals-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--brown-dark);
  color: #b89070;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.approvals-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--beige-border);
  color: var(--text-muted);
}

.approvals-table tr:last-child td { border-bottom: none; }

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

.btn-approve, .btn-decline {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-approve         { background: #2d6a4f; color: #fff; }
.btn-approve:hover   { opacity: .85; }
.btn-decline         { background: #8b2e2e; color: #fff; }
.btn-decline:hover   { opacity: .85; }
.btn-approve--sm, .btn-decline--sm, .btn-delete--sm { padding: 4px 12px; font-size: 12px; }
.btn-delete         { background: #555; color: #fff; padding: 6px 16px; border-radius: 6px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.btn-delete:hover   { opacity: .85; }

.no-items { color: var(--text-subtle); font-size: 14px; padding: 12px 0; }

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-pill--approved { background: #d1fae5; color: #065f46; }
.status-pill--pending  { background: #fef9c3; color: #854d0e; }
.status-pill--declined { background: #fee2e2; color: #7f1d1d; }

/* ─── Signup Banner ────────────────────────────────────────────────────── */
.signup-banner {
  background: var(--brown-dark);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.signup-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.signup-banner-text strong {
  color: #f5e6d3;
  font-size: 14px;
  font-weight: 600;
}

.signup-banner-text span {
  color: #b89070;
  font-size: 13px;
}

.signup-banner-cta {
  background: var(--brown-mid);
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .15s;
}

.signup-banner-cta:hover { opacity: .85; text-decoration: none; color: #fff; }

/* ─── Admin shared header ───────────────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 32px;
}

.admin-page-header h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 28px;
  margin: 0;
}

.admin-nav-link {
  font-size: 14px;
  color: var(--brown-mid);
  font-weight: 500;
}

/* ─── Metrics Page ──────────────────────────────────────────────────────── */
.metrics-page { max-width: 900px; margin: 0 auto; }

.metrics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.metrics-card {
  background: var(--beige-card);
  border: 1px solid var(--beige-border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
}

.metrics-card-value {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--brown-dark);
  line-height: 1;
}

.metrics-card-label {
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 6px;
}

.metrics-card-value--mono {
  font-size: 24px;
  font-family: 'Courier New', monospace;
}

.metrics-card-date {
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 4px;
}

.metrics-chart-section { margin-bottom: 40px; }

.metrics-chart-section h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 18px;
  color: var(--brown-dark);
  margin-bottom: 14px;
}

.metrics-chart-wrap {
  background: var(--beige-card);
  border: 1px solid var(--beige-border);
  border-radius: 10px;
  padding: 20px;
}

/* Fix approvals h1 now that it's inside .admin-page-header */
.approvals-page .admin-page-header h1 { margin-bottom: 0; }
.approvals-page > h1 { margin-bottom: 32px; }

/* ─── Rubric page ───────────────────────────────────────────────────────── */
.rubric-page { max-width: 680px; margin: 0 auto; }

.rubric-hero {
  background: linear-gradient(135deg, var(--brown-dark) 0%, #542e1a 100%);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 28px;
}

.rubric-hero-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #f5e6d3;
  margin: 0 0 8px;
}

.rubric-hero-desc {
  font-size: 14px;
  color: rgba(245, 230, 211, .8);
  line-height: 1.6;
  margin: 0;
}

.rubric-dimension {
  background: var(--beige-card);
  border: 1px solid var(--beige-border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
  /* offset the sticky header when jumping to an anchor */
  scroll-margin-top: 72px;
}

.rubric-dimension-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.rubric-dimension-header h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px;
  color: var(--brown-dark);
}

.rubric-dimension-max {
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.rubric-dimension-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.rubric-levels { list-style: none; }

.rubric-level {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--beige-border);
}
.rubric-level:first-child { border-top: none; }

.rubric-level-score {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brown-light);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rubric-level-desc {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.rubric-footnote {
  font-size: 13px;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 8px;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .landing-card { padding: 36px 24px; }
  .picks-page, .approvals-page, .rubric-page { max-width: 100%; }
  .approvals-table { font-size: 13px; }
  .approvals-table th, .approvals-table td { padding: 10px 12px; }
}
