* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e5e5ea;
  --accent: #ff7a1a;
  --accent-dark: #e86500;
  --danger: #ff3b30;
  --sidebar: #111111;
  --sidebar-card: #222222;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* Login */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 380px;
  max-width: 100%;
  background: var(--card);
  padding: 34px;
  border-radius: 26px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 22px;
}

/* Inputs / Buttons */

input,
select {
  width: 100%;
  padding: 14px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  background: white;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}

button {
  border: 0;
  background: var(--accent);
  color: white;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

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

button.secondary {
  background: #eeeeee;
  color: #111111;
}

button.secondary:hover {
  background: #dddddd;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #d92d24;
}

/* Layout */

.layout {
  display: flex;
  min-height: 100vh;
}

aside {
  width: 250px;
  background: var(--sidebar);
  color: white;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

aside h2 {
  margin: 0 0 24px;
  font-size: 24px;
}

aside button {
  display: block;
  width: 100%;
  margin: 10px 0;
  text-align: left;
  background: var(--sidebar-card);
}

aside button:hover {
  background: #333333;
}

main {
  flex: 1;
  padding: 30px;
  min-width: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

header h1 {
  margin: 0;
  font-size: 32px;
}

header p {
  margin: 4px 0 0;
  color: var(--muted);
}

#gymSelect {
  width: 280px;
}

/* Messages */

#message {
  margin-bottom: 16px;
  font-weight: 700;
}

.error {
  color: #c00;
}

/* Dashboard */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat {
  background: var(--card);
  padding: 24px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
}

.stat span {
  color: var(--muted);
}

/* Toolbar / Forms */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  max-width: 280px;
}

.form-card {
  background: var(--card);
  padding: 22px;
  border-radius: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  max-width: 560px;
}

.form-card h3 {
  margin-top: 0;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Lists / Cards */

.list {
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.card p {
  margin: 2px 0;
  color: var(--muted);
}

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

/* Badges */

.badge {
  display: inline-block;
  padding: 5px 10px;
  margin-top: 6px;
  margin-right: 5px;
  border-radius: 999px;
  background: #eeeeee;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: #dcfce7;
  color: #166534;
}

.badge.red {
  background: #fee2e2;
  color: #991b1b;
}

.badge.orange {
  background: #ffedd5;
  color: #9a3412;
}

/* Réservations */

#bookingsPage h2 {
  margin-top: 26px;
  margin-bottom: 12px;
}

#bookingCourseSelect,
#bookingMemberSelect,
#waitlistMemberSelect {
  margin-bottom: 12px;
}

/* Responsive */

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  aside {
    width: 100%;
    height: auto;
    position: relative;
  }

  aside button {
    width: auto;
    display: inline-block;
    margin-right: 8px;
  }

  main {
    padding: 20px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  #gymSelect {
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
  }

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

  .toolbar input,
  .toolbar select {
    max-width: 100%;
  }

  button {
    width: 100%;
  }

  .actions button,
  aside button {
    width: auto;
  }
}