/* © Geopadel · Todos los derechos reservados. Queda prohibida la reproducción total o parcial sin autorización. */
:root {
  --slot-h: 56px;
  --card-normal-striped-bg: var(--blue-soft);
  --card-normal-striped-color: var(--blue);
  --card-normal-solid-bg: var(--green-soft);
  --card-normal-solid-color: var(--green-text);
  --card-pena-bg: #e3d9f3;
  --card-pena-color: #46306b;
  --card-torneo-bg: #f6e3c0;
  --card-torneo-color: #5e410e;
  --card-entreno-bg: #c9e8e4;
  --card-entreno-color: #1b4b47;
}

[data-theme="dark"] {
  --card-normal-striped-bg: #3f6283;
  --card-normal-striped-color: #e9f2fd;
  --card-normal-solid-bg: #3a6a53;
  --card-normal-solid-color: #e3f7ec;
  --card-pena-bg: #594a82;
  --card-pena-color: #f1ebfc;
  --card-torneo-bg: #86683a;
  --card-torneo-color: #fdf0d6;
  --card-entreno-bg: #36706b;
  --card-entreno-color: #e0f6f2;
}

@media (min-width: 1024px) and (min-height: 760px) {
  :root {
    --slot-h: 64px;
  }
}

@media (min-width: 1024px) and (min-height: 940px) {
  :root {
    --slot-h: 72px;
  }
}

.subnav {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav::-webkit-scrollbar {
  display: none;
}

.subnav-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.subnav-btn i {
  margin-right: 0;
  font-size: 16px;
}

.subnav-btn:hover {
  color: var(--text);
}

.subnav-btn.active {
  background: var(--surface);
  color: var(--heading);
  box-shadow: var(--shadow-sm);
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.playtomic-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--border);
}

.btn-imprimir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1.5px solid var(--border-strong);
  color: var(--heading);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.btn-imprimir i {
  font-size: 18px;
  margin-right: 0;
}

.btn-imprimir:hover {
  background: var(--border);
}

.btn-imprimir:active {
  transform: scale(0.97);
}

.btn-imprimir:disabled {
  opacity: 0.6;
  cursor: wait;
}

