:root {
  color-scheme: light;
  --green: #15803d;
  --deep: #102018;
  --ink: #17231d;
  --muted: #66736b;
  --line: #dfe7e2;
  --surface: #ffffff;
  --soft: #f3f7f4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f7f6;
}

.auth-page,
.public-body,
.app-body {
  min-height: 100dvh;
}
.entity-bg-page {
  min-height: 100dvh;
  background:
    linear-gradient(rgba(5, 20, 12, .38), rgba(5, 20, 12, .38)),
    var(--entity-bg) center/cover fixed no-repeat;
}

.auth-page {
  background: linear-gradient(rgba(7, 24, 16, .48), rgba(7, 24, 16, .72)), url('/images/cancha-sintetica-default.png') center/cover fixed;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-shell { width: min(440px, 100%); }
.auth-card,
.panel-section,
.booking-form,
.success-panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(8, 27, 17, .18);
}
.auth-card { padding: 24px; }
.auth-card h1 { font-size: 1.7rem; margin: 0 0 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: .95rem; }
.auth-home-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.password-rules {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .88rem;
}
.password-rules span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.password-rules .is-valid {
  color: var(--green);
}
.password-rules .is-invalid {
  color: #8a5a0a;
}
.password-field {
  position: relative;
}
.password-field .form-control {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}
.password-toggle:hover,
.password-toggle:focus {
  color: var(--green);
  background: #edf7f0;
}
.phone-input-group {
  display: flex;
  width: 100%;
}
.phone-country-select {
  flex: 0 0 auto;
  width: 118px;
  min-height: 38px;
  padding: .375rem 1.55rem .375rem .5rem;
  border: 1px solid #ced4da;
  border-right: 0;
  border-radius: .375rem 0 0 .375rem;
  background-color: #f8faf9;
  color: var(--ink);
  font-weight: 700;
  font-size: .9rem;
}
.phone-number-input.form-control {
  min-width: 0;
  border-radius: 0 .375rem .375rem 0;
}
.phone-input-group:focus-within .phone-country-select {
  border-color: #86b7fe;
}
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inline-form .form-select {
  width: auto;
  min-width: 130px;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.account-grid .grid-wide {
  grid-column: 1 / -1;
}
.account-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.account-subtab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.account-subtab.active {
  color: #0f6b37;
  border-color: #1fbf63;
  background: #e9f9ef;
}
.account-subtab-content > .settings-box {
  margin: 0;
}
.payment-inline-form {
  display: grid;
  grid-template-columns: 110px 142px 120px 142px 120px 42px;
  gap: 6px;
  align-items: center;
  min-width: 700px;
}
.account-payment-table {
  font-size: .82rem;
  white-space: nowrap;
}
.account-payment-table th {
  background: #f1f3f5;
  color: #111;
}
.payment-table-status { font-weight: 900; }
.payment-table-status.status-al_dia { color: #087b38; }
.payment-table-status.status-vence_hoy { color: #0d6efd; }
.payment-table-status.status-vencido { color: #c52838; }
.payment-table-status.status-sin_datos { color: #6c757d; }
.payment-row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.payment-status-panel { width: min(620px, 100%); }
.payment-modal-grid { margin-top: 14px; }
.payment-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.payment-add-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.payment-add-form label {
  display: grid;
  gap: 4px;
  margin: 0;
}
.payment-add-form label span {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}
.account-alerts .alert {
  border-radius: 8px;
}

.entity-selector {
  position: relative;
}
.entity-selector-control {
  display: flex;
  gap: 8px;
}
.entity-selector-control .form-control {
  min-width: 0;
}
.entity-selector-favorite {
  width: 44px;
  flex: 0 0 44px;
}
.entity-selector-favorite[aria-pressed="true"] {
  color: #b7791f;
  border-color: #f6c453;
  background: #fff8e1;
}
.entity-selector-results {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(8, 27, 17, .16);
  overflow: hidden;
}
.entity-selector-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  text-align: left;
}
.entity-selector-result:hover,
.entity-selector-result:focus {
  background: var(--soft);
}
.entity-selector-result span {
  color: var(--muted);
  font-size: .84rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  background: #102018;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.notify-pill { min-width: 58px; }
.notify-pill.notifications-empty {
  color: #e9ecef;
  background: #6c757d;
  border-color: #6c757d;
  opacity: .7;
  cursor: default;
}
.notify-pill.has-unread-notifications,
.notify-pill.notification-heartbeat-active {
  transform-origin: center;
  animation: notification-heartbeat 1s ease-in-out 5;
}
@keyframes notification-heartbeat {
  0%, 35%, 70%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, .45); }
  12% { transform: scale(1.13); box-shadow: 0 0 0 7px rgba(255, 193, 7, .13); }
  24% { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255, 193, 7, .2); }
  47% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 193, 7, .1); }
}
.notify-pill.has-overdue-payment {
  color: #fff;
  background: #dc3545;
  border-color: #dc3545;
  animation: overdue-notification-heartbeat 1s ease-in-out 5;
  transform-origin: center;
}
.notify-pill.has-overdue-payment:hover,
.notify-pill.has-overdue-payment:focus {
  color: #fff;
  background: #bb2d3b;
  border-color: #b02a37;
}
@keyframes overdue-notification-heartbeat {
  0%, 35%, 70%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, .45); }
  12% { transform: scale(1.13); box-shadow: 0 0 0 7px rgba(220, 53, 69, .12); }
  24% { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(220, 53, 69, .2); }
  47% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(220, 53, 69, .1); }
}
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.entity-name-form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 280px;
}
.entity-name-form .form-control {
  min-width: 150px;
}
.admin-entity-search { width: 100%; }
.admin-entity-table { font-size: .88rem; }
.admin-entity-table th { background: #f1f3f5; color: #111; }
.admin-entity-table th:nth-child(1) { width: 62%; }
.admin-entity-table th:nth-child(2) { width: 90px; text-align: center; }
.admin-entity-table td:nth-child(2) { text-align: center; }
.admin-entity-table .row-actions { justify-content: flex-end; flex-wrap: nowrap; }
.entity-active-switch { display: inline-block; position: relative; width: 34px; height: 19px; cursor: pointer; }
.entity-active-switch input { position: absolute; opacity: 0; pointer-events: none; }
.entity-active-switch span { position: absolute; inset: 0; border-radius: 20px; background: #adb5bd; transition: .18s ease; }
.entity-active-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .18s ease; }
.entity-active-switch input:checked + span { background: #0d6efd; }
.entity-active-switch input:checked + span::after { transform: translateX(15px); }
.entity-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }

.entity-hero,
.public-hero {
  min-height: 260px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 34px clamp(18px, 5vw, 72px);
  background: linear-gradient(90deg, rgba(4, 22, 13, .82), rgba(4, 22, 13, .42)), var(--entity-bg) center/cover;
}
.entity-bg-page .entity-hero.panel-hero {
  min-height: 210px;
  background: linear-gradient(90deg, rgba(4, 22, 13, .72), rgba(4, 22, 13, .14));
}
.entity-hero h1,
.public-hero h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  margin: 0 0 8px;
}
.entity-hero p,
.public-hero p { max-width: 720px; margin: 0; font-size: 1.05rem; }
.public-hero-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.public-copy-link,
.public-back-panel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}
.public-copy-link.is-copied {
  color: #fff;
  border-color: #198754;
  background: #198754;
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: .78rem; opacity: .84; margin-bottom: 10px !important; }

