:root {
  color-scheme: light;
  --green: #0b3d2e;
  --green-2: #17644c;
  --gold: #d6a419;
  --ink: #17201d;
  --muted: #68736e;
  --paper: #f7f4ee;
  --line: #d8ddd4;
  --white: #ffffff;
  --danger: #a33932;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--white);
  background: var(--green);
  padding: 8px 12px;
  cursor: pointer;
}

button.secondary {
  color: var(--green);
  background: var(--white);
}

button.icon {
  width: 40px;
  padding: 0;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  padding: 8px 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  color: var(--white);
  background: var(--green);
  border-bottom: 4px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user {
  font-size: 12px;
  opacity: 0.9;
  overflow-wrap: anywhere;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef3ec;
  padding: 14px;
}

.main {
  padding: 16px;
}

.section {
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 15px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
}

.event-row {
  display: grid;
  gap: 3px;
  width: 100%;
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
  text-align: left;
  margin-bottom: 8px;
}

.event-row.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--gold);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  background: #d8f3dc;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.score-table,
.course-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.score-table th,
.score-table td,
.course-table th,
.course-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.score-table th,
.course-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.course-table input {
  min-height: 34px;
  padding: 5px 7px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  border-left: 4px solid var(--gold);
  background: #fff8dd;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.error {
  border-left-color: var(--danger);
  background: #fff1ef;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.checkbox-list input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

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