.btn,
.nav-item,
.icon-button,
.chip {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  background: transparent;
}

.btn:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn.primary {
  color: #fff;
  background: var(--brand);
}

.btn.primary:hover {
  background: var(--brand-strong);
}

.btn.secondary,
.icon-button,
.chip {
  border-color: var(--line);
  color: var(--text);
  background: #f4f7f5;
}

.btn.blocked {
  cursor: not-allowed;
  color: var(--muted);
  background: #eef3f1;
}

.btn.danger {
  border-color: #ebc0c0;
  color: var(--danger);
  background: #fff4f4;
}

.btn.compact {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.nav-item {
  width: 100%;
  color: var(--text);
  text-align: left;
}

.nav-item.active {
  border-color: #b6d5cf;
  color: var(--brand-strong);
  background: #e9f5f1;
}

.user-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: #edf1ef;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.status-pill.ready,
.status-pill.verified,
.status-pill.samples_validated {
  color: var(--ok);
  background: #e5f4ec;
}

.status-pill.training,
.status-pill.captcha_ready,
.status-pill.samples_uploaded,
.status-pill.created {
  color: var(--info);
  background: #e6f1f8;
}

.status-pill.failed {
  color: var(--danger);
  background: #faeaea;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 25, 24, 0.28);
}

.confirm-dialog {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(20, 32, 28, 0.18);
}

.confirm-dialog.form-dialog {
  width: min(520px, 100%);
}

.confirm-dialog-header {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.confirm-dialog-mark {
  width: 10px;
  height: 36px;
  border-radius: 999px;
  background: var(--brand);
}

.confirm-dialog-mark.danger {
  background: var(--danger);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.confirm-dialog p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.confirm-dialog-actions.single {
  justify-content: flex-end;
}

.btn.confirm-danger {
  color: #fff;
  background: var(--danger);
}

.dialog-form-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.panel,
.surface-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  overflow: hidden;
}

.panel-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: var(--surface-soft);
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: #d95b5b;
  background: #fff7f7;
}

.field span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.admin-form-error,
.dialog-form-error {
  border: 1px solid #ebc0c0;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--danger);
  background: #fff4f4;
  font-size: 13px;
  line-height: 1.45;
}

.field-wide {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
}

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

.empty-state,
.loading-card {
  min-height: 140px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.empty-state.tall {
  min-height: 260px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: #22302c;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.toast.success {
  background: var(--ok);
}

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

.toast.warning {
  background: var(--accent);
}
