:root {
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --primary: #2c7be5;
  --primary-dark: #1a68ce;
  --danger: #e74c3c;
  --text: #1f2933;
  --muted: #52606d;
  font-family: 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.container {
  width: min(1100px, 95vw);
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.container.admin {
  gap: 3rem;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(18, 38, 63, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.form,
.form-grid,
.form-inline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--muted);
}

.form-grid .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.form-grid .checkbox input[type="checkbox"] {
  width: auto;
}

.form-note {
  margin: -0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

input,
select,
textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: #e4e7eb;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
  font-weight: 600;
}

.btn:hover {
  background: #cbd2d9;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.full {
  width: 100%;
}

.topbar {
  background: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.brand {
  font-weight: 700;
  font-size: 1.4rem;
}

.welcome {
  margin-right: 1rem;
  color: var(--muted);
}

.alert {
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  animation: slide-in 0.3s ease;
}

.alert-success {
  background: #e6f6f1;
  color: #0f7a6c;
}

.alert-error {
  background: #fde8e8;
  color: #c81e1e;
}
.alert-info {
  background: #e3f2fd;
  color: #1e6fb6;
}

.alert.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e4ebf5;
  text-align: left;
  font-size: 0.95rem;
}

table tbody tr:hover {
  background: #f8f9fb;
}

.badge {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #e0e8f9;
  color: #1e3a8a;
  font-weight: 600;
}

.disabled {
  opacity: 0.5;
}

.reservation-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reservation-list li {
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reservation-list li strong {
  font-size: 1rem;
}

.reservation-resource {
  color: var(--muted);
  font-size: 0.9rem;
}

.club-block {
  border-top: 1px solid #e4ebf5;
  padding-top: 2rem;
  margin-top: 2rem;
}

.help {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tab-button {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #d9e2ef;
  background: #f8f9fb;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tab-button.active,
.tab-button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-panel {
  display: none;
  flex-direction: column;
  gap: 2rem;
}

.admin-panel.active {
  display: flex;
}

.panel-block {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-accordion {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  background: #f9fbff;
  overflow: hidden;
}

.admin-accordion summary {
  list-style: none;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.admin-accordion summary::-webkit-details-marker {
  display: none;
}

.admin-accordion[open] summary {
  background: #eef2ff;
}

.summary-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.accordion-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.club-submenu {
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  background: #fff;
}

.club-submenu summary {
  list-style: none;
  padding: 1rem 1.25rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.club-submenu summary::-webkit-details-marker {
  display: none;
}

.club-submenu[open] summary {
  background: #f1f5ff;
}

.submenu-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.class-card {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.08);
  overflow: hidden;
}

.class-card summary {
  cursor: pointer;
  list-style: none;
  padding: 1.25rem 1.5rem;
}

.class-card summary::-webkit-details-marker {
  display: none;
}

.class-card[open] summary {
  background: #eef2ff;
}

.class-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.class-name {
  font-weight: 600;
  font-size: 1rem;
}

.class-card-body {
  padding: 1.5rem;
  background: #f8fafc;
}

.class-user-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.slot-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(18, 38, 63, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-card.highlight-slot {
  outline: 3px solid var(--primary);
  box-shadow: 0 12px 36px rgba(44, 123, 229, 0.25);
}

.slot-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.slot-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.slot-reservations {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
}

.slot-reservations summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  margin-bottom: 0.75rem;
}

.slot-reservations summary::-webkit-details-marker {
  display: none;
}

.slot-admin-actions {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-admin-actions h5 {
  margin: 0;
  font-size: 1rem;
}

.reservation-admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reservation-admin-list li {
  margin: 0;
  padding: 0;
}

.reservation-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.08);
  overflow: hidden;
}

.reservation-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.25rem;
}

.reservation-item summary::-webkit-details-marker {
  display: none;
}

.reservation-item[open] summary {
  background: #eef2ff;
}

.reservation-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.reservation-summary strong {
  font-size: 1rem;
}

.reservation-summary-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.reservation-item-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.reservation-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.reservation-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--muted);
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-item {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(18, 38, 63, 0.08);
  overflow: hidden;
}

.user-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
}

.user-item summary::-webkit-details-marker {
  display: none;
}

.user-item[open] summary {
  background: #eef2ff;
}

.user-name {
  font-weight: 600;
  font-size: 1rem;
}

.user-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.user-actions {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.user-actions form {
  margin: 0;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.club-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.club-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(18, 38, 63, 0.12);
  display: flex;
  flex-direction: column;
}

.club-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.club-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.club-card-body p {
  color: var(--muted);
  font-size: 0.95rem;
}

.club-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.club-identity {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.club-identity img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.1);
}

.slot-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.slot-entry {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(18, 38, 63, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-entry.disabled {
  opacity: 0.6;
}

.slot-entry header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slot-time {
  color: var(--muted);
  font-weight: 600;
}

.slot-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resource-availability {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.resource-select {
  min-width: 220px;
}

.resource-quantity[disabled] {
  background: #f5f7fb;
  cursor: not-allowed;
}

.slot-update {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
}

@keyframes slide-in {
  from {
    transform: translateY(-5px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  table th,
  table td {
    padding: 0.5rem;
  }
}
