:root {
  color-scheme: light;
  --ink: #27212a;
  --muted: #716775;
  --line: #eadde5;
  --paper: #fffafc;
  --panel: #ffffff;
  --pink: #d82f7f;
  --pink-soft: #ffe2ef;
  --mint: #2c9a75;
  --mint-soft: #daf6e9;
  --amber: #a96d16;
  --amber-soft: #fff0cc;
  --lavender: #eee8ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff7fb;
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(rgba(255, 247, 251, 0.82), rgba(255, 247, 251, 0.92)),
    url("/public/assets/collector-shelf.png") center / cover;
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 26px;
  box-shadow: 0 20px 60px rgba(48, 35, 49, 0.16);
}

.login-card h1 {
  margin-top: 16px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.45;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card input,
.login-card button {
  width: 100%;
}

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

#app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: #302331;
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #f7d9e8;
  color: #7b1648;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #d8c7d4;
  margin-top: 2px;
}

.rail-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f7edf4;
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
}

.rail-item.active,
.rail-item:hover {
  background: #4b334b;
}

.rail-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 16px;
  color: #e6d8e2;
  font-size: 13px;
}

.logout-button {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
}

code {
  display: inline-block;
  max-width: 100%;
  margin-top: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 7px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.shell {
  padding: 24px;
  min-width: 0;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.1;
}

.actions,
.filters {
  display: flex;
  align-items: end;
  gap: 10px;
}

.search span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

input {
  width: min(34vw, 390px);
}

textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.primary-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  padding: 0 15px;
  font-weight: 800;
}

.secondary-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 700;
}

.hero-band {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.hero-band img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.hero-band p {
  margin-bottom: 10px;
  color: var(--muted);
  max-width: 720px;
}

.mini-command {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.mini-command strong {
  background: var(--pink-soft);
  color: #84174f;
  border-radius: 6px;
  padding: 5px 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

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

.metric strong {
  font-size: 28px;
}

.metric.pink {
  background: var(--pink-soft);
}

.metric.mint {
  background: var(--mint-soft);
}

.metric.amber {
  background: var(--amber-soft);
}

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

.table-panel,
.detail-card,
.review-card,
.lower-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-panel {
  min-width: 0;
}

.filters {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
}

.lead-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff8e8;
  padding: 12px;
  color: var(--ink);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #f1e8ee;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

td a {
  color: #9a1b5c;
  font-weight: 800;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.lead-photo {
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.photo-missing {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

th {
  position: sticky;
  top: 0;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tr:hover,
tr.selected {
  background: #fff1f7;
}

tr.owned {
  background: #f0fff8;
}

tr.review {
  background: #fff8e8;
}

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

.detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.detail-card,
.review-card,
.lower-grid > div {
  padding: 16px;
}

.detail-photo {
  display: block;
  width: 100%;
  max-height: 280px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  background: var(--pink-soft);
  color: #8a174d;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.pill.mint {
  background: var(--mint-soft);
  color: #17694e;
}

.pill.amber {
  background: var(--amber-soft);
  color: #754706;
}

.detail h2 {
  margin: 12px 0;
  font-size: 22px;
  line-height: 1.15;
}

dl {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #f2e9ee;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.progress-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid #f2e9ee;
  padding-top: 14px;
}

.progress-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-form input,
.progress-form select {
  width: 100%;
}

.save-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-card button {
  width: 100%;
  border: 0;
  border-top: 1px solid #f2e9ee;
  background: transparent;
  cursor: pointer;
  padding: 10px 0;
  text-align: left;
}

.review-card span {
  display: block;
  color: var(--amber);
  font-size: 12px;
  margin-top: 3px;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.year-bars {
  display: grid;
  gap: 7px;
}

.year-bars button {
  display: grid;
  grid-template-columns: 50px 1fr 92px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}

.year-bars i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) var(--w), #f2e8ef var(--w));
}

.year-bars i.empty-year {
  background: repeating-linear-gradient(90deg, #efd6e2 0 8px, #fff 8px 14px);
}

.year-bars b {
  color: var(--muted);
  font-size: 12px;
}

.artifact-list {
  display: grid;
  gap: 8px;
}

.artifact-list article {
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.artifact-list article.active {
  border-left-color: var(--pink);
}

.artifact-list strong,
.artifact-list span {
  display: block;
  overflow-wrap: anywhere;
}

.artifact-list span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

@media (max-width: 980px) {
  #app,
  .workbench,
  .lower-grid,
  .hero-band {
    grid-template-columns: 1fr;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .brand,
  .rail-note {
    grid-column: 1 / -1;
    margin: 0;
  }

  .toolbar,
  .actions,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select {
    width: 100%;
  }

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

  .table-wrap {
    max-height: 470px;
  }
}
