* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f2937;
  color: #fff;
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.25rem;
  font-weight: bold;
  color: #f97316;
  text-decoration: none;
}

.brand:hover {
  text-decoration: underline;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
}

.topbar nav a:hover {
  color: #4ade80;
}

.user-info {
  color: #9ca3af;
  font-size: 0.85rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  margin-top: 0;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.flash.success {
  background: #dcfce7;
  color: #166534;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

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

main section + section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d1d5db;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.link-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s;
}

.link-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.login-box {
  max-width: 360px;
  margin: 3rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

form.stacked-form,
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 420px;
}

form.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

input,
select,
button {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

button {
  cursor: pointer;
  background: #16a34a;
  color: #fff;
  border: none;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
}

button:hover {
  background: #15803d;
}

button.danger,
.btn.danger {
  background: #dc2626;
}

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

.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.btn:hover {
  background: #1d4ed8;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  background: #f1f5f9;
}

.hint {
  color: #6b7280;
  font-style: italic;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: normal;
  margin-top: 0;
}

label input[type="checkbox"] {
  width: auto;
}

.duplicate-warning {
  background: #fef3c7;
  color: #92400e;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
}

.trainer-photo-box {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.trainer-photo-box img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.trainer-card {
  text-align: center;
}

.trainer-thumb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  display: block;
}

.trainer-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.85rem;
  font-style: italic;
}

.trainer-card h3 {
  margin: 0;
}

.calendar-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-scroll {
  overflow-x: auto;
}

.calendar-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}

.calendar-table th {
  background: #1f2937;
  color: #fff;
  padding: 0.5rem;
}

.calendar-table td {
  vertical-align: top;
  border: 1px solid #e5e7eb;
  height: 110px;
  padding: 0.25rem;
  width: 14.28%;
}

.calendar-table td.empty {
  background: #f8fafc;
}

.calendar-table td.today {
  background: #ecfdf5;
}

.day-num a {
  font-weight: bold;
  color: #1f2937;
  text-decoration: none;
}

.session-pill {
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 0.72rem;
  padding: 2px 4px;
  border-radius: 4px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
