*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee7;
  --brand: #1f7a5b;
  --brand-dark: #155f46;
  --danger: #b42318;
  --warning: #b54708;
}

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

button, input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
button.ghost { color: var(--ink); background: #e9eef3; }
button.danger { background: var(--danger); }

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.narrow {
  width: min(100%, 480px);
  margin: 48px auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wide {
  grid-column: 1 / -1;
}

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

.userbox {
  flex-wrap: wrap;
}

.section-title h2 {
  margin-bottom: 2px;
}

.section-title strong,
.section-title span {
  color: var(--brand);
  font-size: 1.35rem;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 0.95rem;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c8d1dc;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

.weekdays,
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekdays {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.day {
  display: grid;
  align-content: space-between;
  min-height: 82px;
  border: 1px solid var(--line);
  padding: 9px;
  color: var(--ink);
  background: #fbfcfd;
  text-align: left;
}

.day strong {
  color: var(--brand);
  font-size: 1rem;
}

.day.selected {
  outline: 3px solid rgba(31, 122, 91, 0.24);
  border-color: var(--brand);
  background: #eef8f3;
}

.day.locked {
  background: #f2f4f7;
}

.day.blank {
  min-height: 82px;
  border: 0;
  background: transparent;
}

.submit-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.message {
  border-radius: 6px;
  padding: 10px 12px;
  color: #184e36;
  background: #e7f5ee;
}

.message.error {
  color: #7a271a;
  background: #ffebe7;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.reminders {
  display: grid;
  gap: 10px;
}

.reminder {
  display: grid;
  gap: 4px;
  border: 1px solid #fedf89;
  border-radius: 6px;
  padding: 12px;
  background: #fffaeb;
}

.reminder span {
  color: var(--warning);
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .layout,
  .admin-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .day,
  .day.blank {
    min-height: 62px;
    padding: 7px;
  }

  .day strong {
    font-size: 0.88rem;
  }
}
