:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #5b6270;
  --accent: #205375;
  --accent-light: #e1edf7;
  --hr-light: #f7efe3;
  --tech-light: #e7f5ed;
  --warning: #fce8e4;
  --border: #d8dbe1;
}

* {
  box-sizing: border-box;
}

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

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

.user-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  font-size: 0.85rem;
}

.page {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 60px;
}

.page.page-wide {
  max-width: 1500px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(31, 36, 48, 0.06);
}

.card.warning {
  background: var(--warning);
  border-color: #f6c2b8;
}

h1,
h2 {
  margin-top: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button.danger {
  background: #b42318;
}

.button.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  font-size: 0.75rem;
  color: var(--muted);
}

.badge.muted {
  background: #eef0f3;
}

.form {
  display: grid;
  gap: 12px;
}

.form-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.form-block--locked {
  background: var(--accent-light);
  border-color: #c6d7ea;
}

.form-block--hr {
  background: var(--hr-light);
  border-color: #e2d5c0;
}

.form-block--tech {
  background: var(--tech-light);
  border-color: #c1e0d0;
}

.form-block__header {
  display: grid;
  gap: 4px;
}

.form-block__header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.form-block__header .help-text {
  margin: 0;
}

.candidate-fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.candidate-fields-hidden {
  display: none;
}

.candidate-fields.is-hidden {
  display: none;
}

label {
  font-weight: 600;
}

input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  resize: vertical;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  justify-self: start;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cfd6df;
  border: 1px solid #b8c2cf;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 120ms ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(20px);
}

input.prefilled {
  background: #f0f2f5;
  color: var(--muted);
  border-color: #d1d6de;
}

select.prefilled {
  background: #f0f2f5;
  color: var(--muted);
  border-color: #d1d6de;
}

select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.help-text {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-panel {
  border: 1px solid #c6d7ea;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.summary-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.summary-table th {
  color: var(--muted);
  font-weight: 600;
  width: 35%;
}

.summary-table tr:last-child th,
.summary-table tr:last-child td {
  border-bottom: none;
}

.email-status.is-success {
  color: #146a2b;
}

.email-status.is-error {
  color: #b42318;
}

.email-status.is-muted {
  color: var(--muted);
}

.group-picker {
  display: grid;
  gap: 8px;
}

.group-picker.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.group-results {
  display: grid;
  gap: 6px;
}

.group-option {
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.group-option:hover {
  background: #f6f7f9;
}

.group-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #f7f8fa;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--warning);
  margin-bottom: 12px;
}

.alert.success {
  background: #e1f4e7;
  border: 1px solid #b4e2c2;
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
}

.table-search {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.table-search input {
  width: 100%;
  max-width: 360px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 8px 0;
  font-weight: 500;
}

.status-notification-table td {
  vertical-align: top;
}

.status-recipient-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.status-recipient-picker input {
  min-width: 240px;
  flex: 1;
}

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

.page-heading h1 {
  margin-bottom: 8px;
}

.users-page {
  max-width: 1680px;
}

.users-card {
  overflow: hidden;
}

.users-toolbar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4e8ef;
  border-radius: 14px;
  padding: 14px;
}

.users-search input {
  min-width: 320px;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  table-layout: fixed;
  min-width: 1120px;
}

.users-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.users-table th:nth-child(1) {
  width: 23%;
}

.users-table th:nth-child(2) {
  width: 24%;
}

.users-table th:nth-child(3) {
  width: 15%;
}

.users-table th:nth-child(4) {
  width: 13%;
}

.users-table th:nth-child(5) {
  width: 25%;
}

.users-table td {
  vertical-align: top;
  padding: 18px 12px;
}

.user-person,
.user-stack,
.user-actions {
  display: grid;
  gap: 6px;
}

.user-name {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.user-name:hover {
  text-decoration: underline;
}

.user-email,
.user-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef4fb;
  color: #17415f;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-employee,
.status-active {
  background: #e5f5eb;
  color: #166534;
}

.status-onboarding,
.status-paperwork,
.status-background_check {
  background: #fff7df;
  color: #854d0e;
}

.status-separated,
.status-disabled,
.status-leave_of_absence {
  background: #fee2df;
  color: #9f1c12;
}

.company-email-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.company-email-form input[type="text"] {
  width: 100%;
  min-width: 0;
}

.user-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-actions .help-text {
  margin: 0;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .page {
    padding: 0 14px 40px;
  }

  .card {
    padding: 18px;
  }

  .page-heading {
    display: grid;
  }

  .users-search,
  .users-search input {
    min-width: 0;
    width: 100%;
  }

  .users-table-wrap {
    overflow: visible;
  }

  .users-table {
    min-width: 0;
  }

  .users-table,
  .users-table thead,
  .users-table tbody,
  .users-table tr,
  .users-table th,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table thead {
    display: none;
  }

  .users-table tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
  }

  .users-table td {
    border-bottom: none;
    padding: 8px 0;
  }

  .users-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .company-email-form {
    grid-template-columns: 1fr;
  }
}
