:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f8;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: #1864ab;
  color: #fff;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 650;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c7d0d9;
  border-radius: 7px;
  background: #fff;
  color: #17202a;
  outline: 0;
  padding: 10px 11px;
}

input:focus,
textarea:focus {
  border-color: #1864ab;
  box-shadow: 0 0 0 3px rgba(24, 100, 171, 0.14);
}

label {
  display: grid;
  gap: 7px;
  color: #465462;
  font-size: 13px;
  font-weight: 650;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel,
.workspace,
.campaign-list-section {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
}

.login-panel {
  padding: 26px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row.compact h1 {
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0b7285;
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
}

p,
small {
  color: #64717f;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.form-error {
  min-height: 20px;
  color: #c92a2a;
  font-weight: 650;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid #d9e0e7;
  background: #fff;
}

.topbar-actions,
.button-row,
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  color: #465462;
}

.secondary-button {
  background: #e7eef5;
  color: #183247;
}

.danger-button {
  background: #c92a2a;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #e7eef5;
  color: #183247;
}

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.campaign-list-section,
.workspace {
  padding: 18px;
}

.campaign-list-section {
  min-height: calc(100vh - 108px);
}

.section-title {
  justify-content: space-between;
  margin-bottom: 16px;
}

.campaign-list {
  display: grid;
  gap: 8px;
}

.campaign-item {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #17202a;
  border: 1px solid #d9e0e7;
  text-align: left;
}

.campaign-item.active {
  border-color: #1864ab;
  background: #e7f5ff;
}

.campaign-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-form {
  display: grid;
  gap: 16px;
}

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

.full-span {
  grid-column: 1 / -1;
}

.status-pill {
  border-radius: 999px;
  padding: 5px 10px;
  background: #e7f5ff;
  color: #0b5c8f;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.failed,
.status-pill.partially_failed {
  background: #fff0f0;
  color: #c92a2a;
}

.status-pill.sent {
  background: #ebfbee;
  color: #2b8a3e;
}

.status-pill.muted {
  background: #edf1f5;
  color: #64717f;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stats-band div {
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 13px;
}

.stats-band span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.event-log {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #101820;
  color: #dbe4ea;
  padding: 14px;
  white-space: pre-wrap;
}

@media (max-width: 880px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .campaign-list-section {
    min-height: 0;
  }

  .form-grid,
  .stats-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
