:root {
  --ink: #221c16;
  --muted: #6b5e51;
  --paper: #f3eee4;
  --card: #fffdf8;
  --line: #e3d8c6;
  --pine: #1e4d3a;
  --pine-dark: #143528;
  --copper: #b8613a;
  --foam: #d7ece4;
  --wood: #ead7bc;
  --danger: #8d2f2f;
  --ok: #1e4d3a;
  --shadow: 0 16px 40px rgba(34, 28, 22, 0.08);
  --sans: "Segoe UI", "Liberation Sans", "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at top left, rgba(184, 97, 58, 0.08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--pine); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button:disabled, .button:disabled { opacity: 0.45; cursor: not-allowed; }
button, .button {
  background: var(--pine);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  min-height: 48px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
button.secondary, .button.secondary { background: transparent; color: var(--pine); border: 1px solid var(--pine); }
button.danger { background: var(--danger); }
button.copper { background: var(--copper); }
.site-header, .admin-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
}
.brand { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.brand strong { font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.08em; }
.brand span { color: var(--muted); font-size: 0.92rem; }
.wrap { width: min(1120px, calc(100% - 1.5rem)); margin: 0 auto 3rem; }
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1rem;
}
.preview-stage {
  min-height: 280px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), transparent),
    repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(34,28,22,0.04) 16px),
    var(--paper);
  border-radius: 18px;
  color: var(--ink);
  overflow: hidden;
}
.preview-stage img, .preview-stage svg { width: min(100%, 420px); height: 240px; }
.price-box { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-top: 0.8rem; }
.price-box b { font-family: var(--serif); font-size: 2rem; }
label { display: block; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0.8rem 0 0.3rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  min-height: 48px;
}
textarea { min-height: 90px; }
.choices, .swatches, .heights { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.choice, .swatch, .height, button.font-card, button.material-card {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 16px;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  justify-content: flex-start;
}
.choice.active, .height.active, button.font-card.active, button.material-card.active {
  border-color: var(--pine);
  background: #e7f2ec;
  color: var(--ink);
}
.swatch { width: 48px; height: 48px; border-radius: 50%; padding: 0; }
.swatch.active { outline: 3px solid var(--pine); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.flash, .banner {
  background: #fff4e8;
  border: 1px solid #efd0b8;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}
.muted { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; margin-top: 0.2rem; }
.bars { display: flex; align-items: end; gap: 0.45rem; height: 140px; margin-top: 1rem; }
.bars div { flex: 1; background: var(--pine); border-radius: 8px 8px 0 0; min-height: 4px; position: relative; }
.bars span { position: absolute; top: -1.3rem; left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--pine-dark); color: #f6f1e7; padding: 1rem 0.7rem; }
.sidebar a { color: #f6f1e7; text-decoration: none; display: block; padding: 0.65rem 0.75rem; border-radius: 10px; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,0.1); }
.sidebar .mark { font-family: var(--serif); letter-spacing: 0.08em; padding: 0.4rem 0.75rem 1rem; }
.sidebar button.secondary { color: #f6f1e7; border-color: rgba(246, 241, 231, 0.7); width: calc(100% - 0.4rem); margin: 0.8rem 0.2rem; }
.kicker { letter-spacing: 0.16em; text-transform: uppercase; color: var(--pine); font-size: 0.78rem; margin: 0; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; margin: 0.2rem 0 0.4rem; }
.lede { font-size: 1.05rem; max-width: 36rem; }
.steps { display: flex; gap: 0.4rem; list-style: none; padding: 0; margin: 0.6rem 0 1rem; }
.steps li { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.font-grid { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
@media (min-width: 700px) {
  .font-grid { grid-template-columns: repeat(3, 1fr); }
}
.font-card, .material-card { min-height: 92px; align-items: flex-start; text-align: left; display: flex; flex-direction: column; gap: 0.15rem; width: 100%; }
.font-card img { height: 42px; width: 100%; object-fit: contain; object-position: left center; }
.font-card span, .material-card span { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.preview-card { position: sticky; top: 0.6rem; }
.pay-now { min-height: 64px; font-size: 1.15rem; width: 100%; }
@media (max-width: 900px) {
  .hero { display: flex; flex-direction: column; }
  .preview-card { order: -1; position: sticky; top: 0; z-index: 3; }
  .preview-stage { min-height: 180px; }
  .preview-stage img, .preview-stage svg { height: 160px; }
  body { overflow-x: hidden; }
}
.admin-main { padding: 1rem 1.1rem 3rem; }
.badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem; background: var(--foam); font-size: 0.82rem; }
.badge.wood { background: var(--wood); }
.badge.warn { background: #f3d0d0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1rem; }
.receipt { max-width: 760px; }
@media (max-width: 900px) {
  .hero, .cards, .split, .admin-shell, .row { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .sidebar { display: flex; gap: 0.3rem; overflow-x: auto; }
  .sidebar a { white-space: nowrap; }
}
@media print {
  .site-header, .sidebar, .admin-top, .no-print { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; }
}
