:root {
  --bg: #f3efe6;
  --ink: #1c1915;
  --muted: #655e54;
  --line: #ddd4c6;
  --panel: #fffdf8;
  --accent: #0e6b4f;
  --accent-dark: #0a5340;
  --danger: #9d2c2c;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 10% -10%, #efe4cf 0%, transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", "Liberation Sans", "Noto Sans", sans-serif;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  position: sticky;
  top: 0;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: Palatino, "Liberation Serif", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.01em;
}

nav { display: flex; gap: 16px; align-items: center; }
nav a { text-decoration: none; font-size: 15px; }
nav form { margin: 0; }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 64px;
}

h1, h2, h3 {
  font-family: Palatino, "Liberation Serif", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 8px;
}

h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 24px; margin-top: 8px; }
h3 { font-size: 18px; margin-top: 8px; }

.lead, .hint, .muted, .empty { color: var(--muted); }
.lead { margin-top: 0; max-width: 68ch; }
.hint { font-size: 13px; }
.empty { padding: 12px 0; }

.banner {
  background: #e7f3ec;
  border: 1px solid #b7d8c8;
  padding: 10px 12px;
  border-radius: 10px;
}

.progress {
  font-weight: 600;
}

.title-row, .row, .filters, .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.title-row { margin-bottom: 8px; }
.row { margin: 12px 0; }
.filters { margin: 14px 0; }
.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink);
  font-size: 14px;
}
.filters a.on { background: var(--ink); color: #fffdf8; border-color: var(--ink); }

.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }

.login {
  width: min(420px, 100%);
  margin: 8vh auto 0;
}

.panel, section.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}

.stack { display: flex; flex-direction: column; gap: 10px; }
.split, .company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

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

input, textarea, select {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid #9dcebb;
  border-color: var(--accent);
}

button, .button {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.ghost:hover { background: #f6f1e6; }
button.danger {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}
button.danger:hover { background: #f8ecec; }

fieldset.template-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0;
}
legend { padding: 0 6px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf6ee; }
td a { word-break: break-word; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #efe8dc;
  color: var(--ink);
  white-space: nowrap;
}
.pill-running, .pill-collecting { background: #d9ecff; }
.pill-ready, .pill-done, .pill-sent { background: #d9f0e4; }
.pill-no_email, .pill-stopping { background: #f8e7c8; }
.pill-error { background: #f6d6d6; }

.log {
  background: #231f1a;
  color: #f6f1e7;
  border-radius: 12px;
  padding: 12px 14px;
  max-height: 240px;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Mono", "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.45;
}

.quiet { margin-left: 6px; font-size: 12px; color: var(--muted); }
.description, .template-edit { white-space: pre-wrap; }
.description {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.vacancies, .sends, .accounts { list-style: none; padding: 0; margin: 0; }
.vacancies li, .sends li { margin: 0 0 8px; }
.accounts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.chip {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}
.chip:hover { background: #f6f1e6; }

@media (max-width: 860px) {
  .split, .company-grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .top { padding: 14px 16px; }
}
