:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --text: #172033;
  --muted: #647084;
  --line: #dde3ee;
  --panel: #ffffff;
  --accent: #1e7d63;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text);
  font-weight: 700;
}

nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.nav-form {
  margin: 0;
}

.student-picker {
  align-items: end;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 42px;
  padding: 8px;
}

td {
  overflow-wrap: anywhere;
}

.link-button {
  background: transparent;
  color: var(--accent);
  padding: 0;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px;
}

.summary-grid,
.two-column {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}

.two-column > * {
  min-width: 0;
}

.two-column {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 320px;
}

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

.section {
  margin-top: 22px;
}

.label,
.muted {
  color: var(--muted);
}

.panel strong {
  display: block;
  font-size: 34px;
  margin-top: 8px;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

.button,
button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  padding: 10px 14px;
}

button.danger {
  background: var(--danger);
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.positive {
  color: #14764f;
  font-weight: 700;
}

.negative {
  color: var(--danger);
  font-weight: 700;
}

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

.checkin-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.checkin-image,
.table-thumb {
  align-items: center;
  background: #e9f2ef;
  color: var(--accent);
  display: flex;
  font-weight: 700;
  justify-content: center;
  overflow: hidden;
}

.checkin-image {
  aspect-ratio: 1 / 1;
}

.checkin-image img,
.table-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.checkin-meta {
  align-items: center;
  display: flex;
  font-size: 14px;
  justify-content: space-between;
  padding: 10px 12px;
}

.table-thumb {
  border-radius: 6px;
  height: 64px;
  width: 64px;
}

.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.status.pending {
  background: #fff7e6;
  color: #9a5b00;
}

.status.approved {
  background: #e8f6ef;
  color: #14764f;
}

.status.rejected {
  background: #fff1f0;
  color: var(--danger);
}

.upload-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.upload-card h2 {
  font-size: 15px;
  margin: 10px 0 4px;
  overflow-wrap: anywhere;
}

.upload-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.thumb {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #e9f2ef;
  border-radius: 6px;
  color: var(--accent);
  display: flex;
  font-weight: 700;
  justify-content: center;
}

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

.actions {
  display: grid;
  gap: 10px;
  min-width: 320px;
}

.review-form {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 72px minmax(120px, 1fr) 88px 72px;
}

.review-form button,
.review-form input {
  min-height: 38px;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 110px;
}

.form-grid textarea,
.form-grid .check {
  grid-column: 1 / -1;
}

.pet-admin-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pet-preview-box {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #e9f2ef;
  border-radius: 8px;
  color: var(--accent);
  display: flex;
  font-weight: 700;
  justify-content: center;
  overflow: hidden;
  width: 128px;
  max-width: 100%;
}

.pet-preview-box img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 10px;
  width: 100%;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  min-width: 0;
}

@media (max-width: 1100px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

.check {
  align-items: center;
  display: flex;
  gap: 8px;
}

.check input {
  width: auto;
}

.empty {
  color: var(--muted);
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-panel h1 {
  margin-bottom: 10px;
}

.error {
  background: #fff1f0;
  border: 1px solid #ffd5d1;
  border-radius: 6px;
  color: var(--danger);
  margin: 16px 0;
  padding: 10px 12px;
}

@media (max-width: 760px) {
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .page {
    padding: 18px;
  }

  .summary-grid,
  .two-column,
  .checkin-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .pet-admin-grid,
  .review-form {
    grid-template-columns: 1fr;
  }

  .actions {
    min-width: 0;
  }
}
