:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d8dde7;
  --accent: #087f5b;
  --accent-strong: #06684a;
  --warning: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.toolbar,
.result-bar,
.settings-grid,
.calls-panel {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button,
input,
select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

button {
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

label {
  display: grid;
  gap: 6px;
}

label.wide {
  grid-column: span 2;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
}

#lastRun {
  color: var(--muted);
  margin-left: 8px;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calls-panel {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: #fbfcfd;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.missed {
  color: var(--warning);
  font-weight: 600;
}

@media (max-width: 760px) {
  .toolbar,
  .result-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 140px;
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-actions button {
    flex: 1 1 180px;
  }

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

  label.wide {
    grid-column: auto;
  }
}
