:root {
  --ink: #17211f;
  --muted: #66736f;
  --line: #d9ded8;
  --paper: #f7f5ee;
  --panel: #ffffff;
  --sage: #596f62;
  --blue: #315d7c;
  --clay: #9a654d;
  --gold: #c5a35f;
  --danger: #8d3f39;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.admin-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  gap: 24px;
  align-items: end;
  padding: 34px clamp(18px, 5vw, 64px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--clay);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.admin-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
  margin: 0 0 6px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  border: 1px solid var(--sage);
  border-radius: 6px;
  background: var(--sage);
  color: #fff;
  cursor: pointer;
  font-weight: 760;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  background: var(--blue);
  border-color: var(--blue);
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

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

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

main {
  padding: 22px clamp(16px, 4vw, 56px) 48px;
}

.status-band {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-band span {
  display: block;
  font-weight: 800;
}

.status-band p {
  color: var(--muted);
  margin: 4px 0 0;
}

.status-band.error span {
  color: var(--danger);
}

.queue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.queue-tabs button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.queue-tabs button.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

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

.queue-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 520px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 1rem;
  margin: 0;
}

.panel-head span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
}

.submission-list {
  display: grid;
  gap: 0;
}

.submission-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 74px;
  padding: 14px 16px;
  background: #fff;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.submission-item:hover,
.submission-item.active {
  background: #f0f5f2;
}

.submission-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-item small {
  color: var(--muted);
}

.file-count {
  align-self: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
}

.detail-panel {
  padding: 18px;
}

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

.detail-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.detail-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 0;
}

.detail-header p {
  color: var(--muted);
  margin: 8px 0 0;
}

.status-pill {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 10px;
  text-transform: capitalize;
}

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

.detail-grid div,
.message-block,
.review-block,
.file-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  margin: 0 0 5px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.message-block {
  margin-bottom: 18px;
}

.message-block h3,
.review-block h3,
.files-section h3 {
  font-size: 0.96rem;
  margin: 0 0 10px;
}

.message-block p {
  line-height: 1.58;
  margin: 0;
  white-space: pre-wrap;
}

.files-section {
  margin-bottom: 18px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.file-tile {
  display: grid;
  gap: 8px;
}

.file-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper);
}

.file-tile a {
  color: var(--blue);
  font-weight: 780;
  text-decoration-thickness: 2px;
}

.file-tile small {
  color: var(--muted);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.decision-note {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 10px;
}

@media (max-width: 900px) {
  .admin-header,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-auth,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
