:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #eef2f6;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f6;
}

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

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid #d8dee8;
}

.brand {
  color: #172033;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav form {
  margin: 0;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 32px auto;
}

.panel,
.auth-panel {
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(34, 44, 64, 0.08);
}

.auth-panel,
.narrow {
  width: min(440px, 100%);
  margin: 72px auto 0;
}

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

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

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

label {
  display: grid;
  gap: 8px;
  color: #3a465a;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #c4ccd8;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #c4ccd8;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

button:hover,
.button:hover {
  background: #f4f7fb;
  text-decoration: none;
}

.primary {
  border-color: #1c5fd4;
  background: #1c5fd4;
  color: #ffffff;
}

.primary:hover {
  background: #174fb2;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #c4ccd8;
  background: #ffffff;
}

.message.error {
  border-color: #e0a2a2;
  background: #fff0f0;
  color: #8f1d1d;
}

.message.success {
  border-color: #8fc7a1;
  background: #eefaf1;
  color: #176332;
}

.profile {
  display: grid;
  gap: 16px;
  margin: 0;
}

.profile div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #e4e9f1;
}

.profile dt {
  color: #657184;
  font-weight: 700;
}

.profile dd {
  margin: 0;
}

.muted {
  color: #657184;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: #657184;
  font-size: 14px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form select {
  width: 130px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .section-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
