/* Small additions on top of Pico (classless). */
:root {
  --pico-font-size: 100%;
}

body > header {
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

body > header nav {
  flex-wrap: wrap;
}

body > header nav ul:last-child {
  flex-wrap: wrap;
}

body > header nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

.inline-form {
  display: inline;
  margin: 0;
}

.inline-form button {
  margin: 0;
  padding: 0.25rem 0.75rem;
  width: auto;
}

.login {
  max-width: 24rem;
  margin-inline: auto;
}

.error {
  color: var(--pico-del-color);
}

.muted {
  color: var(--pico-muted-color);
}

.flash {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--pico-primary);
  background: var(--pico-card-sectioning-background-color);
  margin-bottom: 1rem;
}

.flash.error {
  border-left-color: var(--pico-del-color);
}

/* --- Lists, tables, toolbars (contacts / lists / segments / stop-list) --- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.toolbar > *,
.toolbar label > * {
  margin-bottom: 0;
}

.toolbar input:not([type="checkbox"], [type="radio"]),
.toolbar select,
.toolbar button {
  width: auto;
  margin-bottom: 0;
}

.toolbar input[type="search"],
.toolbar input[type="text"],
.toolbar input[type="email"] {
  flex: 1 1 14rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.actions button {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

table.compact th,
table.compact td {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  vertical-align: top;
}

table.compact input,
table.compact select {
  margin-bottom: 0;
  padding-block: 0.35rem;
  height: auto;
}

table.report {
  width: auto;
  min-width: 24rem;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

tr.suppressed td {
  opacity: 0.65;
}

.field-pair {
  display: inline-block;
  margin-right: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
  background: var(--pico-muted-border-color);
  color: var(--pico-color);
}

.badge.danger {
  background: var(--pico-del-color);
  color: #fff;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

button.secondary {
  width: auto;
  background: transparent;
  color: var(--pico-primary);
  border-color: var(--pico-primary);
  padding: 0.25rem 0.75rem;
}

button.danger {
  width: auto;
  background: var(--pico-del-color);
  border-color: var(--pico-del-color);
}

ul.plain {
  list-style: none;
  padding-left: 0;
}

ul.plain li {
  list-style: none;
  margin-bottom: 0.25rem;
}

.cond-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cond-row select,
.cond-row input {
  width: auto;
  margin-bottom: 0;
}

.cond-row input[type="text"] {
  flex: 1 1 12rem;
}

details {
  margin-block: 1rem;
}

.flash.warning {
  border-left-color: #c58a00;
}

/* --- Campaign statistics --- */
.small {
  font-size: 0.85rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tile {
  padding: 0.75rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  background: var(--pico-card-background-color);
}

.tile.tile-warn {
  border-color: #c58a00;
}

.tile-title {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.tile-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.tile-sub {
  font-size: 0.8rem;
}

tr.total-row td {
  font-weight: 600;
}

.recipient-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

/* --- DRY-RUN banner (every page) --- */
.dry-run-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #c58a00;
  color: #1a1200;
  font-weight: 700;
  text-align: center;
}

/* --- Settings --- */
.banner-warning {
  padding: 1rem;
  border: 2px solid #c58a00;
  border-radius: 0.5rem;
  background: rgba(197, 138, 0, 0.12);
  font-weight: 600;
  margin-bottom: 1rem;
}

dl.info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
}

dl.info dt {
  color: var(--pico-muted-color);
}

dl.info dd {
  margin: 0;
  word-break: break-all;
}

.api-result {
  margin-top: 1rem;
/* --- Campaigns --- */
.badge.status-scheduled { background: #dbe7ff; color: #1d3f8a; }
.badge.status-sending { background: #fff1c2; color: #6b4e00; }
.badge.status-paused { background: #ffe0c2; color: #7a3a00; }
.badge.status-done { background: #d5f2dc; color: #17562a; }
.badge.status-failed,
.badge.status-cancelled { background: #f6d5d5; color: #7a1d1d; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0 1rem;
}

label.inline {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.audience-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.audience-row label {
  min-width: 7rem;
  margin-bottom: 0;
}

.audience-row select {
  width: auto;
  flex: 1 1 16rem;
  margin-bottom: 0;
}

dl.summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}

dl.summary dt {
  color: var(--pico-muted-color);
  font-weight: normal;
}

dl.summary dd {
  margin: 0;
}

.variant-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.variant-card h3 {
  margin-bottom: 0.25rem;
}

.preview-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--pico-muted-border-color);
  background: #fff;
}

pre.plaintext {
  white-space: pre-wrap;
  max-height: 40vh;
  overflow: auto;
  font-size: 0.8rem;
}

ul.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-left: 0;
}

ul.counts li {
  list-style: none;
}

.confirm-box {
  border: 2px solid var(--pico-primary);
  border-radius: 0.5rem;
  padding: 1rem;
}

.confirm-box input[name="confirmed_count"] {
  max-width: 14rem;
  font-size: 1.25rem;
}

.issue-error {
  color: var(--pico-del-color);
}