.app-container,
.public-container {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 40px;
}
.panel-glass {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
  backdrop-filter: blur(6px);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  min-width: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.tabs-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  position: relative;
}
.tabs-navigation.has-overflow {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
}
.tabs-navigation-arrow {
  display: none;
  width: 32px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: #fff;
  border: 1px solid var(--green);
  border-radius: 6px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .12);
  cursor: pointer;
}
.tabs-navigation.has-overflow .tabs-navigation-arrow {
  display: inline-flex;
}
.tabs-navigation-arrow:disabled {
  opacity: .28;
  cursor: default;
}
.tabs a,
.tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--deep);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 700;
}
.tabs a:hover,
.tabs button:hover,
.tabs button.is-active {
  border-color: var(--green);
  color: var(--green);
  background: #eefbf2;
}

.tabs button {
  cursor: pointer;
}

.assistant-permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.assistant-permission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.assistant-permission-card:has(input:checked) {
  border-color: var(--green);
  background: #eefbf2;
}
.assistant-permission-copy strong,
.assistant-permission-copy small { display: block; }
.assistant-permission-copy small { margin-top: 4px; color: var(--muted); }
.assistant-permission-card .form-check-input { width: 2.5em; height: 1.3em; }

.panel-section {
  padding: 18px;
  margin-bottom: 18px;
  scroll-margin-top: 74px;
}
.tab-screen {
  display: none;
}
.tab-screen.is-active {
  display: block;
}
.panel-section h1,
.panel-section h2 { font-size: 1.35rem; margin: 0 0 14px; }
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-toolbar h2 {
  margin: 0;
}
.status-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.status-filter button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 7px 10px;
  font-weight: 800;
}
.status-filter button:hover,
.status-filter button.is-active {
  border-color: var(--green);
  color: var(--green);
  background: #eefbf2;
}

