/* Main layout: league switch at the top of the sidebar, grouped nav, a header with breadcrumb,
   period filters, and one PDF button, then the tabs of the current subject (league, umpire, or game). */
.ux-league-switch { margin: -10px 14px 10px; }
.ux-nav-group { margin: 6px 12px 2px; color: #9fb3c2; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.ux-switch-layout { margin-top: 6px; color: #b7cbd8; font-size: 12px; }

/* Header grid: title left, period filters and PDF right. Below 1400px the title takes its own row, always left-aligned
   (as a flex column, align-items: center had pushed it to the middle of the bar). */
.topbar.ux-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 12px 20px; }
.ux-topbar .title-wrap { grid-column: 1; min-width: 0; justify-self: start; }
.ux-topbar .filters { grid-column: 2; justify-content: flex-end; }
.ux-topbar .ux-actions { grid-column: 3; }
@media (max-width: 1400px) {
  .topbar.ux-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .ux-topbar .title-wrap { grid-column: 1 / -1; }
  .ux-topbar .filters { grid-column: 1; justify-content: flex-start; }
  .ux-topbar .ux-actions { grid-column: 2; }
}
@media (max-width: 600px) {
  .topbar.ux-topbar { grid-template-columns: minmax(0, 1fr); }
  .ux-topbar .filters, .ux-topbar .ux-actions { grid-column: 1; }
}
.ux-title { min-width: 0; }
.ux-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; color: #9fb3c2; font-size: 11px; font-weight: 700; }
.ux-breadcrumb a { color: #b7dcff; text-decoration: none; }
.ux-breadcrumb a:hover, .ux-breadcrumb a:focus-visible { color: #fff; text-decoration: underline; outline: none; }
.ux-breadcrumb i { color: #6f8292; font-size: 8px; }
.ux-breadcrumb span[aria-current] { color: #d6e3ec; }
.ux-topbar .subtitle strong { color: #f6fbff; }
.ux-delta { padding: 1px 6px; border-radius: 99px; font-size: 11px; }
.ux-delta.is-up { background: #23534b; color: #b9f0d4; }
.ux-delta.is-down { background: #5a3138; color: #ffc0c4; }
.ux-kpi-loading { color: #9fb3c2; }
.ux-actions { display: grid; justify-items: end; gap: 4px; align-self: end; }
.ux-actions .export-button[hidden] { display: none; }
.ux-pdf-status { max-width: 220px; color: #c3d2dd; font-size: 10px; text-align: right; }
.ux-pdf-status.is-error { color: #ffb4b9; }

/* Subject tabs: one row under the header, same look on every subject. */
.ux-tabs { display: flex; gap: 4px; padding: 0 22px; overflow-x: auto; border-bottom: 1px solid #5d6f7d; background: #2f3b45; scrollbar-width: none; }
.ux-tabs::-webkit-scrollbar { display: none; }
.ux-tabs[hidden] { display: none; }
.ux-tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-bottom: 3px solid transparent; color: #c9d7e2; font-size: 13px; font-weight: 700; text-decoration: none; }
.ux-tab i { color: #9dccff; }
.ux-tab:hover, .ux-tab:focus-visible { color: #fff; background: #ffffff0a; outline: none; }
.ux-tab.is-active { border-bottom-color: #4ea1ff; color: #fff; }

/* The breadcrumb replaces the game page's own "Back to Game Log" link. */
.game-page .game-back { display: none; }

@media (max-width: 1024px) {
  .ux-league-switch { margin: 0 14px 10px; }
  .ux-tabs { padding: 0 8px; }
}
@media (max-width: 600px) {
  .ux-actions { justify-items: stretch; }
  .ux-pdf-status { max-width: none; text-align: left; }
}
@media (max-width: 600px) {
  .ux-tab { padding: 0 12px; font-size: 12px; }
}

/* The game's tabs look like every other subject's tabs. */
.game-page .game-tabs { gap: 4px; padding: 0; border: 0; border-bottom: 1px solid #5d6f7d; border-radius: 0; background: none; }
.game-page .game-tab { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-bottom: 3px solid transparent; border-radius: 0; }
.game-page .game-tab.is-active { border-bottom-color: #4ea1ff; background: none; box-shadow: none; }
.game-page .game-tab.is-active i { color: #9dccff; }
@media (max-width: 600px) { .game-page .game-tab { flex: 1 1 0; } }

/* Pitch filters (Zone Analysis and Context tabs): one row above the cards. */
.pitch-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #5d6f7d; border-radius: 10px; background: #2b3741; }
.pitch-filter { display: grid; gap: 4px; min-width: 150px; color: #b7cbd8; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pitch-filter select { min-height: 34px; padding: 0 8px; border: 1px solid #6f8292; border-radius: 7px; background: #36434d; color: #f3f8fc; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.pitch-filter select:focus { border-color: #b7dcff; outline: none; box-shadow: 0 0 0 3px #b7dcff33; }
.pitch-filters-clear { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid #8fb9dc; border-radius: 7px; background: none; color: #e3f2ff; font-size: 12px; font-weight: 700; }
.pitch-filters-clear[hidden] { display: none; }
.pitch-filters-note { flex: 1 1 100%; margin: 0; color: #9fb3c2; font-size: 10px; }
.pitch-filters-note i { margin-right: 5px; color: #9dccff; }
.field-season-type[hidden], .field-team[hidden] { display: none; }
@media (max-width: 600px) {
  .pitch-filter { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .pitch-filter select, .pitch-filters-clear { min-height: 40px; }
}
.ux-topbar .field-team { width: 170px; }
.ux-topbar .field-season-type { width: 140px; }

/* Card definitions (ⓘ buttons). */
.card-help-dialog { width: min(440px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid #6f8292; border-radius: 12px; background: #2f3b45; color: #e3ebf1; box-shadow: 0 20px 60px #0008; }
.card-help-dialog::backdrop { background: rgba(10, 16, 22, .55); }
.card-help-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.card-help-header h2 { margin: 0; color: #f6fbff; font-size: 17px; }
.card-help-close { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border: 1px solid #72808b; border-radius: 8px; background: none; color: #e3ebf1; }
.card-help-what { margin: 10px 0 8px; color: #f3f8fc; font-size: 13px; font-weight: 700; line-height: 1.5; }
.card-help-how { display: grid; gap: 4px; margin: 0; color: #d6e3ec; font-size: 12px; line-height: 1.55; }
.card-help-how span:first-child { color: #9fb3c2; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* Help page. */
.help-page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.help-card { padding: 16px 18px; border: 1px solid #5d6f7d; border-radius: 12px; background: linear-gradient(145deg, #46545f, #394752); color: #d6e3ec; font-size: 12px; line-height: 1.55; }
.help-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #f6fbff; font-size: 15px; }
.help-card h2 i { color: #9dccff; }
.help-card ul { margin: 0; padding-left: 18px; }
.help-card li + li { margin-top: 6px; }
.help-card a { color: #b7dcff; }
.help-glossary { grid-column: 1 / -1; }
.help-glossary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 10px 0 0; }
.help-term dt { color: #f6fbff; font-weight: 800; }
.help-term dd { margin: 2px 0 0; color: #c3d2dd; }
.help-term dd strong { color: #e3ebf1; }
@media (max-width: 1024px) { .help-page { grid-template-columns: minmax(0, 1fr); } .help-glossary dl { grid-template-columns: minmax(0, 1fr); } }

/* Data Export. */
.export-page { display: grid; gap: 12px; max-width: 1100px; }
.export-scope { margin: 0; color: #c3d2dd; font-size: 12px; }
.export-scope i { margin-right: 6px; color: #9dccff; }
.export-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 16px 18px; border: 1px solid #637380; border-radius: 12px; background: linear-gradient(145deg, #4a5966, #384550); }
.export-card-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 10px; background: #2f7fd8; color: #fff; font-size: 18px; }
.export-card-body h3 { margin: 0 0 4px; color: #f6fbff; font-size: 15px; }
.export-card-body p { margin: 0; color: #d6e3ec; font-size: 12px; line-height: 1.5; }
.export-options { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.export-options label { display: grid; gap: 4px; color: #b7cbd8; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.export-options select { min-height: 34px; min-width: 200px; padding: 0 8px; border: 1px solid #6f8292; border-radius: 7px; background: #36434d; color: #f3f8fc; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; }
.export-card-actions { display: grid; justify-items: end; gap: 6px; min-width: 170px; }
.missed-calls-csv { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid #8fb9dc; border-radius: 7px; background: none; color: #e3f2ff; font-size: 11px; font-weight: 700; }
.missed-calls-csv:disabled { opacity: .5; }
@media (max-width: 760px) {
  .export-card { grid-template-columns: minmax(0, 1fr); }
  .export-card-icon { display: none; }
  .export-card-actions { justify-items: stretch; }
  .export-options select { min-width: 0; width: 100%; }
  .export-options label { flex: 1 1 100%; }
}
