:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d7dce0;
  --accent: #166c64;
  --accent-dark: #0d4f49;
  --danger: #b42318;
  --ok-bg: #d9f2e7;
  --ok: #106645;
  --empty-bg: #edf0f2;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
  padding: 0 28px;
  background: #101820;
  color: white;
}

.topbar a { color: white; }
.brand { font-weight: 700; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.adminbar { background: #15251f; }

.container {
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto 56px;
}
.container.wide { width: min(1440px, calc(100vw - 24px)); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.stack { display: grid; gap: 14px; }

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

h1, h2 { line-height: 1.2; margin: 0 0 12px; }
p { margin: 0 0 12px; }

label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--text);
}
textarea { resize: vertical; }

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: #475467; }
button.danger { background: var(--danger); }

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { background: #eef2f3; font-size: 13px; color: #344054; }
tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--empty-bg);
  color: var(--muted);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.empty { background: var(--empty-bg); color: var(--muted); }
.mini {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--empty-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.mini.ok { background: var(--ok-bg); color: var(--ok); }
.muted { color: var(--muted); font-size: 13px; }
.warning { color: #92400e; font-weight: 700; }
.error { color: var(--danger); font-weight: 700; }
pre {
  max-width: 420px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f2f4f7;
  padding: 10px;
  border-radius: 6px;
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  button { width: 100%; }
}

