/* ============================================================
   Overhead Tennis Academy — design tokens
   ============================================================ */

:root {
  --court-950: #0A3F38;
  --court-800: #0F5C50;
  --court-700: #12695C;
  --court-600: #147A6A;
  --gold-500: #E2A63B;
  --gold-600: #C98F2B;
  --chalk-50: #F6F4EE;
  --chalk-100: #EFEBE0;
  --ink-900: #16211D;
  --ink-700: #33413C;
  --ink-500: #62716B;
  --line-200: #E2DFD3;
  --line-on-dark: rgba(255, 255, 255, 0.16);
  --white: #FFFFFF;

  --danger: #B4482A;
  --warn: #C98F2B;
  --ok: #147A6A;

  --sidebar-w: 248px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--chalk-50);
  color: var(--ink-900);
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

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

h1, h2, h3, .num {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  background: var(--court-950);
  color: var(--chalk-50);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.sidebar .brand img {
  width: 40px; height: 40px; object-fit: contain;
  background: var(--white); border-radius: 8px; padding: 4px;
}

.sidebar .brand-name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
}
.sidebar .brand-name span {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: rgba(246, 244, 238, 0.6);
  letter-spacing: 0.04em;
}

.nav-group + .nav-group { margin-top: 22px; }

.nav-label {
  font-size: 11px;
  color: rgba(246, 244, 238, 0.45);
  margin-bottom: 8px;
  padding: 0 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-inline-start: 3px solid transparent;
  color: rgba(246, 244, 238, 0.82);
  font-size: 14.5px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--chalk-50);
}

.nav-link.active {
  border-color: var(--gold-500);
  background: rgba(226, 166, 59, 0.1);
  color: var(--chalk-50);
  font-weight: 700;
}

.nav-icon { width: 18px; text-align: center; opacity: 0.9; }

.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line-200);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar .page-title { font-size: 19px; font-weight: 800; }
.topbar .page-date { color: var(--ink-500); font-size: 13px; margin-top: 2px; }

.topbar .who { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink-500);
}
.lang-switch a { color: var(--ink-500); padding: 3px 5px; }
.lang-switch a.active { color: var(--court-700); }
.lang-switch span { color: var(--line-200); }
.lang-switch.on-dark { position: absolute; top: 24px; inset-inline-end: 28px; color: rgba(255,255,255,0.5); }
.lang-switch.on-dark a { color: rgba(255,255,255,0.6); }
.lang-switch.on-dark a.active { color: var(--gold-500); }
.lang-switch.on-dark span { color: rgba(255,255,255,0.25); }
.topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--court-700); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.topbar .who-name { font-size: 13.5px; font-weight: 700; }
.topbar .who-role { font-size: 11.5px; color: var(--ink-500); }

.logout-btn {
  font-size: 12.5px;
  color: var(--ink-500);
  border: 1px solid var(--line-200);
  padding: 6px 12px;
  border-radius: 3px;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

.content { padding: 28px 32px 48px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--court-950);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 28px;
}

.stat {
  padding: 22px 24px;
  border-inline-start: 1px solid var(--line-on-dark);
}
.stat:first-child { border-inline-start: none; }

.stat .num { font-size: 30px; color: var(--white); }
.stat .num small { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.55); margin-inline-start: 4px; }
.stat .label { font-size: 12.5px; color: rgba(246,244,238,0.6); margin-top: 4px; }
.stat.gold .num { color: var(--gold-500); }

.panel-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 4px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-200);
}
.panel-head h2 { font-size: 15.5px; }
.panel-head .see-all { font-size: 12.5px; color: var(--court-700); font-weight: 700; }
.matches-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--court-700, #147A6A);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.schedule-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--chalk-100);
  color: inherit;
  text-decoration: none;
}
.schedule-row:last-child { border-bottom: none; }
a.schedule-row:hover { background: var(--chalk-50); }

.tournament-tag {
  color: var(--court-700);
  border-color: var(--court-700);
  font-weight: 700;
}

.time-badge {
  flex: none;
  font-weight: 800;
  font-size: 13px;
  color: var(--court-700);
  background: var(--chalk-100);
  border-radius: 3px;
  padding: 6px 9px;
  min-width: 58px;
  text-align: center;
}

.schedule-main { flex: 1; min-width: 0; }
.schedule-title { font-weight: 700; font-size: 14px; }
.schedule-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

.court-tag {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-500);
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 3px 8px;
}

