/* Golf with Stars — Manager Portal */
:root {
  --green: #133a24;
  --green-deep: #0d2a19;
  --green-soft: #1d4d31;
  --gold: #c6a04a;
  --gold-soft: #ead9a8;
  --paper: #f6f5f1;
  --card: #ffffff;
  --ink: #1c221e;
  --muted: #646b66;
  --line: #e3e0d6;
  --line-strong: #cfcabb;
  --live: #2e7d4f;
  --review: #a8741a;
  --approved: #8a6a1f;
  --draft: #7c817c;
  --changes: #b3452f;
  --focus: #2b6cb0;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --serif-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --serif: "Libre Caslon Text", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--green);
  color: #e9eee9;
  display: flex; flex-direction: column;
  padding: 26px 18px 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid rgba(198,160,74,.35); }
.brand img { width: 64px; height: 64px; border-radius: 14px; }
.brand .name { font-family: var(--serif); font-weight: 700; font-size: 19px; color: #fff; letter-spacing: .2px; }
.brand .sub { font-size: 12px; color: var(--gold-soft); letter-spacing: .6px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-m);
  color: #dfe6e0; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { background: var(--green-soft); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side .foot { margin-top: auto; font-size: 13px; color: #b9c5bc; }
.side .foot strong { display: block; color: #fff; font-weight: 600; }
.side .foot button { margin-top: 10px; background: none; border: 1px solid rgba(255,255,255,.25); color: #e9eee9; border-radius: var(--radius-s); padding: 6px 12px; cursor: pointer; }

.main { padding: 40px 48px 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
h1 { font-family: var(--serif-display); font-weight: 400; font-size: 44px; line-height: 1.05; margin: 0; letter-spacing: -.3px; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 20px; margin: 0 0 14px; }
h3 { font-family: var(--serif); font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 8px 0 0; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--card);
  padding: 10px 18px; border-radius: var(--radius-m);
  font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
  min-height: 42px;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #14261b; }
.btn.primary:hover { background: #b98f37; border-color: #b98f37; }
.btn.dark { background: var(--green); border-color: var(--green); color: #fff; }
.btn.dark:hover { background: var(--green-deep); }
.btn.danger { color: var(--changes); }
.btn.link { border: none; background: none; padding: 0; min-height: 0; color: var(--green); text-decoration: underline; font-weight: 500; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 999px; background: #f0efea; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--live); background: #e6f2ea; }
.pill.in_review { color: var(--review); background: #f8efdc; }
.pill.approved { color: var(--approved); background: #f6efd9; }
.pill.draft, .pill.not_invited { color: var(--draft); }
.pill.changes_requested { color: var(--changes); background: #f8e7e2; }
.pill.offline { color: var(--draft); }
.pill.invite_sent { color: var(--review); background: #f8efdc; }
.pill.activated { color: var(--live); background: #e6f2ea; }
.pill span { color: var(--ink); }

/* ---------- roster ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: #ecebe5; padding: 4px; border-radius: var(--radius-m); flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 7px 14px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20,38,27,.12); }
.tabs .count { font-size: 12px; color: var(--muted); margin-left: 4px; }
.search { position: relative; min-width: 240px; flex: 0 1 320px; }
.search input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--card); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }

.roster { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.roster table { width: 100%; border-collapse: collapse; }
.roster th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 12px 16px; background: #faf9f6; border-bottom: 1px solid var(--line); }
.roster td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.roster tr:last-child td { border-bottom: none; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr:hover { background: #fbfaf7; }
.roster .num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.who b { display: block; font-family: var(--serif); font-size: 16px; }
.who small { color: var(--muted); }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #e7e4da; flex: none; display: grid; place-items: center; font-family: var(--serif); color: var(--green); font-weight: 700; }
.muted { color: var(--muted); }
.next { font-size: 13px; color: var(--muted); }
.empty { padding: 56px 24px; text-align: center; }
.empty p { color: var(--muted); max-width: 420px; margin: 8px auto 20px; }

.cards { display: none; }

/* ---------- editor ---------- */
.banner { border-radius: var(--radius-l); padding: 16px 20px; margin-bottom: 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); background: var(--card); }
.banner p { margin: 2px 0 0; color: var(--muted); }
.banner.live { border-color: #bcdcc8; background: #f1f8f3; }
.banner.in_review { border-color: #ecd6a6; background: #fdf8ec; }
.banner.approved { border-color: #e6d4a2; background: #fcf7e8; }
.banner.changes_requested { border-color: #eec2b7; background: #fdf3f0; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 10px 12px; background: #fff; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: 2px solid rgba(19,58,36,.18); outline-offset: 0; }
.field.changed label::after { content: " · edited"; color: var(--review); font-weight: 500; }
.money { position: relative; }
.money input { padding-left: 52px; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.photos { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.photo-slot { border: 1px dashed var(--line-strong); border-radius: var(--radius-m); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: #faf9f6; position: relative; }
.photo-slot.cover { aspect-ratio: 16 / 9; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .ph { color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.photo-actions { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions-bar { position: sticky; bottom: 0; background: linear-gradient(to top, var(--paper) 70%, rgba(246,245,241,0)); padding: 18px 0 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toggle { display: flex; gap: 14px; align-items: flex-start; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }

/* the fan-view preview: the one ornamental element */
.preview { position: sticky; top: 24px; }
.preview .label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.phone {
  border-radius: 34px; background: var(--green-deep); padding: 12px;
  box-shadow: 0 30px 60px -30px rgba(13,42,25,.55);
}
.phone .screen { background: #fff; border-radius: 24px; overflow: hidden; }
.phone .cover { aspect-ratio: 16 / 10; background: linear-gradient(160deg, var(--green-soft), var(--green-deep)); position: relative; }
.phone .cover img { width: 100%; height: 100%; object-fit: cover; }
.phone .face { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; margin: -42px auto 0; position: relative; background: #e7e4da; overflow: hidden; display: grid; place-items: center; font-family: var(--serif); font-size: 28px; color: var(--green); }
.phone .face img { width: 100%; height: 100%; object-fit: cover; }
.phone .info { padding: 10px 18px 20px; text-align: center; }
.phone .info .n { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.phone .info .c { font-size: 12px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.phone .info .h { font-size: 13px; color: var(--muted); margin: 8px 0 14px; }
.phone .prices { display: flex; gap: 8px; justify-content: center; }
.phone .prices div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 96px; }
.phone .prices small { display: block; color: var(--muted); font-size: 11px; }
.phone .prices b { font-size: 15px; }
.phone .book { margin-top: 14px; background: var(--green); color: #fff; border-radius: 10px; padding: 10px; font-weight: 600; font-size: 14px; }

/* ---------- history ---------- */
.history-box { padding: 16px 24px; }
.history-box summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.history-box summary::-webkit-details-marker { display: none; }
.history-box summary::before { content: "▸"; color: var(--muted); margin-right: 6px; transition: transform .15s; display: inline-block; }
.history-box[open] summary::before { transform: rotate(90deg); }
.history-box .hb-title { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.history-box[open] .history { margin-top: 10px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.history li:last-child { border-bottom: none; }
.history .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.history .ch { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.history .src { font-size: 12px; color: var(--muted); }

/* ---------- auth / activation ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth .art {
  background: var(--green); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: radial-gradient(120% 70% at 85% 105%, #2a6a3f 0%, rgba(42,106,63,0) 60%);
}
.auth .art img { width: 76px; height: 76px; border-radius: 16px; }
.auth .art h1 { color: #fff; font-size: 52px; max-width: 12ch; margin-top: 40px; }
.auth .art p { color: var(--gold-soft); max-width: 36ch; }
.auth .form { display: grid; place-items: center; padding: 48px 24px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .box h2 { font-family: var(--serif-display); font-weight: 400; font-size: 32px; margin-bottom: 6px; }
.auth .box > p { color: var(--muted); margin: 0 0 26px; }
.auth .box .btn { width: 100%; }
.auth .alt { margin-top: 18px; font-size: 14px; color: var(--muted); }

.activate { max-width: 980px; margin: 0 auto; padding: 40px 24px 80px; }
.activate .top { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.activate .top img { width: 48px; height: 48px; border-radius: 11px; }
.activate .top span { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.activate .layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }
.terms { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 6px 22px; background: #fff; font-family: var(--serif); font-size: 14px; line-height: 1.65; }
.terms h1 { font-size: 22px; margin: 16px 0 8px; font-family: var(--serif); font-weight: 700; }
.terms h3 { margin: 18px 0 6px; font-size: 15px; }
.terms ul { padding-left: 20px; }
.accept { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; font-weight: 500; }
.accept input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.steps { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { font-size: 13px; color: var(--muted); padding: 4px 12px; border-radius: 999px; background: #ecebe5; }
.steps span[aria-current="step"] { background: var(--green); color: #fff; }

/* ---------- messages ---------- */
.note { padding: 12px 14px; border-radius: var(--radius-m); background: #f0efea; margin: 0 0 16px; font-size: 14px; }
.note.err { background: #f8e7e2; color: #7d2a19; }
.note.ok { background: #e6f2ea; color: #1f5a37; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--green-deep); color: #fff; padding: 12px 18px; border-radius: var(--radius-m); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #7d2a19; }
dialog { border: none; border-radius: var(--radius-l); padding: 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(13,42,25,.45); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list li .grow { flex: 1; min-width: 0; }
.list li b { font-family: var(--serif); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .editor, .admin-grid { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 340px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand { flex-direction: row; padding: 0; margin: 0; border: none; gap: 10px; }
  .brand img { width: 36px; height: 36px; border-radius: 9px; }
  .brand .name { font-size: 16px; }
  .brand .sub { display: none; }
  .nav { flex-direction: row; margin-left: auto; }
  .nav a { padding: 8px 10px; }
  .nav a .t { display: none; }
  .side .foot { display: none; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 34px; }
  .roster table { display: none; }
  .cards { display: block; }
  .cards a { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
  .cards a:last-child { border-bottom: none; }
  .cards .meta { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; }
  .cards .p { grid-column: 2; font-size: 13px; color: var(--muted); }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .photos { grid-template-columns: 1fr; }
  .photo-slot { max-width: 180px; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { padding: 28px 24px; }
  .auth .art h1 { font-size: 34px; margin-top: 18px; }
  .activate .layout { grid-template-columns: 1fr; }
  .search { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
