:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --text: #15201a;
  --muted: #617068;
  --line: #dce4df;
  --accent: #0f8f62;
  --accent-dark: #0a724d;
  --soft: #e9f6ef;
  --warn: #8a5a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a,
.import-label {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
a:hover,
.import-label:hover {
  background: var(--accent-dark);
}

button.secondary,
.secondary {
  background: #eef2ef;
  color: var(--text);
}

button.secondary:hover,
.secondary:hover {
  background: #dfe7e2;
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 5px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 38px;
  margin-bottom: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 180px;
  padding: 14px 16px;
}

.status-card span,
.status-card strong {
  display: block;
}

.status-card span {
  color: var(--muted);
  font-size: 14px;
}

.status-card strong {
  margin-top: 4px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.controls-panel {
  grid-row: span 2;
}

.send-panel,
.history-panel {
  min-height: 280px;
}

.panel-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
}

textarea,
input[type="number"],
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

select {
  background: #ffffff;
  margin-bottom: 10px;
}

.template-actions {
  margin-bottom: 10px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field-row {
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row.compact {
  flex-wrap: nowrap;
}

.batch-list,
.history-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  align-items: center;
  background: #f8faf8;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 180px;
  justify-content: center;
  padding: 22px;
  text-align: center;
}

.contact-card,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.contact-card {
  background: var(--soft);
}

.contact-name,
.contact-number {
  display: block;
}

.contact-number,
.history-item span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 3px;
}

.message-preview {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
  margin: 12px 0;
  padding: 12px;
  white-space: pre-wrap;
}

.import-label {
  position: relative;
}

.import-label input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .panel-heading {
    display: block;
  }

  .status-card,
  .panel-heading .button-row {
    margin-top: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    grid-row: auto;
  }
}