.date-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-playtomic-nav {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.btn-playtomic-nav:hover {
  background: var(--border);
}

.date-picker-input {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  background: var(--surface);
}

.stats-chips {
  display: flex;
  gap: 8px;
}

.chip {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.chip b {
  color: var(--heading);
}

.btn-crear-partido {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(42, 56, 52, 0.18);
  transition:
    background 0.15s,
    transform 0.1s;
}

.btn-crear-partido:hover {
  background: var(--primary-hover);
}

.btn-crear-partido:active {
  transform: scale(0.96);
}

.btn-crear-partido .plus {
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 1023px) {
  .btn-crear-partido {
    position: fixed;
    right: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: var(--gp-lime);
    color: var(--gp-navy-dark);
    box-shadow: 0 4px 14px rgba(42, 56, 52, 0.22);
    z-index: 150;
  }

  .btn-crear-partido:hover {
    background: var(--gp-lime-hover);
  }

  .btn-crear-partido .txt {
    display: none;
  }

  .btn-crear-partido .plus {
    font-size: 30px;
  }
}

@media (max-width: 700px) {
  .btn-imprimir {
    width: 100%;
  }

  .date-nav-group {
    width: 100%;
    justify-content: space-between;
  }

  .date-picker-input {
    flex: 1;
    text-align: center;
  }

  .stats-chips {
    width: 100%;
  }

  .stats-chips .chip {
    flex: 1;
    text-align: center;
  }
}

.grid-playtomic-wrapper {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: auto;
  max-height: calc(100dvh - var(--header-h) - 192px);
  min-height: 420px;
  position: relative;
  border: 1.5px solid var(--border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.playtomic-grid {
  display: grid;
  grid-template-columns: 60px repeat(9, minmax(105px, 1fr));
  min-width: calc(60px + 9 * 105px);
  position: relative;
}

.grid-header-pista {
  background: var(--surface);
  padding: 12px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--heading);
  border-bottom: 3px solid var(--heading);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-header-corner {
  background: var(--surface);
  border-bottom: 3px solid var(--heading);
  border-right: 2px solid var(--border);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-time-axis {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 20;
  border-right: 2px solid var(--border-strong);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
}

.time-slot-label {
  height: var(--slot-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-top: 1px dashed var(--border-strong);
  background: var(--surface);
}

.time-slot-label.hour {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  border-top: 2px solid var(--border-strong);
  background: var(--surface-2);
}

.time-slot-label.blocked {
  color: var(--muted);
  opacity: 0.75;
  background: var(--surface-3);
  border-top: 1px solid var(--border);
}

.court-column {
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.slot {
  height: var(--slot-h);
  box-sizing: border-box;
  cursor: pointer;
}

.slot.hour {
  border-top: 2px solid var(--border-strong);
  background-color: var(--surface);
}

.slot.half {
  border-top: 1px dashed var(--border-strong);
  background-color: var(--surface-2);
}

.slot.hour:hover,
.slot.half:hover {
  background-color: var(--slot-hover);
}

.slot.blocked {
  border-top: 1px solid var(--border);
  background: repeating-linear-gradient(
    135deg,
    var(--surface-3),
    var(--surface-3) 8px,
    var(--surface-2) 8px,
    var(--surface-2) 16px
  );
  opacity: 0.8;
}

.slot.blocked:hover {
  opacity: 1;
  background: var(--amber-soft);
}

.court-line-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--red);
  opacity: 0.5;
  z-index: 15;
  pointer-events: none;
}

.reserva-card {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(42, 56, 52, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  transition:
    box-shadow 0.15s,
    filter 0.15s;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text);
  -webkit-touch-callout: none;
}

.reserva-card:hover {
  filter: brightness(0.97);
  box-shadow: 0 4px 12px rgba(42, 56, 52, 0.2);
}

.reserva-card:active {
  cursor: grabbing;
}

.reserva-card.dragging-touch {
  opacity: 0.85;
  z-index: 1000;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition: none;
}

.card-normal-striped {
  background: var(--card-normal-striped-bg);
  color: var(--card-normal-striped-color);
}

.card-normal-solid {
  background: var(--card-normal-solid-bg);
  color: var(--card-normal-solid-color);
}

.card-pena-striped {
  background: var(--card-pena-bg);
  color: var(--card-pena-color);
}

.card-torneo-striped {
  background: var(--card-torneo-bg);
  color: var(--card-torneo-color);
}

.card-entreno-striped {
  background: var(--card-entreno-bg);
  color: var(--card-entreno-color);
}

.reserva-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.reserva-card.compact .reserva-top {
  display: none;
}

.reserva-card.compact {
  justify-content: center;
  gap: 2px;
  padding-top: 3px;
  padding-bottom: 3px;
}

.reserva-card.compact .reserva-title {
  -webkit-line-clamp: 1;
  font-size: 14px;
  margin-top: 0;
}

.badge-sin-pagar,
.badge-pagado,
.badge-parcial {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.badge-sin-pagar {
  background: var(--danger-btn);
}

.badge-pagado {
  background: var(--ok-btn);
}

.badge-parcial {
  background: var(--amber);
  color: var(--ink);
}

.pagos-dots-container {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pago-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.pago-dot.pagado {
  background: var(--ok-btn);
}

.pago-dot.pendiente {
  background: var(--danger-btn);
}

.reserva-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  word-break: break-word;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.reserva-time {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.reserva-time > span:first-child {
  opacity: 0.95;
}

.reserva-card.has-nota {
  box-shadow:
    inset 0 0 0 2px #f2b84b,
    0 1px 3px rgba(42, 56, 52, 0.14);
}

.reserva-card.has-nota:hover {
  box-shadow:
    inset 0 0 0 2px #f2b84b,
    0 4px 12px rgba(42, 56, 52, 0.2);
}

.nota-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f2b84b;
  color: #4a3200;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.nota-flag i {
  margin-right: 0;
  font-size: 12px;
}

.reserva-nota-txt {
  background: #f6d36b;
  color: #4a3200;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

@media (min-width: 900px) {
  .playtomic-grid {
    grid-template-columns: 60px repeat(9, minmax(0, 1fr));
    min-width: 0;
  }
}

.grid-header-pista {
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  padding: 8px 4px;
  min-height: 52px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.time-slot-label {
  font-size: 13px;
}

.time-slot-label.hour {
  font-size: 15px;
}

.reserva-card {
  padding: 7px 9px;
  border-left-width: 5px;
}

.card-normal-striped {
  border-left-color: var(--blue-btn);
}

.card-normal-solid {
  border-left-color: var(--ok-btn);
}

.card-pena-striped {
  border-left-color: #8466c4;
}

.card-torneo-striped {
  border-left-color: #d19a3a;
}

.card-entreno-striped {
  border-left-color: #3f9b92;
}

.reserva-title {
  font-size: clamp(15px, 0.7vw + 8px, 19px);
}

.reserva-card:not(.compact) .reserva-title {
  -webkit-line-clamp: 3;
}

.reserva-card.compact .reserva-title {
  font-size: clamp(14px, 0.6vw + 8px, 17px);
}

.reserva-time {
  font-size: clamp(12px, 0.4vw + 8px, 15px);
}

.badge-sin-pagar,
.badge-pagado,
.badge-parcial,
.badge-pendiente,
.nota-flag {
  font-size: 12px;
}

.pago-dot {
  width: 19px;
  height: 19px;
  font-size: 11px;
}

.reserva-card:focus-visible {
  outline: 3px solid var(--gp-lime) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px var(--primary) !important;
}

.court-column.drag-over,
.slot:focus-visible {
  outline: 2px dashed var(--primary) !important;
  background-color: var(--slot-hover) !important;
}

.mesas-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  scrollbar-width: none;
}

.mesas-bar::-webkit-scrollbar {
  display: none;
}

.btn-mesa {
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-mesa.activa {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(42, 56, 52, 0.2);
}

.badge-total {
  background: var(--danger-btn);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

.tpv-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

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

  .ticket-box {
    order: -1;
    min-height: 0 !important;
  }

  .ticket-items {
    max-height: 170px !important;
  }
}

.tpv-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tpv-catalog-header {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  flex: 1;
}

.tpv-catalog-header::-webkit-scrollbar {
  display: none;
}

.btn-cat-filter {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}

.btn-cat-filter.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.catalog-grid > * {
  min-width: 0;
  max-width: 100%;
}

.btn-product {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 14px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 88px;
  word-break: break-word;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  box-sizing: border-box;
}

.btn-product:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-product:active {
  transform: scale(0.96);
}

.btn-product span {
  display: block;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
}

.ticket-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

@media (max-width: 900px) {
  .ticket-box {
    position: static;
  }
}

.ticket-box h4 {
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  font-weight: 700;
  font-size: 16px;
}

.ticket-box h4 span {
  color: var(--heading);
}

.ticket-items {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.ticket-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.ticket-items li:hover {
  color: var(--red);
}

.ticket-empty {
  color: var(--muted);
  font-weight: 600;
  cursor: default !important;
  justify-content: center !important;
}

.ticket-total {
  font-size: 22px;
  font-weight: 700;
  text-align: right;
  margin-bottom: 14px;
  color: var(--heading);
}

.pay-buttons {
  display: flex;
  gap: 12px;
}

.btn-pay {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  transition:
    transform 0.1s,
    opacity 0.15s;
  box-shadow: var(--shadow-sm);
}

.btn-pay:active {
  transform: scale(0.97);
}

.btn-pay:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-cash {
  background: var(--ok-btn);
}

.btn-card {
  background: var(--blue-btn);
}

#tab-tpv,
#tab-tpv .card,
#tab-tpv .tpv-grid,
#tab-tpv .tpv-grid > *,
#tab-tpv .tpv-tools {
  min-width: 0;
  max-width: 100%;
}

#tab-tpv .tpv-tools {
  width: 100%;
}

#tab-tpv #buscarTPV {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#tab-tpv .tpv-catalog-header {
  min-width: 0;
  max-width: 100%;
}

#tab-tpv .ticket-box {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#tab-tpv .ticket-box > *,
#tab-tpv .ticket-box h4,
#tab-tpv .ticket-items {
  min-width: 0;
  max-width: 100%;
}

#tab-tpv .ticket-items li {
  overflow-wrap: anywhere;
}

#tab-tpv .ticket-total {
  overflow-wrap: anywhere;
}

#tab-tpv .pay-buttons {
  width: 100%;
  min-width: 0;
  gap: 8px;
}

#tab-tpv .btn-pay {
  min-width: 0;
  padding: 12px 6px;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  #tab-tpv .card {
    padding: 12px;
  }

  #tab-tpv .tpv-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #tab-tpv .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #tab-tpv .btn-product {
    padding: 12px 8px;
    font-size: 13px;
  }

  #tab-tpv .btn-product span {
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  #tab-tpv .ticket-box {
    padding: 12px;
  }

  #tab-tpv .ticket-box h4 {
    overflow-wrap: anywhere;
  }

  #tab-tpv .btn-pay {
    font-size: 13px;
  }
}

