* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7f9;
  color: #1e2933;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

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

a:hover {
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #102a43;
  color: #fff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 20px;
}

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

.userline {
  color: #d9e2ec;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.nav {
  background: #fff;
  border-right: 1px solid #d9e2ec;
  min-height: calc(100vh - 52px);
  padding: 14px;
}

.nav a {
  border-radius: 6px;
  color: #334e68;
  display: block;
  font-weight: 600;
  padding: 9px 10px;
}

.nav a:hover {
  background: #e6f6ff;
  text-decoration: none;
}

.content {
  padding: 22px;
}

.login {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-panel {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

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

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

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

.card {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 14px;
}

.metric {
  color: #102a43;
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
}

.label {
  color: #627d98;
  font-size: 13px;
  margin-top: 6px;
}

table {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-collapse: collapse;
  width: 100%;
}

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

th {
  background: #f0f4f8;
  color: #334e68;
  font-size: 13px;
}

.muted {
  color: #627d98;
}

.notice,
.error {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
}

.notice {
  background: #e6f6ff;
  border: 1px solid #b3ecff;
}

.error {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #8a1f11;
}

label {
  display: block;
  font-weight: 650;
  margin: 12px 0 5px;
}

input,
select,
textarea {
  border: 1px solid #bcccdc;
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button {
  background: #0f6b8d;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: 16px;
  padding: 10px 14px;
  width: 100%;
}

.button {
  background: #0f6b8d;
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-weight: 700;
  padding: 9px 12px;
}

.button:hover {
  text-decoration: none;
}

.button.secondary {
  background: #334e68;
}

.actions {
  margin: 0 0 12px;
}

.form {
  margin-bottom: 12px;
}

td form.card {
  border-radius: 6px;
  margin: 6px 0 0;
  padding: 8px;
}

td form.card button {
  margin-top: 8px;
}

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

.checkbox {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.checkbox input {
  width: auto;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #e6f6ff;
  border: 1px solid #b3ecff;
  border-radius: 999px;
  color: #0b4f6c;
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
}

.prewrap {
  white-space: pre-wrap;
}

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

  .nav {
    border-bottom: 1px solid #d9e2ec;
    border-right: 0;
    min-height: 0;
  }

  .nav a {
    display: inline-block;
  }

  .content {
    padding: 14px;
  }

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