* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2937;
  background: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  padding: 22px 16px;
  background: #111827;
  color: #fff;
}

.sidebar.hidden {
  display: none;
}

.brand {
  margin: 8px 8px 28px;
  font-size: 20px;
  font-weight: 800;
}

.nav {
  display: block;
  width: 100%;
  height: 44px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.nav.active,
.nav:hover {
  color: #fff;
  background: #0f8b6f;
}

.logout {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  width: calc(100% - 32px);
  color: #fecaca;
}

.main {
  margin-left: 232px;
  padding: 28px;
}

.login-main {
  margin-left: 0;
}

.panel {
  display: none;
}

.hidden,
.login-panel.hidden,
.admin-app.hidden,
.sidebar.hidden {
  display: none !important;
}

.panel.active {
  display: block;
}

.login-panel {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

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

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

p {
  margin: 8px 0 0;
  color: #667085;
}

button,
input,
select {
  font: inherit;
}

.primary,
.secondary {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: #0f8b6f;
  font-weight: 800;
  cursor: pointer;
}

.secondary {
  margin-top: 16px;
  color: #0f6f5b;
  background: #dff3ed;
}

.toolbar {
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.toolbar input {
  max-width: 420px;
}

.table-wrap,
.form-grid,
.setting-block,
dialog {
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #eaecf0;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #475467;
  background: #f9fafb;
  font-size: 13px;
}

td {
  font-size: 14px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #0f8b6f;
  font-weight: 800;
  cursor: pointer;
}

.danger {
  color: #d92d20;
}

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

.setting-block {
  margin-bottom: 18px;
}

.setting-block .subhead {
  margin: 0;
  padding: 18px 18px 0;
}

.form-grid.single {
  grid-template-columns: 1fr;
  border: 0;
  box-shadow: none;
  padding: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

.status {
  min-height: 22px;
  margin-top: 14px;
  color: #0f8b6f;
  font-weight: 800;
}

.subhead {
  margin: 24px 0 12px;
  color: #111827;
  font-size: 18px;
}

dialog {
  width: min(720px, calc(100vw - 40px));
  border: 0;
  padding: 22px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.dialog-actions button {
  height: 40px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  cursor: pointer;
}

.dialog-actions .primary {
  border: 0;
  background: #0f8b6f;
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .brand {
    white-space: nowrap;
    margin: 8px;
  }

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

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .panel-head,
  .form-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}
