/* Entries and Events sections (P1): secondary nav, the Clubs and Athletes lenses, the events catalogue and the
   event page. Builds on dash.css (Material layer: .mbtn, .ml-list, .drawer, type tokens). Venue colour only where
   it means a venue; grey = not allocated; gold = the split between venues. */

/* ---- top tabs fit five on a phone ---- */
@media (max-width: 899px) { .admin-tabs a { padding: 0 4px; font-size: 13px; } }

/* ---- secondary nav: Material secondary tabs ---- */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.subnav a, .subnav .off { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; font: var(--t-head); font-size: 13px;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); background: rgba(27,36,64,.04); }
.subnav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.subnav .off { opacity: .45; cursor: default; }
.sn-count { font: var(--t-meta); font-size: 11px; color: var(--muted); background: #EEF1F7; border-radius: 99px; padding: 0 7px; }

/* ---- lists: rows are links ---- */
a.crm-row { text-decoration: none; }
.crm-bar .mbtn { flex: none; }
.crm-head > span.num { justify-self: end; }

/* Clubs lens */
.crm.lens-clubs .crm-head, .crm.lens-clubs .crm-row { grid-template-columns: minmax(220px, 2.4fr) 70px 80px 170px minmax(120px, 1fr) 110px; }
.crm-row .c-drive small { display: block; }
.crm-row .c-orders { color: var(--muted); }
/* Athletes lens */
.crm.lens-ath .crm-head, .crm.lens-ath .crm-row { grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.6fr) minmax(120px, 1fr) 70px 150px; }
.crm-row .c-name b { display: block; font: var(--t-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-row .c-clubname span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-row .c-relay { color: var(--muted); font-size: 13px; }
.crm-row .pill { font-size: 12px; padding: 2px 10px; }

@media (max-width: 899px) {
  .crm.lens-clubs .crm-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "club paid" "venue ath"; }
  .crm.lens-clubs .crm-row .c-orders, .crm.lens-clubs .crm-row .c-drive { display: none; }
  .crm.lens-ath .crm-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name venue" "club event"; }
  .crm.lens-ath .c-name { grid-area: name; } .crm.lens-ath .c-venue { grid-area: venue; justify-self: end; }
  .crm.lens-ath .c-clubname { grid-area: club; } .crm.lens-ath .c-event { grid-area: event; justify-self: end; color: var(--muted); font-size: 13px; }
  .crm.lens-ath .c-relay { display: none; }
  .crm.lens-ath .crm-row .c-ath::after { content: none; }
  .crm-bar .segctl { flex: 1 1 100%; }
}

/* ---- small parts ---- */
.vdot { display: inline-flex; align-items: center; gap: 6px; font: var(--t-meta); color: var(--muted); }
.vdot i { width: 8px; height: 8px; border-radius: 50%; background: #9AA3B8; }
.vdot.ox i { background: var(--blue); } .vdot.ld i { background: var(--purple); }
.club-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: 16px; background: #EEF1F7; font: var(--t-head); font-size: 13px; }
.club-chip a { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); text-decoration: none; }
.club-chip a:hover { background: rgba(27,36,64,.08); color: var(--ink); }
.sec-filter { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sec-empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.ml-text small.wrap { white-space: normal; }
a.ml-item { text-decoration: none; color: inherit; } a.ml-item:hover { background: rgba(18,71,188,.06); }
.es-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 8px; }
.es-chips .pill { font-size: 12px; padding: 2px 10px; }
.es-events { margin: 0 4px; font: var(--t-body); }
.cc-status.none { color: var(--muted); }
.ev-open { justify-self: start; }

/* ---- event page ---- */
.evp { background: #fff; border-radius: var(--r-card, 14px); box-shadow: var(--shadow); padding: 16px 18px 18px; }
.evp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.evp-id { flex: 1; min-width: 0; }
.evp-id h1 { margin: 0; font: var(--t-title); font-size: 20px; display: flex; align-items: center; gap: 8px; }
.evp-id h1 .pill { font-size: 11px; padding: 2px 8px; }
.evp-id p { margin: 2px 0 0; font: var(--t-meta); color: var(--muted); }
.evp-split { margin: 16px 0 6px; }
.ev-bar .none { background: #C3C9D6; }
.evp-venues { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.evp-venues > div { display: flex; flex-direction: column; }
.evp-venues > div:nth-child(2) { align-items: center; text-align: center; }
.evp-venues > div:last-child { align-items: flex-end; text-align: right; }
.evp-venues span { font: var(--t-label); letter-spacing: .1em; text-transform: uppercase; }
.evp-venues .ox span { color: var(--blue); } .evp-venues .ld span { color: var(--purple); } .evp-venues .none span { color: #7A849D; }
.evp-venues b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.evp-venues small { font: var(--t-meta); color: var(--muted); }
.evp-tabs { margin: 8px -18px 10px; padding: 0 10px; }
.evp-tabs button { flex: 0 0 auto; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.evp-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.evp-cols, .evp-relay { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.evp-venue h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 4px 6px; padding-bottom: 6px; border-bottom: 3px solid #C3C9D6;
  font: var(--t-label); letter-spacing: .1em; text-transform: uppercase; color: #7A849D; }
.evp-venue.ox h3 { color: var(--blue); border-bottom-color: var(--blue); } .evp-venue.ld h3 { color: var(--purple); border-bottom-color: var(--purple); }
.evp-venue h3 span { font-size: 13px; color: var(--ink); }
.evp-venue > p { margin: 0 4px 8px; font: var(--t-body); }
.evp-note { margin: 0 4px 14px; padding: 10px 12px; border-radius: 10px; background: #F6F7FA; font: var(--t-body); color: var(--muted); }
.evp-list { max-width: 720px; }
@media (max-width: 599px) {
  .evp { padding: 12px; border-radius: 12px; }
  .evp-tabs { margin: 8px -12px 10px; padding: 0 4px; }
  .evp-tabs button { flex: 1; padding: 0 6px; }
  .evp-venues b { font-size: 20px; }
}

/* ---- icons in navigation and headings: one size per level, the brand tone on headings (tokens --ic-*) ---- */
.admin-tabs a .ic { font-size: var(--ic-sm); margin-right: 6px; }
.subnav .ic, .ptabs .ic { font-size: var(--ic-sm); }
.subnav a.on .ic, .ptabs a.on .ic { color: var(--ic-tone); }
.sx-ic { font-size: var(--ic-sm); color: var(--ic-tone); }
.pcard-h:has(> .ic) { justify-content: flex-start; }
.pcard-h > .ic { font-size: var(--ic-sm); color: var(--ic-tone); align-self: center; margin-right: -2px; }
.pcard-h:has(> .ic) > span:last-child { margin-left: auto; }
.ph-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--pale); color: var(--ic-tone); display: grid; place-items: center; flex: none; }
.ph-ic .ic { font-size: var(--ic-lg); }

/* ---- list views: Entries, Clubs, Athletes and a club's entries (mobile-app rows: lead, title + supporting line,
   trailing meta and chevron). The bar with search, sort and filter chips sticks under the topbar. ---- */
.lv-top { position: sticky; top: var(--topbar); z-index: 18; background: var(--bg); margin: 0 calc(-1 * var(--gutter)) var(--s2); padding: var(--s2) var(--gutter); }
@media (max-width: 899px) { .lv-top { top: calc(var(--topbar) + 66px); } }
.lv-bar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.lv-search { flex: 1 1 260px; }
.lv-search > svg.ic { width: var(--ic-sm); height: var(--ic-sm); fill: currentColor; stroke: none; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ic-meta); font-size: var(--ic-sm); pointer-events: none; }
.lv-search input { width: 100%; padding-right: 36px; }
.lv-kbd, .lv-keys kbd { font: 600 11px/1 Inter, sans-serif; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: #fff; }
.lv-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.lv-search:focus-within .lv-kbd { opacity: 0; }
.lv-bar .mbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.lv-bar .mbtn .ic { font-size: var(--ic-sm); }
.lv-toggle.on { background: var(--pale); color: var(--blue); border-color: transparent; }
.lv-menu { position: relative; }
.lv-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 190px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(27,36,64,.16);
  animation: lv-pop .16s ease-out; transform-origin: top left; }
@keyframes lv-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.lv-pop button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: 500 var(--fs-md) Inter, sans-serif; color: var(--ink); text-align: left; cursor: pointer; }
.lv-pop button:hover { background: var(--bg); }
.lv-pop button.on { color: var(--blue); font-weight: 700; }
.lv-pop .ic { font-size: var(--ic-sm); } .lv-off { visibility: hidden; }

.lv-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: var(--s2); }
.fchip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font: 600 13px Inter, sans-serif; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.fchip:hover { background: #F5F8FE; }
.fchip .ic { font-size: var(--ic-sm); margin-left: -4px; }
.fchip-n { font: 600 11px Inter, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.fchip.on { background: var(--pale); border-color: transparent; color: var(--blue); }
.fchip.on .fchip-n { color: inherit; }
.fchip.ox.on { background: var(--pale); color: var(--blue); } .fchip.ld.on { background: var(--purple-pale); color: var(--purple); }
.fchip.err.on { background: var(--err-bg); color: var(--err); }
.lv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.lv-clear { font-size: 13px; margin-left: 4px; }

.lv { list-style: none; margin: 0; padding: 4px 0; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); }
.lv > li + li { border-top: 1px solid #F0F2F7; }
.lv-row { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s2) var(--s4); color: var(--ink); text-decoration: none; transition: background .12s; }
.lv-row:hover { background: #F7F9FE; }
.lv-row:focus-visible { outline: 0; background: var(--pale); box-shadow: inset 3px 0 0 var(--blue); }
.lv-no { flex: none; min-width: 44px; height: 32px; padding: 0 6px; border-radius: 8px; background: var(--pale); color: var(--blue); font-weight: 800; font-size: 13px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.lv-blade, .lv-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #F2F4F9; color: var(--ic-meta); overflow: hidden; }
.lv-blade { border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.lv-blade:has(> .ic) { background: #F2F4F9; box-shadow: none; }
.lv-blade img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.lv-blade .ic { font-size: var(--ic-md); }
.lv-av.tbc { background: var(--warn-bg); color: var(--warn); font-weight: 800; }
.lv-text { flex: 1; min-width: 0; }
.lv-text b { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; line-height: 1.3; min-width: 0; }
.lv-text b.tbc { color: var(--muted); font-style: italic; }
.lv-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-tag { flex: none; font: 600 11px Inter, sans-serif; color: var(--muted); background: #EEF0F4; border-radius: 6px; padding: 2px 6px; font-style: normal; }
.lv-meta { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; max-width: 52%; }
/* desktop: fixed slots, so counts, venues and payments line up down the list */
@media (min-width: 700px) {
  .lv-meta.slots { display: grid; grid-template-columns: 56px 64px 168px 112px; justify-items: start; }
  .lv-meta.slots.ath { grid-template-columns: 150px 64px 112px; }
  .lv-meta.slots > .lv-count { justify-self: end; }
}
.lv-meta .pill { font-size: 12px; padding: 2px 10px; white-space: nowrap; }
.lv-count { display: inline-flex; align-items: center; gap: 3px; min-width: 44px; justify-content: flex-end; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.lv-count .ic { font-size: var(--ic-sm); color: var(--ic-meta); }
.lv-event { font-size: 13px; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.lv-chev { flex: none; color: var(--placeholder); font-size: var(--ic-md); transition: transform .15s; }
.lv-row:hover .lv-chev { transform: translateX(2px); color: var(--muted); }
.lv-group + .lv-group { margin-top: var(--s4); }
.lv-group-h { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 6px; font-size: 14px; }
.lv-group-h a { color: var(--ink); text-decoration: none; font-weight: 800; } .lv-group-h a:hover { color: var(--blue); text-decoration: underline; }
.lv-group-h small { color: var(--muted); font-weight: 500; font-size: 12px; }
.lv-keys { margin: var(--s2) 4px 0; font-size: 12px; color: var(--muted); }
@media (max-width: 899px) { .lv-keys, .lv-kbd { display: none; } }
@media (max-width: 699px) {
  /* phone: the chips scroll sideways in one line; rows wrap their meta under the title */
  .lv-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .lv-chips::-webkit-scrollbar { display: none; }
  .lv-bar .mbtn { padding: 0 10px; }
  .lv-row { flex-wrap: wrap; row-gap: 6px; column-gap: 10px; padding: 10px 12px; }
  .lv-no { min-width: 38px; height: 28px; font-size: 12px; }
  .lv-blade, .lv-av { width: 32px; height: 32px; }
  .lv-text { flex-basis: calc(100% - 140px); }
  .lv-meta { order: 5; max-width: none; flex: 1 1 100%; justify-content: flex-start; padding-left: 48px; }
  .lv-count { min-width: 0; }
  .lv-row:not(:has(.lv-no)) .lv-meta { padding-left: 42px; }
  .lv-chev { order: 4; }
}
@media (prefers-reduced-motion: reduce) { .lv-pop { animation: none; } .lv-chev { transition: none; } }
.dash-line > span > .ic, .dash-line > a > .ic { font-size: var(--ic-sm); color: var(--ic-meta); margin-right: 5px; vertical-align: -3px; }
.dash-line button > .ic { font-size: var(--ic-sm); margin-right: 4px; vertical-align: -3px; }
.dash-line a.dash-money.overdue > .ic { color: var(--err); }
.feed-sec h3 > .ic { font-size: var(--ic-sm); margin-right: -4px; }
@media (max-width: 699px) { .lv-meta > span:empty { display: none; } }
@media (max-width: 599px) {
  /* phone: inactive top tabs show only their icon (label kept for screen readers) */
  .admin-tabs a:not(.active) .at-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .admin-tabs a:not(.active) .ic { font-size: 20px; margin: 0; }
  .admin-tabs a.active { padding: 0 10px; }
  .admin-tabs a.active .ic { margin-right: 4px; }
}
@media (max-width: 699px) {
  /* phone: the bar scrolls with the page (sticky would cover half the screen); the export is an icon button */
  .lv-top { position: static; }
  .lv-bar .lv-search { flex: 1 1 100%; }
  .lv-bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* an entry whose coach left notes for the organisers */
.lv-note { display: inline-grid; place-items: center; flex: none; color: var(--blue); }
.lv-note .ic { font-size: 16px; }
