:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.container--wide {
  max-width: none;
  width: 100%;
  overflow-x: hidden;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #253044;
}

 .card--compact {
   padding: 0.85rem 1rem;
 }

 .card--compact h1,
 .card--compact h2 {
   margin-top: 0;
   margin-bottom: 0.35rem;
 }

 .card--compact p {
   margin-top: 0;
   margin-bottom: 0;
 }

.card--club {
  border-left: 4px solid var(--accent);
}

.card--socio {
  border-left: 4px solid #64748b;
}

.card__kicker {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.lang-hint {
  opacity: 0.85;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: start;
  width: 100%;
}

.app-main {
  padding: 1rem;
  width: 100%;
  max-width: 100%;
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  background: var(--card);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid #253044;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  z-index: 100;
}

.app-sidebar__title {
  font-weight: 700;
  margin-right: 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.app-sidebar__nav .btn {
  width: auto;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
}

.app-main {
  padding: 1rem;
}

.foot-hint {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.grid-inicio {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-inicio {
    grid-template-columns: 1fr 1fr;
  }
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-secondary {
  background: #334155;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.jugadores-edit-wrap td {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #253044;
}

.jugadores-edit-form {
  margin-bottom: 0.75rem;
}

.jugadores-edit-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .jugadores-edit-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .jugadores-edit-span {
    grid-column: 1 / -1;
  }
}

.jugadores-edit-actions,
.jugadores-edit-delete {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.alert-ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: var(--text);
  margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: var(--text);
  margin-bottom: 1rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 720px;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
}

.tab--active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.45);
}

.pagos-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .pagos-top {
    grid-template-columns: 1fr;
  }
}

.pagos-total {
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pagos-total__value {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 0.15rem;
}

.pagos-filters {
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.segmented {
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.segmented__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}

.segmented__btn:last-child {
  border-right: none;
}

.segmented__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.segmented__btn--active {
  background: rgba(59, 130, 246, 0.22);
}

.dropdown {
  position: relative;
}

.dropdown__summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 12rem;
}

.dropdown__summary::-webkit-details-marker {
  display: none;
}

.dropdown[open] .dropdown__summary {
  border-color: rgba(255, 255, 255, 0.18);
}

.dropdown__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 16rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(18, 24, 38, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.dropdown__item {
  display: block;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.day-nav {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.day-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 900;
}

.day-nav__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.day-nav__label {
  padding: 0 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  min-width: 7rem;
  text-align: center;
}

.day-nav__cal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  height: 2.25rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 700;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
}

.day-nav__cal:hover {
  background: rgba(255, 255, 255, 0.08);
}

.caja-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .caja-grid {
    grid-template-columns: 1fr;
  }
}

.caja-card {
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.caja-card__title {
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.ppagos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.ppagos__row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .ppagos__row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.ppagos__name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ppagos__debe {
  font-weight: 800;
}

.ppagos__metodo {
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #253044;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.checkbox-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.checkbox-row label {
  display: inline;
  margin-left: 0.35rem;
  color: var(--text);
}

.canchas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
}

.canchas-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.canchas-legend__swatch {
  width: 1rem;
  height: 0.65rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.canchas-legend__swatch--partido {
  background: rgba(59, 130, 246, 0.55);
  border: 1px solid #3b82f6;
}

.canchas-legend__swatch--reserva {
  background: rgba(245, 158, 11, 0.55);
  border: 1px solid #f59e0b;
}

.canchas-legend__swatch--clase {
  background: rgba(168, 85, 247, 0.55);
  border: 1px solid #a855f7;
}

.canchas-legend__swatch--bloqueo {
  background: rgba(239, 68, 68, 0.35);
  border: 1px solid rgba(239, 68, 68, 0.85);
}

.canchas-legend__swatch--cerrado {
  background: rgba(148, 163, 184, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.9);
}

.canchas-timeline {
  margin-top: 0.5rem;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.canchas-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.canchas-main {
  min-width: 0;
}

.canchas-side {
  min-width: 0;
}

.canchas-pay-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.canchas-pay-list {
  margin-top: 0.25rem;
  max-height: 62vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.45);
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text);
}

.pill--ok {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.18);
}

.pill--warn {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.18);
}

