:root {
  --bg: #f3f6ef;
  --panel: #fffdf7;
  --panel-strong: #fbf4e8;
  --text: #1d2a21;
  --muted: #5f6f62;
  --line: #d6dece;
  --accent: #355e3b;
  --accent-soft: #e1ecdf;
  --danger: #8b2e2e;
  --danger-soft: #f8e4e0;
  --success: #2f6b3b;
  --success-soft: #e2f2e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(53, 94, 59, 0.1), transparent 34%),
    linear-gradient(180deg, #eef3e7 0%, var(--bg) 100%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  padding: 32px 16px;
}

.shell {
  width: min(1080px, 100%);
  margin: 0 auto;
}

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

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1;
}

.lede {
  margin-top: 10px;
  max-width: 640px;
  color: var(--muted);
}

.link-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.card {
  padding: 24px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(214, 222, 206, 0.95);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(34, 48, 31, 0.08);
}

.hidden {
  display: none;
}

.muted {
  margin-top: 6px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  max-width: 360px;
  margin-top: 18px;
}

.login-form label,
.table-input-wrap {
  display: grid;
  gap: 6px;
}

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

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.badge-role {
  background: #edf0fb;
  color: #3a4d8d;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--text);
}

button {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

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

.notice,
.error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.notice {
  background: var(--success-soft);
  color: var(--success);
}

.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.workspace-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7fbf5;
  color: var(--text);
}

.tab-button.active {
  background: var(--accent);
  color: white;
}

.workspace-panel + .workspace-panel {
  margin-top: 18px;
}

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

th,
td {
  padding: 16px;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--panel-strong);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.contract-id {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.contract-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-shell {
  display: grid;
  gap: 16px;
}

.settings-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 245, 0.96));
}

.settings-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.settings-head,
.form-head,
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-top: 18px;
}

.users-table-wrap th,
.users-table-wrap td {
  white-space: nowrap;
}

.users-table-wrap td:nth-child(2) {
  min-width: 180px;
  white-space: normal;
}

.user-name {
  font-weight: 700;
}

.user-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.role-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-chip {
  background: #edf0fb;
  color: #3a4d8d;
}

.status-chip.status-active {
  background: var(--success-soft);
  color: var(--success);
}

.status-chip.status-inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.user-actions button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
}

.user-form {
  display: grid;
  gap: 16px;
  align-content: start;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.checkbox-field input {
  width: 18px;
  min-height: auto;
  margin: 0;
  padding: 0;
}

.checkbox-field span {
  font-weight: 600;
}

.table-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.table-input-row input {
  min-width: 240px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero,
  .toolbar,
  .table-input-row,
  .settings-head,
  .form-head,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-layout,
  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .table-input-row input {
    min-width: 0;
  }

  th,
  td {
    padding: 14px;
  }
}
