:root {
  color-scheme: light;
  --bg: #f6efe4;
  --bg-accent: #efe3d4;
  --surface: #fff9f0;
  --ink: #2b2520;
  --muted: #6f6358;
  --accent: #1f6f78;
  --accent-strong: #155359;
  --warm: #d1923f;
  --alipay: #8bbbf0;
  --apple-pay: #d5d7db;
  --cash: #f2c54e;
  --crypto: #9dd6a7;
  --flik: #f18b2f;
  --google-pay: #a3c7ff;
  --m-pesa: #8fd6a6;
  --mercado-pago: #90c9f2;
  --n26: #7fd0c7;
  --other: #e2d6c7;
  --paypal: #8aaef5;
  --revolut: #5a8ff2;
  --wechat-pay: #91d98f;
  --wire: #c5cbd6;
  --no-show: #e4574b;
  --shadow: 0 22px 45px rgba(46, 34, 24, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6e6 0%, transparent 55%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(31, 111, 120, 0.12), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(209, 146, 63, 0.2), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.nav-links .nav-button {
  margin-top: 0;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 120, 0.3);
  background: var(--surface);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  background: var(--surface);
  box-shadow: 0 12px 25px rgba(31, 111, 120, 0.12);
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.month-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

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

button {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button:disabled {
  background: rgba(31, 111, 120, 0.35);
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background: #fff;
  border: 1px solid rgba(31, 111, 120, 0.3);
  color: var(--accent-strong);
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.control input,
.control select {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(43, 37, 32, 0.12);
  background: var(--surface);
  font-size: 0.95rem;
  color: var(--ink);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: float-in 0.6s ease both;
}

.summary-card strong {
  font-size: 1.4rem;
}

.month-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}

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

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2b2520;
}

.badge.alipay {
  background: var(--alipay);
}

.badge.apple_pay {
  background: var(--apple-pay);
}

.badge.cash {
  background: var(--cash);
}

.badge.crypto {
  background: var(--crypto);
}

.badge.flik {
  background: var(--flik);
  color: #2a1e0e;
}

.badge.google_pay {
  background: var(--google-pay);
}

.badge.m_pesa {
  background: var(--m-pesa);
}

.badge.mercado_pago {
  background: var(--mercado-pago);
}

.badge.n26 {
  background: var(--n26);
}

.badge.other {
  background: var(--other);
}

.badge.paypal {
  background: var(--paypal);
}

.badge.revolut {
  background: var(--revolut);
  color: #0f1d3a;
}

.badge.wechat_pay {
  background: var(--wechat-pay);
}

.badge.wire {
  background: var(--wire);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.attendance-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attendance-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.attendance-header h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.attendance-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.attendance-controls select {
  min-width: 160px;
}

.attendance-table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(43, 37, 32, 0.08);
  background: #fff;
}

.attendance-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.attendance-table th,
.attendance-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(43, 37, 32, 0.08);
  font-size: 0.82rem;
  text-align: center;
}

.attendance-table thead th {
  position: sticky;
  top: 0;
  background: rgba(31, 111, 120, 0.08);
  z-index: 1;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  background: #fff;
  font-weight: 600;
  z-index: 2;
}

.attendance-table thead th:first-child {
  background: rgba(31, 111, 120, 0.12);
  z-index: 3;
}

.attendance-table tbody tr:hover {
  background: rgba(241, 139, 47, 0.08);
}

.attendance-table input[type="checkbox"] {
  transform: scale(1.1);
}

.attendance-empty {
  text-align: center;
  color: var(--muted);
  padding: 16px;
}

.players-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.players-table thead {
  background: rgba(31, 111, 120, 0.08);
}

.players-table th,
.players-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(43, 37, 32, 0.08);
  font-size: 0.92rem;
}

.players-table tbody tr:hover {
  background: rgba(241, 139, 47, 0.08);
}

.players-table tbody tr.no-show {
  color: var(--muted);
  background: rgba(228, 87, 75, 0.06);
}

.players-table tbody tr.owes {
  background: rgba(228, 87, 75, 0.12);
}

.players-table tbody tr.owes:hover {
  background: rgba(228, 87, 75, 0.18);
}

.owe-note {
  display: block;
  font-size: 0.75rem;
  color: var(--no-show);
  margin-top: 4px;
  font-weight: 600;
}

.players-table input[type="text"] {
  width: 140px;
}

.players-table input[type="number"] {
  width: 110px;
}

.method-cell {
  border-radius: 12px;
  padding: 4px;
}

