/* Shared look of the HandStats admin, club and team pages. */
/* Colours, spacing, radii and type sizes come from design/tokens.json (generated into tokens.css). */
@import url("/common/tokens.css");
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: var(--font-body)/1.4 var(--font-family); }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--header); color: var(--text);
         border-bottom: 1px solid var(--border); }
header a.back { color: inherit; background: var(--surface); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap;
                padding: 5px 10px 5px 8px; border: 1px solid var(--border); border-radius: 8px; }
header a.back:hover { border-color: var(--accent); }
header a.home { color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
header h1 { font-size: 17px; margin: 0; font-weight: 600; opacity: .85; flex: 1; min-width: 0;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .who { font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
header .who .name { opacity: .85; }
header .club-logo, img.club-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; flex: none; }
header button { height: 32px; }
/* The profile: initials in a circle, next to Log out (hs.js). */
a.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--accent);
           color: #fff; font-weight: 700; font-size: 13px; text-decoration: none; text-transform: uppercase; }
a.avatar:hover { filter: brightness(1.1); }
a.avatar:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
a.avatar[hidden] { display: none; }
footer.version { max-width: 900px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted); font-size: 12px; text-align: right; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
p.hint { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, button { font: inherit; color: inherit; }
input, select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
button { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
         cursor: pointer; font-weight: 600; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.icon { width: 40px; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--accent); }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row > .fixed { flex: 0 0 auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px 6px; }
td { padding: 4px; vertical-align: middle; }
td.num { width: 76px; } td.act { width: 48px; }
tfoot td { padding-top: 10px; }
.badge { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.status { font-size: 13px; min-height: 18px; margin-top: 8px; color: var(--muted); }
.status.error { color: var(--danger); } .status.ok { color: var(--ok); }
.muted { color: var(--muted); }
.played td { opacity: .5; }
.hidden { display: none !important; }
.notice { max-width: 420px; margin: 48px auto; text-align: center; }
details.club { border-top: 1px solid var(--border); padding: 10px 0; }
details.club:first-of-type { border-top: 0; }
details.club summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; list-style: none; }
details.club summary::-webkit-details-marker { display: none; }
details.club summary::before { content: "›"; color: var(--muted); transition: transform .15s; display: inline-block; width: 10px; }
details.club[open] summary::before { transform: rotate(90deg); }
details.club .body { padding: 10px 0 4px 22px; }
@media (max-width: 640px) {
  header .who .name { display: none; }
  header a.home { display: none; }   /* Back + the page name are enough on a phone */
  thead { display: none; }
  table, tbody, tfoot { display: block; }
  tr { display: grid; grid-template-columns: 70px 1fr 44px; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  td { padding: 0; width: auto !important; }
  td.wide { grid-column: 1 / -1; }
  td.act { grid-column: 3; grid-row: 1; }
  button.icon { width: 44px; }
}
/* Tabs (HS.tabs): one section of the page at a time. */
nav.tabs { display: flex; gap: 6px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface); white-space: nowrap; flex: none; display: flex; align-items: center; gap: 6px; }
nav.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
nav.tabs button .n { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 9px; background: var(--bg); color: var(--muted); }
nav.tabs button.active .n { background: rgba(255, 255, 255, .25); color: #fff; }
section[hidden] { display: none; }
/* Access codes and the users of a team (common/access.js, club and team pages). */
button.small { height: 28px; padding: 0 8px; font-size: 12px; font-weight: 500; margin-left: 4px; }
td.code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .05em; }
table.codes small { font-size: 12px; }
@media (max-width: 640px) {
  table.codes tr { grid-template-columns: 1fr 1fr 44px; }
  table.codes td.code { grid-column: 1 / 3; }
  table.codes tfoot td.lbl { grid-column: 1 / 3; }
  table.codes td.type, table.codes td.valid { grid-column: span 1; }
  table.codes td.used { grid-column: 1 / 3; }
  table.codes td.team { grid-column: 1 / 3; font-weight: 600; }
  table.codes td.code button.small { margin: 4px 4px 0 0; }
}
/* People (common/people.js): rows, role badges, requests, the add-person form and the panel. */
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; min-height: 48px; padding: 8px 10px; border: 0;
          border-top: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left; font-weight: 400; }
.person:first-child { border-top: 0; }
.person:hover { background: var(--bg); }
.person .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .pname small, .request .pname small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.role { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 9px;
        background: var(--bg); color: var(--muted); white-space: nowrap; }
.role.admin { background: var(--accent); color: #fff; } .role.coach { background: var(--ok); color: #fff; }
.person .seen { font-size: 12px; color: var(--muted); white-space: nowrap; width: 90px; text-align: right; }
.person .count { font-size: 12px; color: var(--accent); white-space: nowrap; }
.request { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.request:first-child { border-top: 0; }
.request .pname { flex: 1; min-width: 180px; }
.request .acts { display: flex; gap: 6px; }
.addbox { border-top: 1px solid var(--border); padding: 12px; background: var(--bg); }
.addbox .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.addbox .seg button { height: 32px; border: 0; border-radius: 0; background: var(--surface); font-weight: 500; font-size: 13px; padding: 0 12px; }
.addbox .seg button.active { background: var(--accent); color: #fff; }
.addperson { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.addperson input, .addperson select { flex: 1 1 140px; height: 36px; font-size: 14px; background: var(--surface); }
.addbox .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.addbox .acts button { height: 36px; }
.findperson input { height: 36px; font-size: 14px; background: var(--surface); margin-bottom: 6px; }
.findperson .found { max-height: 240px; overflow: auto; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.foundrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--border); }
.foundrow:first-child { border-top: 0; }
.foundrow .pname { flex: 1; min-width: 0; }
.foundrow .pname small { color: var(--muted); font-size: 12px; margin: 0 6px; }
.gfoot button.small { height: 32px; font-size: 13px; }
.group { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.group > .ghead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); font-weight: 600; }
.group > .ghead .sub { font-weight: 400; color: var(--muted); font-size: 13px; flex: 1; }
.group > .ghead a { font-size: 13px; font-weight: 500; }
.group > .gfoot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.group > .gfoot button.link, button.link { border: 0; background: transparent; color: var(--accent); padding: 0; height: auto; font-weight: 600; font-size: 13px; }
.group .folded { border-top: 1px solid var(--border); }
.attention { border-left: 4px solid var(--gk); }
.attention .ghead { background: color-mix(in srgb, var(--gk) 12%, var(--surface)); }
.attention .item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.attention .item:first-child { border-top: 0; }
.attention .item .what { flex: 1; min-width: 200px; }
.attention .item .muted { font-size: 13px; }
.quiet { color: var(--muted); font-size: 13px; padding: 10px 12px; }
.hdr { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.hdr:first-child { margin-top: 0; }
button.small.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
details.types { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
details.types summary { cursor: pointer; }
details.types p { margin: 6px 0 0; }
/* the panel */
#hs-panel .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 20; }
#hs-panel .sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); z-index: 21;
                   display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0, 0, 0, .15); }
#hs-panel header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
#hs-panel header h3 { flex: 1; margin: 0; font-size: 17px; }
#hs-panel .body { flex: 1; overflow: auto; padding: 16px; }
#hs-panel .body label { margin-top: 12px; }
#hs-panel .body label:first-child { margin-top: 0; }
#hs-panel .body .chips { margin-top: 4px; }
#hs-panel .body .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
#hs-panel .body .acts button { flex: 1 1 140px; }
#hs-panel .body .danger-zone { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--border); }
#hs-panel .status { padding: 0 16px 12px; }
body.panel-open { overflow: hidden; }
@media (max-width: 640px) {
  #hs-panel .sheet { width: 100%; }
  .person .seen { width: auto; }
  .person .pname { white-space: normal; }
}
.addbox [hidden], .findperson[hidden], form.addperson[hidden] { display: none !important; }
.suggest { flex: 1 0 100%; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--danger); }
button.chipbtn { height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--surface); }
.suggest.ok { color: var(--ok); }
