:root {
  --bg: #f6f1e8;
  --panel: #fffaf2;
  --line: #ded4c3;
  --ink: #1f1b16;
  --muted: #6a6257;
  --accent: #b8693d;
  --accent-2: #d89b71;
  --ok: #1f6c4c;
  --bad: #8d3f33;
  --focus: rgba(184, 105, 61, 0.25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 12% -10%, #fff6eb 0%, var(--bg) 45%);
}
a { color: inherit; }
.wrap { width: min(1240px, calc(100vw - 32px)); margin: 0 auto; padding: 18px 0 56px; }
nav { display: flex; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--panel);
  transition: transform .18s ease, border-color .2s ease, background .2s ease;
}
nav a:hover { transform: translateY(-1px); border-color: #c5b5a0; background: #fff; }
.hero { margin-top: 16px; border: 1px solid var(--line); border-radius: 26px; padding: 30px; background: linear-gradient(150deg, #fffdf8, #fff4e8); }
.hero h1 { margin: 0 0 8px; letter-spacing: -0.02em; font-size: clamp(28px, 5vw, 44px); }
.hero p { margin: 0 0 10px; color: var(--muted); }
.panel { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.panel h2, .panel h3 { margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #fff, #fff8ef); padding: 14px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.metric { border: 1px solid #e5c8ad; border-radius: 14px; padding: 12px; background: #fff1e1; }
.metric strong { display: block; font-size: 22px; }

form { display: grid; gap: 10px; }
label { font-size: 13px; color: #4e473f; }
input, textarea, select, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: #bf9c7e;
}
textarea { min-height: 120px; resize: vertical; }
button {
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, filter .2s ease;
}
button:hover { filter: brightness(1.06); transform: translateY(-1px); }
button.ghost { background: transparent; color: var(--ink); }
.two { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.badge { display: inline-block; font-size: 12px; border: 1px solid #e8c8ac; background: #fff5ea; color: #7d4b2d; border-radius: 999px; padding: 4px 10px; margin-bottom: 8px; }
.flash { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.flash.success { border-color: var(--ok); background: #edf8f2; color: var(--ok); }
.flash.error { border-color: var(--bad); background: #fff2ef; color: var(--bad); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fffdf9; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: #6b6257; letter-spacing: .04em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.progress { width: 100%; height: 10px; border-radius: 999px; background: #eee1d2; overflow: hidden; }
.progress > span { display: block; height: 10px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.product-hero { display: grid; gap: 18px; grid-template-columns: 1.15fr 1fr; }
.product-media {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(165deg, #fff8ee, #fff);
  display: grid;
  place-items: center;
  color: #b1764f;
  font-size: 24px;
}

.admin-shell { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.admin-stack { display: grid; gap: 16px; }
.admin-record-form { min-width: 330px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions > * { flex: 1 1 140px; }
.pill-link {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  background: #fff;
}
.pill-link:hover { border-color: #c5b5a0; }

.flow-wrap { display: grid; gap: 14px; }
.flow-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fffdf9;
  opacity: .45;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}
.flow-step.active { opacity: 1; transform: translateY(0); }
.flow-step h3 { margin: 0 0 10px; }
.flow-actions { display: flex; gap: 10px; margin-top: 10px; }
.flow-actions button { width: auto; min-width: 130px; }
.estimate-box { border: 1px solid #e6cdb3; background: #fff4e8; border-radius: 12px; padding: 10px; }
.fade-in { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .grid, .two, .metrics, .product-hero { grid-template-columns: 1fr; }
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff5ea;
}
.table-compact th, .table-compact td {
  padding: 8px 6px;
  font-size: 14px;
}
.record-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 8px;
}
.record-editor > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  user-select: none;
  list-style: none;
}
.record-editor > summary::-webkit-details-marker { display: none; }
.record-editor[open] > summary { border-bottom: 1px solid var(--line); }
.record-editor .editor-body { padding: 10px; }
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
