* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f6f6;
  color: #20282b;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: #0f6b63;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #172124;
  color: #f9f4e7;
  display: flex;
  justify-content: space-between;
  padding: 12px 28px;
}

.brand {
  font-size: 16px;
  font-weight: 700;
}

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

.nav a,
.nav button {
  background: none;
  border: 0;
  color: #f9f4e7;
  cursor: pointer;
  font: inherit;
}

.page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 22px 28px 40px;
}

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

.panel,
.card {
  background: #fffdfa;
  border: 1px solid #d9e0df;
  border-radius: 8px;
  padding: 18px;
}

.hero {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 32px;
}

.login-box {
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 10px 0 5px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #c9d2d1;
  border-radius: 6px;
  font: inherit;
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #0f6b63;
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: 0;
  padding: 0;
  width: 16px;
}

button,
.button {
  background: #0f6b63;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  min-height: 34px;
  padding: 8px 12px;
}

.button.secondary,
button.secondary {
  background: #455357;
}

.muted {
  color: #667275;
}

.error {
  background: #ffe8df;
  border: 1px solid #ec9b80;
  border-radius: 6px;
  color: #8f2b14;
  padding: 10px 12px;
}

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

td,
th {
  border-bottom: 1px solid #e1e7e6;
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #546164;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  background: #e5f1ee;
  border-radius: 999px;
  color: #0f6b63;
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 10px;
}

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

.section-title {
  margin: 0;
}

.metric {
  padding: 14px 16px;
}

.metric h2 {
  font-size: 24px;
  margin-bottom: 2px;
}

.metric p {
  color: #667275;
  margin: 0;
}

.toolbar-form {
  align-items: end;
  border-top: 1px solid #e1e7e6;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 10px;
  padding-top: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  font-size: 13px;
  min-width: 760px;
}

.data-table code {
  background: #eef2f1;
  border-radius: 4px;
  padding: 2px 5px;
}

.actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.details-edit {
  display: inline-block;
}

.details-edit summary {
  color: #0f6b63;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

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

.edit-popover {
  background: #ffffff;
  border: 1px solid #cad4d3;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(24, 34, 37, 0.16);
  margin-top: 8px;
  max-width: 720px;
  padding: 14px;
  position: absolute;
  right: 28px;
  width: min(720px, calc(100vw - 56px));
  z-index: 10;
}

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

.checkline {
  align-items: center;
  display: flex;
  gap: 6px;
  margin: 0;
  min-height: 34px;
  white-space: nowrap;
}

.checkline input {
  min-height: auto;
  width: auto;
}

.danger {
  background: #8f2b14;
}

.compact-form {
  display: inline;
}

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

  .page {
    padding: 16px;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }

  .edit-popover {
    left: 16px;
    right: 16px;
    width: auto;
  }
}
