:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #dfe3e6;
  --border-soft: #e8ebed;
  --text: #202328;
  --muted: #70767d;
  --green: #2f873b;
  --green-dark: #236d2f;
  --green-soft: #e8f5ea;
  --green-line: #63a66a;
  --blue: #3d80e6;
  --blue-soft: #e8f1ff;
  --orange: #f28a22;
  --orange-soft: #fff0df;
  --yellow: #d6a300;
  --yellow-soft: #fff6da;
  --gray-soft: #f0f1f2;
  --red: #d54444;
  --shadow: 0 1px 2px rgba(22, 27, 29, 0.04);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   MAIN APP LAYOUT
========================= */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  column-gap: 40px;
  align-items: start;
  padding: 0;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  height: 100vh;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 26px 16px 16px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 28px;
  font-weight: 800;
  font-size: 18px;
  color: #173f21;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.logo-mark svg {
  width: 16px;
  height: 16px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 13px;
  border-radius: 7px;
  color: #4f555b;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #f4f6f4;
}

.nav-link.active {
  background: var(--green-soft);
  color: #206a2a;
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: inline-grid;
  place-items: center;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================
   ADMIN CARD
========================= */

.admin-card {
  margin-top: auto;
  border-radius: 7px;
  background: #f7f8f9;
  min-height: 52px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 700;
  flex: 0 0 auto;
}

.admin-copy {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

/* Sidebar user menu (My Account / Log Out) */
.user-menu {
  margin-top: auto;
  position: relative;
}

.user-menu .admin-card {
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu .admin-card:hover,
.user-menu .admin-card[aria-expanded="true"] {
  background: #eef1ef;
}

.user-menu-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: #7d8389;
  transform: rotate(180deg);
  transition: transform 0.15s ease;
}

.user-menu .admin-card[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(0deg);
}

.user-menu-list {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(20, 30, 25, 0.12);
  padding: 5px;
  z-index: 20;
}

.user-menu-list[hidden] {
  display: none;
}

.user-menu-list form {
  margin: 0;
}

.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #4f555b;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: #f4f6f4;
  color: #206a2a;
}

.admin-copy strong,
.admin-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-copy strong {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.admin-copy span {
  display: block;
  color: #7d8389;
  font-size: 9px;
  line-height: 1.25;
  margin-top: 2px;
}

/* =========================
   GENERAL PAGE ELEMENTS
========================= */

.main {
  min-width: 0;
  padding: 40px 48px 48px 0;
}

.page-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-title {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.6px;
  font-weight: 800;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  color: #697078;
  font-size: 10px;
  margin-bottom: 8px;
}

.eyebrow a {
  color: var(--green);
  font-weight: 700;
}

/* =========================
   BUTTONS
========================= */

.btn {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: white;
  color: #454b50;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: #f8f9f9;
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-sm {
  min-height: 31px;
  padding: 0 11px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-icon {
  font-size: 17px;
  line-height: 1;
  margin-top: -1px;
}

/* =========================
   CARDS
========================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================
   DASHBOARD
========================= */

.dashboard-main {
  padding-top: 42px;
}

.dashboard-heading {
  margin-bottom: 24px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  height: 99px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-label {
  color: #676d73;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 25px;
  font-weight: 800;
  margin-top: 4px;
  line-height: 1;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(290px, 1.15fr);
  gap: 24px;
  align-items: start;
}

.section-title {
  font-size: 15px;
  margin: 0 0 12px;
  font-weight: 800;
}

.session-list {
  display: grid;
  gap: 10px;
}

.session-row {
  min-height: 75px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
}

.session-name {
  font-weight: 750;
  font-size: 13px;
}

.session-meta {
  margin-top: 5px;
  color: #70767c;
  font-size: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.session-players {
  color: #3f454b;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.green {
  background: var(--green-soft);
  color: #277432;
}

.badge.blue {
  background: var(--blue-soft);
  color: #2f74d7;
}

.badge.gray {
  background: #f0f1f2;
  color: #666c72;
}

.badge.orange {
  background: var(--orange-soft);
  color: #e27000;
}

.activity-card {
  padding: 18px 20px 8px;
}

.activity-item {
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border-soft);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-title {
  font-size: 11px;
  font-weight: 600;
}

.activity-time {
  color: #90959a;
  font-size: 9px;
  margin-top: 4px;
}

/* =========================
   CREATE SESSION
========================= */

.create-main {
  padding-top: 38px;
}

.form-card {
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

.field {
  margin-bottom: 15px;
}

.field label,
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 7px;
}

.input,
.select {
  width: 100%;
  height: 39px;
  border: 1px solid #cfd5d9;
  border-radius: 6px;
  background: white;
  color: #3b4045;
  padding: 0 12px;
  outline: none;
}

.input:focus,
.select:focus {
  border-color: #7bae80;
  box-shadow: 0 0 0 2px rgba(47, 135, 59, 0.08);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.number-stepper {
  height: 39px;
  border: 1px solid #cfd5d9;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  text-align: center;
}

.number-stepper button {
  border: 0;
  background: transparent;
  color: #62686e;
  cursor: pointer;
  font-size: 16px;
  height: 100%;
}

.segmented {
  height: 39px;
  border: 1px solid #cfd5d9;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
}

.segmented button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #656b70;
  font-size: 10px;
}

.segmented button.active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.radio-group {
  display: grid;
  gap: 11px;
  margin-top: 2px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
}

.choice input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.court-options {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.court-option {
  min-height: 35px;
  border: 1px solid #d9dddf;
  border-radius: 6px;
  background: #f9fafa;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 0 9px;
  font-size: 11px;
}

.court-option.selected {
  border-color: #6da873;
  background: #edf8ef;
}

.fake-check {
  width: 16px;
  height: 16px;
  border: 1px solid #cbd0d3;
  border-radius: 3px;
  background: white;
  display: grid;
  place-items: center;
  color: white;
}

.court-option.selected .fake-check {
  background: var(--green);
  border-color: var(--green);
}

.drag {
  color: #8b9196;
  font-size: 16px;
  letter-spacing: -2px;
}

.form-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 24px 0 18px;
}

.relax-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
}

.relax-title {
  font-size: 11px;
  font-weight: 700;
}

.relax-copy {
  color: #737a80;
  font-size: 9px;
  margin-top: 4px;
  max-width: 510px;
}

/* =========================
   TOGGLE SWITCH
========================= */

.switch {
  position: relative;
  width: 42px;
  height: 22px;
  flex: 0 0 42px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8dcdf;
  cursor: pointer;
  transition: 0.2s;
}

.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: 0.2s;
}

.switch input:checked+.slider {
  background: var(--green);
}

.switch input:checked+.slider:before {
  transform: translateX(20px);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 27px;
}

/* =========================
   ACTIVE SESSION
========================= */

.active-main {
  padding-top: 42px;
}

.active-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.active-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.active-title-row h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.55px;
}

.timer-pill {
  background: var(--orange-soft);
  color: #e36d00;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

.active-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.active-stat {
  height: 64px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-stat .stat-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  background: transparent;
  border-radius: 0;
}

.active-stat .stat-icon svg {
  width: 19px;
  height: 19px;
}

.active-stat-label {
  font-size: 9px;
  color: #676d73;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.active-stat-value {
  font-size: 17px;
  font-weight: 800;
  margin-top: 1px;
}

/* =========================
   ROUND SELECTOR
========================= */

.round-title {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}

.rounds {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}

.round-btn {
  height: 42px;
  border: 1px solid var(--border);
  background: #f8f9fa;
  border-radius: 7px;
  color: #8a9095;
  text-align: left;
  padding: 0 12px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-btn.current {
  border-color: #5fa166;
  color: #277332;
  background: #edf8ef;
  font-weight: 700;
}

.round-btn.completed {
  background: white;
  color: #4f555a;
}

.round-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #a8adb1;
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.current .round-dot {
  background: var(--green);
}

.completed .round-dot {
  background: #777d82;
}

/* =========================
   MATCHES
========================= */

.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 22px;
  align-items: stretch;
}

.matches-wrap .section-title,
.sitout-wrap .section-title {
  margin-bottom: 11px;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.match-card {
  overflow: hidden;
}

.match-card-header {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 800;
}

.team {
  background: #f8f9fa;
  margin: 9px 14px;
  padding: 9px 10px;
  border-radius: 4px;
}

.team-label {
  color: #8a9095;
  font-size: 8px;
  font-weight: 700;
  margin-bottom: 5px;
}

.player-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  min-height: 19px;
}

.player-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.move-icon {
  color: #9fa4a8;
}

.rating {
  color: #8a9095;
  font-size: 9px;
}

.vs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px;
  color: #a4a9ad;
  font-size: 8px;
}

.vs:before,
.vs:after {
  content: "";
  height: 1px;
  background: #e2e5e7;
  flex: 1;
}

.match-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
}

.mini-tag {
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 8px;
  background: var(--green-soft);
  color: #2d7937;
}

/* =========================
   SITTING OUT PLAYERS
========================= */

.sitout-card {
  height: 100%;
  min-height: 493px;
  padding: 15px;
}

.sitout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sitout-head strong {
  font-size: 12px;
}

.sitout-list {
  display: grid;
  gap: 8px;
}

.sitout-player {
  min-height: 55px;
  background: #f4f5f6;
  border: 1px solid #e1e4e6;
  border-radius: 7px;
  padding: 8px 10px;
  display: flex;
  gap: 11px;
  align-items: center;
}

.player-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #ef6c00;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  flex: 0 0 auto;
}

.sitout-name {
  font-size: 10px;
  font-weight: 800;
}

.sitout-meta {
  color: #8b9196;
  font-size: 8px;
  margin-top: 3px;
}

/* =========================
   WHY THIS MATCHUP CARD
========================= */

.why-card {
  margin-top: 24px;
  padding: 19px 22px;
}

.why-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 12px;
}