.fichaje-buttons {
  display: flex;
  gap: 14px;
  margin: 18px auto 0;
  max-width: 460px;
}

.btn-fichar {
  flex: 1;
  padding: 24px 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition:
    transform 0.12s,
    box-shadow 0.15s,
    opacity 0.15s;
  box-shadow: var(--shadow-md);
}

.btn-fichar:active {
  transform: scale(0.97);
}

.btn-fichar:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-entrada {
  background: var(--ok-btn);
}

.btn-salida {
  background: var(--warn-btn);
}

@media (max-width: 480px) {
  .fichaje-buttons {
    flex-direction: column;
  }
}

.badge-fichaje {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  border: 1px solid;
  white-space: nowrap;
}

.badge-fichaje.in {
  background: var(--green-soft);
  color: var(--green-text);
  border-color: var(--green);
}

.badge-fichaje.out {
  background: var(--orange-soft);
  color: var(--orange-text);
  border-color: var(--orange);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.kpi {
  padding: 18px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}

.kpi span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.kpi h2 {
  font-size: 26px;
  margin-top: 4px;
  color: var(--heading);
}

.kpi.ef {
  background: var(--green-soft);
  border-color: var(--green);
}

.kpi.ef span,
.kpi.ef h2 {
  color: var(--green-text);
}

.kpi.ta {
  background: var(--blue-soft);
  border-color: var(--blue-btn);
}

.kpi.ta span,
.kpi.ta h2 {
  color: var(--blue);
}

.cierre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.cierre-grid label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cierre-grid input {
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
}

.cierre-grid input[readonly] {
  background: var(--surface-3);
  color: var(--heading);
}

.cierre-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0;
  font-weight: 700;
}

