:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef2f4;
  --text: #172026;
  --muted: #68747c;
  --line: #dce3e7;
  --primary: #116149;
  --primary-strong: #0d4d3a;
  --accent: #c63d2f;
  --warning: #a76207;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.button-link {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.74rem 1rem;
}

button:hover,
.button-link:hover {
  background: var(--primary-strong);
}

button.secondary,
.secondary {
  background: var(--surface-muted);
  color: var(--text);
}

button.danger,
.danger {
  background: #f7dedb;
  color: #8a241a;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0.72rem 0.8rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #102820;
  color: #eef8f4;
  padding: 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e7c66b;
  color: #102820;
  font-weight: 900;
}

.brand small {
  display: block;
  color: #a8bab2;
}

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

.nav-link {
  display: block;
  width: 100%;
  border-radius: 6px;
  background: transparent;
  color: #dbe8e3;
  padding: 0.75rem;
  text-align: left;
}

.nav-link.is-active,
.nav-link:hover {
  background: #ffffff1a;
}

.content {
  min-width: 0;
  padding: 1.5rem;
}

.topbar,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h1,
.section-title h2,
h3 {
  margin: 0;
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.panel,
.metric,
.login-panel,
.item-card,
.quick-link,
.status-message {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
}

.login-panel {
  max-width: 460px;
  margin: 10vh auto 0;
}

.login-panel h1 {
  margin: 0;
}

.login-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.error-text {
  color: #a21caf;
  font-weight: 700;
}

.status-message {
  margin-bottom: 1rem;
  background: #f0fdf4;
  color: #166534;
}

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

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

.metric strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 2rem;
}

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

.quick-link {
  display: grid;
  gap: 0.35rem;
}

.quick-link span {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 0.8rem;
}

.item-card {
  display: grid;
  gap: 0.8rem;
}

.item-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.item-card__meta,
.item-card__body {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.item-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.6rem;
}

.pill.warning {
  background: #fff7ed;
  color: var(--warning);
}

.pill.success {
  background: #dcfce7;
  color: #166534;
}

.pill.danger {
  background: #fee2e2;
  color: #991b1b;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

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

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

tbody tr:hover {
  background: #f7faf9;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

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

  .cards,
  .quick-grid {
    grid-template-columns: 1fr;
  }
}
