:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7685;
  --line: #e2e7ee;
  --brand: #1f6feb;
  --brand-dark: #1857c2;
  --green: #15803d;
  --green-bg: #e7f6ec;
  --red: #b42318;
  --red-bg: #fdeceb;
  --warn: #92610a;
  --warn-bg: #fdf4e3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: linear-gradient(135deg, #1f6feb, #4f46e5);
  color: #fff;
  padding: 28px 0 30px;
  box-shadow: var(--shadow);
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: .2px; }
.subtitle { margin: 6px 0 0; opacity: .92; font-size: 15px; }

main { padding: 24px 0 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 18px 0;
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.hint { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.hint em { font-style: italic; color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  color: #41506a;
  gap: 6px;
}
input, select {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #cdd5e0;
  border-radius: 9px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .15);
}

.preview {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f1f7ff;
  border: 1px solid #d7e6ff;
  border-radius: 10px;
  font-size: 14.5px;
}
.preview div { margin: 2px 0; }

.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 11px 18px;
  transition: background .15s, box-shadow .15s, opacity .15s;
}
button.primary { background: var(--brand); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--brand-dark); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: #fff; border-color: #cdd5e0; color: #41506a; }
button.ghost:hover { background: #f5f7fa; }
button.big { font-size: 17px; padding: 14px 26px; width: 100%; }

.badge {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  padding: 1px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

.table-scroll { overflow-x: auto; }
table.workers {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.workers th, table.workers td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.workers th {
  background: #f7f9fc;
  font-weight: 700;
  color: #41506a;
}
table.workers tbody tr:hover { background: #fafbfd; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); font-size: .9em; }
.empty-hint { margin-top: 12px; }

button.link {
  background: none;
  border: none;
  color: var(--brand);
  padding: 4px 6px;
  font-size: 13.5px;
}
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--red); }

.messages:empty { display: none; }
.messages { margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.ok { background: var(--green-bg); color: var(--green); }

.generate { border-color: #cfe3ff; background: linear-gradient(180deg, #ffffff, #f7faff); }

.footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
.footer p { margin: 4px 0; }
