/* Club dashboard: builds on /app/app.css */

.club-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.club-head h1 { margin: 0; font-size: 26px; min-width: 0; overflow-wrap: anywhere; }
.club-head .spacer { flex: 1; }
.club-head select, .club-switch { width: auto; min-height: 40px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 600; max-width: 100%; }
.club-head .loc-pick { border-color: var(--blue); }
.loc-name { background: var(--blue-dark); color: var(--blue-on); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.instructor-note { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.instructor-note p { margin: 6px 0; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.invite-text { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; resize: vertical; }

.card { background: var(--surface); border-radius: 18px; padding: 16px 18px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card + .card, .card + .list, .list + .card { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.grid2 > .card { margin-top: 0; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .stats.four { grid-template-columns: repeat(2, 1fr); } .stats.four > :last-child { grid-column: auto; } }

.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row-item:first-of-type { border-top: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 700; }
.row-item .s { color: var(--muted); font-size: 14px; }
.count { font-size: 20px; font-weight: 800; min-width: 2ch; text-align: right; }

/* members table */
.table-wrap { overflow-x: auto; }
table.members { width: 100%; border-collapse: collapse; font-size: 15px; }
table.members th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.members th.num, table.members td.num { text-align: right; }
table.members th[aria-sort] { color: var(--text); }
table.members td { padding: 10px; border-bottom: 1px solid var(--line); }
table.members td .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
table.members tr.quiet td { color: var(--muted); }
table.members td .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.show-sm { display: none; }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .show-sm { display: block; }
  table.members td, table.members th { padding: 10px 6px; }
}
.flag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--amber); margin-left: 6px; }

/* timetable */
.day-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 16px 2px 6px; }

/* class screen: shown on a tablet / laptop at the front of the class */
body.class-mode .topbar { display: none; }
body.class-mode main { max-width: none; padding: 0; }
.class-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); }
@media (max-width: 860px) { .class-screen { grid-template-columns: 1fr; } }
.class-qr { background: #fff; color: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; gap: 14px; text-align: center; }
.class-qr .club { font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #555; }
.class-qr h1 { margin: 0; font-size: clamp(26px, 4vw, 44px); line-height: 1.1; }
.class-qr .when { font-size: 18px; color: #444; }
.class-qr .code svg { width: min(62vh, 82vw, 560px); height: auto; display: block; }
.class-qr .how { font-size: 17px; color: #333; max-width: 520px; }
.class-qr .timer { width: min(62vh, 82vw, 560px); height: 6px; background: #e5e5e5; border-radius: 3px; overflow: hidden; }
.class-qr .timer i { display: block; height: 100%; background: #2f5da8; width: 100%; transition: width 1s linear; }
.class-qr.closed .code { opacity: .08; }
.class-side { padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.class-side .big { font-size: 64px; font-weight: 800; line-height: 1; }
.class-side .names { display: grid; gap: 8px; overflow-y: auto; }
.class-side .name { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 10px 14px; font-size: 18px; font-weight: 600; animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.96); background: var(--blue-dark); } to { transform: none; } }
.class-side .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.closed-banner { background: #3d2a00; color: #ffdea6; border-radius: 12px; padding: 10px 14px; font-weight: 700; }

/* register: tap your name (people without a phone) */
.class-qr .reg-switch { background: #2f5da8; color: #fff; font-size: 17px; min-height: 48px; padding: 0 22px; }
.class-side .name .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.class-side .name .x { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
.class-side .name .x:hover, .class-side .name .x:focus-visible { background: var(--surface-3); color: var(--text); }
.class-register { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; background: var(--surface); }
.class-register .reg-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.class-register .club { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.class-register h1 { margin: 2px 0 4px; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
.class-register .when { color: var(--muted); }
.class-register .reg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-search { width: 100%; font-size: 22px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.reg-search:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-content: start; overflow-y: auto; max-height: calc(100vh - 230px); padding-bottom: 8px; }
.reg-name { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; text-align: left; min-height: 64px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.reg-name:hover, .reg-name:focus-visible { border-color: var(--blue); background: var(--surface-3); }
.reg-name:disabled { opacity: .5; cursor: progress; }
.reg-name .n { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.reg-name .b { grid-column: 2; font-size: 13px; color: var(--muted); }
.reg-empty { color: var(--muted); font-size: 18px; padding: 18px 4px; }
@media (max-width: 860px) { .reg-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } .class-register { padding: 16px; } }
.scan-video { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; transform: scaleX(-1); }
.scan-status { font-size: 18px; font-weight: 700; }
.scan-status.ok { color: var(--green); }
.scan-status.bad { color: var(--amber); }
.flag.reg { color: var(--muted); font-weight: 600; }
.flag.trial { color: var(--blue-on); background: var(--blue-dark); border-radius: 999px; padding: 2px 8px; margin-left: 0; }
.flag.follow { color: #1a1300; background: var(--amber); border-radius: 999px; padding: 2px 8px; margin-left: 0; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
.follow-card { border: 1px solid rgba(255,176,32,.45); }
.follow-card .contact a { color: var(--blue-on); }

/* print member cards */
.pick-list { display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick input { width: 18px; height: 18px; accent-color: var(--blue); }
.pick .grow { flex: 1; min-width: 0; }
.pick .small { font-size: 12px; }
@media screen { #print-cards { display: none; } }
@media print {
  @page { size: A4; margin: 10mm; }
  body > :not(#print-cards) { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  #print-cards { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 4mm; justify-content: center; }
  .mcard { width: 85.6mm; height: 54mm; box-sizing: border-box; border: 0.3mm dashed #888; border-radius: 3mm; padding: 4mm; display: flex; gap: 3mm; align-items: center; break-inside: avoid; color: #000; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  .mcard-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.5mm; }
  .mcard-club { font-size: 7pt; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #444; }
  .mcard-name { font-size: 14pt; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
  .mcard-belt { display: flex; align-items: center; gap: 2mm; font-size: 9pt; }
  .mcard-belt .dot { width: 3.5mm; height: 3.5mm; border-radius: 50%; display: inline-block; border: 0.2mm solid #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mcard-how { font-size: 7pt; color: #444; margin-top: auto; }
  .mcard-qr svg { width: 34mm; height: 34mm; display: block; }
}

/* promotions */
.due-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid rgba(255,176,32,.45); background: #2a2108; color: var(--text); cursor: pointer; margin-bottom: 14px; font: inherit; }
.due-card h2 { color: #ffdea6; }
.due-card .s { color: #e8cf9c; }
.due-card .chev { font-size: 28px; color: #ffdea6; }
.due-text { color: var(--amber) !important; font-weight: 600; }
.progress-row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; align-items: flex-start; }
.progress-row .dot { margin-top: 5px; }
.bar-line { display: grid; grid-template-columns: 88px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--blue); }
.bar.done i { background: var(--amber); }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; }
.rules-grid { grid-template-columns: 1.2fr 1fr 1fr; align-items: center; }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.due-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 600px) {
  .due-row { flex-wrap: wrap; }
  .due-row .grow { flex-basis: calc(100% - 40px); }
  .due-actions { width: 100%; padding-left: 26px; }
  .club-tabs { display: flex; width: 100%; }
  .club-tabs button { flex: 1; padding: 8px 4px; font-size: 14px; }
  .bar-line { grid-template-columns: 76px 1fr 58px; }
}

/* imported members */
.match-card { border: 1px solid rgba(61,123,255,.45); margin-bottom: 14px; }
table.members tr.roster-row { cursor: pointer; }
table.members tr.roster-row:hover td { background: var(--surface-2); }
.import-preview { max-height: 46vh; overflow: auto; }
table.members tr.bad-row td { color: var(--muted); }

/* attendance */
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-nav strong { min-width: 150px; text-align: center; }
.period-nav .icon-btn { font-size: 24px; color: var(--text); }
.period-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.chart-wrap { position: relative; }
.att-chart { width: 100%; height: auto; display: block; }
.att-chart .grid { stroke: var(--line); stroke-width: 1; }
.att-chart .tick { fill: var(--muted); font-size: 11px; }
.att-chart .tick-sel { fill: var(--text); font-weight: 700; }
.att-chart .val { fill: var(--text); font-size: 12px; font-weight: 700; }
.att-chart .col { fill: #4a6aa8; }
.att-chart .sel .col { fill: #3d7bff; }
.att-chart .bar-g { cursor: pointer; }
.att-chart .bar-g:hover .col { fill: #5a77ad; }
.att-chart .sel:hover .col { fill: #5a8fff; }
.att-chart .hit { fill: transparent; }
.chart-tip { position: absolute; top: 0; width: 180px; background: #e6e8ec; color: #111; font-size: 13px; padding: 6px 10px; border-radius: 8px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.class-row .bar { margin-top: 6px; max-width: 320px; }
.class-nums { text-align: right; min-width: 64px; }
.heat { display: grid; gap: 3px; font-size: 13px; }
.heat-h { text-align: center; color: var(--muted); font-weight: 700; font-size: 12px; }
.heat-r { color: var(--muted); font-size: 12px; display: flex; align-items: center; }
.heat-c { min-height: 34px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat-c.none { background: var(--surface-2); }
.heat-key { display: flex; align-items: center; gap: 3px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.heat-key i { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
.heat-key span { margin: 0 6px; }
@media (max-width: 600px) {
  .club-tabs { flex-wrap: wrap; border-radius: 22px; }
  .club-tabs button { flex: 1 1 30%; font-size: 14px; padding: 8px 4px; }
  .period-nav { width: 100%; justify-content: space-between; }
  .heat { font-size: 12px; grid-template-columns: 40px repeat(7, 1fr) !important; }
}
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-line input { margin-top: 3px; width: 18px; height: 18px; }

/* kids' belts in the promotion rules */
tr.group-row td { font-weight: 800; color: var(--muted); padding-top: 14px; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.rules-grid .rules-group { grid-column: 1 / -1; font-weight: 800; color: var(--muted); margin-top: 8px; }

/* class techniques */
.tech-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tech-head h2 { margin: 0; }
.tech-head .grow { flex: 1; min-width: 200px; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tech-item { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tech-thumb { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; background: #000; cursor: pointer; display: block; width: 100%; }
.tech-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tech-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.55);
  color: #fff; display: grid; place-items: center; font-size: 22px; padding-left: 4px; }
.tech-len { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.tech-body { padding: 10px 12px 4px; display: grid; gap: 4px; flex: 1; }
.tech-body .t { font-weight: 700; }
.tech-body .s { font-size: 14px; color: var(--muted); }
.tech-body .s:not(.muted) { color: var(--text); white-space: pre-wrap; }
.tech-actions { display: flex; gap: 8px; padding: 8px 12px 12px; }
dialog.media { width: min(960px, calc(100vw - 24px)); }
.media-dlg { max-height: calc(100vh - 32px); }
.media-box { background: #000; display: grid; place-items: center; min-height: 200px; }
.media-box img, .media-box video { max-width: 100%; max-height: calc(100vh - 200px); display: block; }
.media-note { margin: 0; padding: 12px 22px 18px; white-space: pre-wrap; }
@media (max-width: 600px) {
  .class-row { flex-wrap: wrap; row-gap: 8px; }
  .class-row .grow { flex-basis: calc(100% - 48px); }
  .class-row .grow { order: 1; }
  .class-row .count { order: 2; margin-left: auto; }
  .class-row .btn { order: 3; }
}
