* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  background: #f6f7fb;
  color: #1f2937;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  background: #1f2937;
  color: #fff;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.brand {
  font-size: 18px;
  font-weight: 600;
}

.nav a,
.link-button {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}

.inline-form {
  display: inline;
}

.link-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.card {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

h1 {
  margin-top: 0;
  font-size: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

input[disabled],
input[readonly] {
  background: #f3f4f6;
  color: #6b7280;
}

textarea {
  resize: vertical;
}

button.primary {
  background: #22c55e;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

button.danger {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

a.secondary {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #1f2937;
  text-decoration: none;
  margin-right: 8px;
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 0 0;
}

.inline-input {
  max-width: 150px;
}

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

.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.section {
  margin-top: 20px;
}

.section h2 {
  margin-bottom: 10px;
}

.admin-form {
  margin-top: 12px;
}

.admin-inline-form {
  margin: 0;
}

.admin-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-inline-fields input {
  max-width: 200px;
}

.admin-inline-fields select {
  max-width: 160px;
}

.admin-table td {
  vertical-align: top;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
  align-items: start;
}

.section-grid .section {
  margin-top: 0;
}

.section-grid > * {
  min-width: 0;
}

.section-collapsible {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
  background: #f9fafb;
}

.section-collapsible summary {
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.section-collapsible summary::-webkit-details-marker {
  display: none;
}

.section-collapsible summary::after {
  content: "▾";
  float: right;
  font-size: 16px;
  color: #6b7280;
}

.section-collapsible[open] summary::after {
  content: "▴";
}

.section-content {
  margin-top: 12px;
}

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

.simple-table th,
.simple-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.flash-list {
  margin-bottom: 16px;
}

.flash {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

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

.actions {
  margin-top: 12px;
}
