/* Novelty Manager — light and airy: white cards on a pale grey page, one green accent. */
:root {
  --page: #f6f7f9; --card: #fff; --ink: #1f2937; --mut: #6b7280; --line: #e5e7eb;
  --acc: #2d6a4f; --acc-dark: #24563f; --tint: #e8f3ee;
  --warn: #b45309; --warn-tint: #fef3c7; --bad: #b91c1c; --bad-tint: #fdecec;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--page); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--acc); }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.mut { color: var(--mut); }
.small { font-size: .85rem; }
.empty { color: var(--mut); padding: 1rem 0; }
.loading { color: var(--mut); padding: 2rem 0; }
.error-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.good { color: var(--acc); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.top-gap { margin-top: .8rem; }

/* header */
.top { background: #fff; border-bottom: 1px solid var(--line); border-top: 4px solid var(--acc); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: .9rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .75rem; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-logo.jr { height: 64px; }
.brand-logo.gf { height: 76px; }
.brand span { white-space: nowrap; }
@media (max-width: 640px) { .brand-logo { height: 30px; } .brand-logo.jr { height: 48px; } .brand-logo.gf { height: 56px; } .top .sub { display: none; }
  .brand { min-width: 0; font-size: .95rem; } .brand span { white-space: normal; }
  /* standalone header (logo left + right, long title): title on its own row below */
  .top.duo .top-inner { flex-wrap: wrap; row-gap: .5rem; }
  .top.duo .brand { order: 2; flex-basis: 100%; } }
.sub { color: var(--mut); font-size: .85rem; }
.sub .club-name { color: var(--ink); font-size: 1.35rem; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .75rem; border-radius: 999px; font-size: .8rem;
  font-weight: 600; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--mut); }
.pill .dot { width: .55rem; height: .55rem; border-radius: 50%; background: #cbd5e1; }
.pill.ok .dot { background: #22a06b; } .pill.warn .dot { background: #f59e0b; } .pill.err .dot { background: var(--bad); }

main { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.5rem; margin: 0; font-weight: 700; }
h2 { font-size: 1.02rem; margin: 0 0 .8rem; font-weight: 650; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 1.6rem 0 .6rem; font-weight: 650; }

.notice { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; background: var(--tint); color: var(--acc-dark); border: 1px solid #cfe5da; }
.notice.error { background: var(--bad-tint); color: var(--bad); border-color: #f5c2c2; }
.okbox { margin-top: .8rem; padding: .7rem .9rem; border-radius: 10px; background: var(--tint); color: var(--acc-dark); }
.errbox { margin: .8rem 0; padding: .7rem .9rem; border-radius: 10px; background: var(--bad-tint); color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.small-gap { gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.bar { margin-bottom: 1rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack-col { display: flex; flex-direction: column; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.grid2 .span2 { grid-column: 1 / -1; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: start; }
.cols.one { grid-template-columns: 1fr; }
@media (max-width: 860px) { .cols, .grid2 { grid-template-columns: 1fr; } }

/* form controls */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: #374151; }
label .mut { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; }
input[type=text], input[type=search], input[type=date], input[type=number], input[type=tel], input[type=url], input[type=email], select {
  font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: .5rem .65rem; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--tint); border-color: var(--acc); }
button, .btn { font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border-radius: 8px; padding: .55rem 1rem;
  border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
button.primary, .btn.primary { background: var(--acc); color: #fff; }
button.primary:hover { background: var(--acc-dark); }
button.ghost, .btn.ghost, button:not(.primary):not(.danger) { background: #fff; color: var(--ink); border-color: #d1d5db; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--acc); color: var(--acc); }
button.nextstep:not(.primary):not(.danger) { background: #f08a24; border-color: #e07a12; color: #fff; }
button.nextstep:not(.primary):not(.danger):hover { background: #d9730d; }
button.danger { background: #fff; color: var(--bad); border-color: #f1b5b5; }
button.mini, .btn.mini { padding: .25rem .6rem; font-size: .78rem; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* events list */
.page-head { display: flex; align-items: center; margin-bottom: 1rem; }
.filters { margin-bottom: .8rem; }
.filters input { max-width: 360px; }
.filters select { max-width: 180px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .6rem; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover { background: #fafbfc; }
.tbl.compact td { padding: .35rem .5rem; font-size: .88rem; }
.tbl tr.deleted td { color: #9ca3af; text-decoration: line-through; }
.tbl tr.deleted td.actions { text-decoration: none; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; }

.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: #f1f5f9; color: #475569; }
.status.ACTIVE { background: var(--tint); color: var(--acc); }
.status.CLOSED { background: #f3f4f6; color: #6b7280; }
.status.ARCHIVED { background: #fef3c7; color: #92400e; }
.tbl td.row-act { width: 1%; text-align: right; }
.tbl td.row-act button { padding: .2rem .6rem; font-size: .8rem; }
.status.big { font-size: .85rem; padding: .3rem .9rem; }

/* event detail */
.back { display: inline-block; color: var(--mut); text-decoration: none; font-size: .88rem; margin-bottom: .6rem; }
.back:hover { color: var(--acc); }
.event-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.tabs { display: flex; gap: .35rem; border-bottom: 3px solid var(--acc); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .5rem 1rem; border-bottom: 3px solid var(--acc); margin-bottom: 1rem; }
.tabs-bar .tabs { border-bottom: 0; margin-bottom: 0; }
.tab-status { margin-left: auto; display: flex; align-items: center; gap: .6rem; padding-bottom: .4rem; cursor: help; }
.tab-status .seg button { padding: .4rem .95rem; cursor: pointer; }
.tabs a { padding: .6rem 1.1rem; text-decoration: none; color: var(--ink); font-weight: 600; background: #eef1f4; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.tabs a.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.tabs a:not(.on):hover { background: var(--tint); color: var(--acc-dark); }
/* Tab state from the checklist: light green = its steps done, orange = the next step is here. */
.tabs a.done:not(.on) { background: #dcefe4; border-color: #b9dcc8; color: var(--acc-dark); }
.tabs a.next:not(.on) { background: #ffe6cc; border-color: #f0a35b; color: #9a4d0b; }
.tabs a.next.on { box-shadow: inset 0 4px 0 #f0a35b; }
.hole-logo { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.hole-logo[hidden] { display: none; }
.hole-logo img { max-width: 110px; max-height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
/* Event page: checklist down the left, status + the tab beside it */
.event-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1rem; align-items: start; }
.event-main { min-width: 0; }
.progress-card { padding: 1rem; position: sticky; top: 1rem; }
.status-card { padding: .9rem 1.1rem; }
.progress-status { gap: .8rem; flex-wrap: wrap; align-items: center; }
.progress-head { display: flex; flex-direction: column; gap: .15rem; }
.checklist { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.checklist button { width: 100%; white-space: normal; line-height: 1.3; display: flex; align-items: center; gap: .6rem; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; color: var(--mut); font-weight: 600; }
.checklist button small { display: block; font-weight: 400; font-size: .75rem; }
.checklist .tick { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid #cbd5e1; display: inline-grid; place-items: center; font-size: .8rem; }
.checklist button.done { background: var(--tint); border-color: #cfe5da; color: var(--acc-dark); }
.checklist button.done .tick { background: var(--acc); border-color: var(--acc); color: #fff; }
.checklist button:not(.done):hover { border-color: var(--acc); color: var(--acc); }
.checklist button.next { background: #fff4e5; border-color: #f0a35b; color: #9a4d0b; }
.checklist button.next .tick { border-color: #e8892f; color: #9a4d0b; }
@media (max-width: 860px) { .event-body { grid-template-columns: 1fr; } .progress-card { position: static; } }
.field-like { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: #374151; }
.field-like .seg { align-self: flex-start; }
.field-like .mut { font-weight: 400; }

.seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; }
.seg button { border: 0 !important; border-radius: 0; background: #fff; color: var(--mut); padding: .5rem 1.1rem; }
.seg button + button { border-left: 1px solid #d1d5db !important; }
.seg button.on { background: var(--tint); color: var(--acc); }
.seg button.on.CLOSED { background: #f3f4f6; color: var(--ink); }

/* holes grid */
.holes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.holes.off { grid-template-columns: minmax(220px, 460px); }
.hole { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .75rem; min-height: 96px; }
.hole.has { background: var(--tint); border: 2px solid var(--acc); padding: calc(.7rem - 1px) calc(.75rem - 1px); }
.hole-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.hole-no { font-weight: 700; }
.hole.has .hole-no { color: var(--acc); }
.hole-empty { color: #b6bcc6; font-size: .82rem; padding: .3rem 0; }
.nov { display: flex; align-items: center; gap: .4rem; padding: .45rem .5rem; border-radius: 8px; background: #fafbfc; border: 1px solid #f0f1f3; margin-top: .35rem; cursor: pointer; }
.nov:hover { border-color: var(--acc); }
.nov.inactive { opacity: .55; }
.nov-main { flex: 1; min-width: 0; }
.nov-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nov-meta { display: flex; gap: .4rem; align-items: center; font-size: .75rem; color: var(--mut); flex-wrap: wrap; }
.cat { display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: var(--tint); color: var(--acc); }
.cat.LADIES { background: #fdf2f8; color: #9d174d; }
.cat.MENS { background: #eff6ff; color: #1d4ed8; }

/* results */
.results-card { padding: 1rem 1.1rem; }
.results-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; flex-wrap: wrap; }
.results-head .cat { margin-left: .3rem; }
.entry-edit input[type=text] { max-width: 260px; }
.entry-edit input[type=number] { max-width: 110px; }
.flag { color: var(--warn); }

/* links & QR */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: .8rem; }
@media (max-width: 520px) { .links { grid-template-columns: 1fr; } }
.link-card { display: flex; gap: 1rem; align-items: flex-start; margin: 0; }
.qr-thumb { width: 110px; height: 110px; flex: none; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 6px; }
.link-body { flex: 1; min-width: 0; }
.url { font-size: .8rem; color: var(--acc); word-break: break-all; margin-top: .3rem; }
.md { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--mut); background: #fafbfc; border: 1px solid #f0f1f3; border-radius: 6px; padding: .3rem .45rem; margin-top: .35rem; word-break: break-all; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.5rem; width: min(620px, 94vw); box-shadow: 0 20px 50px rgba(15, 23, 42, .15); color: var(--ink); }
.dlg::backdrop { background: rgba(15, 23, 42, .25); }
.dlg form { display: flex; flex-direction: column; gap: .8rem; }
.dlg h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.dlg-actions { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; }
#confirmBody { max-height: 60vh; overflow: auto; }
#confirmBody p { margin: .3rem 0 .7rem; }
code { background: #f3f4f6; padding: .05rem .35rem; border-radius: 5px; font-size: .85em; }

.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .55rem 1.1rem; border-radius: 999px; font-size: .88rem; z-index: 99; }
.leaders { display: flex; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.leader { background: #fafbfc; border: 1px solid #f0f1f3; border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; }
.leader.r1 { background: var(--tint); border-color: #cfe5da; color: var(--acc-dark); }

/* URL-first new event, club accounts, club sign-in */
.gdp-fetch { align-items: flex-end; }
.grow { flex: 1; }
.toplink { font-size: .85rem; font-weight: 600; text-decoration: none; }
.login { max-width: 380px; margin: 3rem auto; }
.login h1 { margin-bottom: .3rem; }
input[type=password] { font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: .5rem .65rem; width: 100%; }
td input.vm { min-width: 9rem; }
.btp-draw { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }

/* Create shells */
.shell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin: .8rem 0 1.2rem; }
.shell-tile { border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .35rem; }
.shell-tile h3 { margin: 0; font-size: 1rem; }
.shell-tile p { margin: 0; }
.shell-tile button { align-self: flex-start; margin-top: .3rem; }
.push-bar { margin-top: 1.25rem; }
textarea.wide { width: 100%; box-sizing: border-box; font: inherit; padding: .6rem; border: 1px solid #d1d5db; border-radius: 10px; }

/* Sponsor logos uploaded on the client's choices form */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-top: .6rem; }
.logo-tile { margin: 0; padding: .5rem; border: 1px solid var(--line, #ddd); border-radius: 10px; }
.logo-thumb { height: 90px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; }
.logo-thumb img { max-width: 100%; max-height: 90px; object-fit: contain; }
.logo-tile figcaption { margin-top: .4rem; font-size: .9rem; overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 0; color: var(--acc-dark, #2a6); text-decoration: underline; cursor: pointer; }
.client-logo-thumb { border: 1px solid #e5e7eb; }
.hole.resting { background: #f3f4f6; opacity: .6; }
.hole.temp { border-style: dashed; border-color: var(--acc); }
.hole-tag { display: inline-block; font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; margin-bottom: .35rem; }
.hole-tag.rest { background: #e5e7eb; color: #4b5563; }
.hole-tag.temp { background: #e6f2ec; color: var(--acc); }

/* Events list: the client has sent their choices, not yet applied. */
.new-choices { display: inline-block; margin-left: .4rem; padding: .1rem .5rem; border-radius: 999px; background: #f59e0b; color: #fff; font-size: .75rem; font-weight: 600; vertical-align: middle; }

/* Apply-to-the-event questions (client changed / dropped a pick) */
.apply-q { border-top: 1px solid var(--line, #ddd); padding: .6rem 0; }
.apply-q p { margin: 0 0 .4rem; }
.apply-q label.check { display: flex; margin: .25rem 0; }
/* Standalone Holes tab: holes left, Off-course + Client logo in a column on the right. */
.holes-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; align-items: start; }
.holes-split .holes-main > .nine-title:first-child, .holes-side > .section-title:first-child { margin-top: .4rem; }
.holes-side .holes.off { grid-template-columns: 1fr; }
.nine-title { font-size: 1rem; color: var(--ink, inherit); letter-spacing: .04em; }
.nine-range { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--mut); }
@media (max-width: 900px) { .holes-split { grid-template-columns: 1fr; } }
/* Load players from a spreadsheet: drop a file on the card. */
.dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 1.1rem 1rem; text-align: center; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; }
.dropzone.over { border-color: var(--acc); background: var(--tint); }
/* Event page: links not copied into GolfDayPro with the event ≤ 2 days away. */
.warnbox { padding: .8rem 1rem; border-radius: 10px; background: var(--warn-tint); color: var(--warn); border: 1px solid #f5d38a; }
.links-banner { margin: .2rem 0 1rem; }
.links-banner a { color: inherit; font-weight: 650; }

/* Standalone Player management: Part 1 / Part 2 cards */
.ps-part { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #2d6a4f; margin-bottom: 4px; }
.ps-part2 .ps-part { color: #b5651d; }
.ps-card { border-left: 4px solid #2d6a4f; }
.ps-card.ps-part2 { border-left-color: #f08a24; }
.ps-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ps-head h2 { margin-bottom: 0; }
.ps-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; height: 34px; padding: 0 !important; border-radius: 50%; font-size: 22px; line-height: 1; font-weight: 700; }
.ps-ask { margin-top: 10px; }
.ps-ask[hidden], .ps-body[hidden] { display: none !important; }
.ps-steps { margin: 6px 0 8px 18px; padding: 0; }
.ps-steps li { margin: 2px 0; }
/* Change hole sits bottom-right of each novelty, under Copy link. */
.nov-btns { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; align-self: stretch; justify-content: space-between; }
.match-card { margin: .75rem 0; border-left: 4px solid var(--gold, #b7791f); }
.match-rows { display: grid; gap: .6rem; }
.match-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(120px, 220px) 1fr; gap: .6rem; align-items: center; }
@media (max-width: 640px) { .match-row { grid-template-columns: 1fr; gap: .2rem; } }
.seg button.locked { opacity: .45; }
.nov-logo-row { display: flex; flex-direction: column; gap: .35rem; margin: .25rem 0 .75rem; }
.nov-logo-row .lbl { font-weight: 600; }
.nov-logo-thumb { width: 160px; height: 64px; }
.nov-logo-thumb img { max-height: 60px; }
.nov-logo-thumb[hidden] { display: none !important; }
