* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.header h1 span {
  color: #94a3b8;
  font-weight: 400;
  font-size: 12px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

/* ── Cards ── */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

.card-body {
  padding: 18px;
}

/* ── Forms ── */
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  border-color: #38bdf8;
}

.form-row {
  margin-bottom: 14px;
}

/* ── Partner: favourites + club directory search ── */
.partner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.partner-actions:empty {
  display: none;
}

.partner-warning {
  flex-basis: 100%;
  color: #fbbf24;
  line-height: 1.4;
}

.member-search {
  position: relative;
  margin-top: 10px;
}

/* In the flow (pushes the form down): the card clips anything floating
   outside it (overflow: hidden). */
.member-results {
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 8px;
}

.directory-line .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.member-result {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.member-result:hover,
.member-result.active {
  background: #1e293b;
}

.member-results .empty-state {
  padding: 14px;
}

.directory-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

select[multiple] {
  height: 120px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #38bdf8;
  color: #0f172a;
}

.btn-primary:hover {
  background: #7dd3fc;
}

.btn-success {
  background: #22c55e;
  color: #0f172a;
}

.btn-success:hover {
  background: #4ade80;
}

.btn-warning {
  background: #f59e0b;
  color: #0f172a;
}

.btn-warning:hover {
  background: #fbbf24;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #f87171;
}

.btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
}

.btn-ghost:hover {
  background: #334155;
  color: #e2e8f0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* ── Booking Table ── */
.booking-table {
  width: 100%;
  border-collapse: collapse;
}

.booking-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 1px solid #334155;
}

.booking-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}

.booking-table tr:hover td {
  background: #0f172a;
}

/* ── Status Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: #fbbf24;
  color: #0f172a;
}

.badge-success {
  background: #22c55e;
  color: #0f172a;
}

.badge-error {
  background: #ef4444;
  color: white;
}

/* Secondary text next to the booked court/hour (preferred court not obtained) */
.muted {
  color: #94a3b8;
  font-size: 0.85em;
}

/* Weather decision (indoor / outdoor) */
.badge-weather-ok {
  background: #38bdf8;
  color: #0f172a;
  text-transform: none;
}

.badge-weather-indoor {
  background: #6366f1;
  color: white;
  text-transform: none;
}

.badge-weather-na {
  background: #64748b;
  color: white;
  text-transform: none;
}

/* ── Logs ── */
.log-output {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  color: #94a3b8;
}

.log-output .log-time {
  color: #64748b;
}

.log-output .log-info {
  color: #38bdf8;
}

.log-output .log-success {
  color: #22c55e;
}

.log-output .log-error {
  color: #ef4444;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  z-index: 1000;
  animation: slide-up 0.3s ease-out;
}

.toast-success { background: #22c55e; color: #0f172a; }
.toast-error { background: #ef4444; }

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 32px;
  color: #64748b;
  font-size: 13px;
}

/* ── Screenshots ── */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.screenshot-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.screenshot-item img {
  width: 100%;
  border-radius: 4px;
}

.screenshot-item p {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
}

/* ── Login Page ── */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 24px;
}

.login-container .card {
  width: 100%;
  max-width: 380px;
}

.login-error {
  background: #ef4444;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
