:root {
  --terracotta: #BA5626;
  --terracotta-dark: #873F1D;
  --khaki: #A89572;
  --khaki-dark: #74592D;
  --gold: #D0A45A;
  --cream: #F6F2EC;
  --cream-dark: #DCD3C0;
  --text: #4A3B28;
}

body {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--cream);
  margin: 0 auto;
  max-width: 900px;
  padding: 0 1rem 3rem;
}

h1, h2, h3 {
  font-family: 'Noto Serif', Georgia, serif;
  color: var(--khaki-dark);
  font-weight: 700;
}

a {
  color: var(--terracotta);
}
a:hover {
  color: var(--terracotta-dark);
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 3px solid var(--gold);
  margin-bottom: 1.5rem;
}
.brand-logo-link {
  display: inline-flex;
  align-items: center;
}
.brand-logo {
  height: 40px;
  width: auto;
}
.brand-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
  color: var(--khaki-dark);
  letter-spacing: 0.02em;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  background: #fff;
}
th, td {
  border: 1px solid var(--cream-dark);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
th {
  background: var(--cream-dark);
  color: var(--khaki-dark);
}

.error { color: #b00020; }

form { margin: 0 0 0.75rem; }
form p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0;
}
form p label {
  min-width: 160px;
  flex-shrink: 0;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select {
  border: 1px solid var(--cream-dark);
  border-radius: 3px;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 1rem;
}

button, input[type="submit"] {
  background: var(--terracotta);
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 0.55rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover {
  background: var(--terracotta-dark);
}
button.danger {
  background: #b00020;
}
button.danger:hover {
  background: #7f0017;
}

.course-dates {
  margin: -0.5rem 0 1rem;
  color: var(--khaki-dark);
  font-weight: 600;
}

/* Mobile friendliness */
td { overflow-wrap: anywhere; }
button, input[type="submit"] { min-height: 44px; }
input[type="checkbox"] { align-self: flex-start; }

@media (max-width: 640px) {
  body { padding: 0 0.75rem 2rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

  .brand-logo { height: 32px; }
  .brand-logo-link { flex-shrink: 0; }
  .brand-name {
    position: static;
    transform: none;
    flex: 1;
    text-align: center;
    font-size: 1.15rem;
  }

  table, tbody, tr, td { display: block; width: 100%; box-sizing: border-box; }
  table { background: none; margin: 0.75rem 0; }
  thead { display: none; }
  tr {
    background: #fff;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    margin: 0 0 0.75rem;
    padding: 0.25rem 0.75rem;
  }
  td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    border-bottom: 1px solid var(--cream-dark);
    padding: 0.5rem 0;
    text-align: right;
  }
  td:last-child { border-bottom: 0; }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--khaki-dark);
    text-align: left;
    flex-shrink: 0;
  }
  td[colspan] { display: block; text-align: left; }
  td[colspan]::before { content: none; }
  td.actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }
  td.actions::before { content: none; }
  td.actions a { padding: 0.6rem 0; }
  td.actions form { flex: 1 1 100%; margin: 0; }
  td.actions form button { width: 100%; }

  form p { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  form p label { min-width: 0; }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], select {
    width: 100%;
    box-sizing: border-box;
  }
  form > button { width: 100%; }
}

.board-footer { margin-top: 2rem; font-size: 0.9rem; color: var(--khaki-dark); }