.alert-row {
  padding: 13px 20px;
  border-inline-start: 3px solid var(--line-200);
  border-bottom: 1px solid var(--chalk-100);
}
.alert-row:last-child { border-bottom: none; }
.alert-row.warn { border-inline-start-color: var(--warn); }
.alert-row.danger { border-inline-start-color: var(--danger); }
.alert-row.ok { border-inline-start-color: var(--ok); }

.alert-title { font-size: 13.5px; font-weight: 700; }
.alert-sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

.empty-note {
  padding: 24px 20px;
  color: var(--ink-500);
  font-size: 13.5px;
  text-align: center;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-hero {
  background: linear-gradient(160deg, var(--court-950) 0%, var(--court-800) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  position: relative;
  overflow: hidden;
}

.login-hero .court-lines {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255,255,255,0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.9) 1px, transparent 1px);
  background-size: 64px 64px;
}

.login-hero .brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; position: relative; }
.login-hero .brand-row img { width: 52px; height: 52px; background: var(--white); border-radius: 10px; padding: 5px; }
.login-hero .brand-row .name { font-size: 19px; font-weight: 800; }
.login-hero .brand-row .tagline { font-size: 12px; color: var(--gold-500); letter-spacing: 0.06em; }

.login-hero h1 { font-size: 34px; line-height: 1.3; max-width: 420px; position: relative; }
.login-hero p { color: rgba(246,244,238,0.7); margin-top: 14px; max-width: 380px; position: relative; }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-500); font-size: 13.5px; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--chalk-50);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gold-500);
  outline-offset: 1px;
  background: var(--white);
}
.field textarea { min-height: 90px; resize: vertical; }
.field select[multiple] { min-height: 130px; }

.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.field-checkbox input[type="checkbox"] {
  width: auto;
  accent-color: var(--court-700);
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
}
.field-help {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 5px;
}

.form-panel { padding: 24px 28px; max-width: 560px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.form-actions .btn-primary { width: auto; padding: 11px 28px; }

.btn-secondary {
  padding: 11px 20px;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  color: var(--ink-700);
  font-weight: 700;
  font-size: 14.5px;
}
.btn-secondary:hover { background: var(--chalk-100); }


.btn-primary {
  width: 100%;
  background: var(--court-800);
  color: var(--white);
  border: none;
  border-radius: 3px;
  padding: 13px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--court-700); }