.metric-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.metric,
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}
.metric span,
.item-card span { color: var(--muted); font-size: .9rem; }
.metric strong { display: block; font-size: 1.7rem; }
.item-card strong { display: block; margin-bottom: 6px; }
.item-card p { color: var(--muted); min-height: 44px; }
.item-card-title,
.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.item-card-inactive {
  background: #eef1ef;
  opacity: .78;
}
.item-card > span {
  display: block;
}
.inactive-agenda-box {
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #7a4b00;
  padding: 10px;
  margin-top: 10px;
}
.inactive-agenda-box strong {
  margin-bottom: 4px;
}
.inactive-agenda-box p {
  min-height: 0;
  margin: 0 0 6px;
  color: #7a4b00;
  font-size: .85rem;
}
.inactive-agenda-box span {
  display: block;
  color: #7a4b00;
  font-size: .82rem;
  font-weight: 800;
}
.edit-panel {
  margin-top: 12px;
}
.edit-panel summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.edit-panel summary::-webkit-details-marker {
  display: none;
}
.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.item-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: end;
}
.court-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: start;
}
.field-block {
  display: grid;
  gap: 5px;
}
.field-block > span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}
.grid-wide { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.settings-form {
  display: grid;
  gap: 14px;
}
.settings-box {
  border: 2px solid #aebdb4;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  box-shadow: 0 2px 7px rgba(21, 67, 42, .08);
}
.settings-box h3 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  align-items: end;
}
.client-search {
  max-width: 520px;
  margin-bottom: 14px;
}
.client-card {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.client-card:hover,
.client-card:focus-visible {
  border-color: var(--green);
  background: #eefbf2;
  outline: none;
}
.client-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.client-rating {
  display: inline-flex;
  gap: 2px;
  font-weight: 900;
  letter-spacing: 1px;
}
.client-rating.rating-good { color: #15803d; }
.client-rating.rating-medium { color: #d29200; }
.client-rating.rating-bad { color: #dc2626; }
.client-card .client-rating {
  margin-top: 7px;
  font-size: 1.05rem;
}
.client-history-rating {
  margin: -10px 0 14px;
  font-size: 1.35rem;
}
.client-comment-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}
.client-comment-form .btn { justify-self: start; }
.client-profile-comment {
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.client-profile-comment.has-content {
  border-color: #dc3545;
  background: #fff0f1;
  box-shadow: inset 4px 0 0 #dc3545;
}
.client-profile-comment.has-content span,
.client-profile-comment.has-content p {
  color: #842029;
}
.client-profile-comment.has-content p {
  font-weight: 800;
}
.client-history-panel { width: min(620px, 100%); }
.client-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 36px;
}
.client-history-heading h2 { margin: 0; }
.client-history-contact { color: var(--muted); margin: -6px 0 16px; }
.client-history-list { display: grid; gap: 9px; max-height: 60vh; overflow-y: auto; }
.client-history-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 11px 12px;
}
.client-history-entry strong,
.client-history-entry span { display: block; }
.client-history-entry span { color: var(--muted); margin-top: 3px; }
.client-history-status { font-weight: 800; text-transform: capitalize; }
.client-history-status.estado-confirmada { color: #13713d; }
.client-history-status.estado-pendiente { color: #0d6efd; }
.client-history-status.estado-rechazada,
.client-history-status.estado-cancelada { color: #b42332; }
.settings-check {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  margin: 0;
}
.settings-save {
  justify-self: start;
  min-width: 210px;
}
.image-preview-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 12px;
}
.image-preview-frame {
  aspect-ratio: 16 / 9;
  background: #102018;
  border-radius: 8px;
  overflow: hidden;
}
.image-preview-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.image-preview-controls {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.schedule-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}
.schedule-box.is-hidden {
  display: none;
}
.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.schedule-global {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.schedule-global label,
.day-hour-row label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.day-chip {
  cursor: pointer;
}
.day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.day-chip span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}
.day-chip.is-selected span {
  background: #dcfce7;
  border-color: var(--green);
  color: var(--green);
}
.day-hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.day-hour-row {
  display: grid;
  grid-template-columns: 42px 1fr 1fr;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.day-hour-row.is-disabled {
  opacity: .45;
  background: #eef1ef;
}

.court-edit-modal[hidden] {
  display: none;
}
.court-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: block;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.court-edit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 12, .58);
}
.court-edit-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  min-height: min-content;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin: 0 auto 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}
.court-edit-panel h2 {
  margin: 0 42px 8px 0;
}
.court-edit-panel .booking-modal-close {
  z-index: 3;
  cursor: pointer;
}
.court-edit-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.reservation-action-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}
.reservation-edit {
  width: 100%;
}
.reservation-edit summary {
  width: fit-content;
}
.reservation-edit-form {
  display: grid;
  grid-template-columns: minmax(110px, .6fr) minmax(180px, 1fr) auto;
  gap: 6px;
  align-items: end;
  min-width: min(520px, 100%);
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}
.reservation-edit-field {
  display: grid;
  gap: 3px;
  margin: 0;
}
.reservation-edit-field span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}
.reservation-edit-form textarea {
  min-height: 38px;
}
.reservation-note {
  max-width: 220px;
  white-space: normal;
  color: var(--muted);
}
.reservation-search {
  max-width: 420px;
  margin-bottom: 12px;
}