.why-head-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 17px 0 16px;
  color: #596066;
  font-size: 9px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.green-check {
  color: var(--green);
  font-weight: 900;
}

.why-note {
  border-top: 1px solid var(--border-soft);
  padding-top: 13px;
  color: #83898f;
  font-size: 9px;
}

/* =========================
   ACTIVE SESSION BOTTOM BAR
========================= */

.bottom-actions {
  margin-top: 24px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bottom-left {
  display: flex;
  gap: 10px;
}

.save-side {
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-note {
  color: #a1a6aa;
  font-size: 9px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    padding: 32px;
    gap: 28px;
  }

  .sidebar {
    top: 32px;
    height: calc(100vh - 64px);
    min-height: 760px;
  }

  .dashboard-columns,
  .match-layout {
    grid-template-columns: 1fr;
  }

  .sitout-card {
    min-height: 0;
  }
}

@media (max-width: 850px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    border-width: 0 0 1px;
    padding: 14px 18px;
  }

  .brand {
    padding: 0 0 12px;
  }

  .nav {
    display: flex;
    overflow: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    min-width: max-content;
    min-height: 38px;
  }

  .admin-card {
    display: none;
  }

  .user-menu {
    margin-top: 10px;
  }

  .user-menu .admin-card {
    display: flex;
  }

  .user-menu-list {
    top: calc(100% + 6px);
    bottom: auto;
  }

  .main {
    padding: 26px 18px 50px;
  }

  .dashboard-stats,
  .active-stats {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .rounds {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {

  .dashboard-stats,
  .active-stats,
  .two-col {
    grid-template-columns: 1fr;
  }

  .dashboard-columns {
    display: block;
  }

  .activity-card {
    margin-top: 22px;
  }

  .page-topline,
  .active-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-card {
    padding: 20px;
  }

  .rounds {
    grid-template-columns: 1fr;
  }

  .bottom-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .bottom-left,
  .save-side {
    justify-content: space-between;
  }
}

/* =========================
   PLAYERS DATABASE
========================= */

.players-main {
  padding-top: 40px;
}

.players-header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: 24px;
  margin-top: -24px;
  padding-bottom: 12px;
}

.players-search {
  margin-bottom: 16px;
}

.dup-alert {
  border-color: #bfe3c2;
  background: #f4fbf5;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.dup-alert-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.dup-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex: 0 0 auto;
}

.dup-alert-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dup-alert-note {
  color: var(--muted);
  font-size: 11px;
  margin-left: 8px;
}

.players-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.players-table-card {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  overflow-x: hidden;
}

.players-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.players-table th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8a9095;
  font-weight: 800;
  padding: 14px 16px;
}

.players-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
  box-shadow: 0 2px 4px -3px rgba(0, 0, 0, 0.1);
}

.players-table th:last-child,
.players-table td:last-child {
  text-align: right;
}