.form-error {
  border-inline-start: 3px solid var(--danger);
  background: rgba(180, 72, 42, 0.06);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

@media (max-width: 920px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; position: static; height: auto; }
  .panel-row { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: none; }
  .login-screen { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-nav { display: flex; align-items: center; gap: 14px; }

.cal-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  font-size: 16px;
  color: var(--ink-700);
}
.cal-nav-btn:hover { background: var(--chalk-100); }

.cal-date { text-align: center; }
.cal-date strong { display: block; font-size: 15px; }
.cal-date span { font-size: 12.5px; color: var(--ink-500); }

.cal-actions { display: flex; align-items: center; gap: 10px; }

.cal-today-btn {
  font-size: 12.5px; font-weight: 700; color: var(--court-700);
  border: 1px solid var(--line-200); border-radius: 3px; padding: 8px 14px;
}
.cal-today-btn:hover { background: var(--chalk-100); }

.cal-log-btn {
  font-size: 12.5px; font-weight: 700; color: var(--ink-700);
  border: 1px solid var(--line-200); border-radius: 3px; padding: 8px 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.cal-log-btn:hover { background: var(--chalk-100); }

.cal-new-btn {
  font-size: 13px; font-weight: 700; color: var(--white);
  background: var(--court-800); border-radius: 3px; padding: 9px 16px;
}
.cal-new-btn:hover { background: var(--court-700); }

.cal-grid-wrap { overflow-x: auto; border: 1px solid var(--line-200); border-radius: 4px; }

.cal-grid { display: grid; min-width: 640px; }

.cal-cell {
  border-bottom: 1px solid var(--chalk-100);
  border-inline-start: 1px solid var(--chalk-100);
  min-height: 52px;
  display: block;
}

.cal-corner { background: var(--chalk-50); border-inline-start: none; }

.cal-court-head {
  background: var(--chalk-50);
  font-weight: 700;
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
  min-height: auto;
}

.cal-hour {
  background: var(--chalk-50);
  border-inline-start: none;
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 700;
  padding: 8px 10px;
  text-align: center;
}

.cal-empty { background: var(--white); }
.cal-empty:hover { background: var(--chalk-100); }

.cal-booking {
  padding: 6px 10px;
  color: var(--white);
  overflow: hidden;
}
.cal-booking-type { font-size: 12px; font-weight: 700; line-height: 1.3; }
.cal-booking-sub { font-size: 11px; opacity: 0.85; margin-top: 2px; line-height: 1.3; }

.cal-booking-continue { opacity: 0.55; border-inline-start: 1px solid var(--chalk-100); }

@media (max-width: 920px) {
  .cal-toolbar { justify-content: center; text-align: center; }
}




/* ---------- Court booking gallery (cards, not a time grid) ---------- */

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-nav { display: flex; align-items: center; gap: 14px; }

.cal-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  font-size: 16px;
  color: var(--ink-700);
}
.cal-nav-btn:hover { background: var(--chalk-100); }

.cal-date { text-align: center; }
.cal-date strong { display: block; font-size: 15px; }
.cal-date span { font-size: 12.5px; color: var(--ink-500); }

.cal-actions { display: flex; align-items: center; gap: 10px; }

.cal-today-btn {
  font-size: 12.5px; font-weight: 700; color: var(--court-700);
  border: 1px solid var(--line-200); border-radius: 3px; padding: 8px 14px;
}
.cal-today-btn:hover { background: var(--chalk-100); }

.court-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.court-card {
  width: 280px;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.court-card-link {
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.court-card-link:hover { border-color: var(--court-600); }

.court-card > .court-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.court-card-alert { border-color: var(--danger); border-width: 2px; }
.court-card-alert:hover { border-color: var(--danger); }

.court-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--line-200);
}

.court-card-photo {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.court-card-photo-placeholder {
  height: 170px;
  background: var(--court-950);
  color: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.court-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.court-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.court-card-name { font-size: 16px; font-weight: 800; }

.court-card-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-available { background: rgba(20, 122, 106, 0.1); color: var(--court-700); }
.status-maintenance { background: rgba(201, 143, 43, 0.12); color: var(--warn); }
.status-closed { background: rgba(180, 72, 42, 0.1); color: var(--danger); }
.status-neutral { background: var(--chalk-100); color: var(--ink-500); }

.court-card-slots {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  flex: 1;
}
.court-card-slots li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid var(--chalk-100);
}
.court-card-slots li:last-child { border-bottom: none; }

.slot-time { font-weight: 700; color: var(--ink-700); flex: none; }
.slot-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.slot-type { color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.court-card-empty {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-bottom: 14px;
  flex: 1;
}

.court-card-btn {
  display: block;
  text-align: center;
  background: var(--court-800);
  color: var(--white);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px;
  border-radius: 4px;
}
.court-card-btn:hover { background: var(--court-700); }

@media (max-width: 920px) {
  .cal-toolbar { justify-content: center; text-align: center; }
  .court-gallery { justify-content: center; }
}

/* ---------- Players list ---------- */

.players-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.players-search {
  flex: 0 1 240px;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--white);
}
.players-search:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; }

.players-filter {
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--white);
  color: var(--ink-700);
}

.players-search-btn {
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 9px 14px;
  background: var(--chalk-50);
  font-size: 14px;
}
.players-search-btn:hover { background: var(--chalk-100); }

.players-new-btn {
  margin-inline-start: auto;
  background: var(--court-800);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 3px;
}
.players-new-btn:hover { background: var(--court-700); }

.players-count {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-bottom: 10px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--chalk-100);
}
.player-row:last-child { border-bottom: none; }
.player-row:hover { background: var(--chalk-50); }

.player-avatar {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--court-700);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}

.player-main { flex: 1; min-width: 0; }
.player-name { font-weight: 700; font-size: 14px; }
.player-sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

.player-status {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

@media (max-width: 920px) {
  .players-new-btn { margin-inline-start: 0; }
}

/* ---------- Bookings log ---------- */

.log-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--chalk-100);
  flex-wrap: wrap;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: var(--chalk-50); }

.log-date { flex: none; font-weight: 700; font-size: 13px; min-width: 100px; }
.log-time { flex: none; font-size: 12px; color: var(--ink-500); min-width: 90px; }
.log-court {
  flex: none;
  font-size: 11.5px;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  padding: 3px 8px;
  color: var(--ink-700);
}
.log-main { flex: 1; font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 160px; }

.log-main-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.log-main-link:hover .log-main { text-decoration: underline; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.result-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 10px;
  padding: 18px 20px 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 30, 28, 0.04);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  animation: result-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.result-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(var(--court-700), var(--gold-500));
}
.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(20, 30, 28, 0.1);
}

@keyframes result-card-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-500);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line-200);
}
.result-event {
  font-weight: 700;
  color: var(--white);
  background: var(--court-700);
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10.5px;
}
.result-round { color: var(--ink-500); }

