/* Layout and look carried over from the POC (docs/poc-v3.html). The club's two colors come
   from /api/branding and are set on :root by app.js; --on-* is black or white, whichever
   reads better on that color. */
:root {
  --primary: #161616;
  --accent: #ffd52b;
  --on-primary: #ffffff;
  --on-accent: #111111;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, white);
  --accent-line: color-mix(in srgb, var(--accent) 55%, white);
  --bg: #f5f5f2;
  --text: #161616;
  --muted: #62625e;
  --line: #e3e3df;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }

header {
  background: var(--primary); color: var(--on-primary);
  padding: 18px max(16px, calc((100vw - 1100px) / 2));
  border-bottom: 5px solid var(--accent);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 48px; max-width: 120px; object-fit: contain; }
header h1 { margin: 0; font-size: 24px; letter-spacing: .025em; }
header small { opacity: .75; }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs:empty { display: none; }
.tabs button { background: #fff; color: #222; border: 1px solid #d5d5d1; }
.tabs button.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

button, .btn {
  border: 0; background: var(--accent); color: var(--on-accent);
  padding: 12px 17px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 750;
  text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(.96); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: #ededeb; color: #222; }
.danger { background: #fce9e7; color: #9a2721; }
.small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
header .secondary { background: color-mix(in srgb, var(--on-primary) 15%, transparent); color: var(--on-primary); }

.panel {
  background: white; border: 1px solid var(--line); border-radius: 17px;
  padding: 22px; margin: 14px 0; box-shadow: 0 3px 18px #11111109;
}
.panel.narrow { max-width: 480px; margin: 40px auto; }
h2 { margin: 0 0 14px; font-size: 22px; }
h3 { margin: 10px 0; font-size: 18px; }
p { line-height: 1.55; }
label { display: block; font-size: 13px; font-weight: 700; margin: 10px 0 6px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
input, select {
  width: 100%; padding: 12px; border: 1px solid #c9c9c5; border-radius: 9px;
  background: white; font: inherit; color: #171717;
}
input:focus, select:focus { outline: 3px solid var(--accent-line); border-color: var(--primary); }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 4px; height: 46px; }
code { background: #f1f1ec; padding: 1px 5px; border-radius: 5px; font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric { padding: 17px; background: #f4f4f0; border-radius: 12px; }
.metric strong { display: block; font-size: 25px; margin-top: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.ok { color: #176b3a; font-weight: 750; }
.warn { color: #8e5500; font-weight: 750; }
.error { color: #b52323; font-weight: 750; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.tablewrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid #e6e6e1; padding: 10px; text-align: left; vertical-align: middle; }
th { background: #f6f5f0; }
td input, td select { min-width: 85px; padding: 8px; }
td button { white-space: nowrap; }
.chip {
  display: inline-block; border-radius: 100px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); padding: 5px 11px; font-size: 13px; margin: 4px 5px 0 0;
}
.chip.paid { background: #e3f4e8; border-color: #b6dfc2; }
.toast {
  position: sticky; top: 10px; z-index: 5; padding: 12px 16px; border-radius: 10px;
  background: #fff5cf; color: #554100; border: 1px solid #f2df93; margin-bottom: 12px;
}
.toast.error { background: #fce9e7; color: #9a2721; border-color: #f0c2bd; font-weight: 600; }

/* Parent flow */
.intro {
  background: var(--primary); color: var(--on-primary); border-radius: 18px; padding: 24px;
  margin-bottom: 15px;
}
.intro h2 { font-size: 28px; margin: 5px 0; }
.intro p { margin: 0; opacity: .85; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.step { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 18px; font-weight: 800; }
.num {
  display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent);
  border-radius: 50%; width: 31px; height: 31px; font-size: 14px;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.stat { padding: 16px; border-radius: 13px; background: #f4f4f1; }
.stat.primary { background: var(--accent); color: var(--on-accent); }
.stat span { font-size: 12px; font-weight: 700; display: block; }
.stat strong { display: block; font-size: clamp(19px, 3vw, 30px); margin-top: 7px; }
.product {
  border: 1px solid #dfdfd9; border-radius: 14px; padding: 17px; margin: 12px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 125px; gap: 12px; align-items: center;
}
.product h3 { margin: 0 0 5px; }
.product p { margin: 0; color: #5c5c58; font-size: 13px; }
.product .profit { font-weight: 750; color: #222; margin-top: 7px; }
.product input { font-size: 20px; text-align: center; font-weight: 800; }
.choice { background: #f5f4ed; border-radius: 12px; padding: 15px; margin-top: 12px; }
.choice label { margin-top: 0; }
.preview { background: var(--primary); color: var(--on-primary); border-radius: 15px; padding: 20px; margin: 16px 0; }
.preview .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preview .metrics > div { padding: 8px 0; font-size: 13px; opacity: .9; }
.preview b { display: block; font-size: 21px; margin-top: 4px; }
.track { height: 12px; background: color-mix(in srgb, var(--on-primary) 25%, transparent); border-radius: 20px; overflow: hidden; margin: 14px 0 7px; }
.fill { height: 100%; background: var(--accent); border-radius: 20px; transition: width .15s; }
.big { width: 100%; font-size: 17px; padding: 17px; border-radius: 12px; margin-top: 6px; }
.help { font-size: 13px; color: #5b5b56; margin-top: 12px; }
.order { border: 1px solid #e3e3df; border-radius: 12px; padding: 14px; margin: 10px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.order p { margin: 4px 0 0; }
.right { text-align: right; }
.logo-preview { max-height: 80px; max-width: 220px; background: var(--primary); padding: 10px; border-radius: 10px; }

@media (max-width: 700px) {
  header { padding: 14px 16px; }
  header h1 { font-size: 20px; }
  .panel { padding: 17px; }
  .intro { padding: 19px; }
  .intro h2 { font-size: 24px; }
  .stats { gap: 7px; }
  .stat { padding: 12px 9px; }
  .stat strong { font-size: 18px; }
  .product { grid-template-columns: minmax(0, 1fr) 92px; padding: 13px; }
  .product input { font-size: 17px; }
  td, th { padding: 8px 5px; font-size: 12px; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs button { padding: 10px 6px; font-size: 13px; }
}