.players-table td {
  padding: 14px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.players-table tbody tr {
  cursor: pointer;
}

.players-table tbody tr:hover {
  background: #fafbfb;
}

.players-table tbody tr.selected {
  background: var(--green-soft);
}

.player-name-cell {
  font-weight: 700;
}

.player-name-cell .badge,
.player-name-cell .mini-tag {
  margin-left: 6px;
}

.badge.yellow {
  background: var(--yellow-soft);
  color: #8a6d09;
}

.notes-text {
  white-space: pre-line;
  font-size: 11px;
  color: #3f454b;
  margin: 0;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.search-hl {
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 2px;
  padding: 0 1px;
}

.rating-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.rating-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* Sortable column headings (players table) */
.th-sort {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.th-sort:hover,
th[aria-sort="ascending"] .th-sort,
th[aria-sort="descending"] .th-sort {
  color: #3f454b;
}

.sort-arrow {
  font-size: 8px;
  min-width: 8px;
}

.rating-dots span.filled {
  background: var(--green);
}

.player-detail-card {
  position: sticky;
  top: calc(var(--header-height, 168px) + 12px);
  padding: 20px;
  border-radius: var(--radius);
}

.player-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.player-detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
}

.player-detail-name {
  font-weight: 800;
  font-size: 14px;
}

.player-detail-since {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.detail-section-title {
  font-weight: 800;
  font-size: 11px;
  margin-bottom: 10px;
}

.detail-divider {
  border-top: 1px solid var(--border-soft);
  margin: 16px 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 27, 29, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  width: 360px;
  padding: 24px;
}

.modal-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}

.modal-text {
  font-size: 12px;
  color: #596066;
  margin: 0 0 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.partner-row,
.history-row {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #3f454b;
  margin-bottom: 8px;
  align-items: flex-start;
}

.partner-check {
  color: var(--green);
  font-weight: 900;
}

.history-row {
  color: #596066;
}

.history-dot {
  color: var(--muted);
}

/* =========================
   COURT MANAGEMENT
========================= */

.courts-main {
  padding-top: 40px;
}

.rule-banner {
  background: var(--green-soft);
  color: #236d2f;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.courts-scroll-card {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 16px;
}

.court-list {
  display: grid;
  gap: 12px;
}

.court-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 16px;
}

.court-row.disabled {
  opacity: 0.55;
}

.court-row .drag {
  color: #9fa4a8;
  font-size: 16px;
  cursor: grab;
}

.priority-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.court-row.disabled .priority-dot {
  background: var(--gray-soft);
  color: #9fa4a8;
}

.court-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.court-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.court-meta {
  font-size: 11px;
  color: var(--muted);
}

.court-detail {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.court-status {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.active-label {
  color: var(--green);
}

.disabled-label {
  color: #9fa4a8;
}

.badge.gray {
  background: var(--gray-soft);
  color: #666c72;
}

/* =========================
   SESSION TEMPLATES
========================= */

.templates-main {
  padding-top: 40px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.template-card {
  padding: 20px;
}

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.template-name {
  font-weight: 800;
  font-size: 15px;
}

.template-menu {
  color: #9fa4a8;
  font-size: 14px;
  cursor: pointer;
}

.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
}

.template-label {
  color: var(--muted);
}

.template-value {
  font-weight: 700;
}

.template-footer {
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin: 14px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.template-actions {
  display: flex;
  gap: 8px;
}

.template-actions .btn {
  flex: 1;
}

.template-actions-secondary {
  margin-top: 8px;
}

.custom-rules-card {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 32px;
  text-align: center;
}

.custom-rules-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--gray-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.custom-rules-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 8px;
}

.custom-rules-text {
  font-size: 12px;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 12px;
}

.custom-rules-link {
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.template-priority-panel {
  margin-top: 20px;
}

.template-priority-title {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 10px;
}

.template-priority-list {
  max-height: 260px;
}

.template-priority-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.template-priority-row .court-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* =========================
   LANDING PAGE
========================= */

.landing-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

.landing-header {
  height: 78px;
  padding: 0 52px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: white;
  border-bottom: 1px solid var(--border-soft);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 18px;
  font-weight: 800;
  color: #173f21;
}

.landing-brand .logo-mark {
  width: 30px;
  height: 30px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.landing-nav a {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.landing-nav a:hover {
  color: var(--green);
}

.landing-actions {
  display: flex;
  gap: 10px;
}


/* Hero */

.hero-section {
  position: relative;

  min-height: 620px;

  display: flex;
  align-items: center;

  /* Dark green shows instantly while the photo loads */
  background-color: #1d3a30;
  background-image: url("../images/tennis-hero.webp");
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;

  background: linear-gradient(90deg,
      rgba(10, 30, 20, 0.82) 0%,
      rgba(10, 30, 20, 0.55) 40%,
      rgba(10, 30, 20, 0.08) 75%);
}

.hero-content {
  position: relative;
  z-index: 1;

  max-width: 600px;

  padding-left: 80px;

  color: white;
}

.hero-content h1 {
  margin: 0;

  font-size: 54px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  font-weight: 800;
}

.hero-content p {
  max-width: 480px;

  margin: 22px 0 28px;

  font-size: 18px;
  line-height: 1.6;

  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.hero-btn {
  min-width: 130px;
}

.hero-secondary {
  min-width: 120px;

  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.65);
}

.hero-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}


/* Landing responsive */

@media (max-width: 850px) {

  .landing-header {
    padding: 0 20px;
  }

  .landing-nav {
    display: none;
  }

  .hero-section {
    min-height: 560px;
  }

  .hero-content {
    padding: 40px 24px;
  }

  .hero-content h1 {
    font-size: 40px;
  }

  .hero-content p {
    font-size: 16px;
  }

}

@media (max-width: 560px) {

  .landing-actions .btn:first-child {
    display: none;
  }

  .hero-content h1 {
    font-size: 34px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

}

/* =========================
   LANDING FEATURES
========================= */

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);

  gap: 30px;

  padding: 48px 70px;

  background: white;
}

.feature-item {
  text-align: center;
}

.feature-icon {
  width: 52px;
  height: 52px;

  margin: 0 auto 14px;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--green-soft);
  color: var(--green);

  font-weight: 800;
  font-size: 16px;
}

.feature-item h3 {
  margin: 0 0 8px;

  font-size: 15px;
  font-weight: 800;
}

.feature-item p {
  margin: 0 auto;

  max-width: 190px;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.5;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

/* =========================
   HOW IT WORKS
========================= */

.how-it-works {
  padding: 60px 70px 70px;

  background: var(--bg);

  text-align: center;
}

.how-it-works h2 {
  margin: 0 0 38px;

  font-size: 30px;
  font-weight: 800;
}

.steps-grid {
  max-width: 980px;

  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(3, 1fr);

  gap: 28px;
}

.step-card {
  position: relative;

  padding: 38px 26px 28px;

  background: white;

  border: 1px solid var(--border);
  border-radius: 12px;

  box-shadow: var(--shadow);
}

.step-number {
  position: absolute;

  top: -17px;
  left: 50%;

  transform: translateX(-50%);

  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green);
  color: white;

  font-weight: 800;
}

.step-icon {
  width: 50px;
  height: 50px;

  margin: 4px auto 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.step-icon svg {
  width: 24px;
  height: 24px;
}

.step-card h3 {
  margin: 0 0 9px;

  font-size: 15px;
  font-weight: 800;
}

.step-card p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 850px) {

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

}

/* =========================
   LANDING CALL TO ACTION
========================= */

.landing-cta {
  padding: 42px 20px;

  text-align: center;

  background: var(--green);
  color: white;
}

.landing-cta h2 {
  margin: 0 0 8px;

  font-size: 26px;
  font-weight: 800;
}

.landing-cta p {
  margin: 0 0 20px;

  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.cta-button {
  min-width: 145px;

  background: white;
  color: var(--green-dark);

  border-color: white;

  font-weight: 700;
}

.cta-button:hover {
  background: #f4f7f4;
}

/* =========================
   LOGIN PAGE
========================= */

.login-body {
  min-height: 100vh;

  margin: 0;
  padding: 0;

  background: white;
}

.login-page {
  width: 100%;
  min-height: 100vh;

  max-width: none;
}

.login-card {
  width: 100%;
  min-height: 100vh;

  display: grid;
  grid-template-columns: 1fr 1fr;

  overflow: hidden;

  background: white;

  border: none;
  border-radius: 0;
  box-shadow: none;
}


/* Left image */

.login-image {
  position: relative;

  /* Dark green shows instantly while the photo loads */
  background-color: #1d3a30;
  background-image: url("../images/tennis-hero.webp");
  background-size: cover;
  background-position: center;
}

.login-image-overlay {
  position: absolute;
  inset: 0;

  background: linear-gradient(180deg,
      rgba(9, 33, 20, 0.15),
      rgba(9, 33, 20, 0.75));
}

.login-image-content {
  position: relative;
  z-index: 1;

  height: 100%;

  padding: 34px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  color: white;
}

.login-image-content .landing-brand {
  color: white;
}

.login-image-text {
  max-width: 380px;
}

.login-image-text h2 {
  margin: 0 0 10px;

  font-size: 34px;
  font-weight: 800;
}

.login-image-text p {
  margin: 0;

  font-size: 15px;
  line-height: 1.6;

  color: rgba(255, 255, 255, 0.85);
}


/* Right panel */

.login-panel {
  padding: 60px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  background: white;
}

/* =========================
   LOGIN FORM
========================= */

.login-form-wrap {
  width: 100%;
  max-width: 380px;

  margin: 0 auto;
}

.login-form-wrap h1 {
  margin: 0 0 8px;

  font-size: 32px;
  font-weight: 800;
}

.login-subtitle {
  margin: 0 0 30px;

  color: var(--muted);

  font-size: 13px;
}

.login-options {
  margin: 4px 0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  font-size: 11px;
}

.remember-me {
  display: flex;
  align-items: center;

  gap: 7px;

  color: var(--text);
}

.remember-me input {
  accent-color: var(--green);
}

.login-options a {
  color: var(--green);
  font-weight: 600;
}

.login-submit {
  width: 100%;
}

.back-home {
  display: inline-block;

  margin-bottom: 26px;

  color: var(--green);

  font-size: 11px;
  font-weight: 600;
}

.back-home:hover {
  text-decoration: underline;
}

/* =========================
   ACCOUNTS PAGE
========================= */

.accounts-main {
  padding-top: 38px;
}


/* Search and filters */

.account-filters {
  margin-bottom: 22px;
  padding: 16px 18px;

  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px 190px auto;

  gap: 18px;
  align-items: end;
}

.account-search {
  position: relative;
}

.account-search .input {
  padding-left: 40px;
}

.account-search-icon {
  position: absolute;

  left: 14px;
  top: 50%;

  transform: translateY(-50%);

  color: var(--muted);

  font-size: 20px;

  pointer-events: none;
}

.account-filter-field label {
  display: block;

  margin-bottom: 6px;

  font-size: 10px;
  font-weight: 700;

  color: #575e64;
}


/* =========================
   TABLE
========================= */

.accounts-table-card {
  overflow: hidden;
}

.accounts-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.accounts-table {
  width: 100%;

  border-collapse: collapse;

  background: white;
}

.accounts-table th {
  height: 48px;

  padding: 0 18px;

  text-align: left;

  border-bottom: 1px solid var(--border);

  color: #626971;

  font-size: 10px;
  font-weight: 700;

  white-space: nowrap;
}

.accounts-table td {
  height: 57px;

  padding: 0 18px;

  border-bottom: 1px solid var(--border-soft);

  font-size: 11px;

  vertical-align: middle;
}

.accounts-table tbody tr:hover {
  background: #fafbfb;
}

.account-actions-heading {
  text-align: right !important;
}


/* =========================
   ACCOUNT PERSON
========================= */

.account-person {
  display: flex;
  align-items: center;

  gap: 10px;
}

.account-avatar {
  width: 32px;
  height: 32px;

  flex: 0 0 32px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green-dark);

  font-size: 10px;
  font-weight: 800;
}

.account-name {
  font-weight: 700;

  color: var(--text);
}


/* =========================
   ROLE BADGES
========================= */

.account-role {
  display: inline-flex;
  align-items: center;

  min-height: 25px;

  padding: 0 11px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 600;
}

.account-role.owner {
  background: #fff3d5;
  color: #946500;
}

.account-role.admin {
  background: var(--green-soft);
  color: var(--green-dark);
}

.account-role.staff {
  background: #eee8ff;
  color: #6540c9;
}


/* =========================
   STATUS BADGES
========================= */

.account-status {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  min-height: 25px;

  padding: 0 11px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 600;
}

.account-status::before {
  content: "";

  width: 7px;
  height: 7px;

  border-radius: 50%;
}

.account-status.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.account-status.active::before {
  background: var(--green);
}

.account-status.pending {
  background: #fff5d9;
  color: #9a6a00;
}

.account-status.pending::before {
  background: #d99a00;
}

.account-status.disabled {
  background: #ffe7e7;
  color: #c93434;
}

.account-status.disabled::before {
  background: #e13e3e;
}


/* =========================
   ACTION BUTTON
========================= */

.account-menu-button {
  width: 32px;
  height: 32px;

  border: 1px solid var(--border);

  border-radius: 7px;

  background: white;

  cursor: pointer;

  font-size: 18px;
  line-height: 1;
}

.account-menu-button:hover {
  background: #f6f7f8;
}


/* =========================
   EMPTY STATE
========================= */

.accounts-empty {
  padding: 38px;

  text-align: center;

  color: var(--muted);

  font-size: 12px;
}


/* =========================
   FOOTER / PAGINATION
========================= */

.accounts-table-footer {
  min-height: 66px;

  padding: 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--muted);

  font-size: 10px;
}

.account-pagination {
  display: flex;

  gap: 7px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

  .account-filters {
    grid-template-columns: 1fr 1fr;
  }

  .account-search {
    grid-column: 1 / -1;
  }

}

@media (max-width: 650px) {

  .account-filters {
    grid-template-columns: 1fr;
  }

  .account-search {
    grid-column: auto;
  }

  .accounts-table-footer {
    gap: 20px;
  }

}

/* =========================
   FORGOT PASSWORD PAGE
========================= */

.reset-password-icon {
  width: 52px;
  height: 52px;

  margin-bottom: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.reset-password-icon svg {
  width: 24px;
  height: 24px;
}

.reset-subtitle {
  max-width: 370px;

  line-height: 1.6;
}

.reset-login-link {
  margin: 24px 0 0;

  text-align: center;

  color: var(--muted);

  font-size: 11px;
}

.reset-login-link a {
  color: var(--green);

  font-weight: 700;
}

.reset-login-link a:hover {
  text-decoration: underline;
}

/* =========================
   HISTORY PAGE
========================= */

.history-main {
  padding-top: 38px;
}


/* =========================
   HISTORY FILTERS
========================= */

.history-filters {
  margin-bottom: 22px;

  padding: 16px 18px;

  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 190px auto;

  gap: 18px;

  align-items: end;
}

.history-search {
  position: relative;
}

.history-search .input {
  padding-left: 40px;
}

.history-search-icon {
  position: absolute;

  left: 14px;
  top: 50%;

  transform: translateY(-50%);

  width: 17px;
  height: 17px;

  color: var(--muted);

  pointer-events: none;
}

.history-search-icon svg {
  width: 100%;
  height: 100%;
}

.history-filter-field label {
  display: block;

  margin-bottom: 6px;

  font-size: 10px;
  font-weight: 700;

  color: #575e64;
}


/* =========================
   HISTORY TABLE
========================= */

.history-table-card {
  overflow: hidden;
}

.history-table-wrap {
  width: 100%;

  overflow-x: auto;
}

.history-table {
  width: 100%;

  border-collapse: collapse;

  background: white;
}

.history-table th {
  height: 48px;

  padding: 0 18px;

  text-align: left;

  border-bottom: 1px solid var(--border);

  color: #626971;

  font-size: 10px;
  font-weight: 700;

  white-space: nowrap;
}

.history-table td {
  height: 59px;

  padding: 0 18px;

  border-bottom: 1px solid var(--border-soft);

  color: #444a50;

  font-size: 11px;

  vertical-align: middle;
}

.history-table tbody tr:hover {
  background: #fafbfb;
}

.history-actions-heading {
  text-align: right !important;
}


/* =========================
   SESSION DETAILS
========================= */

.history-session-name {
  font-weight: 700;

  color: var(--text);
}

.history-session-meta {
  margin-top: 3px;

  color: var(--muted);

  font-size: 9px;
}

.history-mode {
  display: inline-flex;
  align-items: center;

  min-height: 24px;

  padding: 0 10px;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 600;
}

.history-mode.social {
  background: var(--green-soft);
  color: var(--green-dark);
}

.history-mode.competitive {
  background: var(--blue-soft);
  color: var(--blue);
}


/* =========================
   HISTORY ACTION
========================= */

.history-view-button {
  min-height: 30px;

  padding: 0 11px;

  border: 1px solid var(--border);
  border-radius: 6px;

  background: white;

  color: var(--text);

  font-size: 10px;

  cursor: pointer;
}

.history-view-button:hover {
  background: #f7f8f8;
}


/* =========================
   EMPTY STATE
========================= */

.history-empty {
  padding: 55px 20px;

  text-align: center;
}

.history-empty-icon {
  width: 48px;
  height: 48px;

  margin: 0 auto 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.history-empty-icon svg {
  width: 23px;
  height: 23px;
}

.history-empty h3 {
  margin: 0 0 7px;

  font-size: 14px;
}

.history-empty p {
  margin: 0;

  color: var(--muted);

  font-size: 11px;
}


/* =========================
   HISTORY FOOTER
========================= */

.history-table-footer {
  min-height: 66px;

  padding: 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-top: 1px solid var(--border-soft);

  color: var(--muted);

  font-size: 10px;
}

.history-pagination {
  display: flex;

  gap: 7px;
}


/* =========================
   HISTORY RESPONSIVE
========================= */

@media (max-width: 1050px) {

  .history-filters {
    grid-template-columns: 1fr 1fr;
  }

  .history-search {
    grid-column: 1 / -1;
  }

}

@media (max-width: 650px) {

  .history-filters {
    grid-template-columns: 1fr;
  }

  .history-search {
    grid-column: auto;
  }

  .history-table-footer {
    gap: 20px;
  }

}

/* =========================
   SESSIONS LIST PAGE
========================= */

.sessions-main {
  padding-top: 38px;
}


/* =========================
   SESSION TABS
========================= */

.session-tabs {
  margin-bottom: 18px;

  display: flex;
  align-items: center;

  gap: 8px;
}

.session-tab {
  min-height: 38px;

  padding: 0 15px;

  display: inline-flex;
  align-items: center;

  gap: 8px;

  border: 1px solid var(--border);
  border-radius: 7px;

  background: white;

  color: var(--muted);

  font-size: 11px;
  font-weight: 600;

  cursor: pointer;
}

.session-tab span {
  min-width: 20px;
  height: 20px;

  padding: 0 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  background: #f0f1f2;

  font-size: 9px;
}

.session-tab.active {
  border-color: #79ad7f;

  background: var(--green-soft);
  color: var(--green-dark);
}

.session-tab.active span {
  background: var(--green);
  color: white;
}


/* =========================
   SESSION FILTERS
========================= */

.sessions-filters {
  margin-bottom: 22px;

  padding: 16px 18px;

  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px 180px auto;

  gap: 18px;

  align-items: end;
}

.sessions-search {
  position: relative;
}

.sessions-search .input {
  padding-left: 40px;
}

.sessions-search-icon {
  position: absolute;

  left: 14px;
  top: 50%;

  transform: translateY(-50%);

  width: 17px;
  height: 17px;

  color: var(--muted);

  pointer-events: none;
}

.sessions-search-icon svg {
  width: 100%;
  height: 100%;
}

.sessions-filter-field label {
  display: block;

  margin-bottom: 6px;

  color: #575e64;

  font-size: 10px;
  font-weight: 700;
}


/* =========================
   SESSION LIST
========================= */

.sessions-page-list {
  display: grid;

  gap: 12px;
}

.sessions-page-card {
  min-height: 92px;

  padding: 18px 20px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 56px 96px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;

  gap: 24px;

  align-items: center;

  background: white;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.sessions-page-card:hover,
.sessions-page-card:focus-visible {
  border-color: #bfc8c1;
  box-shadow: 0 4px 14px rgba(22, 27, 29, 0.07);
}

.sessions-page-title {
  margin-bottom: 8px;

  font-size: 16px;
  font-weight: 800;
}

.sessions-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 8px 16px;

  color: var(--muted);

  font-size: 11px;
}

.sessions-page-card .session-status {
  justify-self: end;
}

.session-status.cancelled {
  background: #fdecec;
  color: var(--red);
}

/* Match format, coloured so it reads at a glance */
.format-pill {
  min-height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.format-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.format-pill.open {
  background: #eef0ff;
  color: #5b5bd6;
}

.format-pill.mixed {
  background: var(--orange-soft);
  color: #c26a10;
}

.format-pill.same_gender {
  background: #e6f6f6;
  color: #11807e;
}

@media (max-width: 650px) {
  .sessions-page-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .sessions-page-card .sessions-page-stat {
    display: none;
  }
}

.sessions-page-meta-item {
  display: inline-flex;
  align-items: center;

  gap: 5px;
}

.sessions-page-stat {
  text-align: center;
}

.sessions-page-stat strong {
  display: block;

  font-size: 14px;
}

.sessions-page-stat span {
  display: block;

  margin-top: 2px;

  color: var(--muted);

  font-size: 8px;
}

.sessions-page-actions {
  display: flex;
  align-items: center;

  gap: 8px;
}


/* =========================
   SESSION STATUS
========================= */

.session-status {
  min-height: 25px;

  padding: 0 10px;

  display: inline-flex;
  align-items: center;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 700;
}

.session-status.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.session-status.upcoming {
  background: var(--blue-soft);
  color: var(--blue);
}

.session-status.completed {
  background: var(--gray-soft);
  color: #666c72;
}


/* =========================
   SESSIONS EMPTY STATE
========================= */

.sessions-empty {
  padding: 55px 20px;

  text-align: center;
}

.sessions-empty-icon {
  width: 50px;
  height: 50px;

  margin: 0 auto 15px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.sessions-empty-icon svg {
  width: 24px;
  height: 24px;
}

.sessions-empty h2 {
  margin: 0 0 7px;

  font-size: 15px;
}

.sessions-empty p {
  max-width: 340px;

  margin: 0 auto 18px;

  color: var(--muted);

  font-size: 11px;
  line-height: 1.55;
}


/* =========================
   SESSIONS FOOTER
========================= */

.sessions-footer {
  min-height: 64px;

  margin-top: 15px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--muted);

  font-size: 10px;
}

.sessions-pagination {
  display: flex;

  gap: 7px;
}


/* =========================
   SESSIONS RESPONSIVE
========================= */

@media (max-width: 1050px) {

  .sessions-filters {
    grid-template-columns: 1fr 1fr;
  }

  .sessions-search {
    grid-column: 1 / -1;
  }

}

@media (max-width: 750px) {

  .session-tabs {
    overflow-x: auto;
  }

  .session-tab {
    flex: 0 0 auto;
  }

  .sessions-page-card {
    grid-template-columns: 1fr;

    gap: 12px;
  }

  .sessions-page-stat {
    text-align: left;
  }

}

@media (max-width: 650px) {

  .sessions-filters {
    grid-template-columns: 1fr;
  }

  .sessions-search {
    grid-column: auto;
  }

}

/* =========================
   SESSION PLAYERS PAGE
========================= */

.session-players-main {
  padding-top: 30px;
}


/* =========================
   BREADCRUMB
========================= */

.session-players-breadcrumb {
  margin-bottom: 18px;

  display: flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);

  font-size: 10px;
}

.session-players-breadcrumb a {
  color: var(--green);

  font-weight: 600;
}

.session-players-breadcrumb a:hover {
  text-decoration: underline;
}


/* =========================
   HEADER
========================= */

.session-players-header {
  margin-bottom: 22px;
}

.session-player-count {
  min-width: 100px;

  padding: 10px 16px;

  text-align: center;

  background: white;

  border: 1px solid var(--border);
  border-radius: 9px;
}

.session-player-count span {
  display: block;

  color: var(--muted);

  font-size: 9px;
  font-weight: 600;
}

.session-player-count strong {
  display: block;

  margin-top: 3px;

  color: var(--green-dark);

  font-size: 20px;
}


/* =========================
   SESSION SUMMARY
========================= */

.session-player-summary {
  margin-bottom: 18px;

  padding: 18px 20px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);

  gap: 18px;
}

.session-player-summary>div {
  min-width: 0;
}

.session-player-summary-label {
  display: block;

  margin-bottom: 5px;

  color: var(--muted);

  font-size: 9px;
  font-weight: 600;
}

.session-player-summary strong {
  display: block;

  overflow: hidden;

  color: var(--text);

  font-size: 11px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =========================
   TOOLS / FILTERS
========================= */

.session-player-tools {
  margin-bottom: 18px;

  padding: 16px 18px;

  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 170px auto;

  gap: 16px;

  align-items: end;
}

.session-player-search {
  position: relative;
}

.session-player-search .input {
  padding-left: 40px;
}

.session-player-search-icon {
  position: absolute;

  left: 14px;
  top: 50%;

  transform: translateY(-50%);

  width: 17px;
  height: 17px;

  color: var(--muted);

  pointer-events: none;
}

.session-player-search-icon svg {
  width: 100%;
  height: 100%;
}

.session-player-filter label {
  display: block;

  margin-bottom: 6px;

  color: #575e64;

  font-size: 10px;
  font-weight: 700;
}


/* =========================
   PLAYER LIST
========================= */

.session-player-list-card {
  overflow: hidden;

  margin-bottom: 18px;
}

.session-player-list-header {
  min-height: 70px;

  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid var(--border-soft);
}

.session-player-list-header h2 {
  margin: 0;

  font-size: 14px;
  font-weight: 800;
}

.session-player-list-header p {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 10px;
}

.session-player-list-header>span {
  color: var(--muted);

  font-size: 10px;
}


/* =========================
   INDIVIDUAL PLAYER ROW
========================= */

.session-player-list {
  display: block;
}

.session-player-row {
  min-height: 64px;

  padding: 0 20px;

  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;

  gap: 13px;

  align-items: center;

  border-bottom: 1px solid var(--border-soft);

  cursor: pointer;

  transition: background 0.15s ease;
}

.session-player-row:last-child {
  border-bottom: 0;
}

.session-player-row:hover {
  background: #fafbfb;
}

.session-player-row input[type="checkbox"] {
  width: 16px;
  height: 16px;

  accent-color: var(--green);

  cursor: pointer;
}

.session-player-avatar {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green-dark);

  font-size: 9px;
  font-weight: 800;
}

.session-player-info {
  min-width: 0;
}

.session-player-info strong {
  display: block;

  overflow: hidden;

  font-size: 11px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-player-info span {
  display: block;

  margin-top: 3px;

  color: var(--muted);

  font-size: 9px;
}

.session-player-gender {
  padding: 5px 9px;

  border-radius: 999px;

  background: var(--gray-soft);

  color: #626971;

  font-size: 8px;
  font-weight: 600;
}


/* =========================
   EMPTY STATE
========================= */

.session-player-empty {
  padding: 48px 20px;

  text-align: center;
}

.session-player-empty-icon {
  width: 46px;
  height: 46px;

  margin: 0 auto 13px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.session-player-empty-icon svg {
  width: 22px;
  height: 22px;
}

.session-player-empty h3 {
  margin: 0 0 6px;

  font-size: 13px;
}

.session-player-empty p {
  margin: 0;

  color: var(--muted);

  font-size: 10px;
}


/* =========================
   SELECTED PLAYERS
========================= */

.selected-players-card {
  margin-bottom: 22px;

  padding: 20px;
}

.selected-players-heading {
  margin-bottom: 15px;
}

.selected-players-heading h2 {
  margin: 0;

  font-size: 14px;
  font-weight: 800;
}

.selected-players-heading p {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 10px;
}

.selected-player-chips {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;
}

.selected-player-chip {
  min-height: 34px;

  padding: 0 11px;

  display: inline-flex;
  align-items: center;

  gap: 7px;

  border: 1px solid #cde2cf;
  border-radius: 7px;

  background: var(--green-soft);
  color: var(--green-dark);

  font-size: 9px;
  font-weight: 700;
}

.selected-player-chip button {
  padding: 0;

  border: 0;

  background: transparent;

  color: inherit;

  font-size: 14px;

  cursor: pointer;
}

.selected-player-empty {
  color: var(--muted);

  font-size: 10px;
}


/* =========================
   ACTION BAR
========================= */

.session-player-actions {
  padding: 17px 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.session-player-actions-right {
  display: flex;
  align-items: center;

  gap: 16px;
}

.session-player-help {
  color: var(--muted);

  font-size: 9px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

  .session-player-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .session-player-tools {
    grid-template-columns: 1fr 1fr;
  }

  .session-player-search {
    grid-column: 1 / -1;
  }

}

@media (max-width: 650px) {

  .session-player-summary {
    grid-template-columns: 1fr 1fr;
  }

  .session-player-tools {
    grid-template-columns: 1fr;
  }

  .session-player-search {
    grid-column: auto;
  }

  .session-players-header {
    align-items: flex-start;
  }

  .session-player-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .session-player-actions-right {
    align-items: stretch;
    flex-direction: column;
  }

  .session-player-actions .btn {
    justify-content: center;
  }

}

@media (max-width: 450px) {

  .session-player-summary {
    grid-template-columns: 1fr;
  }

  .session-player-row {
    grid-template-columns: auto auto 1fr;
  }

  .session-player-gender {
    display: none;
  }

}

/* =========================
   SIGN UP PAGE
========================= */

.signup-panel {
  overflow-y: auto;
}

.signup-form-wrap {
  padding-top: 50px;
  padding-bottom: 50px;
}

.signup-form-wrap h1 {
  margin-bottom: 8px;
}


/* =========================
   SIGN UP TERMS
========================= */

.signup-terms {
  margin: 4px 0 20px;

  display: flex;
  align-items: flex-start;

  gap: 9px;

  color: var(--muted);

  font-size: 9px;
  line-height: 1.5;

  cursor: pointer;
}

.signup-terms input {
  width: 14px;
  height: 14px;

  margin-top: 1px;

  flex-shrink: 0;

  accent-color: var(--green);
}


/* =========================
   LOGIN LINK
========================= */

.signup-login-link {
  margin: 24px 0 0;

  text-align: center;

  color: var(--muted);

  font-size: 10px;
}

.signup-login-link a {
  color: var(--green);

  font-weight: 700;
}

.signup-login-link a:hover {
  text-decoration: underline;
}


/* =========================
   SIGN UP RESPONSIVE
========================= */

@media (max-width: 760px) {

  .signup-form-wrap {
    padding-top: 35px;
    padding-bottom: 35px;
  }

}

/* =========================
   ACCEPT INVITATION PAGE
========================= */

.invite-form-wrap {
  padding-top: 48px;
  padding-bottom: 48px;
}


/* =========================
   INVITATION ICON
========================= */

.invite-icon {
  width: 52px;
  height: 52px;

  margin-bottom: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green);
}

.invite-icon svg {
  width: 24px;
  height: 24px;
}


/* =========================
   INVITATION HEADING
========================= */

.invite-eyebrow {
  margin: 0 0 8px;

  color: var(--green);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 0.8px;
}

.invite-subtitle {
  max-width: 380px;

  line-height: 1.55;
}


/* =========================
   INVITATION DETAILS
========================= */

.invite-details-card {
  margin: 22px 0;

  padding: 4px 16px;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: #fafbfb;
}

.invite-detail-row {
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  border-bottom: 1px solid var(--border-soft);
}

.invite-detail-row:last-child {
  border-bottom: 0;
}

.invite-detail-row span {
  color: var(--muted);

  font-size: 9px;
}

.invite-detail-row strong {
  max-width: 220px;

  overflow: hidden;

  color: var(--text);

  font-size: 10px;

  text-align: right;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-role {
  padding: 5px 9px;

  border-radius: 999px;

  background: var(--green-soft);
  color: var(--green-dark) !important;

  font-size: 8px !important;
  font-weight: 700;
}


/* =========================
   LOGIN LINK
========================= */

.invite-login-link {
  margin: 24px 0 0;

  text-align: center;

  color: var(--muted);

  font-size: 10px;
}

.invite-login-link a {
  color: var(--green);

  font-weight: 700;
}

.invite-login-link a:hover {
  text-decoration: underline;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 760px) {

  .invite-form-wrap {
    padding-top: 35px;
    padding-bottom: 35px;
  }

}

/* =========================
   PERMANENT CLUB QR PAGE
========================= */

.qr-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}


/* =========================
   QR HEADER
========================= */

.qr-header {
  min-height: 72px;
  padding: 0 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  background: white;
  border-bottom: 1px solid var(--border-soft);
}

.qr-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-permanent-badge {
  min-height: 28px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;

  border-radius: 999px;

  background: var(--green-soft);
  color: var(--green-dark);

  font-size: 9px;
  font-weight: 700;
}

.qr-print-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.qr-print-button svg {
  width: 15px;
  height: 15px;
}


/* =========================
   QR PAGE
========================= */

.permanent-qr-page {
  width: min(1000px, calc(100% - 48px));

  margin: 0 auto;
  padding: 45px 0 50px;
}


/* =========================
   QR HEADING
========================= */

.permanent-qr-heading {
  margin-bottom: 24px;
  text-align: center;
}

.permanent-qr-heading h1 {
  margin: 0;

  font-size: 30px;
  font-weight: 800;

  letter-spacing: -0.6px;
}

.permanent-qr-heading>p:last-child {
  max-width: 540px;

  margin: 10px auto 0;

  color: var(--muted);

  font-size: 11px;
  line-height: 1.6;
}

.qr-eyebrow {
  margin: 0 0 8px;

  color: var(--green);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 0.8px;
}


/* =========================
   QR MAIN CARD
========================= */

.permanent-qr-card {
  margin-bottom: 28px;
  padding: 38px;

  display: grid;
  grid-template-columns: 1fr 360px;

  gap: 50px;

  align-items: center;
}

.permanent-qr-logo {
  margin-bottom: 28px;

  display: flex;
  align-items: center;

  gap: 9px;

  font-size: 14px;
  font-weight: 800;
}

.permanent-qr-logo .logo-mark {
  width: 30px;
  height: 30px;
}

.permanent-qr-copy h2 {
  margin: 0 0 10px;

  font-size: 25px;
  font-weight: 800;

  letter-spacing: -0.4px;
}

.permanent-qr-message {
  max-width: 420px;

  margin: 0 0 25px;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.6;
}


/* =========================
   QR INFORMATION
========================= */

.permanent-qr-info {
  margin-bottom: 22px;

  border-top: 1px solid var(--border-soft);
}

.permanent-qr-info-row {
  min-height: 45px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid var(--border-soft);
}

.permanent-qr-info-row span {
  color: var(--muted);
  font-size: 9px;
}

.permanent-qr-info-row strong {
  font-size: 10px;
}

.permanent-qr-small-note {
  margin: 0;

  color: var(--muted);

  font-size: 9px;
  line-height: 1.6;
}


/* =========================
   QR CODE
========================= */

.permanent-qr-code-side {
  text-align: center;
}

.permanent-qr-code {
  width: 300px;
  height: 300px;

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;

  background: white;

  border: 1px solid var(--border);
  border-radius: 14px;
}

.permanent-qr-code img,
.permanent-qr-code canvas {
  width: 260px !important;
  height: 260px !important;
}

.qr-not-ready {
  width: 260px;
  height: 260px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 12px;

  border: 2px dashed #b8c8ba;
  border-radius: 10px;

  background: #f8fbf8;
  color: var(--green);
}

.qr-not-ready svg {
  width: 78px;
  height: 78px;
}

.qr-not-ready span {
  font-size: 11px;
  font-weight: 700;
}

.permanent-qr-scan-label {
  margin: 16px 0 4px;

  color: var(--green-dark);

  font-size: 14px;
  font-weight: 900;

  letter-spacing: 1.5px;
}

.permanent-qr-url {
  max-width: 320px;

  margin: 0 auto;

  overflow-wrap: anywhere;

  color: var(--muted);

  font-size: 8px;
}


/* =========================
   HOW IT WORKS
========================= */

.permanent-qr-how {
  margin-bottom: 28px;
}

.permanent-qr-how>h2 {
  margin: 0 0 14px;

  font-size: 16px;
  font-weight: 800;
}

.permanent-qr-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  gap: 14px;
}

.permanent-qr-step {
  padding: 18px;

  display: flex;
  align-items: flex-start;

  gap: 13px;
}

.permanent-qr-step-number {
  width: 28px;
  height: 28px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: var(--green-soft);
  color: var(--green-dark);

  font-size: 10px;
  font-weight: 800;
}

.permanent-qr-step strong {
  display: block;

  margin-bottom: 5px;

  font-size: 11px;
}

.permanent-qr-step p {
  margin: 0;

  color: var(--muted);

  font-size: 9px;
  line-height: 1.5;
}


/* =========================
   LIVE STATUS
========================= */

.permanent-live-status {
  padding: 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 25px;
}

.permanent-live-label {
  display: block;

  margin-bottom: 6px;

  color: var(--green);

  font-size: 8px;
  font-weight: 800;

  letter-spacing: 0.7px;
}

.permanent-live-status h2 {
  margin: 0;
  font-size: 14px;
}

.permanent-live-status p {
  max-width: 570px;

  margin: 5px 0 0;

  color: var(--muted);

  font-size: 9px;
  line-height: 1.5;
}

.permanent-live-status-badge {
  min-height: 28px;
  padding: 0 11px;

  display: inline-flex;
  align-items: center;

  flex-shrink: 0;

  border-radius: 999px;

  background: var(--gray-soft);
  color: #646a70;

  font-size: 9px;
  font-weight: 700;
}


/* =========================
   QR FOOTER
========================= */

.permanent-qr-footer {
  padding-top: 26px;

  text-align: center;

  color: var(--muted);

  font-size: 8px;
}


/* =========================
   QR RESPONSIVE
========================= */

@media (max-width: 800px) {

  .qr-header {
    padding: 0 20px;
  }

  .qr-permanent-badge {
    display: none;
  }

  .permanent-qr-page {
    width: min(100% - 30px, 1000px);
    padding-top: 30px;
  }

  .permanent-qr-card {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .permanent-qr-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {

  .permanent-qr-card {
    padding: 22px;
  }

  .permanent-qr-code {
    width: 250px;
    height: 250px;
  }

  .qr-not-ready {
    width: 215px;
    height: 215px;
  }

  .permanent-qr-code img,
  .permanent-qr-code canvas {
    width: 215px !important;
    height: 215px !important;
  }

  .permanent-live-status {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* =========================
   PERMANENT QR PRINT VERSION
========================= */

@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {

  body.qr-body {
    background: white;
  }

  .qr-header,
  .permanent-qr-how,
  .permanent-live-status,
  .permanent-qr-footer {
    display: none;
  }

  .permanent-qr-page {
    width: 100%;

    margin: 0;
    padding: 0;
  }

  .permanent-qr-heading {
    margin-bottom: 18mm;
  }

  .permanent-qr-heading h1 {
    font-size: 28pt;
  }

  .permanent-qr-heading>p:last-child {
    font-size: 11pt;
  }

  .permanent-qr-card {
    min-height: 220mm;

    margin: 0;
    padding: 15mm;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 12mm;

    text-align: center;

    border: 2px solid #222;

    box-shadow: none !important;

    break-inside: avoid;
    page-break-inside: avoid;
  }

  .permanent-qr-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .permanent-qr-logo {
    margin-bottom: 10mm;
  }

  .permanent-qr-copy h2 {
    font-size: 24pt;
  }

  .permanent-qr-message {
    max-width: 150mm;

    font-size: 12pt;
  }

  .permanent-qr-info,
  .permanent-qr-small-note {
    display: none;
  }

  .permanent-qr-code {
    width: 95mm;
    height: 95mm;

    border: none;
  }

  .permanent-qr-code img,
  .permanent-qr-code canvas {
    width: 85mm !important;
    height: 85mm !important;
  }

  .qr-not-ready {
    width: 85mm;
    height: 85mm;
  }

  .permanent-qr-scan-label {
    margin-top: 7mm;

    color: black;

    font-size: 18pt;
  }

  .permanent-qr-url {
    color: #444;

    font-size: 8pt;
  }
}

/* =========================
   SETTINGS
========================= */

.settings-subnav {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.subnav-link {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.subnav-link.active {
  color: #1c1c1c;
  border-bottom-color: var(--green);
}

.subnav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.subnav-link .subnav-dot {
  display: none;
}

.subnav-link.active .subnav-dot {
  display: inline-block;
}

.team-table-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.team-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.team-table th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8a9095;
  font-weight: 800;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.team-table td {
  padding: 16px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.team-table tr:last-child td {
  border-bottom: none;
}

.member-name-cell {
  font-weight: 700;
}

.team-table-footer {
  padding: 14px 20px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
}

.btn-icon-only {
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* =========================
   INVITE MEMBERS
========================= */
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 10px;
}

.role-option:has(input:checked) {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.role-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--green);
}

.role-option.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.role-option-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.role-option-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.form-error {
  color: var(--red);
  font-size: 11px;
  margin-bottom: 14px;
}

.form-success {
  color: var(--green-dark);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Settings > My Account */
.account-section {
  padding: 24px;
  max-width: 480px;
  margin-bottom: 18px;
}

.account-section h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.account-section .page-subtitle {
  margin-bottom: 16px;
}

.account-email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* =========================
   SUPPORT / USER GUIDE
========================= */

.support-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.support-toc {
  position: sticky;
  top: 24px;
  padding: 18px 20px;
}

.support-toc ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

html.smooth-scroll {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html.smooth-scroll {
    scroll-behavior: auto;
  }
}

.support-toc ol {
  list-style: none;
  padding-left: 0;
  gap: 2px;
}

.support-toc a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}

.support-toc a:hover {
  color: var(--green);
}

.support-toc a.active {
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.support-content {
  display: grid;
  gap: 20px;
  max-width: 820px;
}

.support-section {
  padding: 24px 28px;
  scroll-margin-top: 24px;
  font-size: 13px;
  line-height: 1.6;
}

.support-section h3 {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 800;
}

.support-section p {
  margin: 0 0 10px;
}

.support-section ul,
.support-section ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.support-section li + li {
  margin-top: 4px;
}

.support-section a {
  color: var(--green);
  font-weight: 600;
}

.support-callout {
  margin: 14px 0 4px;
  padding: 12px 16px;
  background: var(--green-soft);
  border-left: 3px solid var(--green-line);
  border-radius: 6px;
}

.support-table-wrap {
  overflow-x: auto;
}

.support-table {
  width: 100%;
  border-collapse: collapse;
}

.support-table th,
.support-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.support-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.support-table th:not(:first-child),
.support-table td:not(:first-child) {
  width: 70px;
  text-align: center;
}

/* Tables with text in every column (CSV columns, pairing modes). */
.support-table.support-table-text th:not(:first-child),
.support-table.support-table-text td:not(:first-child) {
  width: auto;
  text-align: left;
}

.support-table.support-table-text td {
  vertical-align: top;
}

.support-table.support-table-text td:first-child {
  white-space: nowrap;
}

.support-table-wrap + p {
  margin-top: 14px;
}

.support-faq {
  margin: 0;
}

.support-faq dt {
  margin-top: 14px;
  font-weight: 700;
}

.support-faq dt:first-child {
  margin-top: 0;
}

.support-faq dd {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 850px) {
  .support-layout {
    grid-template-columns: 1fr;
  }

  .support-toc {
    position: static;
  }

  .support-section {
    padding: 20px;
  }
}

/* =========================
   CSV IMPORT
========================= */

.csv-dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin-bottom: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.csv-dropzone:hover,
.csv-dropzone.dragging {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.csv-dropzone-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  font-size: 16px;
  flex: 0 0 auto;
}

.csv-dropzone-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
}

.csv-dropzone-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.import-result {
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 12px;
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green-dark);
}

.import-result.import-error {
  border-color: var(--red);
  background: #fdeeee;
  color: var(--red);
}

.session-qr-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;

    background: white;
    border: 1px solid #ddd;
    border-radius: 14px;

    padding: 12px;
    text-align: center;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.session-qr-image {
    display: block;
    width: 140px;
    height: 140px;
}

.session-qr-widget p {
    margin: 8px 0 0;
    font-size: 12px;
    color: #333;
}
/* Fix compact player rows in Active Session */

.match-card .player-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 26px;
    padding: 2px 5px;
}

.match-card .player-inline-select {
    appearance: none;
    -webkit-appearance: none;

    width: auto;
    min-width: 120px;
    max-width: 100%;
    flex: 1;

    height: 24px;
    padding: 2px 6px;

    border: 1px solid transparent;
    background: transparent;

    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.match-card .player-inline-select:hover,
.match-card .player-inline-select:focus {
    background: white;
    border-color: #cfd5d9;
}

.match-card .move-icon {
    flex: 0 0 14px;
    text-align: center;
}

.sitout-player .player-inline-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
}

.sitout-player .player-line {
    justify-content: flex-start;
    gap: 4px;
}
.match-card .team {
    padding: 7px 9px;
    margin: 7px 12px;
}

.match-card .player-line {
    background: #f0f2f4;
    border-radius: 3px;
    margin-bottom: 3px;
}

.match-card .match-card-header {
    height: 40px;
}

.match-card .vs {
    margin: 5px 12px;
}

.match-card .team-label {
    margin-bottom: 5px;
}

.gender-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

.gender-dot.male {
  background-color: #3b82f6; /* blue */
}

.gender-dot.female {
  background-color: #ef4444; /* red */
}

.gender-dot.unknown {
  background-color: #9ca3af; /* grey */
}

.player-line,
.sitout-player {
  display: flex;
  align-items: center;
}


/* =========================
   CREATE SESSION: duration row, info tip, attending players
========================= */

.session-extras {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: start;
}

.relax-field .field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  white-space: nowrap;
}

.relax-field .switch {
  display: block;
  margin-top: 9px;
}

.info-tip {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d6dade;
  color: #4f555b;
  font-size: 10px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
  display: inline-grid;
  place-items: center;
  cursor: help;
  flex: 0 0 15px;
}

.info-tip:hover,
.info-tip:focus-visible {
  background: #b9c0c6;
  outline: none;
}

.info-tip-text {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #22272b;
  color: white;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(20, 30, 25, 0.18);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.info-tip:hover + .info-tip-text,
.info-tip:focus + .info-tip-text {
  opacity: 1;
  visibility: visible;
}

.attending-players {
  margin-top: 10px;
}

.attending-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.attending-header .form-section-title {
  margin: 0 0 12px;
}

.attending-count {
  color: var(--muted);
  font-size: 11px;
}

.attending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 12px;
}

.attending-chips:empty {
  display: none;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 4px 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
}

.player-chip .gender-dot {
  width: 8px;
  height: 8px;
  margin-right: 7px;
}

.chip-remove {
  width: 22px;
  height: 22px;
  margin-left: 4px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #8a9095;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.chip-remove:hover,
.chip-remove:focus-visible {
  background: #e6e9eb;
  color: var(--text);
}

.player-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
}

.player-picker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.all-players-toggle {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
}

.all-players-toggle svg {
  width: 16px;
  height: 16px;
}

.all-players-toggle.active {
  background: var(--green-soft);
  border-color: #b9dcbe;
  color: #206a2a;
}

.all-players-panel {
  margin-top: 12px;
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.all-players-panel[hidden] {
  display: none;
}

.all-players-heading {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.all-players-heading:not(:first-child) {
  margin-top: 14px;
}

.all-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px 8px;
}

.all-players-item {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.all-players-item .gender-dot {
  width: 8px;
  height: 8px;
  margin-right: 8px;
}

.all-players-item:hover,
.all-players-item:focus-visible {
  background: #eef1ef;
}

.all-players-item.chosen {
  background: var(--green-soft);
  color: #206a2a;
  font-weight: 600;
}

.all-players-item.chosen::after {
  content: "✓";
  margin-left: auto;
  font-size: 11px;
}

.player-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 190px; /* about five names; scroll for more */
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(20, 30, 25, 0.12);
  z-index: 25;
}

.player-suggestions[hidden] {
  display: none;
}

.player-suggestions li {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

.player-suggestions li .gender-dot {
  width: 8px;
  height: 8px;
}

.player-suggestions li.active {
  background: var(--green-soft);
  color: #206a2a;
}

.player-suggestions li.empty {
  color: var(--muted);
  cursor: default;
}

.attending-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 850px) {
  .session-extras {
    grid-template-columns: 1fr;
  }

  .all-players-toggle span {
    display: none;
  }

  .info-tip-text {
    left: 0;
    right: auto;
  }
}


/* =========================
   ACTIVE SESSION: drag or click players to swap
========================= */

.match-card .player-line {
  border: 1px solid transparent;
  font-size: 11px;
}

.player-line-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sitout-player .player-line {
  font-size: 11px;
  font-weight: 700;
}

.sitout-player .gender-dot {
  width: 8px;
  height: 8px;
  margin-right: 7px;
}

.swappable {
  cursor: grab;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.swappable:hover {
  border-color: #b9dcbe;
  background: #f3faf4;
}

.swappable:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.swappable:active {
  cursor: grabbing;
}

/* Clicked first: waiting for the player to swap with */
.swappable.picked {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(47, 135, 59, 0.18);
  color: #206a2a;
  font-weight: 700;
}

.swappable.dragging {
  opacity: 0.4;
}

.swappable.drop-target {
  border-color: var(--green);
  border-style: dashed;
  background: #e2f2e5;
}

/* Changed since the last save */
.player-line.moved,
.sitout-player.moved {
  background: var(--yellow-soft);
  border-color: #efd27a;
}

.player-line.moved .player-line-name::after,
.sitout-player.moved .player-line-name::after {
  content: " • moved";
  color: #a07800;
  font-size: 9px;
  font-weight: 600;
}

.swappable.picked.moved {
  background: var(--green-soft);
  border-color: var(--green);
}


/* =========================
   ACTIVE SESSION: QR under Sitting Out, actions bar, skill toggle
========================= */

.sitout-wrap {
  display: flex;
  flex-direction: column;
}

.sitout-wrap .sitout-card {
  flex: 1 1 auto;
  height: auto;
  min-height: 260px;
}

.session-qr-card {
  margin-top: 14px;
  padding: 14px;
  text-align: center;
}

.session-qr-card .session-qr-image {
  margin: 0 auto;
}

.session-qr-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* End Session: orange like the sitting-out avatars */
.btn-end {
  background: #ef6c00;
  border-color: #ef6c00;
  color: white;
  font-weight: 700;
}

.btn-end:hover {
  background: #d65f00;
  border-color: #d65f00;
}

.btn-end:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bottom-actions.session-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.session-actions .btn.active {
  background: var(--green-soft);
  border-color: #b9dcbe;
  color: #206a2a;
}

.session-actions .skill-toggle {
  margin-left: auto;
}

.session-actions .btn svg {
  width: 15px;
  height: 15px;
}

.session-action-panel {
  flex: 1 0 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.session-action-panel[hidden] {
  display: none;
}

.session-action-panel .player-picker {
  max-width: 420px;
}

/* Skill shown next to players and as a team-total chip on each court */
.skill-badge {
  margin-left: 6px;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e6e9eb;
  color: #3f454b;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
}

.court-skill-chip {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--green-soft);
  color: #206a2a;
}

.court-skill-chip.close {
  background: var(--gray-soft);
  color: #4f555b;
}

.court-skill-chip.far {
  background: var(--orange-soft);
  color: #c26a10;
}

@media (max-width: 650px) {
  .session-actions .skill-toggle {
    margin-left: 0;
  }
}

/* Players table: gender dot to the right of M/F, like the rating dots */
.gender-dot.gender-dot-inline {
  width: 8px;
  height: 8px;
  margin: 0 0 0 6px;
}


/* =========================
   PLAYERS: gender alignment, sit-outs column, detail card, full-screen breakdown
========================= */

.gender-letter {
  display: inline-block;
  width: 12px;
}

.sitout-cell {
  white-space: nowrap;
}

.sitout-count {
  display: inline-block;
  min-width: 46px;
  font-variant-numeric: tabular-nums;
}

.sitout-none {
  color: var(--muted);
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.balance-chip.even {
  background: var(--green-soft);
  color: #206a2a;
}

.balance-chip.above {
  background: var(--orange-soft);
  color: #b45c00;
}

.balance-chip.below {
  background: var(--blue-soft);
  color: #2f66b8;
}

.balance-chip.none {
  background: var(--gray-soft);
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.player-detail-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.expand-btn {
  align-self: flex-start;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  color: #4f555b;
  cursor: pointer;
}

.expand-btn:hover,
.expand-btn:focus-visible {
  border-color: #b9dcbe;
  color: #206a2a;
  background: #f3faf4;
}

.expand-btn svg {
  width: 15px;
  height: 15px;
}

.expand-btn .icon-close,
.expand-btn[aria-expanded="true"] .icon-open {
  display: none;
}

.expand-btn[aria-expanded="true"] .icon-close {
  display: inline;
}

.detail-section-note {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 500;
}

.detail-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.quick-sitouts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quick-big strong {
  font-size: 22px;
  font-weight: 800;
}

.quick-big span {
  color: var(--muted);
  font-size: 11px;
}

.quick-meter {
  position: relative;
  height: 8px;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: var(--gray-soft);
}

.quick-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: #ef6c00;
}

.quick-meter-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: var(--text);
}

.quick-note {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

#detail-partners .partner-row,
#detail-history .history-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.partner-count,
.history-sat,
.history-date {
  color: var(--muted);
  white-space: nowrap;
}

.history-date {
  min-width: 46px;
}

.history-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full-screen mode: the breakdown takes the table's place */
.players-main.player-focus .players-table-card,
.players-main.player-focus .players-search,
.players-main.player-focus #csv-import-form,
.players-main.player-focus .import-result,
.players-main.player-focus .dup-alert {
  display: none;
}

.player-insights {
  padding: 22px 24px;
}

.player-insights[hidden] {
  display: none;
}

.insights-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.insights-eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.insights-name {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.insights-headline {
  margin: 12px 0 18px;
  max-width: 760px;
  font-size: 13px;
  line-height: 1.55;
  color: #3f454b;
}

.insights-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.kpi-tile {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.kpi-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kpi-tile.kpi-even {
  background: var(--green-soft);
  border-color: #cfe7d3;
}

.kpi-tile.kpi-above {
  background: var(--orange-soft);
  border-color: #f6d8b5;
}

.kpi-tile.kpi-below {
  background: var(--blue-soft);
  border-color: #cfe0fa;
}

.kpi-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.insights-block {
  margin-bottom: 30px;
}

.insights-block:last-child {
  margin-bottom: 4px;
}

.insights-block h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 800;
}

.insights-caption {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin-bottom: 30px;
}

.insights-grid > .insights-block {
  margin-bottom: 0;
  padding-right: 24px;
}

/* A hairline between the two charts */
.insights-grid > .insights-block + .insights-block {
  padding: 0 0 0 24px;
  border-left: 1px solid var(--border-soft);
}

.partners-more {
  margin-top: 4px;
}

.round-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.round-cell {
  width: 16px;
  height: 22px;
  border-radius: 3px;
  cursor: default;
}

.round-cell.played,
.key.played {
  background: #cfd5d9;
}

.round-cell.sat,
.key.sat {
  background: #ef6c00;
}

/* Staff change: same orange, with stripes so it isn't colour alone */
.round-cell.staff,
.key.staff {
  background: repeating-linear-gradient(45deg, #ef6c00 0 3px, #f8b77d 3px 6px);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: #596066;
  font-size: 11px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.key.expected {
  height: 2px;
  border-radius: 0;
  background: var(--text);
}

.key.me {
  border-radius: 50%;
  background: #ef6c00;
  box-shadow: 0 0 0 2px white, 0 0 0 3px #ef6c00;
}

.key.other {
  border-radius: 50%;
  background: #b7bec4;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid {
  stroke: #eceef0;
  stroke-width: 1;
}

.chart .baseline {
  stroke: #c9cfd4;
  stroke-width: 1;
}

.chart .axis-label {
  fill: #7d8389;
  font-size: 12px;
}

.chart .player-label {
  fill: #b45c00;
  font-weight: 800;
}

.chart .player-label,
.chart .axis-label.strong {
  paint-order: stroke;
  stroke: white;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart .axis-label.strong {
  fill: #3f454b;
  font-weight: 700;
}

.chart .hit {
  fill: transparent;
}

.chart .bar-group:hover .hit {
  fill: rgba(22, 27, 29, 0.04);
}

.chart .bar-sat {
  fill: #ef6c00;
}

.chart .expected-mark {
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}

.chart .dot-other {
  fill: #b7bec4;
  stroke: white;
  stroke-width: 2;
}

.chart .dot-player {
  fill: #ef6c00;
  stroke: white;
  stroke-width: 3;
}

.chart .avg-line {
  stroke: #596066;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.partner-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.partner-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.partner-bar-track {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-soft);
}

/* One bar per player: green = rounds as partner, orange = as opponent. */
.partner-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.partner-bar-seg.partner,
.key.partner {
  background: var(--green);
}

.partner-bar-seg.opponent,
.key.opponent {
  background: var(--orange);
}

.partner-bar-seg + .partner-bar-seg {
  border-left: 2px solid #fff;
}

.partner-bar-seg:last-child {
  border-radius: 0 999px 999px 0;
}

.played-with-legend {
  margin: 0 0 12px;
}

.pw-partner {
  color: var(--green);
  font-weight: 700;
}

.pw-opponent {
  color: #c26a10;
  font-weight: 700;
}

.partner-bar-value {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1000px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .insights-grid > .insights-block {
    padding-right: 0;
  }

  .insights-grid > .insights-block + .insights-block {
    margin-top: 24px;
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }
}


/* =========================
   PAIRING MODE, ROW LAYOUTS, TEMPLATE CARDS, COURT SURFACES
========================= */

/* Radio options side by side (Match Format, Pairing Mode) */
.radio-group.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.choice-with-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.choice-with-tip .info-tip-text {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
}

/* Court checkboxes side by side */
.court-options.court-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

/* Label with an (i) next to it (template Pairing Mode) */
.label-with-tip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.label-with-tip label {
  margin-bottom: 0 !important;
}

.label-with-tip .info-tip-text {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
}

.info-tip-text.info-tip-wide {
  width: 320px;
}

/* Space between a form's buttons and anything after them */
.form-card .form-actions + .field,
.card form .form-actions + .field {
  margin-top: 18px;
}

/* Template cards: Edit top-right, details, then Use Template */
.template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.template-card .template-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  color: var(--muted);
}

.template-mode {
  min-height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: var(--gray-soft);
  color: #4f555b;
  font-size: 10px;
  font-weight: 700;
}

/* Court surfaces */
.badge.surface-clay {
  background: #fbe9df;
  color: #b4532a;
}

.badge.surface-hard {
  background: var(--blue-soft);
  color: #2f66b8;
}

.badge.surface-grass {
  background: var(--green-soft);
  color: #277432;
}

.badge.surface-synthetic {
  background: #f0ebfb;
  color: #6a4bc4;
}

.badge[class*="surface-"]:not(.surface-clay):not(.surface-hard):not(.surface-grass):not(.surface-synthetic) {
  background: var(--gray-soft);
  color: #666c72;
}


/* =========================
   ACCOUNTS: compact row actions
========================= */

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Small dropdown with its own chevron, matching the buttons */
.select.select-sm {
  width: auto;
  min-width: 92px;
  height: 31px;
  padding: 0 30px 0 11px;
  border-color: var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #3f454b;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2370767d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.select.select-sm:hover {
  border-color: #b9dcbe;
  background-color: #f8fbf8;
}

.select.select-sm:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 135, 59, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Orange like End Session: removing / revoking */
.btn.btn-warn {
  background: #ef6c00;
  border-color: #ef6c00;
  color: white;
  font-weight: 600;
}

.btn.btn-warn:hover {
  background: #d65f00;
  border-color: #d65f00;
}

/* Add / Edit Player */
.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.duplicate-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: #596066;
  font-size: 12px;
  cursor: pointer;
}

/* Join page: problem with the invitation link */
.invite-problem {
  margin-bottom: 14px;
  font-size: 12px;
}

/* Accounts: removed members stay listed, greyed out, with no actions. */
.account-removed td {
  color: var(--muted);
}
