:root {
  --ink: #292823;
  --muted: #6e6a60;
  --sand: #f3eee2;
  --paper: #fffdf7;
  --sage: #76957d;
  --sage-dark: #385b43;
  --apricot: #ee996b;
  --line: #ded8ca;
  --danger: #9b3636;
  --shadow: 0 14px 40px rgb(55 48 38 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

input,
select,
textarea {
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: white;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
  outline: 3px solid rgb(238 153 107 / 40%);
  outline-offset: 2px;
}

label {
  display: block;
  margin: 1rem 0 .4rem;
  font-weight: 700;
}

h1,
h2 {
  letter-spacing: -.025em;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 16rem 1fr;
}

.sidebar {
  background: #2f4736;
  color: white;
  padding: 1.35rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 .45rem 2rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .7rem;
  background: var(--apricot);
  color: #2b2924;
}

.sidebar nav {
  display: grid;
  gap: .25rem;
}

.sidebar nav a,
.nav-pending {
  padding: .7rem .8rem;
  border-radius: .55rem;
  text-decoration: none;
}

.sidebar nav a:hover {
  background: rgb(255 255 255 / 10%);
}

.nav-pending {
  color: rgb(255 255 255 / 55%);
  cursor: not-allowed;
}

.content-shell {
  min-width: 0;
}

.topbar {
  min-height: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 2rem;
  border-bottom: 1px solid var(--line);
  background: white;
}

.main-content {
  padding: 2rem;
  max-width: 96rem;
  margin: auto;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1,
.empty-state h1 {
  margin: .2rem 0 .5rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 800;
  color: var(--sage-dark);
}

.muted,
.security-note {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card,
.panel,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 1.2rem;
  display: grid;
  gap: .35rem;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card small a {
  color: inherit;
}

.metric-card strong {
  font-size: 1.55rem;
  color: var(--sage-dark);
}

.panel {
  padding: 1.4rem;
}

.json-block {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1rem;
  border-radius: .75rem;
  background: var(--sand);
}

.feedback-screenshot {
  display: block;
  max-width: 100%;
  border-radius: .9rem;
  border: 1px solid var(--line);
}

.form-panel {
  max-width: 38rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: .65rem 1rem;
  border: 0;
  border-radius: .65rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  width: 100%;
  margin-top: 1.2rem;
  background: var(--apricot);
  color: #28251f;
}

.button-secondary {
  background: var(--sage);
  color: white;
}

.button-quiet {
  background: var(--sand);
  color: var(--ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 500;
}

.check-row input {
  width: auto;
}

.validation {
  display: block;
  color: var(--danger);
  margin-top: .3rem;
}

.validation:empty {
  display: none;
}

.notice {
  border-radius: .7rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}

.notice-warning {
  background: #fff1ce;
}

.notice-success {
  background: #e5f2e8;
  color: var(--sage-dark);
}

.notice-error {
  background: #f8dddd;
  color: var(--danger);
}

.split-header,
.filter-bar,
.button-row,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-bar {
  align-items: end;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--sand);
  border-radius: .85rem;
}

.filter-bar label {
  flex: 1;
  margin: 0;
}

.filter-bar label span {
  display: block;
  margin-bottom: .4rem;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

th,
td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--sand);
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: .2rem;
}

.pagination {
  padding: 1rem;
}

.pagination a {
  margin-left: 1rem;
}

.status {
  display: inline-flex;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: var(--sand);
  font-size: .78rem;
  font-weight: 800;
}

.status-public,
.status-approved,
.status-readyforreview,
.status-healthy {
  background: #dcecdf;
  color: var(--sage-dark);
}

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

.status-processing,
.status-queued {
  background: #fff1ce;
}

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

.form-wide {
  max-width: 58rem;
}

.facts {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: .6rem 1rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 650;
}

.action-stack {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: .4rem;
}

.button-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.button-row form {
  margin: 0;
}

.button-danger {
  background: #a84a45;
  color: white;
}

.button-inline {
  width: auto;
  margin-top: 0;
}

.section-gap {
  margin-top: 1rem;
}

.transcript {
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.6;
  max-height: 32rem;
  overflow: auto;
}

.segment-list {
  max-height: 24rem;
  overflow: auto;
}

.segment-list p {
  border-top: 1px solid var(--line);
  padding-top: .6rem;
}

.break-all {
  overflow-wrap: anywhere;
}

details {
  border-top: 1px solid var(--line);
  padding: .7rem 0;
}

summary {
  cursor: pointer;
  font-weight: 750;
}

.danger-zone {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid #d79b96;
  border-radius: .8rem;
  background: #fff6f5;
}

.chart-list {
  display: grid;
  gap: .6rem;
}

.chart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .75rem;
  border-radius: .7rem;
  background: var(--sand);
}

.chart-row strong {
  color: var(--sage-dark);
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  padding-top: .6rem;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(145deg, var(--paper), var(--sand));
}

.auth-shell {
  width: min(100%, 29rem);
}

.auth-card {
  padding: clamp(1.4rem, 5vw, 2.4rem);
}

.auth-card h1 {
  margin: .3rem 0;
}

.security-note {
  text-align: center;
  font-size: .84rem;
  margin: 1rem 0 0;
}

.empty-state {
  max-width: 40rem;
  margin: 8vh auto;
  text-align: center;
}

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

  .sidebar {
    position: static;
  }

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

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

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

@media (max-width: 560px) {

  .main-content,
  .topbar {
    padding: 1rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-bar,
  .split-header {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}