@media (max-width: 980px) {
  .canchas-page {
    grid-template-columns: 1fr;
  }
}

.canchas-timeline--vertical-grid {
  display: grid;
  grid-template-columns: 3.75rem repeat(var(--court-count, 4), minmax(var(--court-min, 280px), 1fr));
  gap: 0.5rem;
  max-height: 70vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 0.25rem;
}

.canchas-vaxis {
  position: relative;
}

.canchas-vcourt {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.canchas-vcourt__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  position: sticky;
  top: 0;
  background: var(--card);
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid #253044;
  z-index: 2;
}

.canchas-vcourt__track {
  position: relative;
  background: #141c28;
  border-radius: 8px;
  border: 1px solid #253044;
  touch-action: pan-y;
}

.cancha-timeline-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.cancha-timeline-row__label {
  width: 4.25rem;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 0.5rem;
  line-height: 1.2;
}

.cancha-timeline-row__track {
  flex: 1;
  position: relative;
  min-height: 3.15rem;
  background: #141c28;
  border-radius: 8px;
  border: 1px solid #253044;
  cursor: crosshair;
  touch-action: pan-y;
}

.canchas-timeline:not(.canchas-timeline--vertical-grid) .cancha-timeline-row__track {
  min-height: 4.4rem;
}


.cancha-timeline-axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1rem;
  pointer-events: none;
}

.cancha-timeline-axis--vertical {
  top: 0;
  bottom: 0;
  height: auto;
  width: 3.25rem;
  left: 0;
  right: auto;
}

.cancha-timeline-axis__tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
}

.cancha-timeline-axis__tick--vertical {
  left: 0.25rem;
  transform: translateY(-100%);
}

.cancha-timeline-axis__tick--end {
  transform: translateX(-100%);
}

.cancha-bar {
  position: absolute;
  border-radius: 4px;
  min-width: 4px;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
  color: var(--text);
}


.canchas-timeline--vertical-grid .cancha-bar {
  left: 0.25rem;
  right: 0.25rem;
  min-width: 0;
}

.cancha-bar--partido {
  left: 0.1rem;
  right: 0.1rem;
  background: rgba(59, 130, 246, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.65);
  pointer-events: auto;
  cursor: pointer;
}

.cancha-bar--reserva {
  background: rgba(245, 158, 11, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.85);
  pointer-events: auto;
  cursor: pointer;
}

.cancha-bar--clase {
  background: rgba(168, 85, 247, 0.35);
  border: 1px solid rgba(168, 85, 247, 0.9);
  pointer-events: auto;
  cursor: pointer;
}

.cancha-bar__badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.35rem;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.95);
}

.cancha-bar__badge--float {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  margin-left: 0;
  pointer-events: none;
  z-index: 2;
}

.cancha-bar--pago-pagado {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.55) inset;
}

.cancha-bar--pago-senia {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55) inset;
}

 .cancha-bar--bloqueo {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.75);
  pointer-events: auto;
  cursor: pointer;
 }

 .cancha-bar--cerrado {
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.85);
  pointer-events: auto;
  cursor: pointer;
 }

.cancha-bar--selecting {
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.8);
}

.cancha-bar__tag {
  display: block;
  padding: 0.15rem 0.35rem;
  font-size: 0.65rem;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text);
}

.canchas-pick-toolbar {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #141c28;
  border-radius: 8px;
  border: 1px solid #253044;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.canchas-pick-toolbar[hidden] {
  display: none !important;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid #253044;
  border-radius: 12px;
  padding: 1.25rem;
  max-height: 94vh;
  z-index: 10000;
  overflow-y: auto;
}

.modal__body {
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}
