:root {
  --bg: #eef3ea;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --text: #162018;
  --muted: #5a6a5f;
  --line: rgba(22, 32, 24, 0.12);
  --brand: #1e5b39;
  --brand-strong: #11472b;
  --accent: #d3e670;
  --danger: #a63b2c;
  --shadow: 0 18px 42px rgba(31, 61, 35, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.5 "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(211, 230, 112, 0.55), transparent 26%),
    linear-gradient(135deg, #f8faf2 0%, #edf4ea 55%, #e6efe7 100%);
}

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

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: rgba(15, 43, 26, 0.94);
  color: #f4f8f2;
}

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

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #173521;
  background: linear-gradient(135deg, #f2ffb3 0%, #c8dd62 100%);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.sidebar .brand-subtitle,
.sidebar-footer .muted {
  color: rgba(244, 248, 242, 0.72);
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(244, 248, 242, 0.88);
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.main {
  padding: 32px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1,
.panel-head h2 {
  margin: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-grid,
.grid-two {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid-two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.stat-card,
.panel,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 2rem;
  line-height: 1;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
}

.button-full {
  width: 100%;
}

.button-primary {
  color: #0f2216;
  background: linear-gradient(135deg, #dff07d 0%, #bfd34e 100%);
}

.button-secondary {
  color: var(--text);
  background: rgba(22, 32, 24, 0.06);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #c34f3e 0%, #8d291d 100%);
}

.stack {
  display: grid;
  gap: 14px;
}

.gap-sm {
  margin-top: 14px;
}

.inline-grid,
.inline-form,
.actions-row {
  display: grid;
  gap: 14px;
}

.inline-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inline-form {
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: end;
}

.actions-row {
  grid-auto-flow: column;
  justify-content: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(22, 32, 24, 0.12);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(22, 32, 24, 0.08);
  font-size: 0.84rem;
}

.badge-success {
  color: #13341f;
  background: rgba(191, 211, 78, 0.34);
}

.badge-danger {
  color: #fff;
  background: rgba(166, 59, 44, 0.88);
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
}

.flash-success {
  color: #15351f;
  background: rgba(191, 211, 78, 0.34);
}

.flash-error {
  color: #fff;
  background: rgba(166, 59, 44, 0.9);
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(440px, 100%);
  padding: 30px;
}

.auth-card h1 {
  margin: 0 0 10px;
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.meta-list dd {
  margin: 0;
  text-align: right;
}

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

  .sidebar {
    gap: 18px;
  }

  .main {
    padding: 20px;
  }

  .page-head,
  .actions-row {
    grid-auto-flow: row;
    justify-content: stretch;
  }

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