:root {
  --bg: #f3f4f7;
  --panel: #fff;
  --ink: #1b2130;
  --muted: #6b7385;
  --line: #e3e6ec;
  --brand: #2f5bea;
  --brand-ink: #fff;
  --ok: #178a4c;
  --warn: #b7791f;
  --bad: #c53030;
  --side: #151a27;
  --side-ink: #c9cfdc;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font:
    14px/1.45 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.loading {
  padding: 40px;
  color: var(--muted);
}
.shell {
  display: flex;
  min-height: 100vh;
}
.side {
  width: 220px;
  background: var(--side);
  color: var(--side-ink);
  padding: 18px 0;
  flex-shrink: 0;
}
.side .logo {
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  padding: 0 20px 18px;
}
.side a {
  display: block;
  color: var(--side-ink);
  padding: 8px 20px;
  border-left: 3px solid transparent;
}
.side a:hover {
  background: #1d2436;
  text-decoration: none;
}
.side a.on {
  background: #1d2436;
  border-left-color: var(--brand);
  color: #fff;
}
.side .who {
  padding: 16px 20px;
  font-size: 12px;
  color: #8b93a7;
  border-top: 1px solid #232a3c;
  margin-top: 14px;
}
.main {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
}
h1 {
  font-size: 20px;
  margin: 0 0 16px;
}
h2 {
  font-size: 16px;
  margin: 22px 0 10px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row > * {
  flex: 0 0 auto;
}
.grow {
  flex: 1 1 220px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
input,
select,
textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
textarea {
  min-height: 90px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
textarea.code {
  min-height: 320px;
}
input[type="checkbox"] {
  width: auto;
}
.field {
  margin-bottom: 12px;
  min-width: 160px;
}
button {
  font: inherit;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
}
button.sec {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
button.bad {
  background: var(--bad);
  border-color: var(--bad);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button + button {
  margin-left: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}
th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: #fafbfc;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 12px;
  background: #eef1f6;
  color: var(--ink);
}
.tag.running,
.tag.done,
.tag.ok,
.tag.active {
  background: #e3f5ea;
  color: var(--ok);
}
.tag.paused,
.tag.scheduled,
.tag.warn {
  background: #fdf3e1;
  color: var(--warn);
}
.tag.cancelled,
.tag.bad,
.tag.failed,
.tag.bounced,
.tag.complained,
.tag.unsubscribed {
  background: #fde8e8;
  color: var(--bad);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi .v {
  font-size: 22px;
  font-weight: 700;
}
.kpi .l {
  font-size: 12px;
  color: var(--muted);
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: 6px;
}
.bars .b {
  flex: 1;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  min-height: 1px;
  position: relative;
}
.bars .b.f {
  background: var(--bad);
}
.muted {
  color: var(--muted);
}
.msg {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.msg.err {
  background: #fde8e8;
  color: var(--bad);
}
.msg.ok {
  background: #e3f5ea;
  color: var(--ok);
}
.msg.warn {
  background: #fdf3e1;
  color: var(--warn);
}
.progress {
  height: 8px;
  background: #eef1f6;
  border-radius: 6px;
  overflow: hidden;
  min-width: 120px;
}
.progress > div {
  height: 100%;
  background: var(--brand);
}
.login {
  max-width: 380px;
  margin: 10vh auto;
  background: var(--panel);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.login h1 {
  text-align: center;
}
.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
iframe.preview {
  width: 100%;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.wa-check {
  text-align: center;
  padding: 28px 16px;
}
.wa-num {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 1px;
}
.wa-label {
  margin-top: 6px;
  font-size: 18px;
  color: var(--muted);
}
.wa-open {
  margin: 20px 0;
}
a.wa-btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.wa-acts button {
  min-width: 110px;
  padding: 10px 16px;
}
@media (max-width: 900px) {
  .shell {
    flex-direction: column;
  }
  .side {
    width: auto;
  }
  .split {
    grid-template-columns: 1fr;
  }
}
