:root {
  --navy: #102a43;
  --blue: #146ebe;
  --teal: #00a3a3;
  --ink: #172033;
  --muted: #667085;
  --line: #dce4ee;
  --bg: #f4f7fb;
  --white: #fff;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(16, 42, 67, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 Arial,
    Helvetica,
    sans-serif;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 245px 1fr;
}
.sidebar {
  background: linear-gradient(180deg, #102a43, #0b1f33);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 30px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #3cb8ff);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}
.nav a {
  display: block;
  color: #cfe3f6;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 3px 0;
}
.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}
.sidebar-foot {
  position: absolute;
  bottom: 24px;
  left: 30px;
  color: #9fb8cf;
  font-size: 13px;
}
.main {
  padding: 28px 34px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.topbar h1 {
  margin: 0;
  font-size: 28px;
  color: var(--navy);
}
.muted {
  color: var(--muted);
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.stat strong {
  display: block;
  color: var(--navy);
  font-size: 30px;
}
.stat span {
  color: var(--muted);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
}
.button:hover {
  text-decoration: none;
  filter: brightness(0.98);
}
.button.primary {
  background: var(--blue);
  color: #fff;
}
.button.secondary {
  background: #e9f1f8;
  color: var(--navy);
}
.button.danger {
  background: #fee4e2;
  color: var(--danger);
}
.button.small {
  padding: 6px 9px;
  font-size: 13px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.actions form {
  display: inline;
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e9f1f8;
  color: #344054;
}
.badge.active,
.badge.sent,
.badge.completed {
  background: #d1fadf;
  color: #05603a;
}
.badge.paused,
.badge.pending,
.badge.draft {
  background: #fef0c7;
  color: #93370d;
}
.badge.failed,
.badge.stopped,
.badge.cancelled,
.badge.unsubscribed {
  background: #fee4e2;
  color: #912018;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.span-2 {
  grid-column: 1/-1;
}
label {
  display: block;
  color: #344054;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  margin-top: 6px;
}
textarea {
  min-height: 140px;
  resize: vertical;
}
small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.alert-success {
  background: #d1fadf;
  color: #05603a;
}
.alert-danger {
  background: #fee4e2;
  color: #912018;
}
.alert-warning {
  background: #fef0c7;
  color: #93370d;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px;
}
.login-page,
.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef7ff, #f6fbfb);
}
.login-card,
.install-card {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.install-card {
  width: min(760px, 100%);
}
.login-card .brand-mark,
.install-card .brand-mark {
  margin-bottom: 18px;
}
.login-card h1,
.install-card h1 {
  margin: 0 0 8px;
  color: var(--navy);
}
.login-card label {
  margin-top: 15px;
}
.login-card button {
  width: 100%;
  margin-top: 20px;
}
.campaign-step {
  border-left: 4px solid var(--teal);
}
.campaign-step h3 {
  margin-top: 0;
}
.code {
  font-family: Consolas, monospace;
  background: #eef3f8;
  border-radius: 6px;
  padding: 3px 6px;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #102a43;
  color: #eef7ff;
  padding: 16px;
  border-radius: 8px;
}
.mobile-nav {
  display: none;
}
@media (max-width: 900px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px 18px;
  }
  .brand {
    margin: 0 0 10px;
  }
  .nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav a {
    white-space: nowrap;
  }
  .sidebar-foot {
    display: none;
  }
  .mobile-nav {
    display: block;
  }
  .main {
    padding: 20px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .stats,
  .form-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
  .main {
    padding: 16px;
  }
  .card {
    padding: 16px;
  }
}