.method-cell select {
  width: 140px;
  border: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.method-cell[data-method="cash"] select {
  background: rgba(242, 197, 78, 0.5);
}

.method-cell[data-method="alipay"] select {
  background: rgba(139, 187, 240, 0.45);
}

.method-cell[data-method="apple_pay"] select {
  background: rgba(213, 215, 219, 0.45);
}

.method-cell[data-method="crypto"] select {
  background: rgba(157, 214, 167, 0.45);
}

.method-cell[data-method="flik"] select {
  background: rgba(241, 139, 47, 0.5);
}

.method-cell[data-method="google_pay"] select {
  background: rgba(163, 199, 255, 0.45);
}

.method-cell[data-method="m_pesa"] select {
  background: rgba(143, 214, 166, 0.45);
}

.method-cell[data-method="mercado_pago"] select {
  background: rgba(144, 201, 242, 0.45);
}

.method-cell[data-method="n26"] select {
  background: rgba(127, 208, 199, 0.45);
}

.method-cell[data-method="other"] select {
  background: rgba(226, 214, 199, 0.45);
}

.method-cell[data-method="paypal"] select {
  background: rgba(138, 174, 245, 0.45);
}

.method-cell[data-method="revolut"] select {
  background: rgba(90, 143, 242, 0.4);
}

.method-cell[data-method="wechat_pay"] select {
  background: rgba(145, 217, 143, 0.45);
}

.method-cell[data-method="wire"] select {
  background: rgba(197, 203, 214, 0.45);
}

.credit-small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.remove-btn {
  border: none;
  background: transparent;
  color: var(--no-show);
  font-weight: 600;
  cursor: pointer;
}

.player-add {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.admin-header a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.admin-header a:hover {
  text-decoration: underline;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

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

.session-group {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 111, 120, 0.06);
}

.session-group h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.session-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(241, 139, 47, 0.2);
  font-size: 0.82rem;
}

.session-chip button {
  border: none;
  background: transparent;
  color: var(--no-show);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
}

.checkbox-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

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

.admin-table th,
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(43, 37, 32, 0.08);
  text-align: left;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.calendar-month {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(31, 111, 120, 0.06);
}

.calendar-month h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays span {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.calendar-day {
  border: none;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
}

.calendar-day.is-empty {
  background: transparent;
  cursor: default;
  visibility: hidden;
}

.calendar-day:hover {
  transform: none;
  background: rgba(31, 111, 120, 0.12);
}

.calendar-day.is-existing {
  border: 1px solid rgba(31, 111, 120, 0.5);
}

.calendar-day.is-selected {
  background: var(--accent);
  color: #fff;
}

.calendar-day.is-existing.is-selected {
  background: var(--accent-strong);
}

.summary-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 10px;
}

.alert {
  border-radius: var(--radius);
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(228, 87, 75, 0.12), rgba(241, 139, 47, 0.08));
  border: 1px solid rgba(228, 87, 75, 0.3);
  box-shadow: var(--shadow);
}

.alert.hidden {
  display: none;
}

.alert-header {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.alert-subtitle {
  color: var(--muted);
  margin-bottom: 10px;
}

.alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(228, 87, 75, 0.18);
  font-weight: 600;
  font-size: 0.85rem;
}

.summary-heading h2 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  margin: 0 0 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-panels {
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.summary-panels .panel {
  min-width: 0;
}

.panel h3 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1.1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header h3 {
  margin: 0;
}

.summary-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.summary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.summary-table th,
.summary-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(43, 37, 32, 0.08);
}

.summary-table tbody tr:hover {
  background: rgba(31, 111, 120, 0.08);
}

.footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .month-controls {
    width: 100%;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 32px 18px 48px;
  }

  .summary-card {
    animation: none;
  }

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

  .summary-table {
    font-size: 0.85rem;
  }
}

.landing-page {
  max-width: 960px;
}

.landing-header {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-card {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

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

.landing-card input {
  width: 100%;
}

.note.error {
  color: #b42318;
}

.share-panel {
  background: var(--surface);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-header h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.share-links {
  display: grid;
  gap: 16px;
}

.share-item span {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.share-field {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-field input {
  flex: 1;
  background: #fff;
}

.ghost {
  border: 1px solid rgba(31, 111, 120, 0.3);
  background: transparent;
  color: var(--accent-strong);
}

.readonly-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(226, 214, 199, 0.5);
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 700px) {
  .landing-card {
    width: 100%;
  }
  .share-field {
    flex-direction: column;
    align-items: stretch;
  }
}
