* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
  color: #172033;
  background: #f4f6f8;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  color: #172033;
  background: #fff;
  cursor: pointer;
}

button:hover {
  background: #f8fafc;
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.primary {
  border-color: #1769aa;
  color: #fff;
  background: #1769aa;
}

.primary:hover {
  background: #135b94;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}

.login-panel h1 {
  margin: 0 0 22px;
  font-size: 26px;
}

label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  color: #172033;
  background: #fff;
}

textarea {
  resize: vertical;
}

.captcha-row,
.sms-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  margin-top: 12px;
}

.captcha-button {
  align-self: end;
  height: 40px;
  padding: 0;
  overflow: hidden;
}

.captcha-button img {
  width: 100%;
  height: 100%;
  display: block;
}

.login-panel .primary {
  width: 100%;
  margin-top: 18px;
}

.msg {
  min-height: 20px;
  margin: 12px 0 0;
  color: #b42318;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  padding: 20px 14px;
  color: #fff;
  background: #172033;
}

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

.nav {
  width: 100%;
  margin-bottom: 8px;
  border-color: #34445f;
  color: #fff;
  text-align: left;
  background: #22314a;
}

.nav.active {
  background: #1769aa;
}

.content {
  padding: 24px;
  overflow: auto;
}

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

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 6px 0 0;
  color: #64748b;
}

.pill {
  border-radius: 999px;
  padding: 8px 14px;
  color: #155e91;
  font-weight: 700;
  white-space: nowrap;
  background: #e8f2fb;
}

.toolbar {
  display: grid;
  grid-template-columns: 220px 220px 180px 88px 88px;
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

table {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
}

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

th {
  color: #475569;
  font-weight: 700;
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

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

.summary {
  min-height: 42px;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.status {
  font-weight: 700;
}

.danger {
  color: #b42318;
}

.ok {
  color: #067647;
}

.muted {
  color: #64748b;
}

.clickable {
  cursor: pointer;
}

.clickable:hover td {
  background: #f8fafc;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 18px;
}

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

  .sidebar {
    display: flex;
    gap: 8px;
    overflow: auto;
  }

  .sidebar h2 {
    display: none;
  }

  .nav {
    width: auto;
    white-space: nowrap;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .form-grid,
  .captcha-row,
  .sms-row {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow: auto;
  }
}