.result-card-players { margin-bottom: 14px; }
.result-card-player {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-900);
  padding: 3px 0;
}
.result-card-vs {
  font-size: 10.5px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 0;
}

.result-card-score {
  display: inline-block;
  background: var(--court-950);
  color: var(--gold-500);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: "Cairo", monospace;
}

.schedule-card-players {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 16px;
  line-height: 1.45;
}

.schedule-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.schedule-card-footer .court-tag {
  background: var(--court-700);
  color: var(--white);
  border-color: transparent;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
}
.schedule-card-time {
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .result-card { animation: none; opacity: 1; transform: none; }
}

.scoreboard { width: 100%; border-collapse: collapse; }
.scoreboard td { padding: 6px 4px; font-size: 13.5px; vertical-align: middle; }
.scoreboard-name {
  text-align: start;
  font-weight: 600;
  color: var(--ink-700);
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}
.scoreboard-set {
  text-align: center;
  font-weight: 700;
  color: var(--ink-500);
  width: 28px;
  font-family: "Cairo", monospace;
  transition: transform 0.15s ease;
}
.scoreboard-winner .scoreboard-name { color: var(--court-800); font-weight: 800; }
.scoreboard-winner .scoreboard-set {
  color: var(--white);
  background: var(--court-700);
  border-radius: 4px;
  animation: score-pop 0.35s ease;
}

@keyframes score-pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .result-card { animation: none; opacity: 1; transform: none; }
}


.log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}
.log-page-btn {
  padding: 8px 16px;
  border: 1px solid var(--line-200);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--court-700);
}
.log-page-btn:hover { background: var(--chalk-100); }
.log-page-current { font-size: 12.5px; color: var(--ink-500); }

/* ---------- Receipt attach button (tournament roster) ---------- */

.receipt-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid var(--line-200);
  border-radius: 50%;
  color: var(--ink-500);
  cursor: pointer;
  background: var(--white);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.receipt-attach-btn:hover { background: var(--chalk-100); border-color: var(--court-600); color: var(--court-700); }
.receipt-attach-btn.has-receipt { background: rgba(20, 122, 106, 0.1); border-color: var(--court-600); color: var(--court-700); }

.receipt-view-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--court-700);
  text-decoration: none;
  white-space: nowrap;
}
.receipt-view-link:hover { text-decoration: underline; }

/* ---------- Roster tile (tournament roster page — expands downward, paginated) ---------- */

.roster-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: start;
}
.roster-toggle-right { display: flex; align-items: center; gap: 8px; }
.roster-chevron {
  transition: transform 0.25s ease;
  flex: none;
  color: var(--ink-500);
}
.roster-tile.is-open .roster-chevron { transform: rotate(180deg); }

.roster-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-200);
  border-radius: var(--glass-radius-sm, 8px);
  font-family: inherit;
  font-size: 12.5px;
  background: var(--white);
}
.roster-search-input:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; }

.roster-pending-tag {
  display: inline-block;
  font-size: 9.5px;
  color: var(--ink-500);
  background: var(--chalk-100);
  border-radius: 999px;
  padding: 1px 6px;
  margin-inline-start: 6px;
  white-space: nowrap;
}

.roster-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-200);
  direction: ltr;
}
.roster-pagination button {
  border: 1px solid var(--line-200);
  background: var(--white);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-700);
}
.roster-pagination button:hover { background: var(--chalk-100); }
.roster-page-label { font-size: 11.5px; color: var(--ink-500); min-width: 44px; text-align: center; }
.roster-tile { align-self: flex-start; height: fit-content; }
.roster-tile-pending { border-color: rgba(200, 140, 30, 0.4); }

/* ---------- Page-transition loader (tennis ball) ---------- */

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 63, 56, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.loader-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease;
}

.tennis-ball {
  width: 56px;
  height: 56px;
  animation: ball-bounce 0.6s ease-in-out infinite alternate;
}

.tennis-ball svg {
  width: 100%;
  height: 100%;
  animation: ball-spin 0.8s linear infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

@keyframes ball-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ball-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  .tennis-ball, .tennis-ball svg { animation: none; }
}

/* ---------- Users & permission matrix ---------- */

.perm-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.perm-matrix th {
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 2px solid var(--line-200);
}
.perm-matrix td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--chalk-100);
}
.perm-matrix-label {
  text-align: start !important;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-700);
}
.perm-matrix input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.copy-perms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.copy-perms-row label { font-size: 13px; font-weight: 700; color: var(--ink-700); }

/* ---------- Notification bell ---------- */

.notif-bell-wrap { position: relative; }
.notif-bell {
  list-style: none;
  cursor: pointer;
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--court-700);
  user-select: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.notif-bell::-webkit-details-marker { display: none; }
