:root {
  --ink: #17332f;
  --muted: #738681;
  --primary: #187968;
  --bg: #f4f7f6;
  --line: #dfe8e4;
  --white: #fff
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif
}

a {
  color: var(--primary);
  text-decoration: none
}

button,
.button {
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: white;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  display: inline-block
}

button:hover,
.button:hover {
  filter: brightness(.94)
}

button:disabled {
  opacity: .55;
  cursor: wait
}

.secondary {
  background: #edf3f0;
  color: var(--ink)
}

.danger {
  color: #b93838;
  background: #fff0ef
}

input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #88bfad;
  outline-offset: 1px
}

label {
  display: block;
  font-weight: 550;
  margin: 10px 0
}

label small,
small,
.muted {
  color: var(--muted);
  font-weight: 400
}

input[type=checkbox] {
  width: auto;
  display: inline;
  margin-right: 8px
}

aside {
  width: 224px;
  position: fixed;
  inset: 0 auto 0 0;
  background: white;
  border-right: 1px solid var(--line);
  padding: 32px 22px
}

.brand {
  font-size: 23px;
  font-weight: 750;
  color: var(--ink)
}

aside>p {
  font-size: 10px;
  letter-spacing: 2px
}

nav {
  margin-top: 40px
}

nav a {
  display: block;
  color: #607770;
  padding: 12px 16px;
  margin: 7px 0;
  border-radius: 9px
}

nav a.active {
  background: #e4f2ec;
  color: var(--primary);
  font-weight: 650
}

.account {
  position: absolute;
  bottom: 28px;
  left: 24px;
  right: 24px
}

.account button {
  display: block;
  width: 100%;
  margin-top: 12px
}

.workspace {
  margin-left: 224px;
  max-width: 1500px;
  padding: 36px 42px
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px
}

h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 4px 0
}

h2 {
  font-size: 19px;
  margin: 0 0 20px
}

h3 {
  font-size: 16px;
  margin: 10px 0
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 22px
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 26px
}

.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px
}

.stat strong {
  font-size: 30px;
  display: block;
  margin-top: 5px
}

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

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

.wide {
  grid-column: 1/-1
}

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

.actions button,
.actions a {
  padding: 6px 10px;
  font-size: 13px
}

.badge {
  display: inline-block;
  background: #e6f5ed;
  color: #167459;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 12px
}

.badge.paused,
.badge.failed {
  background: #fff0ee;
  color: #af5144
}

.badge.retry,
.badge.pending,
.badge.sending {
  background: #fff6d9;
  color: #987327
}

.badge.skipped {
  background: #edf0f1;
  color: #78858a
}

.tablewrap {
  overflow: auto
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted)
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf1ef
}

td.wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 320px
}

.empty {
  text-align: center;
  padding: 50px;
  color: var(--muted)
}

.rule {
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin: 14px 0
}

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

.rule-head select {
  flex: 1
}

.weekday-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 14px
}

.weekday-row label {
  margin: 5px 0
}

.rule-details {
  margin-top: 10px
}

#notice {
  margin-bottom: 15px;
  color: var(--primary)
}

#notice.error,
#error {
  color: #b53636
}

footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 30px
}

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

.preview {
  width: 100%;
  height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white
}

ol.times {
  padding-left: 22px;
  color: #4d6860
}

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.filters input,
.filters select {
  width: auto
}

.login {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: radial-gradient(at 20% 15%, #ddefe6, transparent 55%), var(--bg)
}

.login-card {
  width: 420px;
  margin: 25px;
  background: #fff;
  padding: 38px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px #17332f0b
}

.login-card .brand {
  margin-bottom: 30px
}

.login-card button {
  width: 100%;
  margin-top: 16px
}

.hint {
  font-size: 13px;
  color: var(--muted)
}

@media(max-width:1100px) {
  .stats {
    grid-template-columns: repeat(3, 1fr)
  }

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

  .workspace {
    padding: 28px
  }
}

@media(max-width:720px) {
  aside {
    position: static;
    width: 100%;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line)
  }

  aside>p,
  .account {
    display: none
  }

  nav {
    margin: 10px 0 0;
    display: flex;
    overflow: auto;
    white-space: nowrap
  }

  nav a {
    padding: 8px 12px;
    margin: 0
  }

  .workspace {
    margin: 0;
    padding: 20px 14px
  }

  h1 {
    font-size: 25px
  }

  header small {
    font-size: 11px
  }

  header .button {
    font-size: 12px;
    padding: 8px
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
  }

  .card {
    padding: 18px
  }

  .fieldgrid {
    grid-template-columns: 1fr
  }

  .wide {
    grid-column: auto
  }

  .weekday-row {
    grid-template-columns: 90px 1fr
  }
}

.offset-row {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 480px
}

.offset-row label {
  flex: 1
}

.offset-row button {
  margin-top: 28px
}

@media(max-width:720px) {
  .account {
    display: flex;
    position: static;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px
  }

  .account button {
    width: auto;
    display: inline;
    margin: 0;
    padding: 5px 12px
  }
}

.tablewrap td .actions {
  flex-wrap: nowrap
}

.tablewrap table {
  min-width: 780px
}
