:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --text: #18202a;
  --muted: #5f6b7a;
  --panel: #ffffff;
  --line: #d9dee7;
  --accent: #216869;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.shell-narrow {
  width: min(480px, calc(100% - 32px));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

button,
.link-button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-button {
  background: transparent;
  color: var(--accent);
}

.alert {
  border: 1px solid #c74747;
  border-radius: 6px;
  padding: 10px 12px;
  color: #8c1f1f;
  background: #fff3f3;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.admin-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.admin-grid h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 24px;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

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

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