:root {
  color: #29221f;
  background: #f6efe8;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at 8% 0%, rgba(243, 190, 154, 0.36), transparent 28%),
    linear-gradient(155deg, #fff8f1 0%, #f8efe7 48%, #eaf3ef 100%);
}

.login-panel,
.dashboard {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 56px);
  align-content: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  display: block;
  width: min(220px, 44vw);
  height: auto;
  object-fit: contain;
}

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

.brand strong {
  font-size: 24px;
}

.brand small {
  margin-top: 5px;
  color: #75665e;
}

.login-form,
.stats-grid div,
.toolbar,
.table-panel,
dialog {
  border: 1px solid rgba(87, 68, 58, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.82);
}

.login-form {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: #67594f;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  min-height: 42px;
  border: 1px solid rgba(87, 68, 58, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #29221f;
}

button,
.secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #2f6f69;
  color: #fffaf3;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.secondary-button {
  display: inline-grid;
  place-items: center;
  background: rgba(47, 111, 105, 0.12);
  color: #2f6f69;
}

.error-text {
  min-height: 20px;
  margin: 0;
  color: #b45d3f;
  font-size: 13px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b45d3f;
  font-size: 13px;
  font-weight: 800;
}

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

.header-actions {
  display: flex;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats-grid div {
  min-height: 104px;
  padding: 18px;
}

.stats-grid strong {
  display: block;
  color: #2f6f69;
  font-size: 30px;
  line-height: 1.1;
}

.stats-grid span {
  display: block;
  margin-top: 10px;
  color: #75665e;
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.table-panel {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid rgba(87, 68, 58, 0.1);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #75665e;
  font-size: 13px;
  font-weight: 800;
}

td {
  color: #3f352f;
  font-size: 14px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(47, 111, 105, 0.06);
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(47, 111, 105, 0.11);
  color: #2f6f69;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 42px;
  color: #75665e;
  text-align: center;
}

dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  color: #29221f;
}

dialog::backdrop {
  background: rgba(38, 30, 26, 0.42);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(87, 68, 58, 0.12);
  padding: 18px 20px;
}

.dialog-header h2 {
  margin: 0;
}

#closeDialogButton {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  background: rgba(47, 111, 105, 0.12);
  color: #2f6f69;
  font-size: 24px;
}

.detail-content {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

.detail-summary p {
  margin: 0;
  color: #67594f;
  line-height: 1.55;
}

.answer-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.answer-list li strong,
.answer-list li span {
  display: block;
}

.answer-list li span {
  margin-top: 4px;
  color: #67594f;
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 18px;
  }

  .dashboard-header,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .toolbar,
  .detail-summary {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
