@import url('/tournament-summary.css');
:root { --color-border: #dbe4ed; --color-text-secondary: #52657a; --radius-md: 8px; }
body { margin: 0; padding: 16px; background: #f4f7fa; color: #21364d; font: 15px/1.5 system-ui, sans-serif; }
.dashboard-header, .events-dashboard { max-width: 1120px; margin: 0 auto; }
.events-dashboard *, dialog * { box-sizing: border-box; }
.events-dashboard [hidden], dialog [hidden] { display: none !important; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin: 28px 0 18px; }
.dashboard-heading > div:first-child { max-width: 620px; }
h1 { margin: 0; color: #124f8a; font-size: clamp(1.8rem, 4vw, 2.4rem); text-align: left; }
h2 { font-size: 1.25rem; color: #174c7f; margin: 0; }
h3 { font-size: 1.05rem; margin: 0; }
.dashboard-heading p { margin: 5px 0 0; color: #52657a; }
.player-priority { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid #28784a; border-radius: 8px; background: #edf9f0; }
.player-priority h2 { margin: 0; font-size: 1.05rem; }
.player-priority ul { list-style: none; margin: 0; padding: 0; }
.player-priority a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; overflow-wrap: anywhere; }
.dashboard-heading .eyebrow { text-transform: uppercase; font-weight: 700; font-size: .75rem; letter-spacing: .09em; color: #277049; }
.dashboard-actions, .card-actions, .guide-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.events-dashboard button, .events-dashboard .button, dialog button, dialog .button { font: inherit; border: 1px solid #1565c0; border-radius: 6px; background: #1565c0; color: white; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.events-dashboard .secondary, dialog .secondary { background: white; color: #155a9e; }
.events-dashboard button:disabled, dialog button:disabled { opacity: .6; cursor: wait; }
.events-dashboard a, dialog a { color: #125ba7; }
.events-dashboard .button, dialog .button { color: white; }
.events-dashboard .button.secondary, dialog .button.secondary { color: #155a9e; }
.events-dashboard .danger { color: #a12323; background: white; border-color: #d49c9c; }
.guide-links { font-size: .9rem; margin-bottom: 20px; }
.dashboard-filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; background: white; border: 1px solid #dbe4ed; border-radius: 10px; padding: 14px; margin: 18px 0 26px; }
.dashboard-filters label { flex: 1; min-width: 145px; font-size: .85rem; font-weight: 600; margin: 0; }
.dashboard-filters label:first-child { flex: 2; }
.events-dashboard input:not([type=checkbox]), .events-dashboard select, dialog input:not([type=checkbox]), dialog select { display: block; width: 100%; min-width: 0; font: inherit; color: #21364d; background: white; padding: 9px 10px; border: 1px solid #aabccd; border-radius: 5px; margin-top: 4px; }
.dashboard-filters .check { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; padding: 10px 0; min-width: 0; }
.section-heading { display: flex; gap: 10px; align-items: center; margin: 24px 0 6px; }
.count, .status-badge { border-radius: 20px; background: #e8eff8; padding: 3px 10px; font-size: .8rem; color: #234c77; display: inline-block; }
.status-draft { background: #fff0d5; color: #805100; }
.status-confirmed { background: #e4f4e8; color: #236139; }
.section-hint { color: #52657a; font-size: .9rem; margin: 6px 0 14px; }
.tournament-card, .tournament-group { background: white; border: 1px solid #dbe4ed; border-radius: 10px; margin: 12px 0; overflow: hidden; }
.tournament-card { padding: 18px; border-left: 4px solid #23724d; }
.card-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 10px; }
.card-meta { color: #52657a; margin: 6px 0 10px; font-size: .9rem; }
.entry-summary { list-style: none; margin: 10px 0 14px; padding: 0; }
.entry-summary li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf1f5; padding: 7px 0; font-size: .9rem; }
.card-actions { margin-top: 12px; }
.card-actions a:not(.button) { font-size: .9rem; }
.admin-card { --accent: #23724d; --accent-soft: #e4f4e8; padding: 0; border-left: 0; border-top: 4px solid var(--accent); box-shadow: 0 1px 2px rgba(20, 50, 80, .05); transition: box-shadow .15s; }
.admin-card:hover { box-shadow: 0 6px 18px rgba(20, 50, 80, .10); }
.admin-card.status-draft { --accent: #c98a0d; --accent-soft: #fff3dc; background: white; color: inherit; }
.admin-card.status-completed { --accent: #6b7c8f; --accent-soft: #eef2f6; }
.admin-card.status-cancelled { --accent: #b52d2d; --accent-soft: #fdeaea; }
.admin-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 18px 4px; }
.admin-card-title { min-width: 0; }
.admin-card-link { color: inherit; text-decoration: none; }
.admin-card-link:hover, .admin-card-link:focus-visible { color: #0d47a1; text-decoration: underline; }
.admin-card h3 { font-size: 1.2rem; color: #173f66; margin: 6px 0 2px; overflow-wrap: anywhere; }
.admin-card .card-meta { margin: 0; }
.admin-card-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-chip, .window-chip { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 20px; padding: 2px 9px; }
.status-chip { background: var(--accent-soft); color: var(--accent); }
.window-chip { color: #52657a; background: #f1f5f9; text-transform: none; letter-spacing: 0; font-weight: 600; }
.dupr-chip { font-size: .72rem; font-weight: 700; border-radius: 20px; padding: 2px 9px; background: #e6f0ff; color: #0b3d91; }
.events-dashboard a.qr-link { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 58px; padding: 8px 4px 6px; border: 1px solid #dbe4ed; border-radius: 10px; color: #155a9e; text-decoration: none; font-size: .7rem; font-weight: 700; letter-spacing: .05em; background: #f8fbfe; transition: background .15s, border-color .15s; }
.events-dashboard a.qr-link:hover { background: #e8f1fb; border-color: #9fc0e3; }
.qr-icon { width: 30px; height: 30px; background: currentColor; -webkit-mask: url(/assets/qr-code-svgrepo-com.svg) center / contain no-repeat; mask: url(/assets/qr-code-svgrepo-com.svg) center / contain no-repeat; }
.card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 18px 14px; }
.card-stats div { background: #f6f9fc; border-radius: 8px; padding: 8px 12px; min-width: 0; }
.card-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6a7c8f; font-weight: 600; }
.card-stats dd { margin: 0; font-size: 1.35rem; font-weight: 700; color: #173f66; line-height: 1.3; }
.card-stats small { font-size: .78rem; font-weight: 600; color: #52657a; }
.admin-card > .notice { margin: 0 18px 14px; }
.card-tools { display: flex; flex-wrap: wrap; border-top: 1px solid #e5ebf2; background: #fbfcfe; }
.card-tools > a, .card-tools > span, .events-dashboard .card-tools > button { flex: 1 1 0; min-width: 120px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 10px; font-size: .88rem; font-weight: 600; text-decoration: none; color: #24527f; border-right: 1px solid #e5ebf2; white-space: nowrap; transition: background .15s, color .15s; }
.events-dashboard .card-tools > button { background: transparent; border: 0; border-right: 1px solid #e5ebf2; border-radius: 0; min-height: 44px; }
.card-tools > :last-child { border-right: 0; }
.events-dashboard .card-tools > a { color: #24527f; }
.events-dashboard .card-tools > a:hover, .events-dashboard .card-tools > button:hover { background: #eaf2fb; color: #0d47a1; }
.events-dashboard .card-tools > .player-dashboard-tool { background: #e4f4e8; color: #236139; font-weight: 750; }
.events-dashboard .card-tools > .player-dashboard-tool:hover { background: #d3ebda; color: #194b2b; }
.card-tools svg { width: 18px; height: 18px; flex: none; }
.card-tools .tool-disabled { color: #9aa9b8; cursor: not-allowed; }
.card-lifecycle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 18px 14px; padding: 9px 12px; border-radius: 8px; background: #f3f6f9; color: #485c71; font-size: .88rem; }
.card-lifecycle.due { background: #fff5e0; color: #6b4a00; }
.events-dashboard .card-lifecycle button { padding: 6px 12px; font-size: .85rem; white-space: nowrap; }
.events-dashboard .card-lifecycle.due button { background: #2e7d32; border-color: #2e7d32; }
.past-search-hint { padding: 12px 14px; border: 1px dashed #c3d0dd; border-radius: 8px; background: #fbfcfe; }
.lifecycle-dialog { width: min(640px, calc(100vw - 28px)); }
.lifecycle-dialog h2 { margin-top: 0; }
.lifecycle-dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.lifecycle-dialog .danger { background: #fff; color: #b71c1c; border-color: #b71c1c; }
.lifecycle-events { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.lifecycle-events th, .lifecycle-events td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e5ebf1; vertical-align: top; }
.lifecycle-status { font-weight: 600; }
.lifecycle-status.ok { color: #2e7d32; }
.lifecycle-status.blocking { color: #b71c1c; }
.lifecycle-warning { color: #e65100; font-weight: 600; }
.player-card.phase-underway { --accent: #23724d; --accent-soft: #e4f4e8; }
.player-card.phase-upcoming { --accent: #1565c0; --accent-soft: #e5effb; }
.player-card:target, .player-card.tournament-return-target { outline: 2px solid #1565c0; outline-offset: 3px; scroll-margin: 16px; }
.player-card.phase-past { --accent: #6b7c8f; --accent-soft: #eef2f6; }
.player-card-tools { margin-top: 12px; border-bottom: 1px solid #e5ebf2; }
.player-card-tools > * { min-height: 44px; }
.events-dashboard .player-card-tools.registration-incomplete > .registration-tool { background: #e5effb; color: #0d47a1; font-weight: 700; }
.events-dashboard .player-card-tools.registration-incomplete > .registration-tool:hover { background: #d4e5f9; }
.status-chip.chip-draft { background: #fff0d5; color: #805100; }
.partner-attention { display: inline-block; margin-top: 5px; padding: 3px 7px; background: #fff0d5; color: #805100; font-size: .85rem; font-weight: 700; border-radius: 4px; }
.partner-attention-summary { margin: 12px 18px; padding: 10px 12px; background: #fff0d5; color: #805100; border-left: 3px solid #c67c00; font-size: .9rem; }
.partner-attention.waiting-partner, .partner-attention-summary.waiting-partner { background: #eaf2fb; color: #285f97; border-color: #8bb1da; }
.phase-group { margin-bottom: 8px; }
.phase-heading { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; color: #173f66; margin: 22px 0 2px; text-transform: uppercase; letter-spacing: .06em; }
.phase-group-underway > .phase-heading::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #23a35a; box-shadow: 0 0 0 4px rgba(35, 163, 90, .18); }
details.phase-group > summary, summary.disclosure { cursor: pointer; list-style: none; }
details.phase-group > summary::-webkit-details-marker, summary.disclosure::-webkit-details-marker { display: none; }
details.phase-group > summary::before, summary.disclosure::before { content: "\25B8"; color: #6a7c8f; transition: transform .15s; }
details.phase-group[open] > summary::before, details[open] > summary.disclosure::before { transform: rotate(90deg); }
/* Visible Show/Hide cue so collapsed sections read as expandable. */
.disclosure-hint { font-size: .85rem; font-weight: 600; color: #125ba7; text-transform: none; letter-spacing: normal; }
.disclosure-hint::after { content: "Show"; }
details[open] > summary .disclosure-hint::after { content: "Hide"; }
summary:hover .disclosure-hint, summary:focus-visible .disclosure-hint { text-decoration: underline; }
/* Each major area (invitations, tournaments, other events, payments) starts below a divider. */
.dashboard-section { border-top: 1px solid #dbe4ed; margin-top: 30px; }
.dashboard-section > .section-heading, .dashboard-section > details > .section-heading { margin: 18px 0 6px; }
.dashboard-footer { border-top: 1px solid #dbe4ed; margin-top: 36px; padding-top: 14px; text-align: center; color: #52657a; font-size: .9rem; }
.dashboard-footer p { margin: 0; }
.bracket-entries { list-style: none; margin: 10px 0 14px; padding: 0 18px; }
.bracket-entry { border: 1px solid #e5ebf2; border-radius: 9px; padding: 10px 12px; margin-top: 8px; background: #fbfcfe; }
.bracket-entry-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.bracket-entry-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.bracket-entry-head strong { color: #173f66; }
.bracket-entry-meta { font-size: .85rem; color: #52657a; margin-top: 1px; }
.entry-note { font-size: .85rem; color: #6a7c8f; margin: 8px 0 0; font-style: italic; }
.card-pad { padding: 0 18px 14px; margin: 0; }
.entry-subhead { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: #6a7c8f; margin: 0 0 4px; }
.play-events { list-style: none; margin: 8px 0 0; padding: 0; }
.play-event { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; background: white; border: 1px solid #e5ebf2; border-left: 3px solid #9aa9b8; border-radius: 7px; padding: 8px 10px; margin-top: 6px; }
.play-event.status-active { border-left-color: #23a35a; }
.play-event.status-starting { border-left-color: #1565c0; }
.play-event-main { min-width: 0; }
.play-event-main > strong { font-weight: 650; overflow-wrap: anywhere; }
.play-event-meta { font-size: .82rem; color: #52657a; }
.event-state { font-weight: 700; color: #3c4f63; }
.play-event.status-active .event-state { color: #1d7a45; }
.you-status { margin-left: 4px; background: #fff3dc; color: #805100; border-radius: 20px; padding: 1px 8px; font-weight: 700; font-size: .75rem; }
.you-status.you-idle, .you-status.you-finished { background: #eef2f6; color: #44546a; }
.you-status.you-waiting { background: #eaf2fb; color: #285f97; }
.you-status.you-medal { background: #fff6d6; color: #6b4e00; }
.you-status.you-on-court { background: #c62828; color: white; font-size: .82rem; padding: 2px 10px; }
.play-event.on-court { border: 2px solid #c62828; border-left-width: 6px; background: #fff5f5; }
.record-chip { background: #eef2f6; color: #2c3e50; }
.player-card.player-on-court, .tournament-group.player-on-court { border: 2px solid #c62828; box-shadow: 0 0 0 4px rgba(198, 40, 40, .15); }
.on-court-alert { display: flex; gap: 12px; align-items: center; background: #c62828; color: white; padding: 12px 18px; font-size: 1rem; }
.on-court-alert strong { display: block; font-size: 1.1rem; }
.on-court-alert span { font-size: .9rem; }
.on-court-alert .on-court-icon { font-size: 1.8rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .on-court-alert .on-court-icon { animation: on-court-pulse 1.4s ease-in-out infinite; }
  @keyframes on-court-pulse { 50% { transform: scale(1.18); } }
}
.tournament-group-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; background: #eaf0f6; padding: 12px 16px; }
.tournament-group-header strong { margin-right: auto; }
.event-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; background: white; border-bottom: 1px solid #e5ebf2; }
.event-row:last-child { border-bottom: 0; }
.event-row-main { flex: 1; min-width: 140px; }
.event-row-main > a { font-weight: 650; }
.event-row-meta { color: #52657a; font-size: .85rem; margin-top: 3px; overflow-wrap: anywhere; }
.event-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.event-row-actions button { padding: 5px 9px; font-size: .85rem; background: white; color: #125ba7; }
.empty-state { padding: 24px; text-align: center; color: #52657a; border: 1px dashed #b8c9d8; background: white; border-radius: 8px; margin: 18px 0; }
.notice { padding: 12px 16px; border-left: 4px solid #25734b; background: #eaf5ee; border-radius: 4px; margin: 12px 0; }
.notice.error { border-color: #b52d2d; background: #fff0f0; color: #942727; }
.events-dashboard .text-button { background: transparent; border: 0; color: #125ba7; padding-left: 0; }
.utility-section { border-top: 1px solid #ccd9e5; margin-top: 28px; padding-top: 20px; }
.archive-search { max-width: 650px; }
.search-line { display: flex; gap: 8px; align-items: center; }
.search-line input { flex: 1; }
dialog { width: min(900px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); box-sizing: border-box; border: 1px solid #bbcddd; border-radius: 12px; padding: 22px; color: #21364d; background: #f8fafc; }
dialog::backdrop { background: rgba(15, 35, 57, .55); }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.dialog-heading p { font-size: .9rem; color: #52657a; margin-bottom: 0; }
.dialog-actions { position: sticky; bottom: -22px; padding: 12px 0; background: #f8fafc; text-align: right; }
.roster-table { width: 100%; border-collapse: collapse; background: white; margin-top: 16px; }
.events-dashboard .roster-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; font-size: .85rem; font-weight: 600; background: white; color: #24527f; border: 1px solid #c3d0dd; border-radius: 6px; }
.events-dashboard .roster-button:hover { background: #eaf2fb; color: #0d47a1; }
.roster-button svg { width: 16px; height: 16px; flex: none; }
.roster-table th, .roster-table td { padding: 8px; text-align: left; border-bottom: 1px solid #dbe4ed; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #f1a735; outline-offset: 3px; }
@media (max-width: 600px) {
  body { padding: 10px; }
  .dashboard-heading { margin-top: 18px; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions .button, .dashboard-actions button { flex: 1; text-align: center; }
  .dashboard-filters { padding: 12px; gap: 10px; }
  .dashboard-filters label:first-child { flex-basis: 100%; }
  .tournament-card:not(.admin-card) { padding: 14px; }
  .admin-card-top { padding: 14px 14px 2px; }
  .card-stats { margin: 10px 14px 12px; gap: 6px; }
  .card-stats div { padding: 6px 8px; }
  .card-stats dd { font-size: 1.15rem; }
  .bracket-entries { padding: 0 14px; }
  .card-pad { padding: 0 14px 12px; }
  .player-card .admin-card-top { flex-wrap: wrap; }
  .card-tools > a, .card-tools > span, .events-dashboard .card-tools > button { flex: 1 1 50%; min-width: 0; border-bottom: 1px solid #e5ebf2; }
  .player-card-tools > a, .player-card-tools > span, .events-dashboard .player-card-tools > button { white-space: normal; padding: 10px 8px; text-align: center; }
  .entry-summary li { flex-wrap: wrap; gap: 4px; }
  .dialog-heading { flex-wrap: wrap; }
  dialog { padding: 16px; }
  .dialog-actions { bottom: -16px; }
  .roster-table { font-size: .85rem; }
}