.estado-pendiente .status-badge { background: #fff3cd; color: #7a5700; }
.estado-confirmada .status-badge { background: #d1e7dd; color: #0f5132; }
.estado-rechazada .status-badge { background: #f8d7da; color: #842029; }
.status-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: .78rem;
}

.calendar-list {
  display: grid;
  gap: 8px;
}
.calendar-list div {
  border-left: 4px solid var(--green);
  background: var(--soft);
  padding: 10px;
}

.admin-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.calendar-court-select {
  max-width: 320px;
}
.calendar-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-week-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
}
.admin-week-day {
  flex: 0 0 auto;
  border: 1px solid #aeb8b2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 800;
}
.admin-week-day:hover,
.admin-week-day.is-selected {
  border-color: var(--green);
  background: #dcfce7;
  color: var(--green);
}
.admin-calendar-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}
.admin-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.admin-legend-dot.is-free {
  background: #dcfce7;
  border-color: #16a34a;
}
.admin-legend-dot.is-pending {
  background: #dbeafe;
  border-color: #2563eb;
}
.admin-legend-dot.is-occupied {
  background: #fef3c7;
  border-color: #f59e0b;
}
.admin-legend-dot.is-past {
  background: #e5e7eb;
  border-color: #9ca3af;
}
.admin-slot-grid,
.admin-court-day {
  display: grid;
  gap: 12px;
}
.admin-court-day h4 {
  margin: 0;
  font-size: 1.15rem;
}
.admin-slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}
.admin-slot {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.admin-slot strong,
.admin-slot span {
  display: block;
}
.admin-slot strong {
  font-size: .98rem;
  line-height: 1.1;
}
.admin-slot span {
  margin-top: 2px;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.15;
}
.admin-slot-status {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .68rem;
  line-height: 1;
  text-transform: uppercase;
}
.admin-slot-client {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-slot .admin-slot-rating {
  margin-top: 4px;
  font-size: .76rem;
  text-decoration: none;
}
.admin-slot.is-free {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  cursor: pointer;
}
.admin-slot.is-free:hover,
.admin-slot.is-free.is-selected {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  transform: translateY(-1px);
}
.admin-slot.is-unavailable {
  background: #eef8f0;
  border-color: #9fd8ad;
  color: #53715b;
  cursor: not-allowed;
  opacity: .78;
}
.admin-slot.is-unavailable strong,
.admin-slot.is-unavailable span {
  text-decoration: line-through;
}
.admin-slot.is-past {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #6b7280;
  cursor: not-allowed;
  opacity: .9;
}
.admin-slot.is-occupied {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #7a4b00;
  cursor: pointer;
  opacity: 1;
}
.admin-slot.is-occupied.estado-pendiente {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e3a8a;
}
.admin-slot.is-occupied.estado-pendiente .admin-slot-status {
  background: #2563eb;
  color: #fff;
}
.admin-slot.is-occupied.estado-confirmada .admin-slot-status {
  background: #f59e0b;
  color: #422006;
}
.admin-slot.is-occupied:hover {
  background: #fde68a;
  border-color: #d97706;
  transform: translateY(-1px);
}
.admin-slot.is-occupied.estado-pendiente:hover {
  background: #bfdbfe;
  border-color: #1d4ed8;
}
.reservation-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 34px;
}
.reservation-detail-heading h2 {
  margin: 0;
}
.reservation-detail-status-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.reservation-detail-status-actions form {
  margin: 0;
}
.reservation-detail-status-actions .btn {
  white-space: nowrap;
}
.reservation-detail-status-actions .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.whatsapp-choice-modal[hidden] {
  display: none;
}
.whatsapp-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 16px;
}
.whatsapp-choice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 24, 12, .48);
}
.whatsapp-choice-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}
.whatsapp-choice-panel h2 {
  margin: 0 36px 18px 0;
}
.whatsapp-choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.whatsapp-choice-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.admin-month-modal[hidden] {
  display: none;
}
.admin-recurring-list-modal[hidden] {
  display: none;
}
.admin-recurring-modal[hidden] {
  display: none;
}
.admin-recurring-modal,
.admin-recurring-list-modal,
.admin-month-modal {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: grid;
  place-items: center;
  padding: 16px;
}
.admin-recurring-panel,
.admin-recurring-list-panel,
.admin-month-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(94dvh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}
.admin-recurring-panel {
  width: min(720px, 100%);
}
.admin-recurring-list-panel {
  width: min(920px, 100%);
}
.admin-recurring-list-panel h2,
.admin-recurring-panel h2 {
  margin: 0 42px 14px 0;
}
.recurring-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.recurring-form .grid-wide,
.recurring-alert,
.recurring-confirm,
.recurring-submit {
  grid-column: 1 / -1;
}
.recurring-alert {
  border: 1px solid #ef4444;
  border-radius: 8px;
  background: #fee2e2;
  color: #7f1d1d;
  padding: 10px 12px;
  font-weight: 900;
}
.recurring-alert.is-success {
  border-color: #16a34a;
  background: #dcfce7;
  color: #14532d;
}
.recurring-confirm {
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #7a4b00;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.recurring-confirm[hidden] {
  display: none;
}
.recurring-confirm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.recurring-confirm-actions .btn {
  min-height: 44px;
  padding: 9px 16px;
  font-size: .92rem;
  font-weight: 900;
}
.recurring-confirm-actions .btn-success {
  min-width: 190px;
  box-shadow: 0 10px 22px rgba(22, 163, 74, .24);
}
.recurring-list {
  display: grid;
  gap: 12px;
}
.recurring-search {
  margin-bottom: 12px;
}
.recurring-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
}
.recurring-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.recurring-card-head strong,
.recurring-card-head span {
  display: block;
}
.recurring-card-head span {
  color: var(--muted);
}
.recurring-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.recurring-card-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.recurring-card-grid span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}
.recurring-card-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.recurring-dates {
  margin-bottom: 10px;
}
.recurring-dates summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}
.recurring-dates div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.recurring-dates span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
  font-size: .82rem;
  font-weight: 800;
}
.admin-month-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  margin: 0 38px 14px 0;
  text-align: center;
}
.admin-month-header h2 {
  margin: 0;
  font-size: 1.45rem;
  text-transform: lowercase;
}
.admin-month-header .booking-month-nav {
  position: static;
  transform: none;
  border: 1px solid var(--line);
  background: #fff;
}
.admin-month-labels,
.admin-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.admin-month-labels {
  margin-bottom: 8px;
}
.admin-month-labels span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}
.admin-month-cell {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 7px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-month-cell:hover,
.admin-month-cell:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, .14);
  outline: none;
}
.admin-month-cell.has-reservations {
  border-color: #f5d275;
  background: #fffbeb;
}
.admin-month-cell.is-past:not(.has-reservations) {
  background: #f1f3f2;
  border-color: #c8cfcb;
}
.admin-month-day-cell {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 5px;
  text-align: left;
}
.admin-month-day-cell:hover,
.admin-month-day-cell.is-selected {
  background: #dcfce7;
  color: var(--green);
}
.admin-month-day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--green);
}
.admin-month-day-cell.is-muted {
  color: #8f9892;
}
.admin-month-day-cell.is-past {
  color: #737b76;
}
.admin-month-day-cell.is-past:not(.is-selected):hover {
  background: #e5e7eb;
  color: #4b5563;
}
.admin-month-day-number {
  font-size: 1rem;
  font-weight: 900;
}
.admin-month-day-count {
  font-size: .72rem;
  font-weight: 900;
  color: inherit;
  white-space: nowrap;
}
.admin-month-reservations {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}
.admin-month-reservation {
  width: 100%;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fef3c7;
  color: #7a4b00;
  padding: 4px 5px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  text-align: left;
  font-size: .74rem;
  line-height: 1.15;
}
.admin-month-reservation.estado-confirmada {
  border-color: #16a34a;
  background: #dcfce7;
  color: #14532d;
}
.admin-month-reservation span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-month-more {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
  padding-left: 5px;
}