.dif-ok {
  color: var(--green);
}

.dif-ko {
  color: var(--red);
}

.tabla-tarifas {
  min-width: 420px;
}

.tabla-tarifas input {
  width: 92px;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
}

.tabla-tarifas input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.reserva-card.pendiente {
  outline: 2px dashed var(--amber);
  outline-offset: -3px;
}

.badge-pendiente {
  background: var(--amber);
  color: #4a3410;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.chip-pendientes {
  cursor: pointer;
  font-family: inherit;
}

.chip-pendientes.hay {
  background: var(--amber);
  border-color: var(--amber);
  color: #4a3410;
}

.chip-pendientes.hay b {
  color: #4a3410;
}

.deuda-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.deuda-total b {
  color: var(--red);
  font-size: 18px;
}

.badge-deuda {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  border: 1px solid;
  white-space: nowrap;
}

.badge-deuda.pend {
  background: var(--orange-soft);
  color: var(--orange-text);
  border-color: var(--orange);
}

.badge-deuda.ok {
  background: var(--green-soft);
  color: var(--green-text);
  border-color: var(--green);
}

tr.deuda-resuelta td {
  opacity: 0.65;
}

.tabla-productos td .btn-add {
  padding: 7px 11px;
  font-size: 12px;
  margin-right: 4px;
  white-space: nowrap;
}

.limp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 8px;
}

.limp-label:first-of-type {
  margin-top: 0;
}

.limp-grid {
  max-height: none;
}

