:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f3;
  color: #20251f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cbd3c6;
  border-radius: 7px;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  min-height: 90px;
}

table {
  border-collapse: collapse;
  max-width: 100%;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e2e5dc;
  overflow-wrap: anywhere;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #606b5b;
  font-size: 12px;
  text-transform: uppercase;
}

.sidebar {
  background: #1f261f;
  bottom: 0;
  color: #f7faf4;
  display: grid;
  gap: 18px;
  left: 0;
  padding: 20px;
  position: fixed;
  top: 0;
  width: 250px;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand strong {
  font-size: 20px;
}

.brand span,
.page-head p {
  color: #6a7465;
}

.sidebar .brand span {
  color: #b8c4b0;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.sidebar a,
.button,
button {
  align-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none;
}

.sidebar a,
.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.content {
  display: grid;
  gap: 20px;
  margin-left: 250px;
  padding: 24px;
}

.login-content {
  align-items: center;
  display: grid;
  justify-content: center;
  min-height: 100vh;
  padding: 22px;
}

.login-panel,
.panel {
  background: #ffffff;
  border: 1px solid #dce1d5;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  padding: 20px;
}

.login-panel {
  min-width: min(420px, calc(100vw - 44px));
}

.narrow {
  max-width: 760px;
}

.page-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.page-head p,
.panel > p {
  margin: 6px 0 0;
}

.page-head h1,
.panel h2,
.login-panel h1 {
  margin: 0;
}

.metrics,
.grid.two {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid > * {
  min-width: 0;
}

.metrics article {
  background: #ffffff;
  border: 1px solid #dce1d5;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.metrics span {
  color: #606b5b;
  font-size: 13px;
}

.metrics strong {
  font-size: 30px;
}

.primary {
  background: #1f6a46;
  color: #ffffff;
}

.secondary {
  background: #edf2e8;
  color: #24301f;
}

.danger {
  background: #a93a34;
  color: #ffffff;
}

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

.actions .button,
.actions button {
  white-space: nowrap;
}

.actions form {
  margin: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.broadcast-table {
  min-width: 860px;
}

.broadcast-table th:nth-child(2),
.broadcast-table td:nth-child(2),
.broadcast-table th:nth-child(3),
.broadcast-table td:nth-child(3),
.broadcast-table th:nth-child(5),
.broadcast-table td:nth-child(5),
.broadcast-table th:nth-child(6),
.broadcast-table td:nth-child(6),
.broadcast-table th:nth-child(7),
.broadcast-table td:nth-child(7) {
  overflow-wrap: normal;
  white-space: nowrap;
}

.broadcast-table .actions {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.broadcast-detail {
  align-items: start;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
}

.detail-actions {
  align-content: start;
  display: grid;
  gap: 8px;
  width: 100%;
}

.detail-actions form,
.detail-actions button,
.detail-actions .pill {
  width: 100%;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  min-width: 0;
}

.detail-list > div {
  border-bottom: 1px solid #e2e5dc;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  padding: 10px 0;
}

.detail-list dt {
  color: #606b5b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
}

.messages {
  display: grid;
  gap: 8px;
}

.message {
  border-radius: 8px;
  padding: 10px 12px;
}

.log {
  background: #11140f;
  border-radius: 8px;
  color: #e9f2e4;
  font-family: Consolas, monospace;
  min-height: 130px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.success {
  background: #dff1e7;
  color: #145434;
}

.error {
  background: #f8dfdc;
  color: #8d2520;
}

.muted {
  color: #606b5b;
}

.pill {
  background: #edf2e8;
  border-radius: 999px;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: normal;
  padding: 3px 8px;
  white-space: nowrap;
}

.table-link {
  color: #1f6a46;
  font-weight: 700;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.field-label,
form label {
  color: #4f5c4a;
  font-size: 13px;
  font-weight: 700;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row ul,
.errorlist {
  color: #8d2520;
  list-style: none;
  padding: 0;
}

.broadcast-control form {
  display: grid;
  gap: 18px;
  max-width: 980px;
}

.active-broadcasts {
  border-color: #d9c7a3;
}

.active-broadcasts > p {
  color: #6a5b36;
}

.busy-box {
  background: #fff8e7;
  border: 1px solid #e5d19a;
  border-radius: 8px;
  color: #5f4b17;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.busy-box ul {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.segmented,
.target-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.segmented label,
.target-options label {
  align-items: center;
  background: #f8faf5;
  border: 1px solid #d9dfd2;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.segmented input,
.target-options input {
  accent-color: #1f6a46;
  min-height: auto;
  width: auto;
}

.segmented label:has(input:checked),
.target-options label:has(input:checked) {
  background: #e7f2eb;
  border-color: #1f6a46;
  box-shadow: inset 0 0 0 1px #1f6a46;
}

.target-options label.disabled-choice {
  background: #f1f1ee;
  color: #8a9185;
  cursor: not-allowed;
}

.target-selects {
  display: grid;
  gap: 14px;
}

.muted-target {
  background: #f8faf5;
  border: 1px dashed #cbd3c6;
  border-radius: 8px;
  color: #5f6c5a;
  padding: 12px;
}

.compact-field {
  max-width: 240px;
}

.stat-panel {
  gap: 5px;
}

.stat-panel span {
  color: #606b5b;
  font-size: 13px;
}

.stat-panel strong {
  font-size: 24px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 240px));
}

.tall-select {
  min-height: 160px;
}

code {
  overflow-wrap: anywhere;
  white-space: normal;
}

form p {
  display: grid;
  gap: 6px;
}

[hidden] {
  display: none !important;
}

ul {
  margin: 0;
}

@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .content {
    margin-left: 0;
  }

  .metrics,
  .grid.two,
  .detail-grid,
  .broadcast-detail,
  .detail-list > div {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1240px) {
  .grid.two.dashboard-grid {
    grid-template-columns: 1fr;
  }
}