.entity-delete-modal[hidden],
.admin-reservation-modal[hidden] {
  display: none;
}
.app-confirm-modal[hidden] {
  display: none;
}
.app-confirm-modal,
.entity-delete-modal,
.admin-reservation-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.app-confirm-backdrop,
.entity-delete-backdrop,
.admin-reservation-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 20, 12, .58);
}
.app-confirm-panel,
.entity-delete-panel,
.admin-reservation-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(92dvh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}
.app-confirm-panel {
  width: min(420px, 100%);
}
.entity-delete-panel {
  width: min(520px, 100%);
}
.app-confirm-panel h2 {
  margin: 0 42px 10px 0;
}
.app-confirm-panel p {
  overflow-wrap: anywhere;
}
.app-confirm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.entity-delete-panel h2,
.admin-reservation-panel h2 {
  margin: 0 42px 14px 0;
}
.admin-manual-panel {
  width: min(520px, 100%);
}
.admin-manual-panel .admin-manual-form {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.app-confirm-panel .booking-modal-close,
.entity-delete-panel .booking-modal-close,
.admin-recurring-panel .booking-modal-close,
.admin-recurring-list-panel .booking-modal-close,
.admin-month-panel .booking-modal-close,
.admin-reservation-panel .booking-modal-close {
  z-index: 3;
  cursor: pointer;
}
.entity-delete-expected {
  border: 1px solid #f1b6bd;
  border-radius: 8px;
  background: #fff5f6;
  color: #842029;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.reservation-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.reservation-detail-grid div,
.reservation-detail-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
}
.reservation-detail-grid span,
.reservation-detail-note span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  margin-bottom: 3px;
}
.reservation-detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.reservation-detail-note {
  margin-bottom: 12px;
}
.reservation-detail-note p {
  margin: 0;
  overflow-wrap: anywhere;
}
.reservation-modal-edit {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
  margin-bottom: 12px;
}
.reservation-modal-edit select.is-placeholder-selected {
  font-weight: 900;
  color: var(--ink);
}

