/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --navy:      #1a1a2e;
  --navy-80:   rgba(26,26,46,.82);
  --accent:    #6366f1;
  --accent-h:  #4f52e0;
  --bg:        #f8f9fc;
  --card:      #ffffff;
  --border:    #e5e7eb;
  --text:      #1f2937;
  --muted:     #6b7280;
  --error:     #dc2626;
  --error-bg:  #fef2f2;
  --success:   #16a34a;
  --success-bg:#dcfce7;
  --warning:   #d97706;
  --warning-bg:#fef3c7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
}

.container-wide {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.main-content { flex: 1; }

.mt-lg { margin-top: 28px; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
}
.site-logo:hover { text-decoration: none; }

.site-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,.15);
  padding: 3px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.cr-footer {
  background: var(--navy);
  color: rgba(255,255,255,.55);
  padding: 52px 0 0;
  font-size: 14px;
  line-height: 1.6;
}
.cr-footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px 44px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr;
  gap: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cr-footer-heading {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: #fff; margin: 0 0 18px;
}
.cr-footer-heading span { color: #a5b4fc; }
.cr-footer-col p { margin: 0; font-size: 13px; line-height: 1.75; color: rgba(255,255,255,.5); }
.cr-footer-nav { display: flex; flex-direction: column; gap: 9px; }
.cr-footer-nav a { color: rgba(255,255,255,.55); text-decoration: none; font-size: 13px; transition: color .15s; }
.cr-footer-nav a:hover { color: #fff; }
.cr-footer-social { display: flex; gap: 10px; margin-top: 4px; }
.cr-footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.cr-footer-social-link:hover { background: rgba(255,255,255,.16); color: #fff; }
.cr-footer-bottom {
  max-width: 1080px; margin: 0 auto;
  padding: 16px 24px;
  font-size: 12px; color: rgba(255,255,255,.3);
}

/* ── Screen wrapper ────────────────────────────────────────────────────────── */
.screen { padding: 40px 0 64px; }

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 60px;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

.muted-text { color: var(--muted); margin-top: 8px; }

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
}

.request-card { margin-top: 40px; }

.card-icon { font-size: 40px; line-height: 1; margin-bottom: 16px; text-align: center; }
.card-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.card-subtitle { color: var(--muted); text-align: center; margin-bottom: 28px; font-size: 14px; line-height: 1.6; }

/* ── Form fields ───────────────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.field-label { font-size: 13px; font-weight: 600; }
.req { color: var(--error); }

.field-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.field-input:focus { border-color: var(--accent); }
.field-input.error { border-color: var(--error); background: var(--error-bg); }
.field-error { font-size: 12px; color: var(--error); min-height: 16px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; margin-top: 4px; }

/* ── Status screens ────────────────────────────────────────────────────────── */
.status-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin-bottom: 20px;
}
.status-icon--success { background: var(--success-bg); color: var(--success); }
.status-icon--error   { background: var(--error-bg);   color: var(--error); }
.status-title   { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.status-subtitle { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 380px; }

/* ── List header + toolbar ─────────────────────────────────────────────────── */
.list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.list-title { font-size: 22px; font-weight: 700; }
.list-email { font-size: 13px; color: var(--muted); margin-top: 3px; }

.list-toolbar { display: flex; align-items: center; gap: 12px; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  width: 280px;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }

/* ── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.reg-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.col-right { text-align: right !important; }

.reg-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.reg-table tbody tr:last-child { border-bottom: none; }
.reg-table tbody tr:hover { background: #f3f4f6; }

.reg-table td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--text);
}

.td-event strong { display: block; font-weight: 600; font-size: 14px; }
.td-event span   { font-size: 12px; color: var(--muted); }

.td-right { text-align: right; font-weight: 600; }

/* ── Status badge ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--confirmed { background: var(--success-bg); color: var(--success); }
.badge--pending   { background: var(--warning-bg); color: var(--warning); }
.badge--cancelled { background: #f1f5f9;           color: #64748b; }

/* ── Action links/buttons in table ─────────────────────────────────────────── */
.td-actions { white-space: nowrap; }

.link-detail, .link-edit {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s, color .15s;
  display: inline-block;
  cursor: pointer;
}

.link-detail {
  color: var(--accent);
  text-decoration: none;
  border: 1.5px solid var(--border);
}
.link-detail:hover { border-color: var(--accent); background: #eef2ff; text-decoration: none; }

.link-edit {
  color: var(--muted);
  background: none;
  border: 1.5px solid var(--border);
  font-family: inherit;
  margin-left: 6px;
}
.link-edit:hover { border-color: var(--accent); color: var(--accent); background: #eef2ff; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--muted);
}
.empty-state p { margin-top: 10px; font-size: 14px; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn, .page-num {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
  padding: 0 8px;
  color: var(--text);
}

.page-btn:hover, .page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.page-num.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.page-numbers { display: flex; gap: 4px; }

.page-info {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  max-width: calc(100vw - 32px);
  text-align: center;
  pointer-events: none;
}

/* ── Club widget ───────────────────────────────────────────────────────────── */
.club-search-box { position: relative; }

.club-search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 36px;
}

.club-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0; right: 0;
  background: var(--card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(99,102,241,.14);
  list-style: none;
  padding: 5px; margin: 0;
  z-index: 300;
  max-height: 200px;
  overflow-y: auto;
}

.club-dropdown-item {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background .1s, color .1s;
  outline: none;
}
.club-dropdown-item:hover,
.club-dropdown-item:focus { background: #eef2ff; color: var(--accent); }

.club-dropdown-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.club-selected-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: #eef2ff;
  margin-top: 6px;
}

.club-selected-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 500;
  color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.club-selected-name::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  position: relative; top: -1px;
}

.club-clear-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 3px 6px;
  border-radius: 5px; line-height: 1;
  transition: background .12s, color .12s;
}
.club-clear-btn:hover { background: #fef2f2; color: var(--error); }

.club-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.club-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

/* ── Edit dialog ───────────────────────────────────────────────────────────── */
.edit-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  padding: 0;
  width: min(600px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: hidden;
}

.edit-dialog[open] {
  display: flex;
  flex-direction: column;
}

.edit-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.edit-dialog::backdrop {
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.edit-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.edit-dialog-title { font-size: 18px; font-weight: 700; }

.edit-dialog-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.edit-dialog-close:hover { background: var(--bg); color: var(--text); }

.edit-dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.edit-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.edit-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

/* ── Kind badge ────────────────────────────────────────────────────────────── */
.kind-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.kind-badge--circuit {
  background: #ede9fe;
  color: #6d28d9;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 24px 20px; }
  .list-header { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
  .list-toolbar { width: 100%; }
  .search-wrap { width: 100%; }
  .edit-grid { grid-template-columns: 1fr; }
  .site-footer-inner { flex-direction: column; gap: 12px; }
  .cr-footer-inner { grid-template-columns: 1fr; gap: 32px; }
}
