:root {
  --bg: #f4efe6;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffaf3;
  --ink: #1f1a17;
  --muted: #73655a;
  --line: rgba(74, 55, 40, 0.14);
  --accent: #c65d3a;
  --accent-deep: #8d3c22;
  --good: #247a55;
  --warn: #9a5a05;
  --bad: #a0332c;
  --shadow: 0 24px 60px rgba(92, 63, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(198, 93, 58, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(210, 159, 91, 0.18), transparent 25%),
    linear-gradient(180deg, #f7f2ea 0%, #efe5d7 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero,
.layout,
.forms-grid,
.dashboard-grid,
.metric-grid,
.field-grid {
  display: grid;
  gap: 20px;
}

.hero {
  grid-template-columns: 1.6fr 0.9fr;
  align-items: end;
  margin-bottom: 24px;
}

.hero h1,
.section-heading h2,
.photo-scan h3 {
  font-family: "Fraunces", serif;
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card,
.card,
.subcard {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  border-radius: 28px;
}

.hero-card strong {
  display: block;
  font-size: 1.4rem;
  margin-top: 6px;
}

.hero-card-label,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-deep);
  margin: 0 0 8px;
  font-weight: 700;
}

.card {
  border-radius: 30px;
  padding: 28px;
}

.layout {
  gap: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 1.9rem;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #da8d5b 100%);
  color: white;
}

.ghost-button {
  background: rgba(198, 93, 58, 0.1);
  color: var(--accent-deep);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.metric,
.subcard {
  padding: 20px;
  border-radius: 24px;
}

.metric {
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.metric span,
.subcard-heading span,
label span,
.muted,
.hero-card .muted {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 2rem;
  margin: 8px 0 6px;
}

.dashboard-grid,
.forms-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subcard-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.subcard-heading h3 {
  margin: 0;
}

.bars,
.recent-list,
.specials-list,
.stack {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  background: rgba(198, 93, 58, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #df9b64, var(--accent));
}

.recent-row,
.special-card {
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.72);
  border-radius: 20px;
  padding: 16px;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.recent-row strong,
.special-card strong {
  display: block;
  margin-bottom: 4px;
}

.trend {
  font-weight: 800;
}

.trend.up {
  color: var(--bad);
}

.trend.down {
  color: var(--good);
}

.trend.flat,
.trend.new {
  color: var(--warn);
}

form label {
  display: grid;
  gap: 8px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(74, 55, 40, 0.16);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.photo-scan {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.real-saving {
  color: var(--good);
  background: rgba(36, 122, 85, 0.12);
}

.badge.fake-special {
  color: var(--bad);
  background: rgba(160, 51, 44, 0.1);
}

.badge.inflated-discount,
.badge.needs-more-history {
  color: var(--warn);
  background: rgba(154, 90, 5, 0.12);
}

.flash {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: 18px;
  color: white;
  background: rgba(31, 26, 23, 0.92);
  box-shadow: 0 20px 40px rgba(31, 26, 23, 0.2);
}

.empty-state {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero,
  .forms-grid,
  .dashboard-grid,
  .metric-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .photo-scan,
  .section-heading,
  .recent-row {
    align-items: start;
    flex-direction: column;
  }
}