.aviso-limpieza {
  background: var(--orange-soft);
  border: 1.5px solid var(--orange);
  color: var(--orange-text);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.aviso-limpieza[hidden] {
  display: none;
}

.aviso-limpieza i {
  margin-right: 6px;
}

.limp-leyenda {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.limp-ok {
  color: var(--green-text);
  font-weight: 700;
}

.limp-ko {
  color: var(--red);
  font-weight: 800;
}

.limp-cell small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.aviso-lista {
  list-style: none;
  margin: 10px 0 0;
}

.aviso-lista li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.aviso-lista li small {
  display: block;
  font-weight: 600;
  color: var(--muted);
}

.copia-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.copia-grid .btn-cat-filter,
.deuda-total .btn-cat-filter {
  display: inline-flex;
  align-items: center;
}

#cardCopia[hidden] {
  display: none;
}

@media (max-width: 420px) {
  .app-nav {
    overflow-x: auto;
  }

  .nav-tab {
    min-width: 54px;
  }
}

.tabla-productos,
.tabla-productos * {
  -webkit-user-select: text;
  user-select: text;
}

.inf-bar {
  display: inline-block;
  width: 90px;
  height: 8px;
  border-radius: 9999px;
  background: var(--surface-3);
  vertical-align: middle;
  margin-left: 8px;
  overflow: hidden;
}

.inf-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  margin: 0;
}

.esc-thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.esc-sin {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 26px;
}

.esc-sin i {
  margin-right: 0;
}

.esc-desc {
  display: block;
  max-width: 320px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.esc-acciones {
  white-space: normal !important;
}

.esc-acciones .btn-add {
  margin-bottom: 4px;
}

.esc-acciones .btn-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.art-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 240px;
  margin-bottom: 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.art-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.art-preview span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.art-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}

.art-textarea:focus,
#artFoto:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 28%, transparent);
}

#artFoto {
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

