:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f5;
  color: #17211b;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 60px; }

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #18241d;
  color: #f8fbf8;
}

.topbar div { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 800; }
.auth, .panel {
  background: #ffffff;
  border: 1px solid #d9e0db;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(23, 33, 27, 0.08);
}

.auth { width: min(460px, calc(100% - 32px)); margin: 9vh auto; }
h1 { margin: 0 0 12px; font-size: 24px; }
p { color: #526158; line-height: 1.5; }
label { display: grid; gap: 8px; margin: 14px 0; font-weight: 700; }
input, select {
  width: 100%;
  border: 1px solid #cbd5ce;
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

button, .button {
  border: 0;
  border-radius: 6px;
  background: #2f6f46;
  color: white;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.danger, .danger {
  background: #a33a2f;
}

.error { color: #b42318; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats article {
  background: #ffffff;
  border: 1px solid #d9e0db;
  border-radius: 8px;
  padding: 20px;
}
.stats span { display: block; font-size: 30px; font-weight: 900; color: #2f6f46; }
.actions, .search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { margin: 18px 0; }
.search input { max-width: 420px; }
.secondary { background: #eef4f0; color: #1f3328; border: 1px solid #cbd5ce; }
.danger { background: #b42318; }
.muted { color: #65756b; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin: 2px 4px 2px 0;
}
.badge.ok { background: #e5f5eb; color: #17633b; }
.badge.warn { background: #fff3da; color: #8a4b00; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.admin-form { display: grid; gap: 12px; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 14px;
  margin: 8px 0;
}
.check-grid label, .permissions label { display: flex; gap: 7px; align-items: center; margin: 0; font-weight: 600; }
.check-grid input, .permissions input { width: auto; }
.permissions { display: grid; gap: 6px; min-width: 180px; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { border-bottom: 1px solid #e2e8e4; padding: 11px 8px; text-align: left; vertical-align: top; }
th { color: #526158; font-size: 13px; text-transform: uppercase; }
td form { display: inline-flex; gap: 8px; margin: 2px; align-items: center; }
td form.permissions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8e4;
}
td form.permissions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
}
td form.permissions input[type="checkbox"] {
  width: auto;
}
small { color: #65756b; }

@media (max-width: 720px) {
  .topbar { height: auto; padding: 14px 16px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .topbar div { flex-wrap: wrap; gap: 12px; }
  table { display: block; overflow-x: auto; }
}
