:root {
  --bg: #f5f4f0;
  --panel: #ffffff;
  --panel-soft: #faf9f6;
  --text: #1a1a1a;
  --muted: #9a958a;
  --line: #e8e4db;
  --line-strong: #c8c3b8;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
}

body::before {
  display: none;
}

input,
select,
button {
  font: inherit;
}

.clean-shell.admin-shell {
  min-height: 100vh;
  padding: 0 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clean-header.admin-header {
  width: 100%;
  max-width: 960px;
  padding: 1.4rem 0 0;
  display: flex;
  align-items: center;
}

.clean-brand {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  text-transform: lowercase;
}

.clean-brand:hover {
  color: #666;
}

.admin-stage {
  width: 100%;
  max-width: 960px;
  min-height: 0;
  display: grid;
  gap: 0.8rem;
  padding: 2.2rem 0 1rem;
}

.admin-intro {
  display: grid;
  gap: 0.45rem;
}

.admin-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-intro h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.admin-lede {
  margin: 0;
  max-width: 760px;
  color: #726d63;
  line-height: 1.7;
  font-size: 0.92rem;
}

.clean-card,
.clean-raw-details {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

.clean-card {
  padding: 1rem;
}

.admin-section-head {
  display: grid;
  gap: 0.32rem;
  margin-bottom: 0.85rem;
}

.admin-section-head h2,
.detail-head h2 {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

.admin-section-head p,
.detail-head p {
  margin: 0;
  color: #8a857b;
  line-height: 1.55;
  font-size: 0.78rem;
}

.float-field {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.float-field:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.07);
}

.float-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 1.65rem 0.95rem 0.65rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.float-field label {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #aaa;
  pointer-events: none;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease, color 0.15s ease, letter-spacing 0.15s ease;
}

.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  top: 0.6rem;
  transform: none;
  font-size: 0.66rem;
  color: #999;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

button {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0.58rem 0.88rem;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:hover {
  background: #f0ece4;
  border-color: #bfb8aa;
}

button.secondary {
  background: transparent;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.filters {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 0.7fr)) auto;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 0.3rem;
}

.filters label span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.filters input,
.filters select {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
  padding: 0.6rem 0.72rem;
}

.filters input:focus,
.filters select:focus {
  border-color: var(--text);
}

.admin-results-area {
  width: 100%;
  max-width: 960px;
  display: grid;
  gap: 0.8rem;
  padding-bottom: 2rem;
}

.table-head,
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.admin-summary,
#detail-id {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.55;
}

.compact-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.table-wrap {
  margin-top: 0.8rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.63rem;
  font-weight: 500;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8f6f1;
}

tbody tr.active {
  background: #f0ece4;
}

.admin-detail-card {
  overflow: hidden;
}

.detail-head {
  padding: 0.95rem 1rem 0.75rem;
}

#detail-json {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  color: #5b564d;
  min-height: 320px;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 0.78rem;
}

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

  .filters button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .clean-shell.admin-shell {
    padding-inline: 0.95rem;
  }

  .admin-stage {
    padding-top: 1.7rem;
  }

  .table-head,
  .detail-head {
    flex-direction: column;
  }

  .compact-actions {
    width: 100%;
  }

  .compact-actions button {
    flex: 1;
  }
}