.ct-cab,
.ct-fila {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.ct-cab {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.ct-fila {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.ct-fila.off {
  opacity: 0.55;
}

.ct-dia {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
}

.ct-dia input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.ct-horas {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ct-horas input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 9px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 620px) {
  .ct-cab {
    display: none;
  }

  .ct-fila {
    grid-template-columns: 1fr 1fr;
  }

  .ct-dia {
    grid-column: 1/-1;
  }
}

.res-bienvenida {
  margin-bottom: 20px;
}

.res-bienvenida h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 4px;
}

.res-bienvenida p {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.res-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.res-kpi {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.res-kpi span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.res-kpi span i {
  font-size: 16px;
  margin-right: 0;
}

.res-kpi h3 {
  font-size: 28px;
  font-weight: 800;
  color: var(--heading);
  margin: 8px 0 4px;
  line-height: 1;
}

.res-kpi small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.res-kpi-blue {
  border-left: 4px solid var(--blue-btn);
}

.res-kpi-blue span i {
  color: var(--blue-btn);
}

.res-kpi-green {
  border-left: 4px solid var(--green);
}

.res-kpi-green span i {
  color: var(--green);
}

.res-kpi-red {
  border-left: 4px solid var(--red);
}

.res-kpi-red span i {
  color: var(--red);
}

.res-kpi-amber {
  border-left: 4px solid var(--amber);
}

.res-kpi-amber span i {
  color: var(--orange-text);
}

.res-alertas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.res-alerta {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--blue-btn);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.res-alerta i {
  font-size: 22px;
  color: var(--blue-btn);
  flex: 0 0 auto;
  margin-right: 0;
}

.res-alerta div {
  flex: 1;
  min-width: 180px;
}

.res-alerta b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--heading);
}

.res-alerta p {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.res-alerta-warn {
  border-left-color: var(--amber);
}

.res-alerta-warn i {
  color: var(--orange-text);
}

.res-alerta .btn-add {
  font-size: 12px;
  padding: 8px 14px;
}

.res-acciones,
.res-agenda {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.res-acciones h3,
.res-agenda h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.res-acciones h3 i,
.res-agenda h3 i {
  margin-right: 0;
  color: var(--primary);
}

.res-acciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.res-accion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition:
    background 0.15s,
    transform 0.1s,
    border-color 0.15s;
  font-family: inherit;
}

.res-accion:hover {
  background: var(--slot-hover);
  border-color: var(--primary);
}

.res-accion:active {
  transform: scale(0.97);
}

.res-accion i {
  font-size: 22px;
  color: var(--primary);
  margin-right: 0;
}

.res-agenda-lista {
  list-style: none;
  padding: 0;
  margin: 0;
}

.res-agenda-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.res-agenda-item:last-child {
  border-bottom: 0;
}

.res-agenda-hora {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding-right: 14px;
  border-right: 2px solid var(--border);
}

.res-agenda-hora b {
  font-size: 15px;
  font-weight: 800;
  color: var(--heading);
}

.res-agenda-hora small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.res-agenda-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.res-agenda-info b {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
}

.res-agenda-info span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-agenda-estado {
  flex: 0 0 auto;
}

.res-agenda-vacia {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.badge-confirmada {
  background: var(--green-soft);
  color: var(--green-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .res-kpi h3 {
    font-size: 22px;
  }

  .res-agenda-item {
    flex-wrap: wrap;
  }

  .res-agenda-estado {
    margin-left: auto;
  }

  .res-bienvenida h2 {
    font-size: 20px;
  }
}

.hist-item {
  border-left: 3px solid var(--border);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hist-item.accion-INSERT {
  border-left-color: var(--green);
}

.hist-item.accion-DELETE {
  border-left-color: var(--red);
}

.hist-item.accion-UPDATE {
  border-left-color: var(--blue);
}

.hist-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--heading);
}

.hist-meta i {
  font-size: 16px;
}

.hist-item.accion-INSERT .hist-meta i {
  color: var(--green);
}

.hist-item.accion-DELETE .hist-meta i {
  color: var(--red);
}

.hist-item.accion-UPDATE .hist-meta i {
  color: var(--blue);
}

.hist-cambios {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 22px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.hist-cambios li {
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.pistas-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
}

.pistas-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s ease;
  user-select: none;
}

.pistas-checkbox-item span {
  line-height: 1.3;
  word-break: break-word;
  text-align: left;
}

.pistas-checkbox-item:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

.pistas-checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pistas-checkbox-item::before {
  content: "";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.15s;
  font-size: 14px;
  font-weight: 800;
  color: transparent;
  line-height: 1;
}

.pistas-checkbox-item:has(input:checked)::before {
  content: "✓";
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pistas-checkbox-item:has(input:checked) {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-text);
}

.pistas-checkbox-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.pistas-checkbox-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.card-jugador-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.15s;
}

.card-jugador-item.estado-efectivo {
  border-left: 4px solid #16a34a;
  background: rgba(22, 163, 74, 0.05);
}

.card-jugador-item.estado-tarjeta {
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.jugador-info-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--heading);
}

.jugador-info-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.jugador-actions {
  display: flex;
  gap: 6px;
}

.btn-pay-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  color: #fff;
  font-size: 18px;
}

.btn-pay-toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-pay-efectivo {
  background: #16a34a;
}

.btn-pay-efectivo:hover:not(:disabled) {
  background: #15803d;
  transform: scale(1.05);
}

.btn-pay-tarjeta {
  background: #3b82f6;
}

.btn-pay-tarjeta:hover:not(:disabled) {
  background: #2563eb;
  transform: scale(1.05);
}

.btn-pay-reset {
  background: #ef4444;
}

.btn-pay-reset:hover:not(:disabled) {
  background: #dc2626;
  transform: scale(1.05);
}

.estado-global {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.nota-box h5 {
  color: var(--heading);
}

.nota-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: 12px;
}

.modal-section-box .pistas-checkbox-grid {
  margin: 8px 0 16px;
}

.modal-section-box .pistas-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.modal-section-box .pistas-checkbox-item:has(input:checked) {
  color: var(--green-text);
}

.modal-section-box .pistas-checkbox-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  position: relative;
  box-shadow: none;
}

.modal-section-box .pistas-checkbox-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.modal-section-box .pistas-checkbox-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid var(--on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.modal-section-box .pistas-checkbox-item input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--primary) !important;
  outline-offset: 2px !important;
}

.modal-section-box .cli-wrap input {
  width: 100%;
}

.modal-section-box .cli-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 122, 134, 0.2);
}

.btn-pay.active {
  box-shadow: inset 0 0 0 3px var(--surface);
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-pay:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.reserva-card,
.cl-res,
.tabla-productos tr {
  content-visibility: auto;
  contain-intrinsic-size: 50px;
}

@media (max-width: 700px) {
  .subnav-btn {
    min-width: 72px;
    padding: 9px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .subnav-btn i {
    font-size: 14px;
  }
}
