* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fb;
  color: #192132;
}

a {
  color: #1f5cff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.admin-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.admin-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 31, 68, 0.08);
  padding: 24px;
}

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

.admin-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.admin-subtitle {
  margin: 8px 0 0;
  color: #5d6882;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #0c3dff, #2b8cff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(31, 92, 255, 0.24);
}

.button-secondary {
  background: #eef3ff;
  color: #1f5cff;
}

.button-danger {
  background: #fff0f2;
  color: #cf2148;
}

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

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #edf2ff);
  border: 1px solid #e2e9ff;
}

.stat-label {
  color: #66718d;
  font-size: 13px;
}

.stat-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

.flash {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.flash-success {
  background: #edf9ef;
  color: #1f7a36;
  border: 1px solid #d2efd8;
}

.flash-error {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #ffd1d9;
}

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

.report-table th,
.report-table td {
  border-bottom: 1px solid #edf1f7;
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  font-size: 13px;
  color: #6a748e;
}

.link-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f7f9ff;
  border: 1px solid #e0e7ff;
  border-radius: 12px;
  padding: 10px 12px;
  word-break: break-all;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field > span {
  font-size: 13px;
  color: #57627d;
  font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid #dbe3f1;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

.form-field textarea {
  min-height: 96px;
  resize: vertical;
}

.section-block {
  margin-top: 24px;
  border-top: 1px solid #eef2f8;
  padding-top: 24px;
}

.section-block:first-of-type {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button {
  background: #eff3fb;
  color: #44506c;
}

.tab-button.is-active {
  background: #1f5cff;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.repeater {
  border: 1px solid #e8edf7;
  border-radius: 16px;
  padding: 16px;
  background: #fbfcff;
}

.repeater-rows {
  display: grid;
  gap: 12px;
}

.repeater-row {
  border: 1px solid #e7ecf8;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.repeater-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.table-editor {
  border: 1px solid #e7ecf8;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.edit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.edit-table th,
.edit-table td {
  border: 1px solid #e6ebf4;
  padding: 10px;
  text-align: left;
}

.edit-table input {
  width: 100%;
  border: 1px solid #dbe3f1;
  border-radius: 10px;
  padding: 10px 12px;
}

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

.meta-pill {
  border-radius: 14px;
  background: #f7f9ff;
  border: 1px solid #e0e7ff;
  padding: 14px 16px;
}

.meta-pill strong {
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .admin-shell {
    padding: 16px;
  }

  .admin-header {
    flex-direction: column;
  }

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