.notif-bell:hover { background: rgba(255, 255, 255, 0.75); transform: translateY(-1px); }
.notif-bell-wrap[open] .notif-bell { background: var(--glass-surface-strong); border-color: var(--gold-500); }

.notif-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(20, 30, 28, 0.14);
  z-index: 50;
}
.notif-dropdown-head {
  padding: 12px 16px;
  font-weight: 800;
  font-size: 13px;
  border-bottom: 1px solid var(--line-200);
}
.notif-dropdown .alert-row { padding: 12px 16px; }

/* ---------- Today's tournament matches, grouped by court ---------- */

.court-group { margin-bottom: 26px; }
.court-group:last-child { margin-bottom: 0; }

.court-group-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--court-700);
  margin: 0 0 12px;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--gold-500);
}

/* ============================================================
   GLASS MODERN — site-wide visual refresh
   Soft mint/cream gradient canvas, frosted translucent surfaces
   (backdrop-filter blur) instead of flat white/dark-teal panels,
   rounder corners, quieter shadows. Overrides the tokens/components
   above; kept as one block at the end so the whole redesign lives
   in one place and the original rules above stay untouched as a
   record of the previous look.
   ============================================================ */

:root {
  --glass-surface: rgba(255, 255, 255, 0.45);
  --glass-surface-strong: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-blur: blur(16px);
  --glass-radius: 16px;
  --glass-radius-sm: 10px;
  --glass-shadow: 0 12px 30px rgba(20, 60, 50, 0.08);
}

html, body {
  background: linear-gradient(160deg, #cfeae0 0%, #e7f3ee 45%, #f3ece0 100%);
  background-attachment: fixed;
}

/* ---------- Sidebar & topbar: light frosted glass ---------- */

.sidebar {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-inline-end: 1px solid var(--glass-border);
  color: var(--ink-900);
}
.sidebar .brand-name { color: var(--court-800); }
.sidebar .brand-name span { color: var(--ink-500); }
.nav-label { color: rgba(22, 33, 29, 0.4); }
.nav-link { color: var(--ink-700); }
.nav-link:hover { background: rgba(255, 255, 255, 0.5); color: var(--court-800); }
.nav-link.active {
  border-color: var(--gold-500);
  background: rgba(226, 166, 59, 0.18);
  color: var(--court-800);
}

.topbar {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

/* ---------- Stat strip: individual glass tiles, not one solid bar ---------- */

.stat-strip {
  background: transparent;
  border-radius: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-inline-start: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
.stat .num { color: var(--court-800); }
.stat .num small { color: var(--ink-500); }
.stat .label { color: var(--ink-500); }
.stat.gold .num { color: var(--gold-600); }

/* ---------- Panels, cards, form surfaces: frosted glass ---------- */

.panel,
.court-card,
.result-card,
.form-panel,
.login-card,
.notif-dropdown {
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
.panel-head, .court-card-actions { border-bottom-color: var(--glass-border); }
.court-card-actions { border-top: 1px solid var(--glass-border); border-bottom: none; }
.notif-dropdown-head { border-bottom-color: var(--glass-border); }

.schedule-row, .log-row, .alert-row { border-bottom-color: rgba(20, 60, 50, 0.08); }

.time-badge, .court-tag {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--glass-border);
}
.schedule-card-footer .court-tag { background: var(--court-700); }

/* ---------- Buttons: solid teal primary, glass outline secondary ---------- */

.players-new-btn, .btn-primary {
  background: var(--court-700);
  border-radius: var(--glass-radius-sm);
  box-shadow: 0 6px 16px rgba(15, 102, 86, 0.25);
}
.cal-log-btn, .cal-today-btn, .btn-secondary, .logout-btn, .players-search-btn {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--glass-border);
  border-radius: var(--glass-radius-sm);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ---------- Status pills & badges: rounder ---------- */

.status-available, .status-closed, .status-maintenance, .status-neutral,
.player-status, .court-card-status {
  border-radius: 20px;
}

/* ---------- Inputs & selects ---------- */

.players-filter, input[type="text"], input[type="date"], input[type="time"],
input[type="number"], input[type="email"], input[type="tel"], select, textarea {
  border-radius: var(--glass-radius-sm) !important;
}

/* ---------- Scoreboard / permission matrix: sit cleanly on glass ---------- */

.scoreboard-winner { background: rgba(226, 166, 59, 0.12); }
.perm-matrix th { border-bottom-color: var(--glass-border); }
.perm-matrix td { border-bottom-color: rgba(20, 60, 50, 0.08); }

@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
