* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

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

.wrapper {
  max-width: 760px;
  margin: 40px auto;
  padding: 20px;
}

.wrapper.wide {
  max-width: 1400px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

p {
  margin-top: 0;
  line-height: 1.6;
}

.top-link {
  display: inline-block;
  margin-bottom: 24px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

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

.spacer {
  height: 16px;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  word-break: break-word;
}

.notice.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.notice.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.form-grid {
  display: grid;
  gap: 18px;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-weight: 600;
  font-size: 14px;
}

.hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: -2px;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: monospace;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
}

.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.checkbox-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.checkbox-text {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.hidden {
  display: none !important;
}

.submit-btn {
  background: #111827;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.submit-btn:hover {
  opacity: 0.95;
}

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

.actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions form,
.inline-actions form {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.btn:hover {
  opacity: 0.95;
}

.btn-secondary {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-warning {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.btn-small {
  min-width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.tile strong {
  font-size: 15px;
}

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

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  font-size: 14px;
}

th {
  font-size: 13px;
  color: #6b7280;
  font-weight: 700;
  background: #f9fafb;
}

tr:hover td {
  background: #fcfcfd;
}

.content-block {
  white-space: pre-wrap;
  line-height: 1.7;
}

.approval-actions {
  margin-bottom: 16px;
}

.codeish {
  font-family: monospace;
  font-size: 13px;
  word-break: break-word;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions,
  .inline-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .wrapper {
    margin: 20px auto;
    padding: 14px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  th,
  td {
    font-size: 13px;
    padding: 10px 8px;
  }
}