.notification-item {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 38px 12px 12px;
  margin-bottom: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.notification-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #a61e2d;
  cursor: pointer;
}
.notification-delete:hover,
.notification-delete:focus-visible {
  color: #fff;
  background: #dc3545;
  outline: none;
}
.notification-item:hover {
  border-color: var(--green);
  background: #f2fbf5;
}
.notification-item.account-notification {
  font-weight: 800;
}
.notification-item.is-due-today {
  border-color: #0d6efd;
  background: #e7f1ff;
  box-shadow: 0 8px 20px rgba(13, 110, 253, .14);
  color: #06357a;
}
.notification-item.is-due-today:hover {
  border-color: #084298;
  background: #dbeafe;
}
.notification-item.is-overdue {
  border: 2px solid #dc3545;
  background: #fff0f1;
  color: #842029;
  box-shadow: 0 8px 22px rgba(220, 53, 69, .2);
}
.notification-item.is-overdue:hover {
  border-color: #a71d2a;
  background: #ffe1e4;
}
.notification-item.is-overdue p {
  color: #842029;
}
.account-alert-due-today {
  border-color: #0d6efd;
  box-shadow: 0 8px 20px rgba(13, 110, 253, .12);
}
.account-alert-overdue {
  border-color: #dc3545;
  box-shadow: 0 8px 20px rgba(220, 53, 69, .16);
}
.notification-item.read { opacity: .62; }
.notification-item p { margin: 4px 0 0; color: var(--muted); }
.notification-item.is-due-today p { color: #084298; }
@keyframes notification-reservation-focus {
  0%, 100% { background: inherit; box-shadow: none; }
  15%, 70% { background: #fff3a8; box-shadow: inset 5px 0 0 #f0ad00, 0 0 0 3px rgba(240, 173, 0, .18); }
}
tr.notification-reservation-highlight > td {
  animation: notification-reservation-focus 1s ease-in-out 5;
}

.public-body {
  background: #eef3f0;
}
.public-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.public-agendas-button {
  border: 0;
  color: #2c1d00;
  font-weight: 900;
  min-height: 52px;
  padding-inline: 24px;
  box-shadow: 0 14px 26px rgba(177, 113, 0, .28);
}
.compact-hero {
  min-height: 210px;
}
.lookup-panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 18px 42px rgba(8, 27, 17, .12);
}
.lookup-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}
.lookup-form .form-label {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}
.visible-section {
  display: block;
}
.agenda-list {
  display: grid;
  gap: 12px;
}
.agenda-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.agenda-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.agenda-card-head strong,
.agenda-card-head span {
  display: block;
}
.agenda-card-head > div > span {
  color: var(--muted);
}
.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 18px;
  align-items: start;
}
.booking-layout.public-single-column {
  grid-template-columns: minmax(0, 1fr);
}
.public-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.public-list-header h2 {
  margin: 0;
}
.public-list-header span {
  color: var(--muted);
  font-weight: 700;
}
.public-courts-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #9db0a4 transparent;
}
.public-court-card {
  aspect-ratio: 1;
  min-height: 0;
}
.public-court-button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 2px solid #15803d;
  background: #fbfffc;
  box-shadow: 0 8px 18px rgba(21, 128, 61, .12);
}
.public-court-button:hover,
.public-court-button:focus {
  border-color: #0f6a31;
  background: #effbf3;
  box-shadow: 0 12px 28px rgba(21, 128, 61, .22);
  outline: none;
  transform: translateY(-1px);
}
.public-court-button small {
  display: inline-flex;
  margin-top: auto;
  color: var(--green);
  font-weight: 900;
}
.public-court-price {
  color: var(--ink);
  font-weight: 900;
}
.public-court-card p {
  min-height: auto;
  margin: 8px 0 18px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.booking-form,
.success-panel { padding: 18px; }
.success-panel {
  text-align: center;
  margin-bottom: 18px;
}
.success-panel > i {
  color: var(--green);
  font-size: 2.5rem;
}
.success-panel-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.success-payment-notice {
  width: min(560px, 100%);
  margin: 18px auto 0;
  text-align: left;
}
.booking-modal[hidden] {
  display: none;
}
.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 18px;
}
.booking-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 20, 12, .58);
}
.booking-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(92dvh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}
.booking-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.booking-modal-header {
  padding-right: 42px;
  margin-bottom: 14px;
}
.booking-modal-header h2 {
  margin: 0 0 6px;
}
.booking-modal-header p:last-child {
  color: var(--muted);
  margin: 0;
}
.booking-calendar {
  display: grid;
  grid-template-columns: minmax(290px, 330px) 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.booking-flow-view {
  animation: booking-view-enter .2s ease-out;
}
.booking-date-view {
  width: min(360px, 100%);
  margin: 0 auto;
}
.booking-time-view {
  width: min(720px, 100%);
  margin: 0 auto;
}
.booking-time-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.booking-time-heading strong {
  text-align: right;
  text-transform: capitalize;
}
@keyframes booking-view-enter {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.duration-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.duration-picker span {
  color: var(--muted);
  font-weight: 900;
}
.duration-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 900;
}
.duration-option:hover,
.duration-option.is-selected {
  border-color: var(--green);
  background: #dcfce7;
  color: var(--green);
}
.booking-date-list,
.booking-slot-list {
  display: grid;
  gap: 8px;
  align-content: start;
}
.booking-date-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.booking-date,
.booking-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  font-weight: 900;
}
.booking-date:hover,
.booking-date.is-selected,
.booking-slot:hover,
.booking-slot.is-selected {
  border-color: var(--green);
  background: #dcfce7;
  color: var(--green);
}
.booking-month-calendar {
  background: #fff;
  padding: 4px 2px 8px;
}
.booking-month-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  min-height: 38px;
  padding: 0 42px;
}
.booking-month-header strong {
  display: block;
  width: 100%;
  text-align: center;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: lowercase;
  white-space: nowrap;
}
.booking-month-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7b827d;
  font-weight: 900;
  line-height: 1;
}
.booking-month-nav:first-child {
  left: 0;
}
.booking-month-nav:last-child {
  right: 0;
}
.booking-month-nav:hover:not(:disabled) {
  background: #eef3f0;
}
.booking-month-nav:disabled {
  opacity: .38;
}
.booking-month-labels,
.booking-month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}
.booking-month-labels {
  margin-bottom: 10px;
}
.booking-month-labels span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
}
.booking-month-day {
  aspect-ratio: 1;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #252b28;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: .9rem;
  font-weight: 500;
}
.booking-month-day:hover:not(:disabled),
.booking-month-day.is-selected {
  background: var(--green);
  color: #fff;
}
.booking-month-day.is-muted,
.booking-month-day:disabled {
  color: #9aa19c;
}
.booking-month-day:disabled {
  cursor: not-allowed;
  opacity: .7;
}
.booking-month-day:disabled:hover {
  background: transparent;
  color: #9aa19c;
}
.booking-month-day:not(:disabled) {
  background: #effaf3;
  color: #123d25;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #9acdac;
}
.booking-month-day:not(:disabled):hover,
.booking-month-day.is-selected {
  background: var(--green);
  color: #fff;
  box-shadow: none;
}
.reschedule-month-calendar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.reschedule-month-calendar .booking-month-header {
  margin-bottom: 8px;
}
.reschedule-month-calendar .booking-month-labels,
.reschedule-month-calendar .booking-month-days {
  gap: 3px;
}
.reschedule-month-calendar .booking-month-day {
  min-height: 30px;
  font-size: .78rem;
}
.booking-slot-list {
  grid-template-columns: repeat(auto-fill, minmax(58px, 58px));
  align-items: start;
}
.booking-slot {
  width: 58px;
  min-height: 50px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  font-size: .84rem;
}
.selected-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 900;
}
.selected-slot-price {
  color: #0f6b37;
  font-weight: 900;
  margin: -4px 0 12px;
}
.public-payment-notice {
  border: 1px solid #86b99a;
  border-radius: 10px;
  background: #f0faf4;
  padding: 14px;
  margin: 0 0 16px;
}
.public-payment-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #145c33;
}
.public-payment-heading > i { font-size: 1.35rem; }
.public-payment-heading strong,
.public-payment-heading span { display: block; }
.public-payment-heading span { margin-top: 2px; font-size: .9rem; }
.public-payment-details {
  margin: 12px 0;
  white-space: pre-line;
  color: var(--ink);
}
.public-payment-alias {
  border: 1px dashed #6ca982;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  margin-bottom: 9px;
}
.public-payment-alias span,
.public-payment-alias strong { display: block; }
.public-payment-alias span { color: var(--muted); font-size: .8rem; }
.public-payment-alias strong { overflow-wrap: anywhere; }
.modal-booking-form {
  box-shadow: none;
  border: 1px solid var(--line);
  width: min(620px, 100%);
  margin: 0 auto;
}
.booking-data-summary {
  margin-bottom: 14px;
}
.booking-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.booking-step-actions .btn {
  min-width: 145px;
}
body.modal-open {
  overflow: hidden;
}

