:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-strong: #ededeb;
  --ink: #121212;
  --muted: #626262;
  --line: #d8d8d3;
  --line-strong: #b6b6af;
  --brand: #111111;
  --brand-2: #4d4d4d;
  --accent: #f2c300;
  --accent-ink: #2c2500;
  --success: #16643f;
  --warning: #8a5b00;
  --danger: #b3261e;
  --info: #414141;
  --shadow: 0 16px 36px rgba(17, 17, 17, 0.13);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 280px;
  font-family:
    "Segoe UI", Aptos, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(242, 195, 0, 0.12), transparent 34%),
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 36px 36px, 36px 36px, auto;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #111111;
  color: #f8f8f8;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand img {
  width: 84px;
  height: 64px;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.brand-title {
  display: block;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: #d6d6d0;
  font-size: 12px;
}

.campus-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  margin-bottom: 14px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  color: #e8e8e3;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.campus-card-label {
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.role-card {
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.role-card label,
.field label {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.role-card select,
.role-card input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.auth-label {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.auth-form .button {
  width: 100%;
  margin-top: 4px;
}

.auth-divider {
  color: #d6d6d0;
  font-size: 12px;
  text-align: center;
}

.error-text {
  color: #ffb4ab;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: #d9e7f6;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(242, 195, 0, 0.18);
}

.nav-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(242, 195, 0, 0.22);
  color: #ffe27a;
  font-size: 12px;
  text-align: center;
}

.main {
  min-width: 0;
  padding: 28px;
}

.campus-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}

.campus-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #d7c15a;
  border-radius: 999px;
  color: var(--accent-ink);
  background: #fff5bc;
  font-size: 12px;
  font-weight: 800;
}

.campus-strip .source-warning {
  color: #6c4300;
  border-color: #f2d28f;
  background: #fff8e8;
}

.campus-strip .source-ready {
  color: #063d24;
  border-color: #96d4b2;
  background: #e8f7ee;
}

.campus-strip .source-pending {
  color: #373737;
  border-color: #cacaca;
  background: #f5f5f5;
}

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

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 800;
}

.topbar p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  color: #111111;
  border-color: var(--brand);
  background: var(--accent);
}

.button.danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.button.subtle {
  color: var(--brand);
  border-color: transparent;
  background: var(--surface-strong);
}

.button.sidebar-reset {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border-color: rgba(242, 195, 0, 0.38);
  color: #ffe27a;
  background: transparent;
  font-size: 12px;
}

.button:hover {
  filter: brightness(0.98);
}

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

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

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

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(18, 60, 105, 0.03);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 18px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric-value {
  display: block;
  color: var(--brand);
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: #50504c;
  background: #eeeeea;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #2f2f2f;
  background: #eeeeea;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.pending,
.status.submitted,
.status.under_review,
.status.claim_under_review {
  color: var(--warning);
  background: #fff5dd;
}

.status.approved,
.status.approved_for_release,
.status.sent,
.status.listed {
  color: var(--success);
  background: #e8f6ef;
}

.status.rejected,
.status.failed {
  color: var(--danger);
  background: #ffebe9;
}

.status.released {
  color: #4f3a91;
  background: #eeeafd;
}

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

.item-card {
  display: grid;
  grid-template-rows: 164px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.item-card img {
  width: 100%;
  height: 164px;
  object-fit: cover;
  background: var(--surface-strong);
}

.item-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.item-card h3 {
  margin: 0;
  font-size: 16px;
}

.meta-list {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.description {
  margin: 0;
  color: #3b4c61;
}

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

.record-list {
  display: grid;
  gap: 10px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.record-row p {
  margin: 4px 0 0;
}

.record-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.field.full {
  grid-column: 1 / -1;
}

.photo-preview {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.photo-preview:empty {
  display: none;
}

.photo-preview img {
  width: 112px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  object-fit: cover;
}

.record-photo {
  width: 100%;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  object-fit: cover;
}

.help-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #d7c15a;
  border-radius: var(--radius);
  color: var(--accent-ink);
  background: #fff8d8;
}

.notice.warning {
  border-color: #f2d28f;
  color: #6c4300;
  background: #fff8e8;
}

.notice.danger {
  border-color: #f2b8b3;
  color: #7a1c16;
  background: #fff0ef;
}

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

.timeline-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

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

.bar-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111111, #777777, var(--accent));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 30, 47, 0.45);
}

.modal {
  width: min(760px, 100%);
  max-height: min(760px, 92vh);
  overflow-y: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 20px;
}

.close-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfcfe;
  text-align: center;
}

.mobile-menu {
  display: none;
}

.noscript {
  max-width: 720px;
  margin: 80px auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 1120px) {
  .grid.four,
  .item-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

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

  .main {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .item-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .timeline-row {
    grid-template-columns: 1fr;
  }

  .record-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .toolbar {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .photo-preview {
    grid-template-columns: 1fr;
  }

  .photo-preview img {
    width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .panel,
  .button,
  .nav-button,
  .item-card {
    transition:
      border-color 160ms ease,
      background 160ms ease,
      color 160ms ease,
      transform 160ms ease;
  }

  .item-card:hover {
    transform: translateY(-2px);
  }
}
