:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --paper: #fff;
  --ink: #080808;
  --muted: #74716b;
  --line: #dfd9cf;
  --green: #05c46b;
  --green-soft: #d9fbe9;
  --yellow: #ffd45a;
  --black: #101010;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(5,196,107,.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.admin-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--black);
  color: #fff;
}

.vault-logo {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-link,
.icon-button,
.logout-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.ghost-link,
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
}

.icon-button svg,
.logout-button svg {
  width: 18px;
  height: 18px;
}

.auth-card,
.admin-hero,
.workbench,
.launch-card,
.admin-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 18px 54px rgba(0,0,0,.06);
}

.auth-card {
  margin-top: 34px;
  padding: clamp(24px, 6vw, 42px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 9vw, 66px);
  line-height: .94;
  letter-spacing: -0.055em;
}

.auth-card p,
.admin-hero p {
  max-width: 560px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eee9df;
  font-size: .92em;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-form label,
.toolbar label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.auth-form input,
.toolbar select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  font-weight: 760;
}

.auth-form input:focus,
.toolbar select:focus {
  border-color: #a7a197;
  box-shadow: 0 0 0 4px rgba(5,196,107,.14);
}

.auth-form button,
.status-action {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--black);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 900;
}

.auth-message {
  min-height: 20px;
  margin-bottom: 0;
}

.admin-main {
  display: grid;
  gap: 16px;
}

.admin-hero {
  padding: clamp(22px, 6vw, 36px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.admin-chip {
  max-width: 220px;
  padding: 10px 13px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #064426;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.launch-card {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.launch-card strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.launch-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.launch-card.is-good {
  border-color: #aeeecb;
  background: #f1fff7;
}

.launch-card.is-alert {
  border-color: #ffe08a;
  background: #fff8df;
}

.workbench {
  padding: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tabs button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
}

.tabs button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: #064426;
}

.tabs svg {
  width: 18px;
  height: 18px;
}

.toolbar {
  margin: 0 0 12px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  padding: 16px;
  box-shadow: none;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.item-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eee9df;
  color: #514c45;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.status-pill.open { background: #fff1cc; color: #6b4300; }
.status-pill.reviewing,
.status-pill.waiting { background: #dcebff; color: #173f82; }
.status-pill.resolved { background: var(--green-soft); color: #064426; }
.status-pill.dismissed { background: #eee; color: #555; }

.item-body {
  margin: 12px 0;
  color: #333;
  line-height: 1.48;
  font-size: 14px;
  font-weight: 680;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moderation-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.status-action {
  min-height: 38px;
  padding: 0 12px;
  background: #111;
  font-size: 13px;
}

.status-action.danger {
  background: #fee2e2;
  color: #8a1616;
}

.status-action:disabled {
  background: #e8e4dc;
  color: #9a958d;
}

.item-inline-form {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.item-inline-form input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.audit-item .item-body {
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed #cdc6ba;
  border-radius: 18px;
  background: #fbfaf6;
  padding: 24px;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
}

.empty-state span {
  color: var(--muted);
  font-weight: 750;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 99;
  max-width: min(420px, calc(100vw - 28px));
  padding: 13px 16px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
}

@media (max-width: 640px) {
  .admin-shell { padding: 14px 14px 34px; }
  .ghost-link { display: none; }
  .logout-button span { display: none; }
  .admin-hero { display: grid; }
  .launch-grid { grid-template-columns: 1fr; }
}