.pwa-install-prompt[hidden] { display: none; }
.pwa-install-prompt {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3000;
  width: min(620px, calc(100% - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 44px 14px 14px;
  border: 1px solid #78a88a;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(5, 25, 15, .3);
}
.pwa-install-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
  font-size: 1.25rem;
}
.pwa-install-copy strong { display: block; }
.pwa-install-copy p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.pwa-install-close {
  position: absolute;
  top: 7px;
  right: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 760px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .topbar { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .app-container,
  .public-container { width: 100%; padding-left: 8px; padding-right: 8px; }
  .panel-glass { margin: 0; border-radius: 0; }
  .panel-section { padding: 12px; }
  .tabs { gap: 6px; padding-bottom: 10px; }
  .tabs a,
  .tabs button { flex: 0 0 auto; white-space: nowrap; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-grid,
  .settings-grid,
  .assistant-permissions-grid { grid-template-columns: 1fr; }
  .section-heading-row { align-items: flex-start; flex-wrap: wrap; }
  .settings-save { width: 100%; min-width: 0; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .users-table-responsive { overflow: visible; }
  .users-table,
  .users-table tbody { display: block; width: 100%; }
  .users-table thead { display: none; }
  .users-table tbody { display: grid; gap: 12px; }
  .users-table .user-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid #cbd5d1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 45, 30, .08);
  }
  .users-table .user-row td {
    display: block;
    min-width: 0;
    padding: 5px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .users-table .user-row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #5e7089;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .users-table .user-identity,
  .users-table .user-actions { grid-column: 1 / -1; }
  .users-table .user-identity strong { font-size: 1rem; }
  .users-table .user-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding-top: 9px;
    border-top: 1px solid #e2e7e4;
  }
  .users-table .user-actions::before { grid-column: 1 / -1; }
  .users-table .user-actions > button,
  .users-table .user-actions > form,
  .users-table .user-actions > form button,
  .users-table .user-actions > form select { width: 100%; }
  .users-table .user-actions > form { margin: 0 !important; }
  .users-table .user-actions .inline-form {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }
  .reservation-table-responsive {
    overflow: visible;
  }
  .reservation-table,
  .reservation-table tbody {
    display: block;
    width: 100%;
  }
  .reservation-table thead {
    display: none;
  }
  .reservation-table tbody {
    display: grid;
    gap: 10px;
  }
  .reservation-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5d1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 45, 30, .08);
  }
  .reservation-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: .82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .reservation-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: #64746c;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
  }
  .reservation-table .status-badge {
    display: inline-flex;
    max-width: 100%;
    padding: 4px 8px;
    font-size: .72rem;
  }
  .reservation-table .reservation-actions-cell {
    grid-column: 1 / -1;
    padding-top: 7px;
    border-top: 1px solid #e2e8e5;
  }
  .reservation-table .inline-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    width: 100%;
    gap: 6px;
  }
  .reservation-table .reservation-action-form {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .reservation-table .reservation-action-form .form-control,
  .reservation-table .btn,
  .reservation-table .reservation-edit summary {
    font-size: .75rem;
  }
  .reservation-table .reservation-edit {
    grid-column: 1 / -1;
  }
  .reservation-table .reservation-edit summary {
    width: 100%;
    text-align: center;
  }
  .offcanvas { width: min(100vw, 420px) !important; }
  .pwa-install-prompt {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px 38px 12px 12px;
  }
  .pwa-install-prompt > .btn { grid-column: 1 / -1; width: 100%; }
  .entity-hero,
  .public-hero { min-height: 210px; }
  .booking-layout { grid-template-columns: 1fr; }
  .public-courts-scroll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    padding-right: 0;
  }
  .booking-calendar { grid-template-columns: 1fr; }
  .booking-time-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .booking-time-heading strong { text-align: left; }
  .booking-month-days,
  .booking-month-labels {
    gap: 4px;
  }
  .booking-month-day { min-height: 34px; }
  .lookup-form { grid-template-columns: 1fr; }
  .reservation-action-form { grid-template-columns: 1fr; }
  .reservation-edit-form {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .auth-links { flex-direction: column; }
  .day-picker { grid-template-columns: repeat(4, 1fr); }
  .day-hour-row { grid-template-columns: 1fr; }
  .court-edit-modal {
    padding: 8px;
  }
  .court-edit-panel {
    width: 100%;
    padding: 14px;
  }
  .court-edit-form {
    grid-template-columns: 1fr;
  }
  .admin-calendar-layout { grid-template-columns: 1fr; }
  .calendar-court-select { max-width: 100%; }
  .calendar-toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .calendar-toolbar-actions .btn {
    flex: 0 0 44px;
  }
  .calendar-toolbar-actions .calendar-court-select {
    flex: 1 1 180px;
  }
  .admin-slot-grid,
  .admin-court-day {
    gap: 8px;
  }
  .admin-court-day h4 {
    font-size: 1rem;
  }
  .admin-slot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .admin-slot {
    min-height: 44px;
    padding: 5px 6px;
    border-radius: 7px;
  }
  .admin-slot strong {
    font-size: .84rem;
  }
  .admin-slot span {
    margin-top: 1px;
    font-size: .69rem;
    line-height: 1.08;
  }
  .admin-slot-status {
    padding: 2px 4px;
    font-size: .58rem !important;
  }
  .admin-slot-client {
    display: -webkit-box !important;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .admin-slot .admin-slot-rating {
    margin-top: 2px;
    font-size: .62rem;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .admin-recurring-modal,
  .admin-recurring-list-modal,
  .admin-month-modal {
    padding: 8px;
    place-items: stretch;
  }
  .admin-recurring-panel,
  .admin-recurring-list-panel,
  .admin-month-panel {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }
  .recurring-form {
    grid-template-columns: 1fr;
  }
  .recurring-card-grid {
    grid-template-columns: 1fr;
  }
  .admin-month-header {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    margin-right: 34px;
    gap: 6px;
  }
  .admin-month-header h2 {
    font-size: 1.08rem;
  }
  .admin-month-labels,
  .admin-month-grid {
    gap: 4px;
  }
  .admin-month-cell {
    min-height: 82px;
    padding: 4px;
  }
  .admin-month-day-cell {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 3px 2px;
  }
  .admin-month-day-number {
    font-size: .88rem;
  }
  .admin-month-day-count {
    font-size: .58rem;
    white-space: normal;
    text-align: center;
  }
  .admin-month-reservation {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 3px;
    font-size: .62rem;
  }
  .admin-month-reservation span {
    display: none;
  }
  .admin-month-more {
    font-size: .62rem;
    padding-left: 2px;
  }
  .reservation-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  .admin-slot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.app-refresh-button {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 2px solid #92400e;
  border-radius: 999px;
  background: #facc15;
  color: #422006;
  font-weight: 800;
  box-shadow: 0 5px 18px rgba(66, 32, 6, 0.28);
}

.entity-hero.panel-hero {
  position: relative;
}

.app-refresh-button.is-panel-location {
  position: fixed;
  top: 50%;
  right: auto;
  left: 18px;
  transform: translateY(-50%);
}

@media (min-width: 761px) {
  .app-refresh-button.is-panel-location.has-update {
    background: #facc15;
    box-shadow: 0 0 0 8px rgba(250, 204, 21, .24), 0 8px 24px rgba(66, 32, 6, .34);
  }
}

.app-refresh-button.is-panel-location:hover,
.app-refresh-button.is-panel-location:focus-visible {
  transform: translateY(calc(-50% - 1px));
}

.app-refresh-button:hover,
.app-refresh-button:focus-visible {
  background: #fde047;
  transform: translateY(-1px);
}

.app-refresh-button.has-update {
  animation: refresh-button-pulse 1.4s ease-in-out infinite;
  border-color: #b91c1c;
  background: #fb923c;
  color: #431407;
}

.app-refresh-button.is-refreshing i {
  animation: refresh-button-spin 0.7s linear infinite;
}

@keyframes refresh-button-spin {
  to { transform: rotate(360deg); }
}

@keyframes refresh-button-pulse {
  50% { box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.28), 0 5px 18px rgba(66, 32, 6, 0.28); }
}

@media (max-width: 640px) {
  .app-refresh-button span { display: none; }
  .app-refresh-button { width: 44px; justify-content: center; padding: 0.5rem; }
  .app-refresh-button.is-panel-location {
    width: auto;
    padding: 0.5rem 0.75rem;
  }
  .app-refresh-button.is-panel-location span { display: inline; }
}

.pull-refresh-indicator {
  --pull-distance: 0px;
  position: fixed;
  top: max(6px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid #ca8a04;
  border-radius: 999px;
  background: #facc15;
  color: #422006;
  font-size: .75rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-52px + var(--pull-distance)));
  transition: opacity .12s ease;
  box-shadow: 0 5px 16px rgba(66, 32, 6, .24);
}

.pull-refresh-indicator.is-visible { opacity: 1; }
.pull-refresh-indicator.is-ready i { transform: rotate(180deg); }
.pull-refresh-indicator i { transition: transform .15s ease; }

.app-update-notice {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2400;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  padding: 10px 14px;
  border: 2px solid #b91c1c;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
  text-align: left;
  box-shadow: 0 12px 34px rgba(67, 20, 7, .34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -24px);
  transition: opacity .2s ease, transform .2s ease;
}

.app-update-notice.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.app-update-notice > i {
  flex: 0 0 auto;
  font-size: 1.45rem;
  animation: refresh-button-spin 1.2s linear infinite;
}

.app-update-notice span,
.app-update-notice strong,
.app-update-notice small {
  display: block;
}

.app-update-notice small {
  margin-top: 2px;
  color: #9a3412;
  font-size: .76rem;
}
