:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: light-dark(#f5f7fa, #111418);
  color: light-dark(#202938, #e8edf3);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  border: 1px solid light-dark(#d8dee8, #303844);
  background: light-dark(#fff, #171c22);
  color: inherit;
  min-height: 34px;
  padding: 8px 11px;
  cursor: pointer;
}

button.primary {
  background: #245f8f;
  border-color: #245f8f;
  color: white;
}

button.danger {
  background: #b42318;
  border-color: #b42318;
  color: white;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid light-dark(#d8dee8, #303844);
  background: light-dark(#fff, #171c22);
  color: inherit;
  padding: 9px 10px;
}

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

label {
  display: grid;
  gap: 6px;
  color: light-dark(#667085, #a8b1bd);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

label input,
label select,
label textarea {
  color: light-dark(#202938, #e8edf3);
  font-size: 13px;
  font-weight: 400;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: light-dark(#667085, #a8b1bd);
  font-weight: 600;
  background: light-dark(#f9fafb, #1e242c);
  border-bottom: 1px solid light-dark(#d8dee8, #303844);
  padding: 9px 10px;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid light-dark(#d8dee8, #303844);
  padding: 9px 10px;
  vertical-align: top;
}

pre {
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.side {
  background: light-dark(#202a35, #0d1116);
  color: #f8fafc;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  padding: 2px 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  display: block;
  color: rgba(255,255,255,.64);
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  text-align: left;
}

.nav button.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.userbox {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.14);
  padding: 12px 6px 0;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  line-height: 1.5;
}

.userbox label {
  color: rgba(255,255,255,.7);
  margin-top: 10px;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.top {
  background: light-dark(#fff, #171c22);
  border-bottom: 1px solid light-dark(#d8dee8, #303844);
  padding: 13px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  font-weight: 650;
}

h2 {
  font-size: 14px;
  font-weight: 650;
}

.top p,
.panel-head p {
  font-size: 12px;
  color: light-dark(#667085, #a8b1bd);
  margin-top: 3px;
}

.top-actions,
.actions,
.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: light-dark(#fff, #171c22);
  border: 1px solid light-dark(#d8dee8, #303844);
}

.panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid light-dark(#d8dee8, #303844);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.panel-body {
  padding: 14px;
  overflow-x: auto;
}

.task-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.editor {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 14px;
}

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

.choice {
  text-align: left;
  padding: 13px;
}

.choice.active {
  border-color: #245f8f;
  box-shadow: inset 3px 0 0 #245f8f;
}

.choice strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.choice span {
  color: light-dark(#667085, #a8b1bd);
  font-size: 12px;
  line-height: 1.45;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.selected,
.selector {
  background: light-dark(#f9fafb, #1e242c);
  border: 1px solid light-dark(#d8dee8, #303844);
  padding: 10px;
  margin-bottom: 12px;
}

.selected {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}

.selected.small {
  color: light-dark(#667085, #a8b1bd);
  justify-content: flex-start;
}

.checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.checks label,
.selector label.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: inherit;
  background: light-dark(#fff, #171c22);
  border: 1px solid light-dark(#d8dee8, #303844);
  padding: 9px 10px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}

.checks input,
.selector label.checkbox-row input {
  width: auto;
  margin-top: 2px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.stats.two-stats {
  grid-template-columns: 1fr 1fr;
}

.stats div {
  border: 1px solid light-dark(#d8dee8, #303844);
  background: light-dark(#fff, #171c22);
  padding: 11px;
}

.stats span {
  color: light-dark(#667085, #a8b1bd);
  font-size: 12px;
}

.stats strong {
  display: block;
  font-size: 21px;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid light-dark(#d8dee8, #303844);
  background: light-dark(#f9fafb, #1e242c);
  font-size: 12px;
  white-space: nowrap;
}

.badge.ok {
  color: light-dark(#26734d, #72d7a1);
}

.badge.warn {
  color: light-dark(#8a640d, #f1cb6a);
}

.badge.deny {
  color: light-dark(#b42318, #ff8d80);
}

.mail-preview {
  border: 1px solid light-dark(#d8dee8, #303844);
  background: light-dark(#f9fafb, #1e242c);
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.account-form {
  margin-top: 14px;
}

.mail-preview hr {
  border: 0;
  border-top: 1px solid light-dark(#d8dee8, #303844);
  margin: 10px 0;
}

.progress {
  height: 12px;
  background: light-dark(#e7ebf0, #2b333d);
  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0%;
  background: #245f8f;
  transition: width .25s ease;
}

.meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: light-dark(#667085, #a8b1bd);
  font-size: 12px;
  margin-top: 8px;
}

.stop-note {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid light-dark(#ffc9c3, #67302b);
  color: light-dark(#b42318, #ff8d80);
  background: light-dark(#fff0ee, #351614);
  font-size: 13px;
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: 1fr;
  }
  .task-home,
  .editor,
  .two {
    grid-template-columns: 1fr;
  }
  .task-types,
  .checks,
  .stats {
    grid-template-columns: 1fr;
  }
  .userbox {
    display: none;
  }
}
